702 Commits

Author SHA1 Message Date
Alan Agius
e992c9a70b build: update files to be fix eslint header/header failures 2021-05-04 09:59:40 -04:00
Alan Agius
f6135a20d1 fix(@angular/cli): don't display options multiple times in schematics help output
Previously, we disabled options in the help output multiple times.

Previous output
```
Generates and/or modifies files based on a schematic.
usage: ng generate c <name> [options]

arguments:
  schematic
    The schematic or collection:schematic to generate.
  name
    The name of the component.

options:
  --change-detection (-c)
    The change detection strategy to use in the new component.
  --defaults
    When true, disables interactive input prompts for options with a default.
  --display-block (-b)
    Specifies if the style will contain `:host { display: block; }`.
  --dry-run (-d)
    When true, runs through and reports activity without writing out results.
  --entry-component
    When true, the new component is the entry component of the declaring NgModule.
  --export
    When true, the declaring NgModule exports this component.
  --flat
    When true, creates the new files at the top level of the current project.
  --force (-f)
    When true, forces overwriting of existing files.
  --help
    Shows a help message for this command in the console.
  --inline-style (-s)
    When true, includes styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file.
  --inline-template (-t)
    When true, includes template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.
  --interactive
    When false, disables interactive input prompts.
  --lint-fix
    When true, applies lint fixes after generating the component.
  --module (-m)
    The declaring NgModule.
  --prefix (-p)
    The prefix to apply to the generated component selector.
  --project
    The name of the project.
  --selector
    The HTML selector to use for this component.
  --skip-import
    When true, does not import this component into the owning NgModule.
  --skip-selector
    Specifies if the component should have a selector or not.
  --skip-tests
    When true, does not create "spec.ts" test files for the new component.
  --style
    The file extension or preprocessor to use for style files.
  --type
    Adds a developer-defined type to the filename, in the format "name.type.ts".
  --view-encapsulation (-v)
    The view encapsulation strategy to use in the new component.

Help for schematic c
Creates a new generic component definition in the given or default project.
arguments:
  name
    The name of the component.

options:
  --change-detection (-c)
    The change detection strategy to use in the new component.
  --display-block (-b)
    Specifies if the style will contain `:host { display: block; }`.
  --entry-component
    When true, the new component is the entry component of the declaring NgModule.
  --export
    When true, the declaring NgModule exports this component.
  --flat
    When true, creates the new files at the top level of the current project.
  --inline-style (-s)
    When true, includes styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file.
  --inline-template (-t)
    When true, includes template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.
  --lint-fix
    When true, applies lint fixes after generating the component.
  --module (-m)
    The declaring NgModule.
  --prefix (-p)
    The prefix to apply to the generated component selector.
  --project
    The name of the project.
  --selector
    The HTML selector to use for this component.
  --skip-import
    When true, does not import this component into the owning NgModule.
  --skip-selector
    Specifies if the component should have a selector or not.
  --skip-tests
    When true, does not create "spec.ts" test files for the new component.
  --style
    The file extension or preprocessor to use for style files.
  --type
    Adds a developer-defined type to the filename, in the format "name.type.ts".
  --view-encapsulation (-v)
    The view encapsulation strategy to use in the new component.

To see help for a schematic run:
  ng generate <schematic> --help
```

