nx 20.1.0-canary.20241023-12cbfc3 → 20.1.0-canary.20241024-0bea5b2
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +11 -11
- package/src/command-line/add/add.js +9 -2
- package/src/command-line/graph/graph.js +5 -8
- package/src/core/graph/main.js +1 -1
- package/src/core/graph/styles.js +1 -1
- package/src/native/index.d.ts +4 -4
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/tasks-runner/cache.d.ts +1 -0
- package/src/tasks-runner/cache.js +1 -0
- package/src/utils/db-connection.d.ts +1 -1
- package/src/migrations/update-15-0-0/migrate-to-inputs.d.ts +0 -2
- package/src/migrations/update-15-0-0/migrate-to-inputs.js +0 -102
- package/src/migrations/update-16-9-0/remove-project-name-and-root-format.d.ts +0 -2
- package/src/migrations/update-16-9-0/remove-project-name-and-root-format.js +0 -21
package/src/core/graph/styles.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[532],{
|
1
|
+
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[532],{8476:()=>{}},s=>{var e;e=8476,s(s.s=e)}]);
|
package/src/native/index.d.ts
CHANGED
@@ -28,7 +28,7 @@ export declare class ImportResult {
|
|
28
28
|
|
29
29
|
export declare class NxCache {
|
30
30
|
cacheDirectory: string
|
31
|
-
constructor(workspaceRoot: string, cachePath: string, dbConnection: ExternalObject<
|
31
|
+
constructor(workspaceRoot: string, cachePath: string, dbConnection: ExternalObject<NxDbConnection>, linkTaskDetails?: boolean | undefined | null)
|
32
32
|
get(hash: string): CachedResult | null
|
33
33
|
put(hash: string, terminalOutput: string, outputs: Array<string>, code: number): void
|
34
34
|
applyRemoteCacheResults(hash: string, result: CachedResult): void
|
@@ -39,7 +39,7 @@ export declare class NxCache {
|
|
39
39
|
}
|
40
40
|
|
41
41
|
export declare class NxTaskHistory {
|
42
|
-
constructor(db: ExternalObject<
|
42
|
+
constructor(db: ExternalObject<NxDbConnection>)
|
43
43
|
recordTaskRuns(taskRuns: Array<TaskRun>): void
|
44
44
|
getFlakyTasks(hashes: Array<string>): Array<string>
|
45
45
|
getEstimatedTaskTimings(targets: Array<TaskTarget>): Record<string, number>
|
@@ -56,7 +56,7 @@ export declare class RustPseudoTerminal {
|
|
56
56
|
}
|
57
57
|
|
58
58
|
export declare class TaskDetails {
|
59
|
-
constructor(db: ExternalObject<
|
59
|
+
constructor(db: ExternalObject<NxDbConnection>)
|
60
60
|
recordTaskDetails(tasks: Array<HashedTask>): void
|
61
61
|
}
|
62
62
|
|
@@ -97,7 +97,7 @@ export interface CachedResult {
|
|
97
97
|
outputsPath: string
|
98
98
|
}
|
99
99
|
|
100
|
-
export declare export function connectToNxDb(cacheDir: string, nxVersion: string, dbName?: string | undefined | null): ExternalObject<
|
100
|
+
export declare export function connectToNxDb(cacheDir: string, nxVersion: string, dbName?: string | undefined | null): ExternalObject<NxDbConnection>
|
101
101
|
|
102
102
|
export declare export function copy(src: string, dest: string): void
|
103
103
|
|
Binary file
|
@@ -39,6 +39,7 @@ class DbCache {
|
|
39
39
|
constructor(options) {
|
40
40
|
this.options = options;
|
41
41
|
this.cache = new native_1.NxCache(workspace_root_1.workspaceRoot, cache_directory_1.cacheDir, (0, db_connection_1.getDbConnection)());
|
42
|
+
this.isVerbose = process.env.NX_VERBOSE_LOGGING === 'true';
|
42
43
|
}
|
43
44
|
async init() {
|
44
45
|
// This should be cheap because we've already loaded
|
@@ -1,102 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.default = default_1;
|
4
|
-
const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
|
5
|
-
const project_configuration_1 = require("../../generators/utils/project-configuration");
|
6
|
-
const nx_json_1 = require("../../generators/utils/nx-json");
|
7
|
-
const path_1 = require("../../utils/path");
|
8
|
-
const path_2 = require("path");
|
9
|
-
const json_1 = require("../../generators/utils/json");
|
10
|
-
const skippedFiles = [
|
11
|
-
'package.json', // Not to be added to filesets
|
12
|
-
'babel.config.json', // Will be handled by various plugins
|
13
|
-
'karma.conf.js', // Will be handled by @nx/angular
|
14
|
-
'jest.preset.js', // Will be handled by @nx/jest
|
15
|
-
'.storybook', // Will be handled by @nx/storybook
|
16
|
-
// Will be handled by @nx/eslint
|
17
|
-
'.eslintrc.json',
|
18
|
-
'.eslintrc.js',
|
19
|
-
];
|
20
|
-
async function default_1(tree) {
|
21
|
-
// If the workspace doesn't have a nx.json, don't make any changes
|
22
|
-
if (!tree.exists('nx.json')) {
|
23
|
-
return;
|
24
|
-
}
|
25
|
-
const nxJson = (0, nx_json_1.readNxJson)(tree);
|
26
|
-
// If this is a npm workspace, don't make any changes
|
27
|
-
if (nxJson.extends === 'nx/presets/npm.json') {
|
28
|
-
return;
|
29
|
-
}
|
30
|
-
nxJson.namedInputs ??= {
|
31
|
-
default: ['{projectRoot}/**/*', 'sharedGlobals'],
|
32
|
-
sharedGlobals: [],
|
33
|
-
production: ['default'],
|
34
|
-
};
|
35
|
-
if (nxJson.namedInputs.default) {
|
36
|
-
if (!nxJson.namedInputs.production) {
|
37
|
-
nxJson.namedInputs.production = ['default'];
|
38
|
-
}
|
39
|
-
else if (!nxJson.namedInputs.production.includes('default')) {
|
40
|
-
nxJson.namedInputs.production = [
|
41
|
-
'default',
|
42
|
-
...nxJson.namedInputs.production,
|
43
|
-
];
|
44
|
-
}
|
45
|
-
}
|
46
|
-
if (isBuildATarget(tree)) {
|
47
|
-
nxJson.targetDefaults ??= {};
|
48
|
-
nxJson.targetDefaults.build ??= {};
|
49
|
-
nxJson.targetDefaults.build.inputs ??= ['production', '^production'];
|
50
|
-
}
|
51
|
-
if (nxJson.implicitDependencies) {
|
52
|
-
const projects = (0, project_configuration_1.getProjects)(tree);
|
53
|
-
for (const [files, dependents] of Object.entries(nxJson.implicitDependencies)) {
|
54
|
-
// Skip these because other plugins take care of them
|
55
|
-
if (skippedFiles.includes(files)) {
|
56
|
-
continue;
|
57
|
-
}
|
58
|
-
else if (Array.isArray(dependents)) {
|
59
|
-
nxJson.namedInputs.projectSpecificFiles = [];
|
60
|
-
const defaultFileset = new Set(nxJson.namedInputs.default ?? ['{projectRoot}/**/*', 'sharedGlobals']);
|
61
|
-
defaultFileset.add('projectSpecificFiles');
|
62
|
-
nxJson.namedInputs.default = Array.from(defaultFileset);
|
63
|
-
for (const dependent of dependents) {
|
64
|
-
const project = projects.get(dependent);
|
65
|
-
project.namedInputs ??= {};
|
66
|
-
const projectSpecificFileset = new Set(project.namedInputs.projectSpecificFiles ?? []);
|
67
|
-
projectSpecificFileset.add((0, path_1.joinPathFragments)('{workspaceRoot}', files));
|
68
|
-
project.namedInputs.projectSpecificFiles = Array.from(projectSpecificFileset);
|
69
|
-
try {
|
70
|
-
(0, project_configuration_1.updateProjectConfiguration)(tree, dependent, project);
|
71
|
-
}
|
72
|
-
catch {
|
73
|
-
if (tree.exists((0, path_2.join)(project.root, 'package.json'))) {
|
74
|
-
(0, json_1.updateJson)(tree, (0, path_2.join)(project.root, 'package.json'), (json) => {
|
75
|
-
json.nx ??= {};
|
76
|
-
json.nx.namedInputs ??= {};
|
77
|
-
json.nx.namedInputs.projectSpecificFiles ??=
|
78
|
-
project.namedInputs.projectSpecificFiles;
|
79
|
-
return json;
|
80
|
-
});
|
81
|
-
}
|
82
|
-
}
|
83
|
-
}
|
84
|
-
}
|
85
|
-
else {
|
86
|
-
nxJson.namedInputs.sharedGlobals.push((0, path_1.joinPathFragments)('{workspaceRoot}', files));
|
87
|
-
}
|
88
|
-
}
|
89
|
-
delete nxJson.implicitDependencies;
|
90
|
-
}
|
91
|
-
(0, nx_json_1.updateNxJson)(tree, nxJson);
|
92
|
-
await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
|
93
|
-
}
|
94
|
-
function isBuildATarget(tree) {
|
95
|
-
const projects = (0, project_configuration_1.getProjects)(tree);
|
96
|
-
for (const [_, project] of projects) {
|
97
|
-
if (project.targets?.build) {
|
98
|
-
return true;
|
99
|
-
}
|
100
|
-
}
|
101
|
-
return false;
|
102
|
-
}
|
@@ -1,21 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.default = removeProjectNameAndRootFormat;
|
4
|
-
const json_1 = require("../../generators/utils/json");
|
5
|
-
const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
|
6
|
-
async function removeProjectNameAndRootFormat(tree) {
|
7
|
-
if (!tree.exists('nx.json')) {
|
8
|
-
return;
|
9
|
-
}
|
10
|
-
(0, json_1.updateJson)(tree, 'nx.json', (nxJson) => {
|
11
|
-
if (!nxJson.workspaceLayout) {
|
12
|
-
return nxJson;
|
13
|
-
}
|
14
|
-
delete nxJson.workspaceLayout.projectNameAndRootFormat;
|
15
|
-
if (Object.keys(nxJson.workspaceLayout).length === 0) {
|
16
|
-
delete nxJson.workspaceLayout;
|
17
|
-
}
|
18
|
-
return nxJson;
|
19
|
-
});
|
20
|
-
await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
|
21
|
-
}
|