766 Commits

Author SHA1 Message Date
Alan Agius
c3acf3cc26 fix(@angular/cli): remove unused cli project options.
This fixes the JSON workspace schema and removed options projects `.project.cli`. Currently only `defaultCollection` is used from `projects.cli` other options are ignored.

9afe185fc6/packages/angular/cli/models/schematic-command.ts (L381)
2021-09-29 09:21:54 -04:00
Alan Agius
31ec09c111 refactor(@schematics/angular): remove migrations for unsupported versions 2021-09-24 15:38:33 -04:00
Alan Agius
b8e06a3155 docs: replace deprecated camel-case argument
`--createApplication` is deprecated in favor of `--create-application`
2021-09-21 17:03:01 +02:00
Renovate Bot
504f47fd74 build: update all non-major dependencies 2021-09-16 09:19:36 +02:00
Renovate Bot
3f31a6757f build: update all non-major dependencies 2021-09-14 09:05:32 +01:00
Alan Agius
d3fa202e9a fix(@angular/cli): handle FORCE_COLOR when stdout is not instance of WriteStream
In some cases, custom implementation of stdout, don't extend `WriteStream` which causes colors not to be included in the output.

Closes #21732
2021-09-14 09:00:24 +01:00
Alan Agius
027a349527 build: rename typings.d.ts to typings.ts
Fixes
```
ERROR: /home/circleci/ng/packages/angular/cli/BUILD.bazel:289:11: Compiling TypeScript (devmode) //packages/angular/cli:angular-cli_test_lib failed: (Exit 1): tsc_wrapped.sh failed: error executing command
  (cd /home/circleci/.cache/bazel/_bazel_circleci/9ce5c2144ecf75d11717c0aa41e45a8d/execroot/angular_cli && \
  exec env - \
    NG_FORCE_TTY=false \
    PATH=/bin:/usr/bin:/usr/local/bin \
  bazel-out/host/bin/external/npm/@bazel/typescript/bin/tsc_wrapped.sh @@bazel-out/k8-fastbuild/bin/packages/angular/cli/angular-cli_test_lib_es5_tsconfig.json)
Execution platform: //tools:rbe_platform_with_network_access
error TS5055: Cannot write file '/home/circleci/.cache/bazel/_bazel_circleci/9ce5c2144ecf75d11717c0aa41e45a8d/execroot/angular_cli/bazel-out/k8-fastbuild/bin/packages/angular/cli/utilities/package-metadata.d.ts' because it would overwrite input file.
  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.
```
2021-08-27 07:15:30 +02:00
Charles Lyding
3df6fba4c1 refactor(@angular/cli): support bootstrapping with CommonJS startup code
To support the eventual migration of the CLI to ESM, the CLI commandline tool is now bootstrapped by dynamically importing the main initialization code. This is done to allow the main bin file (`ng`) to remain CommonJS so that older versions of Node.js can be checked and validated prior to the execution of the CLI. This separate bootstrap file is needed to allow the use of a dynamic import expression without crashing older versions of Node.js that do not support dynamic import expressions and would otherwise throw a syntax error. This bootstrap file is required from the main bin file only after the Node.js version is determined to be in the supported range. The use of the dynamic import expression allows CommonJS code to execute either CommonJS or ESM code.
2021-08-26 07:30:56 +02:00
Charles Lyding
a7de97e485 build: add Bazel ts_library rule package_name properties to all packages
rules_nodejs 4 requires that a package_name property be specified within a ts_library rule for the output to be linked into the package repository. Failing to add the property can cause test failures due to unresolved packages.
2021-08-26 07:30:44 +02:00
Charles Lyding
64c9a0512e refactor(@angular/cli): convert VERSION property from require to file read
Much like the framework packages, the VERSION property will eventually be set via build-time stamping but the necessary build infrastructure is not yet in place. Until then, the global require usage has been replaced with a file read and JSON parse which provides the equivalent required behavior.
2021-08-25 11:40:51 +01:00
Charles Lyding
c7e39233b4 refactor(@angular/cli): convert pacote usage from require to import
The removal of require usage supports the eventual shift to an ESM output for the CLI package.
2021-08-25 11:40:51 +01:00
Charles Lyding
266233c66e refactor(@angular/cli): convert ini and @yarnpkg/lockfile usage from require to import
The removal of require usage supports the eventual shift to an ESM output for the CLI package.
2021-08-25 11:40:51 +01:00
Charles Lyding
6f4bf38e9c refactor(@angular/cli): convert npm-pick-manifest usage from require to import
The removal of require usage supports the eventual shift to an ESM output for the CLI package.
2021-08-25 11:40:51 +01:00
Charles Lyding
0ba837b2e4 refactor(@angular/cli): use custom scoped require instead of global
To support the eventual conversion of the `@angular/cli` package to ESM, the usage of the global require function must be removed as it is not supported in ESM code. Node.js does have the facility to create custom require functions that can be used when the need to synchronously load a file at runtime is required. Such cases have now been converted to use custom require functions where appropriate.
2021-08-25 11:40:51 +01:00
Charles Lyding
51f89d633f test: enable no-useless-escape lint rule
The `no-useless-escape` eslint rule has now been enabled which removes unneeded characters and complexity from string literals and regular expressions. All files that were in violation of this rule have also been corrected.
2021-08-24 10:51:14 +01:00
Trevor Karjanis
9c62ddcd69 docs: update the description of the lint command
Update the description of the lint command for when a project name is not provided.