New output
```
Generates and/or modifies files based on a schematic.
usage: ng generate c <name> [options]

arguments:
  schematic
    The schematic or collection:schematic to generate.
  name
    The name of the component.

options:
  --change-detection (-c)
    The change detection strategy to use in the new component.
  --defaults
    Disable interactive input prompts for options with a default.
  --display-block (-b)
    Specifies if the style will contain `:host { display: block; }`.
  --dry-run (-d)
    Run through and reports activity without writing out results.
  --export
    The declaring NgModule exports this component.
  --flat
    Create the new files at the top level of the current project.
  --force (-f)
    Force overwriting of existing files.
  --help
    Shows a help message for this command in the console.
  --inline-style (-s)
    Include styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file.
  --inline-template (-t)
    Include template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.
  --interactive
    Enable interactive input prompts.
  --lint-fix
    Apply lint fixes after generating the component.
  --module (-m)
    The declaring NgModule.
  --prefix (-p)
    The prefix to apply to the generated component selector.
  --project
    The name of the project.
  --selector
    The HTML selector to use for this component.
  --skip-import
    Do not import this component into the owning NgModule.
  --skip-selector
    Specifies if the component should have a selector or not.
  --skip-tests
    Do not create "spec.ts" test files for the new component.
  --style
    The file extension or preprocessor to use for style files.
  --type
    Adds a developer-defined type to the filename, in the format "name.type.ts".
  --view-encapsulation (-v)
    The view encapsulation strategy to use in the new component.

To see help for a schematic run:
  ng generate <schematic> --help
```
2021-05-03 11:39:23 -04:00
Charles Lyding
c1512e4274 build: update files to be eslint compliant
All TypeScript files have been updated to pass the new eslint-based linting checks. eslint compatible disabling comments have also been added in place of the previous tslint comments.
2021-05-03 07:31:02 -04:00
Charles Lyding
37a06a7c37 build: format all files
All files are now formatted using the ng-dev tools via prettier.
2021-04-28 16:05:49 -07:00
Joshua Chapman
094d36d36a fix(@angular/cli): Support XDG Base Directory Specfication
Reading throw  #16034 the angular config should be placed in the
`$XDG_CONFIG_HOME/angular/` directory, but if the environmental variable
$XDG_CONFIG_HOME is set the first check of `xdgConfigHome` function will
only put it in the `$XDG_CONFIG_HOME` directory. Also renamed the config
file from `.angular-config.json` to `config.json` when it is in the
`~/.config/angular` directory since it doesn't need to be hidden.
2021-04-28 16:36:33 +02:00
Renovate Bot
8b34305777 build: update all non-major dependencies 2021-04-28 12:18:43 +02:00
Charles Lyding
203f9626df refactor(@angular/cli): correct various uncaught code style issues
This change cleans up some of the code by removing unused variables/imports, unnecessary double negation, and some long line lengths.
2021-04-28 09:58:15 +02:00
Alan Agius
0b27cfb720 build: update minimum supported node.js version to 12.14
This is to match the ranges in the framework repo.
2021-04-27 17:26:56 +02:00
Joey Perrott
003854257c build: migrate all file header to use Google LLC rather than Google Inc 2021-04-27 08:35:22 +02:00
Renovate Bot
9af16dc659 build: update pacote to version 11.3.3 2021-04-24 14:16:26 +02:00
Renovate Bot
2bea25908f build: update pacote to version 11.3.2 2021-04-23 13:38:16 +02:00
Alan Agius
5558047eef fix(@angular/cli): add package manager name and version in ng version output 2021-04-22 14:23:13 +02:00
Keen Yee Liau
49ba5e20aa refactor(@schematics/angular): Do not include Protractor test in new project
Do not include Protractor for new projects since we do not have a concrete
plan for Protractor yet.
2021-04-21 12:38:46 -07:00
David Shevitz
bb3f36f30a docs: remove reference to protractor. 2021-04-21 12:35:50 -07:00
Renovate Bot
1c6ba1f9f6 build: update open to version 8.0.6 2021-04-19 20:33:19 +02:00
Renovate Bot
626d67fa2c build: update symbol-observable to version 4.0.0 2021-04-19 20:30:48 +02:00
Alan Agius
131379f49f fix(@angular/cli): run all migrations when updating from or between prereleases
With this change we consider the update schematics are idempotent. When updating from or between prereleases we will execute all migrations for the version.
2021-04-19 20:28:53 +02:00
Alan Agius
db1719b8c1 refactor(@angular/cli): clean up left over @schematics/update code. 2021-04-19 20:28:53 +02:00
Alan Agius
266c0ce5e5 fix(@angular/cli): ignore tsickle during updates
`tsickle` doesn't be a dependency in users projects, if it is most certain it will cause updates to fail due to mismatching peer dependency on TypeScript.
2021-04-19 20:28:53 +02:00
Alan Agius
d68cb92dc2 fix(@angular/cli): add message update updating from non LTS versions of the CLI 2021-04-14 17:20:33 -04:00
Alan Agius
076ab0f11f refactor: add correct schema keys
With this change
- We replace `id` with `$id`,  this no longer valid in draft-07.
- Replace all `$schemas` to `http://json-schema.org/draft-07/schema`, this is needed to "pin" the schema to `draft-07`.

