733 Commits

Author SHA1 Message Date
Charles Lyding
c1623c429e refactor(@angular/cli): use version class instead of requiring package.json
The CLI contains a helper class instance that provides the version of the executing CLI. By using this helper throughtout the code, repeat `require` calls are no longer necessary.
2021-06-22 17:39:38 +01:00
Renovate Bot
4cfb81e75a build: update all non-major dependencies 2021-06-21 11:13:21 +01:00
Alan Agius
e9717e5812 fix(@angular/cli): don't resolve .npmrc from parent directories
Unlike `yarn`, `npm` doesn't resolve `.npmrc` from parent locations instead it looks in predefied locations in
- per-project config file (/path/to/my/project/.npmrc)
- per-user config file (~/.npmrc)
- global config file ($PREFIX/etc/npmrc)
- npm builtin config file (/path/to/npm/npmrc)

https://docs.npmjs.com/cli/v7/configuring-npm/npmrc#files
2021-06-16 19:28:53 -04:00
Alan Agius
77c96f8b2a fix(@angular/cli): handle unscoped authentication details in .npmrc files
Unless auth options are scope with the registry url it appears that npm-registry-fetch ignores them, even though they are documented.
8954f61d8d/README.md
8954f61d8d/auth.js (L45-L91)
2021-06-16 19:28:53 -04:00
Alan Agius
e680aa1f48 refactor(@angular/cli): remove duplicate npmrc logic 2021-06-16 19:28:53 -04:00
Renovate Bot
3dbd3e3242 build: update all non-major dependencies 2021-06-16 08:00:05 -04:00
Charles Lyding
b3d7080147 build: enable esModuleInterop TypeScript option
The `esModuleInterop` option is recommended to be enable by TypeScript and corrects several assumptions TypeScript would otherwise make when importing CommonJS files.
This option change helps ensure compatibility as packages move towards ESM.
Reference: https://www.typescriptlang.org/tsconfig#esModuleInterop
2021-06-13 11:45:55 -04:00
Alan Agius
1dd3bda57f test: fix failing tests which were not shown
Previously when an unhandled error occured Bazel would mark the suit as passed instead of failed.

See: https://togithub.com/bazelbuild/rules_nodejs/commit/3c4ef58
2021-06-10 16:25:19 +02:00
Alan Agius
cf3b22de58 fix(@angular/cli): correctly redirect nested Angular schematic dependency requests
Closes #21075
2021-06-08 18:29:08 +02:00
Renovate Bot
137bbb7b49 build: update all non-major dependencies 2021-06-08 12:30:32 +02:00
Charles Lyding
87f6f434be refactor(@angular/cli): remove usage of rimraf dependency
With the removal of support for Node.js v10, the Node.js native support for recursively removing a directory can now be used.
2021-06-03 19:51:37 +02:00
Charles Lyding
0978ff5dc8 fix(@angular/cli): avoid shell exec when bootstrapping update command
This change removes the usage of the shell execution when spawning the latest CLI version when bootstrapping the update command. The absolute path of the node process is now spawned which removes the need for any shell path resolution. This also removes the need to quote and/or escape command arguments which can be error-prone. Node.js and the OS will now handle any quoting and escaping automatically and without any custom logic.
2021-06-03 18:57:51 +02:00
Alan Agius
636430099c fix(@angular/cli) escape paths using double quotes
Closes #21027
2021-06-03 13:43:26 +02:00
Renovate Bot
8ca3c2d315 build: update all non-major dependencies 2021-06-03 08:07:59 +02:00
Renovate Bot
0553de187c build: update all non-major dependencies 2021-06-02 09:16:03 +02:00
Alan Agius
06af7d7e7b fix(@angular-devkit/core): handle async schema validations 2021-05-31 12:48:18 +01:00
Hassan Sani
15e5bfa55b fix(@angular/cli): ng update on windows to allow path 2021-05-25 10:29:11 -04:00
Charles Lyding
57640bebfd feat(@angular/cli): show Node.js version support status in version command
Unsupported versions of Node.js will now show an unsupported warning when the `ng version` command is executed.
Currently Node.js major versions 12 and 14 are considered supported and tested.

Closes #20879
2021-05-21 20:04:54 -04:00
Renovate Bot
2c7e5d9fc9 build: update all non-major dependencies 2021-05-18 13:15:00 +02:00
Alan Agius
79c5284892 fix(@angular-devkit/build-angular): revert open to 8.0.2
Closes #20807
2021-05-17 18:05:20 +02:00
Alan Agius
ddb92d815e fix(@angular/cli): improve --prod deprecation warning
Closes  #20806
2021-05-17 18:04:27 +02:00
Charles Lyding
6926b37c0c fix(@angular/cli): clean node modules directory prior to updating
Prior to performing the initial updated package installation during the `ng update` process, the workspace node modules directory will be removed. This cleaning increases the guarantees that the package manager will hoist packages into the correct locations and avoid peer dependency inconsistencies.
2021-05-17 08:38:04 +02:00
Alan Agius
6e34d1bf89 fix(@angular/cli): cannot locate bin for temporary package
This fixes an issue where the installation of the temporary Angular CLI failed with `Cannot locate bin for temporary package: @angular/cli.`
2021-05-14 13:10:56 +02:00
Keen Yee Liau
123735eeb1 docs(@angular/cli): Add Cypress schematic to e2e command
Add Cypress schematic/builder, see
https://github.com/cypress-io/cypress/tree/master/npm/cypress-schematic
and
https://www.npmjs.com/package/@cypress/schematic
2021-05-13 07:41:27 +02:00
Alan Agius
6e6517b699 fix(@angular/cli): disallow additional properties in builders sections
With this change we disallow add additional properties to the `target` object.
2021-05-10 20:57:50 +01:00
Alan Agius
0a0fc41907 fix(@angular/cli): allow config object to be of JSON.
With this change we allow unset a config value to be a JSON.

Example, `ng config -g schematics {}` will remove the entire `schematics` section from the configuration.
2021-05-10 20:57:33 +01:00
Alan Agius
4af963e70b fix(@angular/cli): allow unsetting config when value is undefined
With this change we allow unset a config value when the provided value is `undefined`.

Example, `ng config -g schematics undefined` will remove the entire `schematics` section from the configuration.
2021-05-10 20:57:33 +01:00
Renovate Bot
d279b12e61 build: update all non-major dependencies 2021-05-10 16:22:25 +01:00
Charles Lyding
3d8c16a433 fix(@angular/cli): propagate update's force option to package managers
When the CLI update command's `--force` option is used, the underlying package manager will also be executed with its force option. This behavior is especially important with the advent of npm 7 which will fail installation if any peer dependency version ranges are mismatched.
2021-05-10 16:21:25 +01:00
Alan Agius
586226a305 fix(@angular/cli): infer schematic defaults correctly when using --project
Previously, the `--project` flag was ignored when gathering and merging the schematics defaults from the angular workspace configuration file.

Closes #20666
2021-05-05 11:49:22 -04:00
Alan Agius
d7ef0d0730 fix(@angular/cli): change package installation to async
With this change we change the package installation to async. This is needed as otherwise during `ng-add` the spinner gets stuck. With this change we also add the spinner in the installation methods.
2021-05-05 11:49:08 -04:00
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