Closes #21619
2021-08-23 11:06:33 +01:00
Alan Agius
77fe6c4e67 fix(@angular/cli): update engines to require node 12.20.0
BREAKING CHANGE:

We drop support for Node.js versions prior to `12.20`.
2021-08-09 22:10:50 +02:00
Alan Agius
c0f1b5ea52 fix(@angular/cli): show error when using non-TTY terminal without passing --skip-confirmation during ng add
Closes #21512
2021-08-06 07:23:18 +02:00
Charles Lyding
0afdff028c refactor(@angular-devkit/build-angular): move all builders into a builders subdirectory
All Angular builders are now located within one subdirectory of the `src` directory. This organization provides better discovery of the builders and will allow builder specific code to be stored in a single area.
2021-08-05 06:49:55 +02:00
Alan Agius
a15875a46c docs(@angular/cli): update e2e long description 2021-08-02 16:59:20 +01:00
Alan Agius
e78f6ab5d8 feat(@angular-devkit/build-angular): remove deprecated tslint builder
BREAKING CHANGE:

Deprecated `@angular-devkit/build-angular:tslint` builder has been removed. Use https://github.com/angular-eslint/angular-eslint instead.
2021-08-02 16:57:56 +01:00
Charles Lyding
9a828a4459 refactor(@angular/cli): convert npm-package-arg usage from require to import
The typings package was already present for `npm-package-arg` and the removal of require usage supports the eventual shift to an ESM output for the CLI package.
2021-07-27 12:52:02 -04:00
Alan Agius
259e26979e fix(@angular/cli): merge npmrc files values
Closes #21406
2021-07-23 11:43:07 -04:00
Alan Agius
c1eddbdc98 fix(@angular/cli): handle YARN_ environment variables during ng update and ng add
With this change we handle yarn specific environment variables during `ng update` and `ng add`. This is a follow up of #21297
2021-07-21 14:45:07 +02:00
Mike Jancar
6b00d1270a fix(@angular/cli): handle NPM_CONFIG environment variables during ng update and ng add
Some organizations are moving away from storing tokens/secrets in an NPM config file in favor
of environment variables that only exist for the span of a terminal session. This commit will
make sure those variables are read even when there is no NPM config file present.
2021-07-21 08:57:45 +02:00
Renovate Bot
a155bc5467 build: update all non-major dependencies 2021-07-14 13:57:01 -07:00
Renovate Bot
2bd859e6d5 build: update all non-major dependencies 2021-07-06 10:21:28 -04:00
Charles Lyding
9afe185fc6 build: enable noImplicitOverride TypeScript option
The `noImplicitOverride` TypeScript option improves code quality by ensuring that properties from base classes are not accidentally overriden.
Reference: https://www.typescriptlang.org/tsconfig#noImplicitOverride
2021-07-02 06:40:36 -04:00
Alan Agius
05a52c8c59 refactor: clean up remove unused code 2021-06-25 07:46:22 +02:00
Alan Agius
88ee85c417 fix(@angular/cli): disable update notifier when retrieving package manager version during ng version
NPM updater notifier will prevents the child process from closing until it timeout after 3 minutes.

Closes #21172
2021-06-25 07:45:09 +02:00
Vaibhav Singh
4ce7681cc8 docs(@angular/cli): Add Nightwatch schematics to e2e command 2021-06-24 13:41:00 +01:00
Charles Lyding
31694939aa refactor(@angular/cli): convert Node.js module builtin require to import statement
Now that the TypeScript `esModuleInterop` option is enabled, the Node.js `module` builtin can be used with an import statement.
2021-06-22 17:39:38 +01:00
Charles Lyding
a2cecf05a9 refactor(@angular/cli): remove outdated performance profiling code 2021-06-22 17:39:38 +01:00
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