More information about `draft-07` can be found https://json-schema.org/draft-07/json-schema-release-notes.html
2021-04-13 10:51:12 -04:00
Renovate Bot
7d002213be build: update open to version 8.0.5 2021-04-03 13:22:44 +02:00
Charles Lyding
8a805fe0b9 fix(@angular/cli): exclude deprecated packages with removal migrations from update
Deprecated packages that may have been included in a project by the tooling are now ignored when validating an update. This change removes the need to use the `--force` option in a situation where the later migrations will remove and cleanup the deprecated packages.
2021-04-02 08:09:16 +02:00
Charles Lyding
e84fa72751 fix(@angular/cli): ensure update migrations are fully executed
With the move to refactor and centralize the update logic, the schematics wrapper context needs to be updated to create an exception for the new location of the update schematic.
2021-04-02 08:09:16 +02:00
Alan Agius
f6e1fd84a2 refactor(@angular-devkit/schematics-cli): move @schematics/schematics into this package
This change removes the need for the `@schematics/schematics` package and moves it inside `@angular-devkit/schematics-cli`.
2021-04-02 08:09:07 +02:00
Alan Agius
14c8a09014 refactor(@angular/cli): remove Ivy Workspace from ng version
In version 12, only Ivy will be allowed to be used to compile an application.
2021-03-30 14:36:48 -06:00
Charles Lyding
2dd0cbd2e9 refactor(@angular/cli): inline @schematics/update:update schematic
This change removes the need for the `@schematics/update` package within the Angular tooling and removes the dependency from the `@angular/cli` package.
Only the `update` schematic from the `@schematics/update` package was used and this schematic's logic will eventually be folded into the update command logic directly.
2021-03-29 08:18:11 -06:00
Renovate Bot
6a3a7b020b build: update semver to version 7.3.5 2021-03-24 09:48:08 -04:00
Renovate Bot
decb05b2fe build: update pacote to version 11.3.1 2021-03-23 12:11:38 -04:00
Renovate Bot
caafc6923e build: update open to version 8.0.4 2021-03-21 21:08:41 -04:00
Renovate Bot
bc4c222ee4 build: update npm-pick-manifest to version 6.1.1 2021-03-19 18:36:19 -04:00
Renovate Bot
fbae26c87d build: update npm-package-arg to version 8.1.2 2021-03-19 10:53:50 -04:00
Renovate Bot
0931e37f30 build: update open to version 8.0.3 2021-03-19 10:53:19 -04:00
Renovate Bot
8862a9f07c build: update ora to version 5.4.0 2021-03-18 12:15:24 +01:00
Alan Agius
cc10302fd7 refactor(@angular/cli): add more actionable missing lint target message 2021-03-16 15:49:46 +01:00
Alan Agius
4b0223b64e build: automate @angular/cli schema.json generation
With this change we automate the generation of `@angular/cli/lib/config/schema.json`. While on paper we could use quicktype for this. Quicktype doesn't handle `patternProperties` and `oneOf` that well.

How does this works?
Relative `$ref` will be resolved and inlined as part of the root schema definitions.

