nx 13.8.8 → 13.9.0-beta.2
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/nx.d.ts +1 -0
- package/bin/nx.js +78 -1
- package/bin/nx.js.map +1 -1
- package/package.json +19 -2
- package/src/cli/decorate-cli.d.ts +1 -0
- package/src/cli/decorate-cli.js +19 -0
- package/src/cli/decorate-cli.js.map +1 -0
- package/src/cli/find-workspace-root.d.ts +8 -0
- package/src/cli/find-workspace-root.js +25 -0
- package/src/cli/find-workspace-root.js.map +1 -0
- package/src/cli/index.d.ts +3 -0
- package/src/cli/index.js +74 -0
- package/src/cli/index.js.map +1 -0
- package/src/cli/init-local.d.ts +2 -0
- package/src/cli/init-local.js +109 -0
- package/src/cli/init-local.js.map +1 -0
- package/src/cli/is_ci.d.ts +1 -0
- package/src/cli/is_ci.js +20 -0
- package/src/cli/is_ci.js.map +1 -0
- package/src/cli/output.d.ts +58 -0
- package/src/cli/output.js +129 -0
- package/src/cli/output.js.map +1 -0
- package/src/cli/parse-run-one-options.d.ts +6 -0
- package/src/cli/parse-run-one-options.js +139 -0
- package/src/cli/parse-run-one-options.js.map +1 -0
- package/src/cli/run-cli.d.ts +1 -0
- package/src/cli/run-cli.js +69 -0
- package/src/cli/run-cli.js.map +1 -0
- package/src/cli/workspace.d.ts +4 -0
- package/src/cli/workspace.js +3 -0
- package/src/cli/workspace.js.map +1 -0
- package/src/commands/generate.d.ts +15 -0
- package/src/commands/generate.js +170 -0
- package/src/commands/generate.js.map +1 -0
- package/src/commands/help.d.ts +1 -0
- package/src/commands/help.js +34 -0
- package/src/commands/help.js.map +1 -0
- package/src/commands/migrate.d.ts +77 -0
- package/src/commands/migrate.js +584 -0
- package/src/commands/migrate.js.map +1 -0
- package/src/commands/ngcli-adapter.d.ts +111 -0
- package/src/commands/ngcli-adapter.js +940 -0
- package/src/commands/ngcli-adapter.js.map +1 -0
- package/src/commands/run.d.ts +51 -0
- package/src/commands/run.js +224 -0
- package/src/commands/run.js.map +1 -0
- package/src/compat/compat.d.ts +1 -0
- package/src/compat/compat.js +86 -0
- package/src/compat/compat.js.map +1 -0
- package/src/shared/logger.d.ts +11 -0
- package/src/shared/logger.js +48 -0
- package/src/shared/logger.js.map +1 -0
- package/src/shared/nx-plugin.d.ts +18 -0
- package/src/shared/nx-plugin.js +53 -0
- package/src/shared/nx-plugin.js.map +1 -0
- package/src/shared/nx.d.ts +110 -0
- package/src/shared/nx.js +3 -0
- package/src/shared/nx.js.map +1 -0
- package/src/shared/package-json.d.ts +28 -0
- package/src/shared/package-json.js +10 -0
- package/src/shared/package-json.js.map +1 -0
- package/src/shared/package-manager.d.ts +32 -0
- package/src/shared/package-manager.js +83 -0
- package/src/shared/package-manager.js.map +1 -0
- package/src/shared/params.d.ts +113 -0
- package/src/shared/params.js +587 -0
- package/src/shared/params.js.map +1 -0
- package/src/shared/print-help.d.ts +2 -0
- package/src/shared/print-help.js +32 -0
- package/src/shared/print-help.js.map +1 -0
- package/src/shared/project-graph.d.ts +135 -0
- package/src/shared/project-graph.js +22 -0
- package/src/shared/project-graph.js.map +1 -0
- package/src/shared/tasks.d.ts +82 -0
- package/src/shared/tasks.js +3 -0
- package/src/shared/tasks.js.map +1 -0
- package/src/shared/tree.d.ts +115 -0
- package/src/shared/tree.js +259 -0
- package/src/shared/tree.js.map +1 -0
- package/src/shared/workspace.d.ts +257 -0
- package/src/shared/workspace.js +522 -0
- package/src/shared/workspace.js.map +1 -0
- package/src/utils/app-root.d.ts +2 -0
- package/src/utils/app-root.js +30 -0
- package/src/utils/app-root.js.map +1 -0
- package/src/utils/fileutils.d.ts +31 -0
- package/src/utils/fileutils.js +45 -0
- package/src/utils/fileutils.js.map +1 -0
- package/src/utils/json.d.ts +39 -0
- package/src/utils/json.js +48 -0
- package/src/utils/json.js.map +1 -0
- package/src/utils/object-sort.d.ts +1 -0
- package/src/utils/object-sort.js +12 -0
- package/src/utils/object-sort.js.map +1 -0
- package/src/utils/register.d.ts +9 -0
- package/src/utils/register.js +36 -0
- package/src/utils/register.js.map +1 -0
- package/src/utils/split-target.d.ts +1 -0
- package/src/utils/split-target.js +26 -0
- package/src/utils/split-target.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileutils.js","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/fileutils.ts"],"names":[],"mappings":";;;AAAA,iCAAkD;AAElD,2BAAiD;AACjD,+BAA+B;AAC/B,uCAAyC;AAkBzC;;;;;;GAMG;AACH,SAAgB,YAAY,CAC1B,IAAY,EACZ,OAAyB;IAEzB,MAAM,OAAO,GAAG,IAAA,iBAAY,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC5C,IAAI,OAAO,EAAE;QACX,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;KACzE;IACD,IAAI;QACF,OAAO,IAAA,gBAAS,EAAI,OAAO,EAAE,OAAO,CAAC,CAAC;KACvC;IAAC,OAAO,CAAC,EAAE;QACV,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC5C,MAAM,CAAC,CAAC;KACT;AACH,CAAC;AAdD,oCAcC;AAED;;;;;;GAMG;AACH,SAAgB,aAAa,CAC3B,IAAY,EACZ,IAAO,EACP,OAA0B;IAE1B,IAAA,wBAAa,EAAC,IAAA,cAAO,EAAC,IAAI,CAAC,CAAC,CAAC;IAC7B,MAAM,cAAc,GAAG,IAAA,oBAAa,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACpD,MAAM,OAAO,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,aAAa;QACpC,CAAC,CAAC,GAAG,cAAc,IAAI;QACvB,CAAC,CAAC,cAAc,CAAC;IACnB,IAAA,kBAAa,EAAC,IAAI,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;AACtD,CAAC;AAXD,sCAWC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { stripComments } from 'jsonc-parser';
|
|
2
|
+
export { stripComments as stripJsonComments };
|
|
3
|
+
export interface JsonParseOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Expect JSON with javascript-style
|
|
6
|
+
* @default false
|
|
7
|
+
*/
|
|
8
|
+
expectComments?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Disallow javascript-style
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
disallowComments?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface JsonSerializeOptions {
|
|
16
|
+
/**
|
|
17
|
+
* the whitespaces to add as intentation to make the output more readable.
|
|
18
|
+
* @default 2
|
|
19
|
+
*/
|
|
20
|
+
spaces?: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Parses the given JSON string and returns the object the JSON content represents.
|
|
24
|
+
* By default javascript-style comments are allowed.
|
|
25
|
+
*
|
|
26
|
+
* @param input JSON content as string
|
|
27
|
+
* @param options JSON parse options
|
|
28
|
+
* @returns Object the JSON content represents
|
|
29
|
+
*/
|
|
30
|
+
export declare function parseJson<T extends object = any>(input: string, options?: JsonParseOptions): T;
|
|
31
|
+
/**
|
|
32
|
+
* Serializes the given data to a JSON string.
|
|
33
|
+
* By default the JSON string is formatted with a 2 space intendation to be easy readable.
|
|
34
|
+
*
|
|
35
|
+
* @param input Object which should be serialized to JSON
|
|
36
|
+
* @param options JSON serialize options
|
|
37
|
+
* @returns the formatted JSON representation of the object
|
|
38
|
+
*/
|
|
39
|
+
export declare function serializeJson<T extends object = object>(input: T, options?: JsonSerializeOptions): string;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serializeJson = exports.parseJson = exports.stripJsonComments = void 0;
|
|
4
|
+
const jsonc_parser_1 = require("jsonc-parser");
|
|
5
|
+
Object.defineProperty(exports, "stripJsonComments", { enumerable: true, get: function () { return jsonc_parser_1.stripComments; } });
|
|
6
|
+
/**
|
|
7
|
+
* Parses the given JSON string and returns the object the JSON content represents.
|
|
8
|
+
* By default javascript-style comments are allowed.
|
|
9
|
+
*
|
|
10
|
+
* @param input JSON content as string
|
|
11
|
+
* @param options JSON parse options
|
|
12
|
+
* @returns Object the JSON content represents
|
|
13
|
+
*/
|
|
14
|
+
function parseJson(input, options) {
|
|
15
|
+
try {
|
|
16
|
+
if ((options === null || options === void 0 ? void 0 : options.disallowComments) === true ||
|
|
17
|
+
(options === null || options === void 0 ? void 0 : options.expectComments) !== true) {
|
|
18
|
+
return JSON.parse(input);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
if ((options === null || options === void 0 ? void 0 : options.disallowComments) === true) {
|
|
23
|
+
throw error;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const errors = [];
|
|
27
|
+
const result = (0, jsonc_parser_1.parse)(input, errors);
|
|
28
|
+
if (errors.length > 0) {
|
|
29
|
+
const { error, offset } = errors[0];
|
|
30
|
+
throw new Error(`${(0, jsonc_parser_1.printParseErrorCode)(error)} in JSON at position ${offset}`);
|
|
31
|
+
}
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
exports.parseJson = parseJson;
|
|
35
|
+
/**
|
|
36
|
+
* Serializes the given data to a JSON string.
|
|
37
|
+
* By default the JSON string is formatted with a 2 space intendation to be easy readable.
|
|
38
|
+
*
|
|
39
|
+
* @param input Object which should be serialized to JSON
|
|
40
|
+
* @param options JSON serialize options
|
|
41
|
+
* @returns the formatted JSON representation of the object
|
|
42
|
+
*/
|
|
43
|
+
function serializeJson(input, options) {
|
|
44
|
+
var _a;
|
|
45
|
+
return JSON.stringify(input, null, (_a = options === null || options === void 0 ? void 0 : options.spaces) !== null && _a !== void 0 ? _a : 2) + '\n';
|
|
46
|
+
}
|
|
47
|
+
exports.serializeJson = serializeJson;
|
|
48
|
+
//# sourceMappingURL=json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/json.ts"],"names":[],"mappings":";;;AAAA,+CAAyE;AAG/C,kGAHW,4BAAa,OAGP;AAuB3C;;;;;;;GAOG;AACH,SAAgB,SAAS,CACvB,KAAa,EACb,OAA0B;IAE1B,IAAI;QACF,IACE,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,gBAAgB,MAAK,IAAI;YAClC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,cAAc,MAAK,IAAI,EAChC;YACA,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SAC1B;KACF;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,gBAAgB,MAAK,IAAI,EAAE;YACtC,MAAM,KAAK,CAAC;SACb;KACF;IAED,MAAM,MAAM,GAAiB,EAAE,CAAC;IAChC,MAAM,MAAM,GAAM,IAAA,oBAAK,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAEvC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;QACrB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,IAAI,KAAK,CACb,GAAG,IAAA,kCAAmB,EAAC,KAAK,CAAC,wBAAwB,MAAM,EAAE,CAC9D,CAAC;KACH;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AA5BD,8BA4BC;AAED;;;;;;;GAOG;AACH,SAAgB,aAAa,CAC3B,KAAQ,EACR,OAA8B;;IAE9B,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,mCAAI,CAAC,CAAC,GAAG,IAAI,CAAC;AAClE,CAAC;AALD,sCAKC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function sortObjectByKeys(originalObject: object): {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sortObjectByKeys = void 0;
|
|
4
|
+
function sortObjectByKeys(originalObject) {
|
|
5
|
+
return Object.keys(originalObject)
|
|
6
|
+
.sort()
|
|
7
|
+
.reduce((obj, key) => {
|
|
8
|
+
return Object.assign(Object.assign({}, obj), { [key]: originalObject[key] });
|
|
9
|
+
}, {});
|
|
10
|
+
}
|
|
11
|
+
exports.sortObjectByKeys = sortObjectByKeys;
|
|
12
|
+
//# sourceMappingURL=object-sort.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object-sort.js","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/object-sort.ts"],"names":[],"mappings":";;;AAAA,SAAgB,gBAAgB,CAAC,cAAsB;IACrD,OAAO,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC;SAC/B,IAAI,EAAE;SACN,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACnB,uCACK,GAAG,KACN,CAAC,GAAG,CAAC,EAAE,cAAc,CAAC,GAAG,CAAC,IAC1B;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;AACX,CAAC;AATD,4CASC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Optionally, if swc-node and tsconfig-paths are available in the current workspace, apply the require
|
|
3
|
+
* register hooks so that .ts files can be used for writing custom workspace projects.
|
|
4
|
+
*
|
|
5
|
+
* If ts-node and tsconfig-paths are not available, the user can still provide an index.js file in
|
|
6
|
+
* the root of their project and the fundamentals will still work (but
|
|
7
|
+
* workspace path mapping will not, for example).
|
|
8
|
+
*/
|
|
9
|
+
export declare const registerTsProject: (path: string, configFilename?: string) => any;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerTsProject = void 0;
|
|
4
|
+
const read_default_tsconfig_1 = require("@swc-node/register/read-default-tsconfig");
|
|
5
|
+
const register_1 = require("@swc-node/register/register");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
/**
|
|
8
|
+
* Optionally, if swc-node and tsconfig-paths are available in the current workspace, apply the require
|
|
9
|
+
* register hooks so that .ts files can be used for writing custom workspace projects.
|
|
10
|
+
*
|
|
11
|
+
* If ts-node and tsconfig-paths are not available, the user can still provide an index.js file in
|
|
12
|
+
* the root of their project and the fundamentals will still work (but
|
|
13
|
+
* workspace path mapping will not, for example).
|
|
14
|
+
*/
|
|
15
|
+
const registerTsProject = (path, configFilename = 'tsconfig.json') => {
|
|
16
|
+
try {
|
|
17
|
+
const tsConfig = (0, read_default_tsconfig_1.readDefaultTsConfig)((0, path_1.join)(path, configFilename));
|
|
18
|
+
(0, register_1.register)(tsConfig);
|
|
19
|
+
/**
|
|
20
|
+
* Load the ts config from the source project
|
|
21
|
+
*/
|
|
22
|
+
const tsconfigPaths = require('tsconfig-paths');
|
|
23
|
+
const tsConfigResult = tsconfigPaths.loadConfig(path);
|
|
24
|
+
/**
|
|
25
|
+
* Register the custom workspace path mappings with node so that workspace libraries
|
|
26
|
+
* can be imported and used within project
|
|
27
|
+
*/
|
|
28
|
+
return tsconfigPaths.register({
|
|
29
|
+
baseUrl: tsConfigResult.absoluteBaseUrl,
|
|
30
|
+
paths: tsConfigResult.paths,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
catch (err) { }
|
|
34
|
+
};
|
|
35
|
+
exports.registerTsProject = registerTsProject;
|
|
36
|
+
//# sourceMappingURL=register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/register.ts"],"names":[],"mappings":";;;AAAA,oFAA+E;AAC/E,0DAAuD;AACvD,+BAA4B;AAE5B;;;;;;;GAOG;AACI,MAAM,iBAAiB,GAAG,CAC/B,IAAY,EACZ,cAAc,GAAG,eAAe,EAChC,EAAE;IACF,IAAI;QACF,MAAM,QAAQ,GAAG,IAAA,2CAAmB,EAAC,IAAA,WAAI,EAAC,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC;QACjE,IAAA,mBAAQ,EAAC,QAAQ,CAAC,CAAC;QAEnB;;WAEG;QACH,MAAM,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;QAChD,MAAM,cAAc,GAAG,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACtD;;;WAGG;QACH,OAAO,aAAa,CAAC,QAAQ,CAAC;YAC5B,OAAO,EAAE,cAAc,CAAC,eAAe;YACvC,KAAK,EAAE,cAAc,CAAC,KAAK;SAC5B,CAAC,CAAC;KACJ;IAAC,OAAO,GAAG,EAAE,GAAE;AAClB,CAAC,CAAC;AAtBW,QAAA,iBAAiB,qBAsB5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function splitTarget(s: string): any;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.splitTarget = void 0;
|
|
4
|
+
function splitTarget(s) {
|
|
5
|
+
const parts = [];
|
|
6
|
+
let currentPart = '';
|
|
7
|
+
for (let i = 0; i < s.length; ++i) {
|
|
8
|
+
if (s[i] === ':') {
|
|
9
|
+
parts.push(currentPart);
|
|
10
|
+
currentPart = '';
|
|
11
|
+
}
|
|
12
|
+
else if (s[i] === '"') {
|
|
13
|
+
i++;
|
|
14
|
+
for (; i < s.length && s[i] != '"'; ++i) {
|
|
15
|
+
currentPart += s[i];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
currentPart += s[i];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
parts.push(currentPart);
|
|
23
|
+
return parts;
|
|
24
|
+
}
|
|
25
|
+
exports.splitTarget = splitTarget;
|
|
26
|
+
//# sourceMappingURL=split-target.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"split-target.js","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/split-target.ts"],"names":[],"mappings":";;;AAAA,SAAgB,WAAW,CAAC,CAAS;IACnC,MAAM,KAAK,GAAG,EAAc,CAAC;IAC7B,IAAI,WAAW,GAAG,EAAE,CAAC;IACrB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;QACjC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;YAChB,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACxB,WAAW,GAAG,EAAE,CAAC;SAClB;aAAM,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;YACvB,CAAC,EAAE,CAAC;YACJ,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,EAAE,CAAC,EAAE;gBACvC,WAAW,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;aACrB;SACF;aAAM;YACL,WAAW,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;SACrB;KACF;IACD,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACxB,OAAO,KAAK,CAAC;AACf,CAAC;AAlBD,kCAkBC"}
|