@angular/create 14.1.0 → 14.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +10 -4
  2. package/package.json +2 -2
  3. package/src/index.js +11 -1
package/README.md CHANGED
@@ -1,19 +1,25 @@
1
1
  # `@angular/create`
2
2
 
3
- # Create an Angular CLI workspace
3
+ ## Create an Angular CLI workspace
4
4
 
5
5
  Scaffold an Angular CLI workspace without needing to install the Angular CLI globally. All of the [ng new](https://angular.io/cli/new) options and features are supported.
6
6
 
7
- # Usage
7
+ ## Usage
8
8
 
9
- NPM
9
+ ### npm
10
10
 
11
11
  ```
12
12
  npm init @angular [project-name] -- [...options]
13
13
  ```
14
14
 
15
- Yarn
15
+ ### yarn
16
16
 
17
17
  ```
18
18
  yarn create @angular [project-name] [...options]
19
19
  ```
20
+
21
+ ### pnpm
22
+
23
+ ```
24
+ pnpm create @angular [project-name] [...options]
25
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/create",
3
- "version": "14.1.0",
3
+ "version": "14.1.3",
4
4
  "description": "Scaffold an Angular CLI workspace.",
5
5
  "keywords": [
6
6
  "angular",
@@ -16,7 +16,7 @@
16
16
  "create": "./src/index.js"
17
17
  },
18
18
  "dependencies": {
19
- "@angular/cli": "14.1.0"
19
+ "@angular/cli": "14.1.3"
20
20
  },
21
21
  "repository": {
22
22
  "type": "git",
package/src/index.js CHANGED
@@ -7,12 +7,22 @@
7
7
  * Use of this source code is governed by an MIT-style license that can be
8
8
  * found in the LICENSE file at https://angular.io/license
9
9
  */
10
+ var _a;
10
11
  Object.defineProperty(exports, "__esModule", { value: true });
11
12
  const child_process_1 = require("child_process");
12
13
  const path_1 = require("path");
13
14
  const binPath = (0, path_1.join)(require.resolve('@angular/cli/package.json'), '../bin/ng.js');
15
+ const args = process.argv.slice(2);
16
+ const hasPackageManagerArg = args.some((a) => a.startsWith('--package-manager'));
17
+ if (!hasPackageManagerArg) {
18
+ // Ex: yarn/1.22.18 npm/? node/v16.15.1 linux x64
19
+ const packageManager = (_a = process.env['npm_config_user_agent']) === null || _a === void 0 ? void 0 : _a.split('/')[0];
20
+ if (packageManager && ['npm', 'pnpm', 'yarn', 'cnpm'].includes(packageManager)) {
21
+ args.push('--package-manager', packageManager);
22
+ }
23
+ }
14
24
  // Invoke ng new with any parameters provided.
15
- const { error } = (0, child_process_1.spawnSync)(process.execPath, [binPath, 'new', ...process.argv.slice(2)], {
25
+ const { error } = (0, child_process_1.spawnSync)(process.execPath, [binPath, 'new', ...args], {
16
26
  stdio: 'inherit',
17
27
  });
18
28
  if (error) {