Example
```json
"@schematics/angular:enum": {
    "$ref": "../../../../schematics/angular/enum/schema.json"
},
```

Will be parsed and transformed to
```json
"@schematics/angular:enum": {
  "$ref": "#/definitions/SchematicsAngularEnumSchema"
},
"definitions: {
  "SchematicsAngularEnumSchema": {
    "title": "Angular Enum Options Schema",
    "type": "object",
    "description": "Generates a new, generic enum definition for the given or default project.",
    "properties": {...}
   }
}
```
2021-03-11 21:51:37 +01:00
Alan Agius
d254d058f9 fix(@angular/cli): remove project from required properties in ng-packagr schema
Closes: #20246
2021-03-11 15:59:58 +01:00
Charles Lyding
985dc1a4c7 feat(@angular/cli): confirm ng add action before installation
BREAKING CHANGE:
The `ng add` command will now ask the user to confirm the package and version prior to installing and executing an uninstalled package.
This new behavior allows a user to abort the action if the version selected is not appropriate or if a typo occurred on the command line and an incorrect package would be installed.
A `--skip-confirmation` option has been added to skip the prompt and directly install and execute the package. This option is useful in CI and non-TTY scenarios such as automated scripts.
2021-03-11 08:54:07 +01:00
Alan Agius
988b05a8e5 refactor(@angular/cli): remove deprecated lazyModules option from schema 2021-03-10 12:44:04 -06:00
Renovate Bot
4fce9bf4a2 build: update pacote to version 11.3.0 2021-03-10 08:20:35 -06:00
Charles Lyding
06335515eb fix(@angular/cli): avoid exceptions for expected errors in architect commands
Errors caused by invalid options or workspace configuration will now be presented as fatal console messages and the CLI will exit gracefully with an exit code of 1.
2021-03-10 08:19:42 -06:00
Alan Agius
a5877bf917 feat(@angular/cli): deprecate --prod command line argument
With this change we deprecated the `--prod` command line argument. This argument is confusing especially to new users, since users expect that this builds an application in production mode. This however, is only an alias for `--configuration="production"`
2021-03-10 08:16:38 -06:00
Alan Agius
5f8155dc33 fix(@angular/cli): add ng-packagr builder schema in IDE schema 2021-03-08 08:55:18 -06:00
Alan Agius
f7e3e2335d feat(@angular/cli): add defaultConfiguration property to architect schema 2021-03-08 08:45:54 -06:00
Renovate Bot
9b100253e4 build: update open to version 8.0.2 2021-03-03 07:03:19 -05:00
Renovate Bot
d23e6cad20 build: update open to version 8.0.1 2021-03-02 12:17:14 -05:00
Alan Agius
dbce2a3f28 refactor(@angular/cli): remove dependency on universal-analytics
With this change we remove the dependency on the unmaintained universal-analytics package. We also solve several package deprecation warnings when creating a new workspace.

Closes #16952
2021-03-01 13:59:26 -05:00
Renovate Bot
598190ec73 build: update inquirer to version 8.0.0 2021-03-01 10:40:04 -05:00
Alan Agius
aa3ea885ed feat(@angular-devkit/build-angular): enable inlineCritical by default
BREAKING CHANGE:

Critical CSS inlining is now enabled by default. If you wish to turn this off set `inlineCritical` to `false`.

See: https://angular.io/guide/workspace-config#optimization-configuration
2021-02-26 13:22:58 -05:00
Charles Lyding
ce4d59fee3 refactor(@angular/cli): remove v1 postinstall update check
This postinstall script was put in place during the v6.0 timeframe to aid users migrating from the v1.x configuration file format by displaying a message instructing the user to run `ng update`.
The `ng update` migration is still functional and users can still use it to migrate from a v1.x project.  However, the postinstall script will no longer be run for every install of the Angular CLI.
2021-02-26 07:22:29 -05:00