@nx/devkit 24.0.0-pr.37405.acdaf31 → 24.0.0-rc.1
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/dist/internal.d.ts +7 -3
- package/dist/internal.js +26 -7
- package/dist/src/generators/add-ready-when-signal.d.ts +17 -0
- package/dist/src/generators/add-ready-when-signal.js +81 -0
- package/dist/src/generators/e2e-web-server-info-utils.d.ts +1 -1
- package/dist/src/generators/e2e-web-server-info-utils.js +1 -15
- package/dist/src/generators/plugin-migrations/conversion-warnings.d.ts +5 -0
- package/dist/src/generators/plugin-migrations/conversion-warnings.js +13 -0
- package/dist/src/generators/plugin-migrations/executor-to-plugin-migrator.d.ts +6 -0
- package/dist/src/generators/plugin-migrations/executor-to-plugin-migrator.js +58 -3
- package/dist/src/generators/plugin-migrations/remove-executors.d.ts +9 -0
- package/dist/src/generators/plugin-migrations/remove-executors.js +111 -0
- package/dist/src/utils/ignore-server-inputs-directive.d.ts +5 -0
- package/dist/src/utils/ignore-server-inputs-directive.js +12 -0
- package/dist/src/utils/nx-directives.d.ts +2 -1
- package/dist/src/utils/nx-directives.js +4 -3
- package/dist/src/utils/readiness.d.ts +71 -0
- package/dist/src/utils/readiness.js +259 -0
- package/dist/src/utils/split-shell-args.d.ts +7 -0
- package/dist/src/utils/split-shell-args.js +190 -0
- package/dist/src/utils/test-file-depends-on.d.ts +4 -4
- package/dist/src/utils/test-file-depends-on.js +6 -9
- package/dist/src/utils/test-file-directives.d.ts +7 -9
- package/dist/src/utils/test-file-directives.js +21 -38
- package/package.json +2 -2
- package/dist/src/utils/ultracache-directive.d.ts +0 -8
- package/dist/src/utils/ultracache-directive.js +0 -19
|
@@ -6,54 +6,37 @@ const node_path_1 = require("node:path");
|
|
|
6
6
|
const devkit_internals_1 = require("nx/src/devkit-internals");
|
|
7
7
|
const nx_directives_1 = require("./nx-directives");
|
|
8
8
|
const test_file_depends_on_1 = require("./test-file-depends-on");
|
|
9
|
-
const ultracache_directive_1 = require("./ultracache-directive");
|
|
10
9
|
const without_server_inputs_1 = require("./without-server-inputs");
|
|
11
|
-
const TEST_FILE_DIRECTIVES = ['depends-on', 'ultracache'];
|
|
12
10
|
/**
|
|
13
|
-
* `target` with the `@nx
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* warning.
|
|
11
|
+
* `target` with the `@nx-depends-on` and `@nx-ignore-server-inputs`
|
|
12
|
+
* directives of a workspace-relative test file applied. A directive that lists
|
|
13
|
+
* no projects, has a value it does not take, or is not supported
|
|
14
|
+
* (`ignoreServerInputs: false`) is skipped with a warning.
|
|
17
15
|
*/
|
|
18
|
-
function applyTestFileDirectives(target, workspaceRoot, file,
|
|
16
|
+
function applyTestFileDirectives(target, workspaceRoot, file, options) {
|
|
19
17
|
const directives = (0, nx_directives_1.parseNxDirectives)((0, node_fs_1.readFileSync)((0, node_path_1.join)(workspaceRoot, file), 'utf-8'));
|
|
20
18
|
let result = target;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
const dependsOn = directives.get('depends-on');
|
|
20
|
+
if (dependsOn !== undefined) {
|
|
21
|
+
const projects = (0, test_file_depends_on_1.dependsOnProjects)(dependsOn);
|
|
22
|
+
if (projects.length === 0) {
|
|
23
|
+
(0, devkit_internals_1.emitPluginWorkerLog)('warn', `${file}: "@nx-depends-on:" lists no projects, so Nx ignores it. List the projects the test depends on, separated by commas.`);
|
|
25
24
|
}
|
|
26
|
-
|
|
27
|
-
(0,
|
|
28
|
-
continue;
|
|
25
|
+
else {
|
|
26
|
+
result = (0, test_file_depends_on_1.scopeTestTargetToProjects)(result, projects);
|
|
29
27
|
}
|
|
30
|
-
result = applyDirective(result, directive, values, file);
|
|
31
28
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
case 'depends-on': {
|
|
37
|
-
const projects = (0, test_file_depends_on_1.dependsOnProjects)(values);
|
|
38
|
-
if (projects.length === 0) {
|
|
39
|
-
(0, devkit_internals_1.emitPluginWorkerLog)('warn', `${file}: "@nx-depends-on:" lists no projects, so Nx ignores it. List the projects the test depends on, separated by commas.`);
|
|
40
|
-
return target;
|
|
41
|
-
}
|
|
42
|
-
return (0, test_file_depends_on_1.scopeTestTargetToProjects)(target, projects);
|
|
29
|
+
const ignoreServerInputs = directives.get('ignore-server-inputs');
|
|
30
|
+
if (ignoreServerInputs !== undefined) {
|
|
31
|
+
if (!options.ignoreServerInputs) {
|
|
32
|
+
(0, devkit_internals_1.emitPluginWorkerLog)('warn', `${file}: "@nx-ignore-server-inputs" is not supported in this test file, so Nx ignores it.`);
|
|
43
33
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if (unsupported !== undefined) {
|
|
47
|
-
(0, devkit_internals_1.emitPluginWorkerLog)('warn', `${file}: "@nx-ultracache:${unsupported && ` ${unsupported}`}" is not supported, so Nx ignores "@nx-ultracache" in this file. Use "@nx-ultracache: imports".`);
|
|
48
|
-
return target;
|
|
49
|
-
}
|
|
50
|
-
return target.dependsOn
|
|
51
|
-
? { ...target, dependsOn: (0, without_server_inputs_1.withoutServerInputs)(target.dependsOn) }
|
|
52
|
-
: target;
|
|
34
|
+
else if (ignoreServerInputs.some((value) => value !== '')) {
|
|
35
|
+
(0, devkit_internals_1.emitPluginWorkerLog)('warn', `${file}: "@nx-ignore-server-inputs" takes no value, so Nx ignores it. Write "// @nx-ignore-server-inputs" alone.`);
|
|
53
36
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
throw new Error(`Unhandled test file directive: ${unhandled}`);
|
|
37
|
+
else if (result.dependsOn) {
|
|
38
|
+
result = { ...result, dependsOn: (0, without_server_inputs_1.withoutServerInputs)(result.dependsOn) };
|
|
57
39
|
}
|
|
58
40
|
}
|
|
41
|
+
return result;
|
|
59
42
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/devkit",
|
|
3
|
-
"version": "24.0.0-
|
|
3
|
+
"version": "24.0.0-rc.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"files": [
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"jest": "30.3.0",
|
|
70
|
-
"nx": "24.0.0-
|
|
70
|
+
"nx": "24.0.0-rc.1"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"nx": ">= 23 <= 25 || ^24.0.0-0"
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Whether the comment block that opens `content` has an
|
|
3
|
-
* `@nx-ultracache: imports` directive. False when any `@nx-ultracache` value
|
|
4
|
-
* there is unsupported.
|
|
5
|
-
*/
|
|
6
|
-
export declare function hasUltracacheImportsDirective(content: string): boolean;
|
|
7
|
-
/** The first of the `@nx-ultracache` values that is not supported. */
|
|
8
|
-
export declare function findUnsupportedUltracacheValue(values: string[]): string | undefined;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hasUltracacheImportsDirective = hasUltracacheImportsDirective;
|
|
4
|
-
exports.findUnsupportedUltracacheValue = findUnsupportedUltracacheValue;
|
|
5
|
-
const nx_directives_1 = require("./nx-directives");
|
|
6
|
-
const IMPORTS = 'imports';
|
|
7
|
-
/**
|
|
8
|
-
* Whether the comment block that opens `content` has an
|
|
9
|
-
* `@nx-ultracache: imports` directive. False when any `@nx-ultracache` value
|
|
10
|
-
* there is unsupported.
|
|
11
|
-
*/
|
|
12
|
-
function hasUltracacheImportsDirective(content) {
|
|
13
|
-
const values = (0, nx_directives_1.parseNxDirectives)(content).get('ultracache');
|
|
14
|
-
return (values !== undefined && findUnsupportedUltracacheValue(values) === undefined);
|
|
15
|
-
}
|
|
16
|
-
/** The first of the `@nx-ultracache` values that is not supported. */
|
|
17
|
-
function findUnsupportedUltracacheValue(values) {
|
|
18
|
-
return values.find((value) => value !== IMPORTS);
|
|
19
|
-
}
|