@nx/js 23.0.0-beta.4 → 23.0.0-beta.6
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/package.json +6 -6
- package/src/executors/node/node.impl.d.ts.map +1 -1
- package/src/executors/node/node.impl.js +2 -2
- package/src/executors/tsc/lib/typescript-compilation.js +2 -2
- package/src/generators/init/init.d.ts.map +1 -1
- package/src/generators/init/init.js +7 -8
- package/src/generators/library/library.d.ts.map +1 -1
- package/src/generators/library/library.js +7 -10
- package/src/generators/library/schema.d.ts +1 -1
- package/src/generators/setup-build/generator.d.ts.map +1 -1
- package/src/generators/setup-build/generator.js +3 -3
- package/src/migrations/update-22-0-0/remove-external-options-from-js-executors.d.ts.map +1 -1
- package/src/migrations/update-22-0-0/remove-external-options-from-js-executors.js +2 -2
- package/src/plugins/typescript/plugin.d.ts.map +1 -1
- package/src/plugins/typescript/plugin.js +8 -6
- package/src/release/version-actions.d.ts.map +1 -1
- package/src/release/version-actions.js +3 -3
- package/src/utils/generator-prompts.js +3 -3
- package/src/utils/swc/compile-swc.js +2 -2
- package/src/utils/typescript/compile-typescript-files.d.ts.map +1 -1
- package/src/utils/typescript/compile-typescript-files.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/js",
|
|
3
|
-
"version": "23.0.0-beta.
|
|
3
|
+
"version": "23.0.0-beta.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The JS plugin for Nx contains executors and generators that provide the best experience for developing JavaScript and TypeScript projects. ",
|
|
6
6
|
"repository": {
|
|
@@ -40,16 +40,16 @@
|
|
|
40
40
|
"@babel/preset-env": "^7.23.2",
|
|
41
41
|
"@babel/preset-typescript": "^7.22.5",
|
|
42
42
|
"@babel/runtime": "^7.22.6",
|
|
43
|
-
"@nx/devkit": "23.0.0-beta.
|
|
44
|
-
"@nx/workspace": "23.0.0-beta.
|
|
43
|
+
"@nx/devkit": "23.0.0-beta.6",
|
|
44
|
+
"@nx/workspace": "23.0.0-beta.6",
|
|
45
45
|
"@zkochan/js-yaml": "0.0.7",
|
|
46
46
|
"babel-plugin-const-enum": "^1.0.1",
|
|
47
47
|
"babel-plugin-macros": "^3.1.0",
|
|
48
48
|
"babel-plugin-transform-typescript-metadata": "^0.3.1",
|
|
49
49
|
"chalk": "^4.1.0",
|
|
50
50
|
"columnify": "^1.6.0",
|
|
51
|
-
"detect-port": "^1.
|
|
52
|
-
"ignore": "^
|
|
51
|
+
"detect-port": "^2.1.0",
|
|
52
|
+
"ignore": "^7.0.5",
|
|
53
53
|
"js-tokens": "^4.0.0",
|
|
54
54
|
"jsonc-parser": "3.2.0",
|
|
55
55
|
"npm-run-path": "^4.0.1",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"tslib": "^2.3.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"nx": "23.0.0-beta.
|
|
64
|
+
"nx": "23.0.0-beta.6"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"verdaccio": "^6.0.5"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/executors/node/node.impl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"node.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/executors/node/node.impl.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,eAAe,EAQhB,MAAM,YAAY,CAAC;AAMpB,OAAO,EAAe,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAsB5D,wBAAuB,YAAY,CACjC,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,eAAe;aAgEb,OAAO;cACN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;cA6QhC;AAmID,eAAe,YAAY,CAAC"}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.nodeExecutor = nodeExecutor;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
6
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
7
|
const child_process_1 = require("child_process");
|
|
7
8
|
const devkit_1 = require("@nx/devkit");
|
|
8
|
-
const async_iterable_1 = require("@nx/devkit/src/utils/async-iterable");
|
|
9
9
|
const client_1 = require("nx/src/daemon/client/client");
|
|
10
10
|
const crypto_1 = require("crypto");
|
|
11
11
|
const path = tslib_1.__importStar(require("path"));
|
|
@@ -60,7 +60,7 @@ async function* nodeExecutor(options, context) {
|
|
|
60
60
|
let additionalExitHandler = null;
|
|
61
61
|
let currentTask = null;
|
|
62
62
|
const tasks = [];
|
|
63
|
-
yield* (0,
|
|
63
|
+
yield* (0, internal_1.createAsyncIterable)(async ({ done, next, error, registerCleanup }) => {
|
|
64
64
|
const processQueue = async () => {
|
|
65
65
|
if (tasks.length === 0)
|
|
66
66
|
return;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.compileTypescriptSolution = compileTypescriptSolution;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
const ts = tslib_1.__importStar(require("typescript"));
|
|
7
7
|
const get_custom_transformers_factory_1 = require("./get-custom-transformers-factory");
|
|
8
8
|
const typescript_diagnostic_reporters_1 = require("./typescript-diagnostic-reporters");
|
|
@@ -16,7 +16,7 @@ function compileTypescriptSolution(context, watch, logger, hooks, reporters) {
|
|
|
16
16
|
if (watch) {
|
|
17
17
|
// create an AsyncIterable that doesn't complete, watch mode is only
|
|
18
18
|
// stopped by killing the process
|
|
19
|
-
return (0,
|
|
19
|
+
return (0, internal_1.createAsyncIterable)(async ({ next }) => {
|
|
20
20
|
hooks ??= {};
|
|
21
21
|
const callerAfterProjectCompilationCallback = hooks.afterProjectCompilationCallback;
|
|
22
22
|
hooks.afterProjectCompilationCallback = (tsConfig, success) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/generators/init/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/generators/init/init.ts"],"names":[],"mappings":"AACA,OAAO,EAML,iBAAiB,EAKjB,IAAI,EACL,MAAM,YAAY,CAAC;AAqBpB,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAwCtC,wBAAsB,aAAa,CACjC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,UAAU,GACjB,OAAO,CAAC,iBAAiB,CAAC,CAS5B;AAED,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,UAAU,GACjB,OAAO,CAAC,iBAAiB,CAAC,CAgI5B;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.initGenerator = initGenerator;
|
|
4
4
|
exports.initGeneratorInternal = initGeneratorInternal;
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
6
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const add_plugin_1 = require("@nx/devkit/src/utils/add-plugin");
|
|
7
|
-
const semver_1 = require("@nx/devkit/src/utils/semver");
|
|
8
7
|
const package_json_1 = require("nx/src/utils/package-json");
|
|
9
8
|
const path_1 = require("path");
|
|
10
|
-
const
|
|
9
|
+
const semver_1 = require("semver");
|
|
11
10
|
const plugin_1 = require("../../plugins/typescript/plugin");
|
|
12
11
|
const prettier_1 = require("../../utils/prettier");
|
|
13
12
|
const ts_config_1 = require("../../utils/typescript/ts-config");
|
|
@@ -18,7 +17,7 @@ async function getInstalledTypescriptVersion(tree) {
|
|
|
18
17
|
if (!tsVersionInRootPackageJson) {
|
|
19
18
|
return null;
|
|
20
19
|
}
|
|
21
|
-
if ((0,
|
|
20
|
+
if ((0, semver_1.valid)(tsVersionInRootPackageJson)) {
|
|
22
21
|
// it's a pinned version, return it
|
|
23
22
|
return tsVersionInRootPackageJson;
|
|
24
23
|
}
|
|
@@ -29,12 +28,12 @@ async function getInstalledTypescriptVersion(tree) {
|
|
|
29
28
|
tsPackageJson.dependencies?.['typescript'];
|
|
30
29
|
// the installed version matches the package.json version range
|
|
31
30
|
if (installedTsVersion &&
|
|
32
|
-
(0,
|
|
31
|
+
(0, semver_1.satisfies)(installedTsVersion, tsVersionInRootPackageJson)) {
|
|
33
32
|
return installedTsVersion;
|
|
34
33
|
}
|
|
35
34
|
}
|
|
36
35
|
finally {
|
|
37
|
-
return (0,
|
|
36
|
+
return (0, internal_1.checkAndCleanWithSemver)(tree, 'typescript', tsVersionInRootPackageJson);
|
|
38
37
|
}
|
|
39
38
|
}
|
|
40
39
|
async function initGenerator(tree, schema) {
|
|
@@ -54,7 +53,7 @@ async function initGeneratorInternal(tree, schema) {
|
|
|
54
53
|
nxJson.useInferencePlugins !== false;
|
|
55
54
|
schema.addTsPlugin ??= schema.addPlugin;
|
|
56
55
|
if (schema.addTsPlugin) {
|
|
57
|
-
await (0,
|
|
56
|
+
await (0, internal_1.addPlugin)(tree, await (0, devkit_1.createProjectGraphAsync)(), '@nx/js/typescript', plugin_1.createNodesV2, {
|
|
58
57
|
typecheck: [
|
|
59
58
|
{ targetName: 'typecheck' },
|
|
60
59
|
{ targetName: 'tsc:typecheck' },
|
|
@@ -109,7 +108,7 @@ async function initGeneratorInternal(tree, schema) {
|
|
|
109
108
|
if (!schema.js && !schema.keepExistingVersions) {
|
|
110
109
|
const installedTsVersion = await getInstalledTypescriptVersion(tree);
|
|
111
110
|
if (!installedTsVersion ||
|
|
112
|
-
!(0,
|
|
111
|
+
!(0, semver_1.satisfies)(installedTsVersion, versions_1.supportedTypescriptVersions, {
|
|
113
112
|
includePrerelease: true,
|
|
114
113
|
})) {
|
|
115
114
|
devDependencies['typescript'] = versions_1.typescriptVersion;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/generators/library/library.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/generators/library/library.ts"],"names":[],"mappings":"AAOA,OAAO,EAML,iBAAiB,EAWjB,IAAI,EAKL,MAAM,YAAY,CAAC;AAkCpB,OAAO,KAAK,EAEV,sBAAsB,EACtB,iCAAiC,EAClC,MAAM,UAAU,CAAC;AASlB,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,sBAAsB,8BAO/B;AAED,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,sBAAsB,8BAqK/B;AA2HD,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,iCAAiC,EAC/B,MAAM,GACN,QAAQ,GACR,aAAa,GACb,gBAAgB,GAChB,IAAI,GACJ,yBAAyB,GACzB,aAAa,GACb,SAAS,GACT,WAAW,GACX,yBAAyB,CAC5B,CAAC;AAEF,wBAAsB,OAAO,CAC3B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,iBAAiB,CAAC,CAmH5B;AA+uBD,eAAe,gBAAgB,CAAC"}
|
|
@@ -4,11 +4,8 @@ exports.libraryGenerator = libraryGenerator;
|
|
|
4
4
|
exports.libraryGeneratorInternal = libraryGeneratorInternal;
|
|
5
5
|
exports.addLint = addLint;
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
7
8
|
const devkit_1 = require("@nx/devkit");
|
|
8
|
-
const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
|
|
9
|
-
const prompt_1 = require("@nx/devkit/src/generators/prompt");
|
|
10
|
-
const target_defaults_utils_1 = require("@nx/devkit/src/generators/target-defaults-utils");
|
|
11
|
-
const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
|
|
12
9
|
const path_1 = require("path");
|
|
13
10
|
const generator_prompts_1 = require("../../utils/generator-prompts");
|
|
14
11
|
const sort_fields_1 = require("../../utils/package-json/sort-fields");
|
|
@@ -153,7 +150,7 @@ async function libraryGeneratorInternal(tree, schema) {
|
|
|
153
150
|
tasks.push(() => (0, devkit_1.installPackagesTask)(tree, true));
|
|
154
151
|
}
|
|
155
152
|
tasks.push(() => {
|
|
156
|
-
(0,
|
|
153
|
+
(0, internal_1.logShowProjectCommand)(options.name);
|
|
157
154
|
});
|
|
158
155
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
159
156
|
}
|
|
@@ -177,7 +174,7 @@ async function configureProject(tree, options) {
|
|
|
177
174
|
options.bundler === 'tsc'))) {
|
|
178
175
|
const outputPath = getOutputPath(options);
|
|
179
176
|
const executor = getBuildExecutor(options.bundler);
|
|
180
|
-
(0,
|
|
177
|
+
(0, internal_1.addBuildTargetDefaults)(tree, executor);
|
|
181
178
|
projectConfiguration.targets.build = {
|
|
182
179
|
executor,
|
|
183
180
|
outputs: ['{options.outputPath}'],
|
|
@@ -540,7 +537,7 @@ function replaceJestConfig(tree, options) {
|
|
|
540
537
|
});
|
|
541
538
|
}
|
|
542
539
|
async function normalizeOptions(tree, options) {
|
|
543
|
-
await (0,
|
|
540
|
+
await (0, internal_1.ensureRootProjectName)(options, 'library');
|
|
544
541
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
545
542
|
options.addPlugin ??=
|
|
546
543
|
process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
@@ -549,7 +546,7 @@ async function normalizeOptions(tree, options) {
|
|
|
549
546
|
const hasPlugin = (0, ts_solution_setup_1.isUsingTypeScriptPlugin)(tree);
|
|
550
547
|
const isUsingTsSolutionConfig = (0, ts_solution_setup_1.isUsingTsSolutionSetup)(tree);
|
|
551
548
|
if (isUsingTsSolutionConfig) {
|
|
552
|
-
options.unitTestRunner ??= await (0,
|
|
549
|
+
options.unitTestRunner ??= await (0, internal_1.promptWhenInteractive)({
|
|
553
550
|
type: 'autocomplete',
|
|
554
551
|
name: 'unitTestRunner',
|
|
555
552
|
message: `Which unit test runner would you like to use?`,
|
|
@@ -558,7 +555,7 @@ async function normalizeOptions(tree, options) {
|
|
|
558
555
|
}, { unitTestRunner: 'none' }).then(({ unitTestRunner }) => unitTestRunner);
|
|
559
556
|
}
|
|
560
557
|
else {
|
|
561
|
-
options.unitTestRunner ??= await (0,
|
|
558
|
+
options.unitTestRunner ??= await (0, internal_1.promptWhenInteractive)({
|
|
562
559
|
type: 'autocomplete',
|
|
563
560
|
name: 'unitTestRunner',
|
|
564
561
|
message: `Which unit test runner would you like to use?`,
|
|
@@ -619,7 +616,7 @@ async function normalizeOptions(tree, options) {
|
|
|
619
616
|
(options.skipTypeCheck == null || !isUsingTsSolutionConfig)) {
|
|
620
617
|
options.skipTypeCheck = false;
|
|
621
618
|
}
|
|
622
|
-
const { projectName, names: projectNames, projectRoot, importPath, } = await (0,
|
|
619
|
+
const { projectName, names: projectNames, projectRoot, importPath, } = await (0, internal_1.determineProjectNameAndRootOptions)(tree, {
|
|
623
620
|
name: options.name,
|
|
624
621
|
projectType: 'library',
|
|
625
622
|
directory: options.directory,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ProjectNameAndRootOptions } from '@nx/devkit/
|
|
1
|
+
import type { ProjectNameAndRootOptions } from '@nx/devkit/internal';
|
|
2
2
|
// nx-ignore-next-line
|
|
3
3
|
const { Linter, LinterType } = require('@nx/eslint'); // use require to import to avoid circular dependency
|
|
4
4
|
import type { ProjectPackageManagerWorkspaceState } from '../../utils/package-manager-workspaces';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/generators/setup-build/generator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/generators/setup-build/generator.ts"],"names":[],"mappings":"AACA,OAAO,EAWL,KAAK,iBAAiB,EAEtB,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAoBpB,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAIrD,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,iBAAiB,CAAC,CAkL5B;AAED,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.setupBuildGenerator = setupBuildGenerator;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const target_defaults_utils_1 = require("@nx/devkit/src/generators/target-defaults-utils");
|
|
6
6
|
const posix_1 = require("node:path/posix");
|
|
7
7
|
const devkit_internals_1 = require("nx/src/devkit-internals");
|
|
8
8
|
const get_import_path_1 = require("../../utils/get-import-path");
|
|
@@ -127,7 +127,7 @@ async function setupBuildGenerator(tree, options) {
|
|
|
127
127
|
updatePackageJsonForTsc(tree, options, project);
|
|
128
128
|
}
|
|
129
129
|
else {
|
|
130
|
-
(0,
|
|
130
|
+
(0, internal_1.addBuildTargetDefaults)(tree, '@nx/js:tsc');
|
|
131
131
|
const outputPath = (0, devkit_1.joinPathFragments)('dist', project.root);
|
|
132
132
|
project.targets[options.buildTarget] = {
|
|
133
133
|
executor: `@nx/js:tsc`,
|
|
@@ -144,7 +144,7 @@ async function setupBuildGenerator(tree, options) {
|
|
|
144
144
|
break;
|
|
145
145
|
}
|
|
146
146
|
case 'swc': {
|
|
147
|
-
(0,
|
|
147
|
+
(0, internal_1.addBuildTargetDefaults)(tree, '@nx/js:swc');
|
|
148
148
|
const outputPath = isTsSolutionSetup
|
|
149
149
|
? (0, devkit_1.joinPathFragments)(project.root, 'dist')
|
|
150
150
|
: (0, devkit_1.joinPathFragments)('dist', project.root);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-external-options-from-js-executors.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/migrations/update-22-0-0/remove-external-options-from-js-executors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remove-external-options-from-js-executors.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/migrations/update-22-0-0/remove-external-options-from-js-executors.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,SAAS,UAA+B,CAAC;AAEtD,yBAA+B,IAAI,EAAE,IAAI,iBA+ExC"}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.executors = void 0;
|
|
4
4
|
exports.default = default_1;
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
6
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
|
|
7
7
|
exports.executors = ['@nx/js:swc', '@nx/js:tsc'];
|
|
8
8
|
async function default_1(tree) {
|
|
9
9
|
// update options from project configs
|
|
10
10
|
exports.executors.forEach((executor) => {
|
|
11
|
-
(0,
|
|
11
|
+
(0, internal_1.forEachExecutorOptions)(tree, executor, (options, project, target, configuration) => {
|
|
12
12
|
if (options.external === undefined &&
|
|
13
13
|
options.externalBuildTargets === undefined) {
|
|
14
14
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/plugins/typescript/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/plugins/typescript/plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAQL,KAAK,kBAAkB,EAEvB,KAAK,aAAa,EAInB,MAAM,YAAY,CAAC;AA6BpB,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC1B,SAAS,CAAC,EACN,OAAO,GACP;QACE,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IACN,KAAK,CAAC,EACF,OAAO,GACP;QACE,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,cAAc,CAAC,EAAE,OAAO,CAAC;KAC1B,CAAC;IACN,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AA0KD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAEF,eAAO,MAAM,WAAW,sBAAsB,CAAC;AAI/C,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,gBAAgB,CA+FzD,CAAC;AAEF,eAAO,MAAM,WAAW,iCAAgB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createNodes = exports.createNodesV2 = exports.PLUGIN_NAME = exports.createDependencies = void 0;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const get_named_inputs_1 = require("@nx/devkit/src/utils/get-named-inputs");
|
|
6
6
|
const node_fs_1 = require("node:fs");
|
|
7
7
|
const node_path_1 = require("node:path");
|
|
8
8
|
const file_hasher_1 = require("nx/src/hasher/file-hasher");
|
|
@@ -122,8 +122,10 @@ exports.createNodesV2 = [
|
|
|
122
122
|
const cache = cacheStore.get(cacheKey);
|
|
123
123
|
initializeTsConfigCache(configFilePaths, context.workspaceRoot, cache);
|
|
124
124
|
const normalizedOptions = normalizePluginOptions(options);
|
|
125
|
-
const
|
|
126
|
-
const
|
|
125
|
+
const packageManager = (0, devkit_1.detectPackageManager)(context.workspaceRoot);
|
|
126
|
+
const pmc = (0, devkit_1.getPackageManagerCommand)(packageManager);
|
|
127
|
+
const lockFileName = (0, lock_file_1.getLockFileName)(packageManager);
|
|
128
|
+
const { configFilePaths: validConfigFilePaths, hashes, projectRoots, } = await resolveValidConfigFilesAndHashes(configFilePaths, normalizedOptions, optionsHash, context, cache, lockFileName);
|
|
127
129
|
try {
|
|
128
130
|
return await (0, devkit_1.createNodesFromFiles)((configFilePath, options, context, idx) => {
|
|
129
131
|
const projectRoot = projectRoots[idx];
|
|
@@ -156,8 +158,8 @@ exports.createNodesV2 = [
|
|
|
156
158
|
},
|
|
157
159
|
];
|
|
158
160
|
exports.createNodes = exports.createNodesV2;
|
|
159
|
-
async function resolveValidConfigFilesAndHashes(configFilePaths, options, optionsHash, context, cache) {
|
|
160
|
-
const lockFileHash = (0, file_hasher_1.hashFile)((0, node_path_1.join)(context.workspaceRoot,
|
|
161
|
+
async function resolveValidConfigFilesAndHashes(configFilePaths, options, optionsHash, context, cache, lockFileName) {
|
|
162
|
+
const lockFileHash = (0, file_hasher_1.hashFile)((0, node_path_1.join)(context.workspaceRoot, lockFileName)) ?? '';
|
|
161
163
|
const validConfigFilePaths = [];
|
|
162
164
|
const hashes = [];
|
|
163
165
|
const projectRoots = [];
|
|
@@ -246,7 +248,7 @@ function checkIfConfigFileShouldBeProject(config, cache) {
|
|
|
246
248
|
}
|
|
247
249
|
function buildTscTargets(config, options, context, configFiles, cache, pmc) {
|
|
248
250
|
const targets = {};
|
|
249
|
-
const namedInputs = (0,
|
|
251
|
+
const namedInputs = (0, internal_1.getNamedInputs)(config.project.root, context);
|
|
250
252
|
const tsConfig = retrieveTsConfigFromCache(config.absolutePath, context.workspaceRoot, cache);
|
|
251
253
|
let internalProjectReferences;
|
|
252
254
|
if (options.typecheck &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version-actions.d.ts","sourceRoot":"","sources":["../../../../../packages/js/src/release/version-actions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"version-actions.d.ts","sourceRoot":"","sources":["../../../../../packages/js/src/release/version-actions.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,YAAY,EAEZ,IAAI,EAGL,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAM3E,eAAO,MAAM,yBAAyB,EAAE,yBAkBvC,CAAC;AAKF,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,cAAc;IAC1D,sBAAsB,WAAoB;IAEpC,oCAAoC,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC;QAC9D,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IAkBI,8BAA8B,CAClC,IAAI,EAAE,IAAI,EACV,8BAA8B,EAAE,6BAA6B,CAAC,gCAAgC,CAAC,GAC9F,OAAO,CAAC;QACT,cAAc,EAAE,MAAM,CAAC;QACvB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IAkEI,8BAA8B,CAClC,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,YAAY,EAC1B,qBAAqB,EAAE,MAAM,GAC5B,OAAO,CAAC;QACT,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;QAC9B,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;KACrC,CAAC;IA4CI,oBAAoB,CACxB,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,EAAE,CAAC;IAcd,yBAAyB,CAC7B,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,YAAY,EAC1B,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3C,OAAO,CAAC,MAAM,EAAE,CAAC;IAwHpB,OAAO,CAAC,yBAAyB;CAyClC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.afterAllProjectsVersioned = void 0;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const catalog_1 = require("@nx/devkit/src/utils/catalog");
|
|
6
6
|
const node_child_process_1 = require("node:child_process");
|
|
7
7
|
const node_path_1 = require("node:path");
|
|
8
8
|
const release_1 = require("nx/release");
|
|
@@ -109,7 +109,7 @@ class JsVersionActions extends release_1.VersionActions {
|
|
|
109
109
|
}
|
|
110
110
|
// Resolve catalog references if needed
|
|
111
111
|
if (currentVersion) {
|
|
112
|
-
const catalogManager = (0,
|
|
112
|
+
const catalogManager = (0, internal_1.getCatalogManager)(tree.root);
|
|
113
113
|
if (catalogManager?.isCatalogReference(currentVersion)) {
|
|
114
114
|
currentVersion = catalogManager.resolveCatalogReference(tree, dependencyPackageName, currentVersion);
|
|
115
115
|
}
|
|
@@ -137,7 +137,7 @@ class JsVersionActions extends release_1.VersionActions {
|
|
|
137
137
|
}
|
|
138
138
|
const logMessages = [];
|
|
139
139
|
const catalogUpdates = [];
|
|
140
|
-
const catalogManager = (0,
|
|
140
|
+
const catalogManager = (0, internal_1.getCatalogManager)(tree.root);
|
|
141
141
|
for (const manifestToUpdate of this.manifestsToUpdate) {
|
|
142
142
|
(0, devkit_1.updateJson)(tree, manifestToUpdate.manifestPath, (json) => {
|
|
143
143
|
const dependencyTypes = [
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeLinterOption = normalizeLinterOption;
|
|
4
4
|
exports.normalizeUnitTestRunnerOption = normalizeUnitTestRunnerOption;
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
const ts_solution_setup_1 = require("./typescript/ts-solution-setup");
|
|
7
7
|
async function normalizeLinterOption(tree, linter) {
|
|
8
8
|
if (linter) {
|
|
@@ -13,7 +13,7 @@ async function normalizeLinterOption(tree, linter) {
|
|
|
13
13
|
? [{ name: 'none' }, { name: 'eslint' }]
|
|
14
14
|
: [{ name: 'eslint' }, { name: 'none' }];
|
|
15
15
|
const defaultValue = isTsSolutionSetup ? 'none' : 'eslint';
|
|
16
|
-
return await (0,
|
|
16
|
+
return await (0, internal_1.promptWhenInteractive)({
|
|
17
17
|
type: 'autocomplete',
|
|
18
18
|
name: 'linter',
|
|
19
19
|
message: `Which linter would you like to use?`,
|
|
@@ -30,7 +30,7 @@ async function normalizeUnitTestRunnerOption(tree, unitTestRunner, testRunners =
|
|
|
30
30
|
? [{ name: 'none' }, ...testRunners.map((runner) => ({ name: runner }))]
|
|
31
31
|
: [...testRunners.map((runner) => ({ name: runner })), { name: 'none' }];
|
|
32
32
|
const defaultValue = (isTsSolutionSetup ? 'none' : testRunners[0]);
|
|
33
|
-
return await (0,
|
|
33
|
+
return await (0, internal_1.promptWhenInteractive)({
|
|
34
34
|
type: 'autocomplete',
|
|
35
35
|
name: 'unitTestRunner',
|
|
36
36
|
message: `Which unit test runner would you like to use?`,
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.compileSwc = compileSwc;
|
|
4
4
|
exports.compileSwcWatch = compileSwcWatch;
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
7
|
const node_child_process_1 = require("node:child_process");
|
|
7
8
|
const node_fs_1 = require("node:fs");
|
|
8
9
|
const node_path_1 = require("node:path");
|
|
9
|
-
const async_iterable_1 = require("@nx/devkit/src/utils/async-iterable");
|
|
10
10
|
const print_diagnostics_1 = require("../typescript/print-diagnostics");
|
|
11
11
|
const run_type_check_1 = require("../typescript/run-type-check");
|
|
12
12
|
const path_1 = require("path");
|
|
@@ -101,7 +101,7 @@ async function* compileSwcWatch(context, normalizedOptions, postCompilationCallb
|
|
|
101
101
|
if (normalizedOptions.clean) {
|
|
102
102
|
(0, node_fs_1.rmSync)(normalizedOptions.outputPath, { recursive: true, force: true });
|
|
103
103
|
}
|
|
104
|
-
return yield* (0,
|
|
104
|
+
return yield* (0, internal_1.createAsyncIterable)(async ({ next, done }) => {
|
|
105
105
|
let processOnExit;
|
|
106
106
|
let handleCallback;
|
|
107
107
|
let stdoutOnData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile-typescript-files.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/utils/typescript/compile-typescript-files.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compile-typescript-files.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/utils/typescript/compile-typescript-files.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,4BAA4B,EAC7B,MAAM,oDAAoD,CAAC;AAE5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAWtD,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,sBAAsB,CACpC,iBAAiB,EAAE,yBAAyB,EAC5C,UAAU,EAAE,4BAA4B,EACxC,uBAAuB,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAClD;IACD,QAAQ,EAAE,aAAa,CAAC,2BAA2B,CAAC,CAAC;IACrD,KAAK,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnC,CA0CA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.compileTypeScriptFiles = compileTypeScriptFiles;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const compilation_1 = require("@nx/workspace/src/utilities/typescript/compilation");
|
|
5
|
-
const async_iterable_1 = require("@nx/devkit/src/utils/async-iterable");
|
|
6
6
|
const TYPESCRIPT_FOUND_N_ERRORS_WATCHING_FOR_FILE_CHANGES = 6194;
|
|
7
7
|
// Typescript diagnostic message for 6194: Found {0} errors. Watching for file changes.
|
|
8
8
|
// https://github.com/microsoft/TypeScript/blob/d45012c5e2ab122919ee4777a7887307c5f4a1e0/src/compiler/diagnosticMessages.json#L4763-L4766
|
|
@@ -17,7 +17,7 @@ function compileTypeScriptFiles(normalizedOptions, tscOptions, postCompilationCa
|
|
|
17
17
|
});
|
|
18
18
|
let tearDown;
|
|
19
19
|
return {
|
|
20
|
-
iterator: (0,
|
|
20
|
+
iterator: (0, internal_1.createAsyncIterable)(async ({ next, done }) => {
|
|
21
21
|
if (normalizedOptions.watch) {
|
|
22
22
|
const host = (0, compilation_1.compileTypeScriptWatcher)(tscOptions, async (d) => {
|
|
23
23
|
if (d.code === TYPESCRIPT_FOUND_N_ERRORS_WATCHING_FOR_FILE_CHANGES) {
|