@angular/cli 14.0.0-next.2 → 14.0.0-next.5
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.
- package/bin/ng.js +3 -5
- package/bin/postinstall/analytics-prompt.js +1 -1
- package/lib/cli/index.d.ts +1 -1
- package/lib/cli/index.js +16 -18
- package/lib/config/schema.json +4 -8
- package/lib/init.js +3 -3
- package/models/command.d.ts +14 -19
- package/models/command.js +13 -106
- package/models/interface.d.ts +3 -180
- package/models/interface.js +0 -22
- package/models/schematic-command.d.ts +6 -18
- package/models/schematic-command.js +16 -123
- package/package.json +16 -15
- package/{models → src/analytics}/analytics-collector.d.ts +0 -0
- package/{models → src/analytics}/analytics-collector.js +1 -1
- package/{models → src/analytics}/analytics.d.ts +2 -0
- package/{models → src/analytics}/analytics.js +33 -2
- package/src/command-builder/architect-base-command-module.d.ts +23 -0
- package/src/command-builder/architect-base-command-module.js +105 -0
- package/src/command-builder/architect-command-module.d.ts +22 -0
- package/src/command-builder/architect-command-module.js +110 -0
- package/src/command-builder/command-module.d.ts +85 -0
- package/src/command-builder/command-module.js +185 -0
- package/src/command-builder/command-runner.d.ts +10 -0
- package/src/command-builder/command-runner.js +146 -0
- package/src/command-builder/schematics-command-module.d.ts +31 -0
- package/src/command-builder/schematics-command-module.js +117 -0
- package/src/command-builder/utilities/json-help.d.ts +34 -0
- package/src/command-builder/utilities/json-help.js +90 -0
- package/src/command-builder/utilities/json-schema.d.ts +40 -0
- package/{utilities → src/command-builder/utilities}/json-schema.js +20 -121
- package/src/commands/add/add-impl.d.ts +22 -0
- package/{commands → src/commands/add}/add-impl.js +24 -32
- package/src/commands/add/cli.d.ts +23 -0
- package/src/commands/add/cli.js +48 -0
- package/{commands/add.md → src/commands/add/long-description.md} +0 -0
- package/src/commands/analytics/cli.d.ts +21 -0
- package/src/commands/analytics/cli.js +70 -0
- package/src/commands/analytics/long-description.md +10 -0
- package/src/commands/build/cli.d.ts +16 -0
- package/src/commands/build/cli.js +23 -0
- package/{commands/build-long.md → src/commands/build/long-description.md} +0 -0
- package/src/commands/config/cli.d.ts +21 -0
- package/src/commands/config/cli.js +46 -0
- package/{commands → src/commands/config}/config-impl.d.ts +7 -5
- package/{commands → src/commands/config}/config-impl.js +3 -7
- package/{commands/config-long.md → src/commands/config/long-description.md} +2 -2
- package/src/commands/deploy/cli.d.ts +16 -0
- package/src/commands/deploy/cli.js +35 -0
- package/{commands/deploy-long.md → src/commands/deploy/long-description.md} +0 -0
- package/src/commands/doc/cli.d.ts +23 -0
- package/{commands/doc-impl.js → src/commands/doc/cli.js} +36 -11
- package/src/commands/e2e/cli.d.ts +17 -0
- package/src/commands/e2e/cli.js +34 -0
- package/src/commands/extract-i18n/cli.d.ts +15 -0
- package/src/commands/extract-i18n/cli.js +20 -0
- package/src/commands/generate/cli.d.ts +27 -0
- package/src/commands/generate/cli.js +98 -0
- package/src/commands/generate/generate-impl.d.ts +19 -0
- package/src/commands/generate/generate-impl.js +49 -0
- package/src/commands/lint/cli.d.ts +16 -0
- package/src/commands/lint/cli.js +31 -0
- package/{commands/lint-long.md → src/commands/lint/long-description.md} +0 -0
- package/src/commands/make-this-awesome/cli.d.ts +17 -0
- package/{commands/easter-egg-impl.js → src/commands/make-this-awesome/cli.js} +17 -10
- package/src/commands/new/cli.d.ts +23 -0
- package/src/commands/new/cli.js +36 -0
- package/src/commands/new/new-impl.d.ts +18 -0
- package/{commands → src/commands/new}/new-impl.js +7 -6
- package/src/commands/run/cli.d.ts +23 -0
- package/src/commands/run/cli.js +59 -0
- package/{commands/run-long.md → src/commands/run/long-description.md} +0 -0
- package/src/commands/serve/cli.d.ts +16 -0
- package/src/commands/serve/cli.js +21 -0
- package/src/commands/test/cli.d.ts +16 -0
- package/src/commands/test/cli.js +23 -0
- package/{commands/test-long.md → src/commands/test/long-description.md} +0 -0
- package/src/commands/update/cli.d.ts +29 -0
- package/src/commands/update/cli.js +83 -0
- package/{commands/update-long.md → src/commands/update/long-description.md} +0 -0
- package/src/commands/update/schematic/index.js +1 -1
- package/{commands → src/commands/update}/update-impl.d.ts +8 -6
- package/{commands → src/commands/update}/update-impl.js +22 -31
- package/src/commands/version/cli.d.ts +19 -0
- package/{commands/version-impl.js → src/commands/version/cli.js} +44 -38
- package/src/typings.d.ts +2 -2
- package/{utilities → src/utilities}/color.d.ts +0 -0
- package/{utilities → src/utilities}/color.js +0 -0
- package/{utilities → src/utilities}/config.d.ts +1 -1
- package/{utilities → src/utilities}/config.js +2 -5
- package/{utilities → src/utilities}/find-up.d.ts +0 -0
- package/{utilities → src/utilities}/find-up.js +0 -0
- package/{utilities → src/utilities}/install-package.d.ts +2 -2
- package/{utilities → src/utilities}/install-package.js +1 -1
- package/{utilities → src/utilities}/json-file.d.ts +0 -0
- package/{utilities → src/utilities}/json-file.js +0 -0
- package/{utilities → src/utilities}/log-file.d.ts +0 -0
- package/{utilities → src/utilities}/log-file.js +0 -0
- package/{utilities → src/utilities}/package-json.d.ts +0 -0
- package/{utilities → src/utilities}/package-json.js +0 -0
- package/{utilities → src/utilities}/package-manager.d.ts +1 -1
- package/{utilities → src/utilities}/package-manager.js +1 -1
- package/{utilities → src/utilities}/package-metadata.d.ts +0 -0
- package/{utilities → src/utilities}/package-metadata.js +0 -0
- package/{utilities → src/utilities}/package-tree.d.ts +0 -0
- package/{utilities → src/utilities}/package-tree.js +0 -0
- package/{utilities → src/utilities}/project.d.ts +0 -0
- package/{utilities → src/utilities}/project.js +0 -0
- package/{utilities → src/utilities}/prompt.d.ts +0 -0
- package/{utilities → src/utilities}/prompt.js +0 -0
- package/{utilities → src/utilities}/spinner.d.ts +0 -0
- package/{utilities → src/utilities}/spinner.js +0 -0
- package/{utilities → src/utilities}/tty.d.ts +0 -0
- package/{utilities → src/utilities}/tty.js +0 -0
- package/{models → src/utilities}/version.d.ts +2 -1
- package/{models → src/utilities}/version.js +6 -6
- package/commands/add-impl.d.ts +0 -21
- package/commands/add.d.ts +0 -42
- package/commands/add.js +0 -10
- package/commands/add.json +0 -54
- package/commands/analytics-impl.d.ts +0 -13
- package/commands/analytics-impl.js +0 -80
- package/commands/analytics-long.md +0 -8
- package/commands/analytics.d.ts +0 -46
- package/commands/analytics.js +0 -31
- package/commands/analytics.json +0 -37
- package/commands/build-impl.d.ts +0 -14
- package/commands/build-impl.js +0 -21
- package/commands/build.d.ts +0 -30
- package/commands/build.js +0 -10
- package/commands/build.json +0 -16
- package/commands/config.d.ts +0 -34
- package/commands/config.js +0 -10
- package/commands/config.json +0 -43
- package/commands/definitions.json +0 -66
- package/commands/deploy-impl.d.ts +0 -15
- package/commands/deploy-impl.js +0 -36
- package/commands/deploy.d.ts +0 -30
- package/commands/deploy.js +0 -10
- package/commands/deploy.json +0 -34
- package/commands/doc-impl.d.ts +0 -13
- package/commands/doc.d.ts +0 -39
- package/commands/doc.js +0 -14
- package/commands/doc.json +0 -46
- package/commands/e2e-impl.d.ts +0 -16
- package/commands/e2e-impl.js +0 -36
- package/commands/e2e-long.md +0 -4
- package/commands/e2e.d.ts +0 -29
- package/commands/e2e.js +0 -10
- package/commands/e2e.json +0 -17
- package/commands/easter-egg-impl.d.ts +0 -12
- package/commands/easter-egg.d.ts +0 -14
- package/commands/easter-egg.js +0 -10
- package/commands/easter-egg.json +0 -12
- package/commands/extract-i18n-impl.d.ts +0 -14
- package/commands/extract-i18n-impl.js +0 -21
- package/commands/extract-i18n.d.ts +0 -29
- package/commands/extract-i18n.js +0 -10
- package/commands/extract-i18n.json +0 -15
- package/commands/generate-impl.d.ts +0 -18
- package/commands/generate-impl.js +0 -89
- package/commands/generate.d.ts +0 -37
- package/commands/generate.js +0 -10
- package/commands/generate.json +0 -31
- package/commands/help-impl.d.ts +0 -12
- package/commands/help-impl.js +0 -26
- package/commands/help-long.md +0 -7
- package/commands/help.d.ts +0 -17
- package/commands/help.js +0 -10
- package/commands/help.json +0 -13
- package/commands/lint-impl.d.ts +0 -16
- package/commands/lint-impl.js +0 -69
- package/commands/lint.d.ts +0 -29
- package/commands/lint.js +0 -10
- package/commands/lint.json +0 -36
- package/commands/new-impl.d.ts +0 -16
- package/commands/new.d.ts +0 -41
- package/commands/new.js +0 -10
- package/commands/new.json +0 -34
- package/commands/new.md +0 -16
- package/commands/run-impl.d.ts +0 -13
- package/commands/run-impl.js +0 -22
- package/commands/run.d.ts +0 -30
- package/commands/run.js +0 -10
- package/commands/run.json +0 -36
- package/commands/serve-impl.d.ts +0 -15
- package/commands/serve-impl.js +0 -24
- package/commands/serve.d.ts +0 -29
- package/commands/serve.js +0 -10
- package/commands/serve.json +0 -17
- package/commands/test-impl.d.ts +0 -15
- package/commands/test-impl.js +0 -22
- package/commands/test.d.ts +0 -29
- package/commands/test.js +0 -10
- package/commands/test.json +0 -17
- package/commands/update.d.ts +0 -61
- package/commands/update.js +0 -10
- package/commands/update.json +0 -78
- package/commands/version-impl.d.ts +0 -17
- package/commands/version.d.ts +0 -17
- package/commands/version.js +0 -10
- package/commands/version.json +0 -13
- package/commands.json +0 -20
- package/models/architect-command.d.ts +0 -35
- package/models/architect-command.js +0 -364
- package/models/command-runner.d.ts +0 -24
- package/models/command-runner.js +0 -241
- package/models/parser.d.ts +0 -39
- package/models/parser.js +0 -349
- package/utilities/INITIAL_COMMIT_MESSAGE.txt +0 -8
- package/utilities/json-schema.d.ts +0 -17
|
@@ -10,44 +10,52 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
10
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.
|
|
13
|
+
exports.VersionCommandModule = void 0;
|
|
14
14
|
const child_process_1 = require("child_process");
|
|
15
15
|
const module_1 = __importDefault(require("module"));
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
16
|
+
const path_1 = require("path");
|
|
17
|
+
const command_module_1 = require("../../command-builder/command-module");
|
|
18
|
+
const color_1 = require("../../utilities/color");
|
|
19
|
+
const package_manager_1 = require("../../utilities/package-manager");
|
|
19
20
|
/**
|
|
20
21
|
* Major versions of Node.js that are officially supported by Angular.
|
|
21
22
|
*/
|
|
22
|
-
const SUPPORTED_NODE_MAJORS = [
|
|
23
|
-
|
|
23
|
+
const SUPPORTED_NODE_MAJORS = [14, 16];
|
|
24
|
+
const PACKAGE_PATTERNS = [
|
|
25
|
+
/^@angular\/.*/,
|
|
26
|
+
/^@angular-devkit\/.*/,
|
|
27
|
+
/^@bazel\/.*/,
|
|
28
|
+
/^@ngtools\/.*/,
|
|
29
|
+
/^@nguniversal\/.*/,
|
|
30
|
+
/^@schematics\/.*/,
|
|
31
|
+
/^rxjs$/,
|
|
32
|
+
/^typescript$/,
|
|
33
|
+
/^ng-packagr$/,
|
|
34
|
+
/^webpack$/,
|
|
35
|
+
];
|
|
36
|
+
class VersionCommandModule extends command_module_1.CommandModule {
|
|
24
37
|
constructor() {
|
|
25
38
|
super(...arguments);
|
|
26
|
-
this.
|
|
27
|
-
|
|
28
|
-
this.
|
|
39
|
+
this.command = 'version';
|
|
40
|
+
this.aliases = ['v'];
|
|
41
|
+
this.describe = 'Outputs Angular CLI version.';
|
|
42
|
+
}
|
|
43
|
+
builder(localYargs) {
|
|
44
|
+
return localYargs;
|
|
29
45
|
}
|
|
30
46
|
async run() {
|
|
31
|
-
const
|
|
47
|
+
const logger = this.context.logger;
|
|
48
|
+
const localRequire = module_1.default.createRequire((0, path_1.resolve)(__filename, '../../../'));
|
|
49
|
+
// Trailing slash is used to allow the path to be treated as a directory
|
|
50
|
+
const workspaceRequire = module_1.default.createRequire(this.context.root + '/');
|
|
51
|
+
const cliPackage = localRequire('./package.json');
|
|
32
52
|
let workspacePackage;
|
|
33
53
|
try {
|
|
34
|
-
workspacePackage =
|
|
54
|
+
workspacePackage = workspaceRequire('./package.json');
|
|
35
55
|
}
|
|
36
56
|
catch { }
|
|
37
57
|
const [nodeMajor] = process.versions.node.split('.').map((part) => Number(part));
|
|
38
58
|
const unsupportedNodeVersion = !SUPPORTED_NODE_MAJORS.includes(nodeMajor);
|
|
39
|
-
const patterns = [
|
|
40
|
-
/^@angular\/.*/,
|
|
41
|
-
/^@angular-devkit\/.*/,
|
|
42
|
-
/^@bazel\/.*/,
|
|
43
|
-
/^@ngtools\/.*/,
|
|
44
|
-
/^@nguniversal\/.*/,
|
|
45
|
-
/^@schematics\/.*/,
|
|
46
|
-
/^rxjs$/,
|
|
47
|
-
/^typescript$/,
|
|
48
|
-
/^ng-packagr$/,
|
|
49
|
-
/^webpack$/,
|
|
50
|
-
];
|
|
51
59
|
const packageNames = [
|
|
52
60
|
...Object.keys(cliPackage.dependencies || {}),
|
|
53
61
|
...Object.keys(cliPackage.devDependencies || {}),
|
|
@@ -55,12 +63,12 @@ class VersionCommand extends command_1.Command {
|
|
|
55
63
|
...Object.keys((workspacePackage === null || workspacePackage === void 0 ? void 0 : workspacePackage.devDependencies) || {}),
|
|
56
64
|
];
|
|
57
65
|
const versions = packageNames
|
|
58
|
-
.filter((x) =>
|
|
66
|
+
.filter((x) => PACKAGE_PATTERNS.some((p) => p.test(x)))
|
|
59
67
|
.reduce((acc, name) => {
|
|
60
68
|
if (name in acc) {
|
|
61
69
|
return acc;
|
|
62
70
|
}
|
|
63
|
-
acc[name] = this.getVersion(name);
|
|
71
|
+
acc[name] = this.getVersion(name, workspaceRequire, localRequire);
|
|
64
72
|
return acc;
|
|
65
73
|
}, {});
|
|
66
74
|
const ngCliVersion = cliPackage.version;
|
|
@@ -93,11 +101,11 @@ class VersionCommand extends command_1.Command {
|
|
|
93
101
|
.split('\n')
|
|
94
102
|
.map((x) => color_1.colors.red(x))
|
|
95
103
|
.join('\n');
|
|
96
|
-
|
|
97
|
-
|
|
104
|
+
logger.info(asciiArt);
|
|
105
|
+
logger.info(`
|
|
98
106
|
Angular CLI: ${ngCliVersion}
|
|
99
107
|
Node: ${process.versions.node}${unsupportedNodeVersion ? ' (Unsupported)' : ''}
|
|
100
|
-
Package Manager: ${await this.
|
|
108
|
+
Package Manager: ${await this.getPackageManagerVersion()}
|
|
101
109
|
OS: ${process.platform} ${process.arch}
|
|
102
110
|
|
|
103
111
|
Angular: ${angularCoreVersion}
|
|
@@ -126,36 +134,35 @@ class VersionCommand extends command_1.Command {
|
|
|
126
134
|
.join('\n')}
|
|
127
135
|
`.replace(/^ {6}/gm, ''));
|
|
128
136
|
if (unsupportedNodeVersion) {
|
|
129
|
-
|
|
137
|
+
logger.warn(`Warning: The current version of Node (${process.versions.node}) is not supported by Angular.`);
|
|
130
138
|
}
|
|
131
139
|
}
|
|
132
|
-
getVersion(moduleName) {
|
|
140
|
+
getVersion(moduleName, workspaceRequire, localRequire) {
|
|
133
141
|
let packageInfo;
|
|
134
142
|
let cliOnly = false;
|
|
135
143
|
// Try to find the package in the workspace
|
|
136
144
|
try {
|
|
137
|
-
packageInfo =
|
|
145
|
+
packageInfo = workspaceRequire(`${moduleName}/package.json`);
|
|
138
146
|
}
|
|
139
147
|
catch { }
|
|
140
148
|
// If not found, try to find within the CLI
|
|
141
149
|
if (!packageInfo) {
|
|
142
150
|
try {
|
|
143
|
-
packageInfo =
|
|
151
|
+
packageInfo = localRequire(`${moduleName}/package.json`);
|
|
144
152
|
cliOnly = true;
|
|
145
153
|
}
|
|
146
154
|
catch { }
|
|
147
155
|
}
|
|
148
|
-
let version;
|
|
149
156
|
// If found, attempt to get the version
|
|
150
157
|
if (packageInfo) {
|
|
151
158
|
try {
|
|
152
|
-
|
|
159
|
+
return packageInfo.version + (cliOnly ? ' (cli-only)' : '');
|
|
153
160
|
}
|
|
154
161
|
catch { }
|
|
155
162
|
}
|
|
156
|
-
return
|
|
163
|
+
return '<error>';
|
|
157
164
|
}
|
|
158
|
-
async
|
|
165
|
+
async getPackageManagerVersion() {
|
|
159
166
|
try {
|
|
160
167
|
const manager = await (0, package_manager_1.getPackageManager)(this.context.root);
|
|
161
168
|
const version = (0, child_process_1.execSync)(`${manager} --version`, {
|
|
@@ -175,5 +182,4 @@ class VersionCommand extends command_1.Command {
|
|
|
175
182
|
}
|
|
176
183
|
}
|
|
177
184
|
}
|
|
178
|
-
exports.
|
|
179
|
-
VersionCommand.aliases = ['v'];
|
|
185
|
+
exports.VersionCommandModule = VersionCommandModule;
|
package/src/typings.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ declare module 'ini' {
|
|
|
12
12
|
function parse(data: string): Record<string, any>;
|
|
13
13
|
}
|
|
14
14
|
declare module 'npm-pick-manifest' {
|
|
15
|
-
function pickManifest(metadata: import('
|
|
15
|
+
function pickManifest(metadata: import('./utilities/package-metadata').PackageMetadata, selector: string): import('./utilities/package-metadata').PackageManifest;
|
|
16
16
|
export = pickManifest;
|
|
17
17
|
}
|
|
18
18
|
declare module 'pacote' {
|
|
@@ -20,5 +20,5 @@ declare module 'pacote' {
|
|
|
20
20
|
name: string;
|
|
21
21
|
version: string;
|
|
22
22
|
}>;
|
|
23
|
-
function packument(specifier: string, options: Record<string, unknown>): Promise<import('
|
|
23
|
+
function packument(specifier: string, options: Record<string, unknown>): Promise<import('./utilities/package-metadata').NpmRepositoryPackageJson>;
|
|
24
24
|
}
|
|
File without changes
|
|
File without changes
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
8
|
import { json, workspaces } from '@angular-devkit/core';
|
|
9
|
-
import { PackageManager } from '
|
|
9
|
+
import { PackageManager } from '../../lib/config/workspace-schema';
|
|
10
10
|
import { JSONFile } from './json-file';
|
|
11
11
|
export declare const workspaceSchemaPath: string;
|
|
12
12
|
export declare class AngularWorkspace {
|
|
@@ -62,10 +62,7 @@ function createWorkspaceHost() {
|
|
|
62
62
|
},
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
-
|
|
66
|
-
return path.join(__dirname, '../lib/config/schema.json');
|
|
67
|
-
}
|
|
68
|
-
exports.workspaceSchemaPath = getSchemaLocation();
|
|
65
|
+
exports.workspaceSchemaPath = path.join(__dirname, '../../lib/config/schema.json');
|
|
69
66
|
const configNames = ['angular.json', '.angular.json'];
|
|
70
67
|
const globalFileName = '.angular-config.json';
|
|
71
68
|
function xdgConfigHome(home, configFile) {
|
|
@@ -190,7 +187,7 @@ function getWorkspaceRaw(level = 'local') {
|
|
|
190
187
|
}
|
|
191
188
|
exports.getWorkspaceRaw = getWorkspaceRaw;
|
|
192
189
|
async function validateWorkspace(data) {
|
|
193
|
-
const schema = (0, json_file_1.readAndParseJson)(
|
|
190
|
+
const schema = (0, json_file_1.readAndParseJson)(exports.workspaceSchemaPath);
|
|
194
191
|
const { formats } = await Promise.resolve().then(() => __importStar(require('@angular-devkit/schematics')));
|
|
195
192
|
const registry = new core_1.json.schema.CoreSchemaRegistry(formats.standardFormats);
|
|
196
193
|
const validator = await registry.compile(schema).toPromise();
|
|
File without changes
|
|
File without changes
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
import { PackageManager } from '
|
|
9
|
-
import { NgAddSaveDepedency } from '
|
|
8
|
+
import { PackageManager } from '../../lib/config/workspace-schema';
|
|
9
|
+
import { NgAddSaveDepedency } from './package-metadata';
|
|
10
10
|
export declare function installAllPackages(packageManager?: PackageManager, extraArgs?: string[], cwd?: string): Promise<1 | 0>;
|
|
11
11
|
export declare function installPackage(packageName: string, packageManager?: PackageManager, save?: Exclude<NgAddSaveDepedency, false>, extraArgs?: string[], cwd?: string): Promise<1 | 0>;
|
|
12
12
|
export declare function installTempPackage(packageName: string, packageManager?: PackageManager, extraArgs?: string[]): Promise<{
|
|
@@ -12,7 +12,7 @@ const child_process_1 = require("child_process");
|
|
|
12
12
|
const fs_1 = require("fs");
|
|
13
13
|
const os_1 = require("os");
|
|
14
14
|
const path_1 = require("path");
|
|
15
|
-
const workspace_schema_1 = require("
|
|
15
|
+
const workspace_schema_1 = require("../../lib/config/workspace-schema");
|
|
16
16
|
const spinner_1 = require("./spinner");
|
|
17
17
|
async function installAllPackages(packageManager = workspace_schema_1.PackageManager.Npm, extraArgs = [], cwd = process.cwd()) {
|
|
18
18
|
const packageManagerArgs = getPackageManagerArguments(packageManager);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
import { PackageManager } from '
|
|
8
|
+
import { PackageManager } from '../../lib/config/workspace-schema';
|
|
9
9
|
export declare function getPackageManager(root: string): Promise<PackageManager>;
|
|
10
10
|
/**
|
|
11
11
|
* Checks if the npm version is a supported 7.x version. If not, display a warning.
|
|
@@ -13,7 +13,7 @@ const fs_1 = require("fs");
|
|
|
13
13
|
const path_1 = require("path");
|
|
14
14
|
const semver_1 = require("semver");
|
|
15
15
|
const util_1 = require("util");
|
|
16
|
-
const workspace_schema_1 = require("
|
|
16
|
+
const workspace_schema_1 = require("../../lib/config/workspace-schema");
|
|
17
17
|
const config_1 = require("./config");
|
|
18
18
|
const exec = (0, util_1.promisify)(child_process_1.exec);
|
|
19
19
|
async function supports(name) {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
declare class Version {
|
|
9
9
|
readonly full: string;
|
|
10
10
|
readonly major: string;
|
|
11
11
|
readonly minor: string;
|
|
@@ -13,3 +13,4 @@ export declare class Version {
|
|
|
13
13
|
constructor(full: string);
|
|
14
14
|
}
|
|
15
15
|
export declare const VERSION: Version;
|
|
16
|
+
export {};
|
|
@@ -7,19 +7,19 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.VERSION =
|
|
10
|
+
exports.VERSION = void 0;
|
|
11
11
|
const fs_1 = require("fs");
|
|
12
12
|
const path_1 = require("path");
|
|
13
13
|
// Same structure as used in framework packages
|
|
14
14
|
class Version {
|
|
15
15
|
constructor(full) {
|
|
16
16
|
this.full = full;
|
|
17
|
-
|
|
18
|
-
this.
|
|
19
|
-
this.
|
|
17
|
+
const [major, minor, patch] = full.split('-', 1)[0].split('.', 3);
|
|
18
|
+
this.major = major;
|
|
19
|
+
this.minor = minor;
|
|
20
|
+
this.patch = patch;
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
|
-
exports.Version = Version;
|
|
23
23
|
// TODO: Convert this to use build-time version stamping after flipping the build script to use bazel
|
|
24
24
|
// export const VERSION = new Version('0.0.0-PLACEHOLDER');
|
|
25
|
-
exports.VERSION = new Version(JSON.parse((0, fs_1.readFileSync)((0, path_1.resolve)(__dirname, '
|
|
25
|
+
exports.VERSION = new Version(JSON.parse((0, fs_1.readFileSync)((0, path_1.resolve)(__dirname, '../../package.json'), 'utf-8')).version);
|
package/commands/add-impl.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { Arguments } from '../models/interface';
|
|
9
|
-
import { SchematicCommand } from '../models/schematic-command';
|
|
10
|
-
import { Schema as AddCommandSchema } from './add';
|
|
11
|
-
export declare class AddCommand extends SchematicCommand<AddCommandSchema> {
|
|
12
|
-
readonly allowPrivateSchematics = true;
|
|
13
|
-
initialize(options: AddCommandSchema & Arguments): Promise<void>;
|
|
14
|
-
run(options: AddCommandSchema & Arguments): Promise<number | void>;
|
|
15
|
-
private isProjectVersionValid;
|
|
16
|
-
reportAnalytics(paths: string[], options: AddCommandSchema & Arguments, dimensions?: (boolean | number | string)[], metrics?: (boolean | number | string)[]): Promise<void>;
|
|
17
|
-
private isPackageInstalled;
|
|
18
|
-
private executeSchematic;
|
|
19
|
-
private findProjectVersion;
|
|
20
|
-
private hasMismatchedPeer;
|
|
21
|
-
}
|
package/commands/add.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adds support for an external library to your project.
|
|
3
|
-
*/
|
|
4
|
-
export interface Schema {
|
|
5
|
-
/**
|
|
6
|
-
* The package to be added.
|
|
7
|
-
*/
|
|
8
|
-
collection?: string;
|
|
9
|
-
/**
|
|
10
|
-
* Disable interactive input prompts for options with a default.
|
|
11
|
-
*/
|
|
12
|
-
defaults?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Shows a help message for this command in the console.
|
|
15
|
-
*/
|
|
16
|
-
help?: HelpUnion;
|
|
17
|
-
/**
|
|
18
|
-
* Enable interactive input prompts.
|
|
19
|
-
*/
|
|
20
|
-
interactive?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* The NPM registry to use.
|
|
23
|
-
*/
|
|
24
|
-
registry?: string;
|
|
25
|
-
/**
|
|
26
|
-
* Skip asking a confirmation prompt before installing and executing the package. Ensure
|
|
27
|
-
* package name is correct prior to using this option.
|
|
28
|
-
*/
|
|
29
|
-
skipConfirmation?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Display additional details about internal operations during execution.
|
|
32
|
-
*/
|
|
33
|
-
verbose?: boolean;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Shows a help message for this command in the console.
|
|
37
|
-
*/
|
|
38
|
-
export declare type HelpUnion = boolean | HelpEnum;
|
|
39
|
-
export declare enum HelpEnum {
|
|
40
|
-
HelpJson = "JSON",
|
|
41
|
-
Json = "json"
|
|
42
|
-
}
|
package/commands/add.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
|
|
3
|
-
// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.HelpEnum = void 0;
|
|
6
|
-
var HelpEnum;
|
|
7
|
-
(function (HelpEnum) {
|
|
8
|
-
HelpEnum["HelpJson"] = "JSON";
|
|
9
|
-
HelpEnum["Json"] = "json";
|
|
10
|
-
})(HelpEnum = exports.HelpEnum || (exports.HelpEnum = {}));
|
package/commands/add.json
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
-
"$id": "ng-cli://commands/add.json",
|
|
4
|
-
"description": "Adds support for an external library to your project.",
|
|
5
|
-
"$longDescription": "./add.md",
|
|
6
|
-
|
|
7
|
-
"$scope": "in",
|
|
8
|
-
"$impl": "./add-impl#AddCommand",
|
|
9
|
-
|
|
10
|
-
"type": "object",
|
|
11
|
-
"allOf": [
|
|
12
|
-
{
|
|
13
|
-
"properties": {
|
|
14
|
-
"collection": {
|
|
15
|
-
"type": "string",
|
|
16
|
-
"description": "The package to be added.",
|
|
17
|
-
"$default": {
|
|
18
|
-
"$source": "argv",
|
|
19
|
-
"index": 0
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
"registry": {
|
|
23
|
-
"description": "The NPM registry to use.",
|
|
24
|
-
"type": "string",
|
|
25
|
-
"oneOf": [
|
|
26
|
-
{
|
|
27
|
-
"format": "uri"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"format": "hostname"
|
|
31
|
-
}
|
|
32
|
-
]
|
|
33
|
-
},
|
|
34
|
-
"verbose": {
|
|
35
|
-
"description": "Display additional details about internal operations during execution.",
|
|
36
|
-
"type": "boolean",
|
|
37
|
-
"default": false
|
|
38
|
-
},
|
|
39
|
-
"skipConfirmation": {
|
|
40
|
-
"description": "Skip asking a confirmation prompt before installing and executing the package. Ensure package name is correct prior to using this option.",
|
|
41
|
-
"type": "boolean",
|
|
42
|
-
"default": false
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
"required": []
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"$ref": "./definitions.json#/definitions/interactive"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"$ref": "./definitions.json#/definitions/base"
|
|
52
|
-
}
|
|
53
|
-
]
|
|
54
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { Command } from '../models/command';
|
|
9
|
-
import { Arguments } from '../models/interface';
|
|
10
|
-
import { Schema as AnalyticsCommandSchema } from './analytics';
|
|
11
|
-
export declare class AnalyticsCommand extends Command<AnalyticsCommandSchema> {
|
|
12
|
-
run(options: AnalyticsCommandSchema & Arguments): Promise<0 | 1 | 2 | 3 | 4>;
|
|
13
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
-
* found in the LICENSE file at https://angular.io/license
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.AnalyticsCommand = void 0;
|
|
11
|
-
const analytics_1 = require("../models/analytics");
|
|
12
|
-
const command_1 = require("../models/command");
|
|
13
|
-
const analytics_2 = require("./analytics");
|
|
14
|
-
class AnalyticsCommand extends command_1.Command {
|
|
15
|
-
async run(options) {
|
|
16
|
-
// Our parser does not support positional enums (won't report invalid parameters). Do the
|
|
17
|
-
// validation manually.
|
|
18
|
-
// TODO(hansl): fix parser to better support positionals. This would be a breaking change.
|
|
19
|
-
if (options.settingOrProject === undefined) {
|
|
20
|
-
if (options['--']) {
|
|
21
|
-
// The user passed positional arguments but they didn't validate.
|
|
22
|
-
this.logger.error(`Argument ${JSON.stringify(options['--'][0])} is invalid.`);
|
|
23
|
-
this.logger.error(`Please provide one of the following value: on, off, ci or project.`);
|
|
24
|
-
return 1;
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
// No argument were passed.
|
|
28
|
-
await this.printHelp();
|
|
29
|
-
return 2;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
else if (options.settingOrProject == analytics_2.SettingOrProject.Project &&
|
|
33
|
-
options.projectSetting === undefined) {
|
|
34
|
-
this.logger.error(`Argument ${JSON.stringify(options.settingOrProject)} requires a second ` +
|
|
35
|
-
`argument of one of the following value: on, off.`);
|
|
36
|
-
return 2;
|
|
37
|
-
}
|
|
38
|
-
try {
|
|
39
|
-
switch (options.settingOrProject) {
|
|
40
|
-
case analytics_2.SettingOrProject.Off:
|
|
41
|
-
(0, analytics_1.setAnalyticsConfig)('global', false);
|
|
42
|
-
break;
|
|
43
|
-
case analytics_2.SettingOrProject.On:
|
|
44
|
-
(0, analytics_1.setAnalyticsConfig)('global', true);
|
|
45
|
-
break;
|
|
46
|
-
case analytics_2.SettingOrProject.Ci:
|
|
47
|
-
(0, analytics_1.setAnalyticsConfig)('global', 'ci');
|
|
48
|
-
break;
|
|
49
|
-
case analytics_2.SettingOrProject.Project:
|
|
50
|
-
switch (options.projectSetting) {
|
|
51
|
-
case analytics_2.ProjectSetting.Off:
|
|
52
|
-
(0, analytics_1.setAnalyticsConfig)('local', false);
|
|
53
|
-
break;
|
|
54
|
-
case analytics_2.ProjectSetting.On:
|
|
55
|
-
(0, analytics_1.setAnalyticsConfig)('local', true);
|
|
56
|
-
break;
|
|
57
|
-
case analytics_2.ProjectSetting.Prompt:
|
|
58
|
-
await (0, analytics_1.promptProjectAnalytics)(true);
|
|
59
|
-
break;
|
|
60
|
-
default:
|
|
61
|
-
await this.printHelp();
|
|
62
|
-
return 3;
|
|
63
|
-
}
|
|
64
|
-
break;
|
|
65
|
-
case analytics_2.SettingOrProject.Prompt:
|
|
66
|
-
await (0, analytics_1.promptGlobalAnalytics)(true);
|
|
67
|
-
break;
|
|
68
|
-
default:
|
|
69
|
-
await this.printHelp();
|
|
70
|
-
return 4;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
catch (err) {
|
|
74
|
-
this.logger.fatal(err.message);
|
|
75
|
-
return 1;
|
|
76
|
-
}
|
|
77
|
-
return 0;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
exports.AnalyticsCommand = AnalyticsCommand;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
The value of _settingOrProject_ is one of the following.
|
|
2
|
-
|
|
3
|
-
- "on" : Enables analytics gathering and reporting for the user.
|
|
4
|
-
- "off" : Disables analytics gathering and reporting for the user.
|
|
5
|
-
- "ci" : Enables analytics and configures reporting for use with Continuous Integration,
|
|
6
|
-
which uses a common CI user.
|
|
7
|
-
- "prompt" : Prompts the user to set the status interactively.
|
|
8
|
-
- "project" : Sets the default status for the project to the _projectSetting_ value, which can be any of the other values. The _projectSetting_ argument is ignored for all other values of _settingOrProject_.
|
package/commands/analytics.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configures the gathering of Angular CLI usage metrics. See
|
|
3
|
-
* https://angular.io/cli/usage-analytics-gathering.
|
|
4
|
-
*/
|
|
5
|
-
export interface Schema {
|
|
6
|
-
/**
|
|
7
|
-
* Shows a help message for this command in the console.
|
|
8
|
-
*/
|
|
9
|
-
help?: HelpUnion;
|
|
10
|
-
/**
|
|
11
|
-
* Sets the default analytics enablement status for the project.
|
|
12
|
-
*/
|
|
13
|
-
projectSetting?: ProjectSetting;
|
|
14
|
-
/**
|
|
15
|
-
* Directly enables or disables all usage analytics for the user, or prompts the user to set
|
|
16
|
-
* the status interactively, or sets the default status for the project.
|
|
17
|
-
*/
|
|
18
|
-
settingOrProject: SettingOrProject;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Shows a help message for this command in the console.
|
|
22
|
-
*/
|
|
23
|
-
export declare type HelpUnion = boolean | HelpEnum;
|
|
24
|
-
export declare enum HelpEnum {
|
|
25
|
-
HelpJson = "JSON",
|
|
26
|
-
Json = "json"
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Sets the default analytics enablement status for the project.
|
|
30
|
-
*/
|
|
31
|
-
export declare enum ProjectSetting {
|
|
32
|
-
Off = "off",
|
|
33
|
-
On = "on",
|
|
34
|
-
Prompt = "prompt"
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Directly enables or disables all usage analytics for the user, or prompts the user to set
|
|
38
|
-
* the status interactively, or sets the default status for the project.
|
|
39
|
-
*/
|
|
40
|
-
export declare enum SettingOrProject {
|
|
41
|
-
Ci = "ci",
|
|
42
|
-
Off = "off",
|
|
43
|
-
On = "on",
|
|
44
|
-
Project = "project",
|
|
45
|
-
Prompt = "prompt"
|
|
46
|
-
}
|