nx 22.7.0-beta.16 → 22.7.0-beta.17
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/bin/nx.js +3 -0
- package/dist/src/adapter/compat.js +0 -1
- package/dist/src/command-line/format/format.js +12 -12
- package/dist/src/command-line/init/implementation/add-nx-to-npm-repo.js +0 -1
- package/dist/src/command-line/init/implementation/dot-nx/nxw.js +0 -1
- package/dist/src/command-line/init/implementation/utils.js +0 -2
- package/dist/src/core/graph/main.js +1 -1
- package/dist/src/daemon/client/client.d.ts +1 -0
- package/dist/src/daemon/client/client.js +33 -5
- package/dist/src/daemon/logger.d.ts +14 -0
- package/dist/src/daemon/logger.js +16 -1
- package/dist/src/daemon/message-types/streaming-messages.d.ts +14 -0
- package/dist/src/daemon/message-types/streaming-messages.js +19 -0
- package/dist/src/daemon/server/client-socket-context.d.ts +23 -0
- package/dist/src/daemon/server/client-socket-context.js +89 -0
- package/dist/src/daemon/server/handle-request-project-graph.d.ts +2 -1
- package/dist/src/daemon/server/handle-request-project-graph.js +2 -2
- package/dist/src/daemon/server/project-graph-incremental-recomputation.d.ts +2 -1
- package/dist/src/daemon/server/project-graph-incremental-recomputation.js +15 -1
- package/dist/src/daemon/server/server.js +1 -1
- package/dist/src/migrations/update-17-2-0/move-default-base.js +0 -1
- package/dist/src/native/index.d.ts +31 -11
- package/dist/src/native/nx.wasi.cjs +0 -1
- package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
- package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
- package/dist/src/native/wasi-worker-browser.mjs +0 -2
- package/dist/src/plugins/js/lock-file/utils/pnpm-normalizer.js +1 -1
- package/dist/src/project-graph/build-project-graph.d.ts +4 -4
- package/dist/src/project-graph/build-project-graph.js +35 -36
- package/dist/src/project-graph/plugins/isolation/isolated-plugin.js +24 -6
- package/dist/src/project-graph/plugins/isolation/messaging.d.ts +8 -1
- package/dist/src/project-graph/plugins/isolation/messaging.js +11 -0
- package/dist/src/project-graph/plugins/isolation/plugin-worker.js +5 -0
- package/dist/src/project-graph/plugins/isolation/worker-streaming.d.ts +14 -0
- package/dist/src/project-graph/plugins/isolation/worker-streaming.js +39 -0
- package/dist/src/project-graph/utils/project-configuration-utils.js +11 -11
- package/dist/src/project-graph/utils/retrieve-workspace-files.d.ts +1 -1
- package/dist/src/tasks-runner/pseudo-terminal.d.ts +1 -1
- package/dist/src/utils/db-connection.d.ts +2 -2
- package/dist/src/utils/delayed-spinner.d.ts +9 -0
- package/dist/src/utils/delayed-spinner.js +10 -0
- package/dist/src/utils/progress-topics.d.ts +19 -0
- package/dist/src/utils/progress-topics.js +21 -0
- package/dist/src/utils/yarn-syml/index.js +0 -2
- package/package.json +12 -11
package/dist/bin/nx.js
CHANGED
|
@@ -38,6 +38,9 @@ async function main() {
|
|
|
38
38
|
// --version doesn't need any env / daemon / analytics state — skip dotenv
|
|
39
39
|
// loading (and the heavy modules it would pull in).
|
|
40
40
|
if (workspace && process.argv[2] !== '--version') {
|
|
41
|
+
const { workspaceDataDirectoryForWorkspace } = await import('../src/utils/cache-directory.js');
|
|
42
|
+
process.report.reportOnFatalError = true;
|
|
43
|
+
process.report.directory = workspaceDataDirectoryForWorkspace(workspace.dir);
|
|
41
44
|
const { loadRootEnvFiles } = await import('../src/utils/dotenv.js');
|
|
42
45
|
perf_hooks_1.performance.mark('loading dotenv files:start');
|
|
43
46
|
loadRootEnvFiles(workspace.dir);
|
|
@@ -4,7 +4,6 @@ exports.allowedWorkspaceExtensions = exports.allowedProjectExtensions = void 0;
|
|
|
4
4
|
const project_graph_1 = require("../project-graph/project-graph");
|
|
5
5
|
const configuration_1 = require("../config/configuration");
|
|
6
6
|
const angular_json_1 = require("./angular-json");
|
|
7
|
-
/* eslint-disable */
|
|
8
7
|
const Module = require('module');
|
|
9
8
|
const originalRequire = Module.prototype.require;
|
|
10
9
|
let patched = false;
|
|
@@ -5,17 +5,16 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const node_child_process_1 = require("node:child_process");
|
|
6
6
|
const path = tslib_1.__importStar(require("node:path"));
|
|
7
7
|
const semver_1 = require("semver");
|
|
8
|
-
const handle_import_1 = require("../../utils/handle-import");
|
|
9
|
-
const file_utils_1 = require("../../project-graph/file-utils");
|
|
10
|
-
const command_line_utils_1 = require("../../utils/command-line-utils");
|
|
11
|
-
const fileutils_1 = require("../../utils/fileutils");
|
|
12
|
-
const ignore_1 = require("../../utils/ignore");
|
|
13
8
|
const configuration_1 = require("../../config/configuration");
|
|
14
9
|
const typescript_1 = require("../../plugins/js/utils/typescript");
|
|
15
10
|
const affected_project_graph_1 = require("../../project-graph/affected/affected-project-graph");
|
|
11
|
+
const file_utils_1 = require("../../project-graph/file-utils");
|
|
16
12
|
const project_graph_1 = require("../../project-graph/project-graph");
|
|
17
|
-
const all_file_data_1 = require("../../utils/all-file-data");
|
|
18
13
|
const chunkify_1 = require("../../utils/chunkify");
|
|
14
|
+
const command_line_utils_1 = require("../../utils/command-line-utils");
|
|
15
|
+
const fileutils_1 = require("../../utils/fileutils");
|
|
16
|
+
const handle_import_1 = require("../../utils/handle-import");
|
|
17
|
+
const ignore_1 = require("../../utils/ignore");
|
|
19
18
|
const object_sort_1 = require("../../utils/object-sort");
|
|
20
19
|
const output_1 = require("../../utils/output");
|
|
21
20
|
const package_json_1 = require("../../utils/package-json");
|
|
@@ -77,13 +76,13 @@ async function format(command, args) {
|
|
|
77
76
|
}
|
|
78
77
|
}
|
|
79
78
|
async function getPatterns(prettier, args) {
|
|
80
|
-
const graph = await (0, project_graph_1.createProjectGraphAsync)({ exitOnError: true });
|
|
81
79
|
const allFilesPattern = ['.'];
|
|
82
80
|
if (args.all) {
|
|
83
81
|
return allFilesPattern;
|
|
84
82
|
}
|
|
85
83
|
try {
|
|
86
84
|
if (args.projects && args.projects.length > 0) {
|
|
85
|
+
const graph = await (0, project_graph_1.createProjectGraphAsync)({ exitOnError: true });
|
|
87
86
|
return getPatternsFromProjects(args.projects, graph);
|
|
88
87
|
}
|
|
89
88
|
const p = (0, command_line_utils_1.parseFiles)(args);
|
|
@@ -99,9 +98,10 @@ async function getPatterns(prettier, args) {
|
|
|
99
98
|
.filter((f) => (0, fileutils_1.fileExists)(f) && supportedExtensions.has(path.extname(f)));
|
|
100
99
|
// exclude patterns in .nxignore or .gitignore
|
|
101
100
|
const nonIgnoredPatterns = (0, ignore_1.getIgnoreObject)().filter(patterns);
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
if (args.libsAndApps) {
|
|
102
|
+
return getPatternsFromApps(nonIgnoredPatterns);
|
|
103
|
+
}
|
|
104
|
+
return nonIgnoredPatterns;
|
|
105
105
|
}
|
|
106
106
|
catch (err) {
|
|
107
107
|
output_1.output.error({
|
|
@@ -112,12 +112,12 @@ async function getPatterns(prettier, args) {
|
|
|
112
112
|
return allFilesPattern;
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
async function getPatternsFromApps(affectedFiles
|
|
115
|
+
async function getPatternsFromApps(affectedFiles) {
|
|
116
116
|
const graph = await (0, project_graph_1.createProjectGraphAsync)({
|
|
117
117
|
exitOnError: true,
|
|
118
118
|
});
|
|
119
119
|
const affectedGraph = await (0, affected_project_graph_1.filterAffected)(graph, (0, file_utils_1.calculateFileChanges)(affectedFiles));
|
|
120
|
-
return getPatternsFromProjects(Object.keys(affectedGraph.nodes),
|
|
120
|
+
return getPatternsFromProjects(Object.keys(affectedGraph.nodes), affectedGraph);
|
|
121
121
|
}
|
|
122
122
|
function addRootConfigFiles(chunkList, nxArgs) {
|
|
123
123
|
if (nxArgs.all) {
|
|
@@ -34,7 +34,6 @@ async function addNxToNpmRepo(options, guided = true) {
|
|
|
34
34
|
},
|
|
35
35
|
])).cacheableOperations;
|
|
36
36
|
for (const scriptName of cacheableOperations) {
|
|
37
|
-
// eslint-disable-next-line no-await-in-loop
|
|
38
37
|
scriptOutputs[scriptName] = (await enquirer.prompt([
|
|
39
38
|
{
|
|
40
39
|
type: 'input',
|
|
@@ -28,7 +28,6 @@ function createNxJsonFile(repoRoot, topologicalTargets, cacheableOperations, scr
|
|
|
28
28
|
let nxJson = {};
|
|
29
29
|
try {
|
|
30
30
|
nxJson = (0, fileutils_1.readJsonFile)(nxJsonPath);
|
|
31
|
-
// eslint-disable-next-line no-empty
|
|
32
31
|
}
|
|
33
32
|
catch { }
|
|
34
33
|
nxJson.$schema = './node_modules/nx/schemas/nx-schema.json';
|
|
@@ -41,7 +40,6 @@ function createNxJsonFile(repoRoot, topologicalTargets, cacheableOperations, scr
|
|
|
41
40
|
}
|
|
42
41
|
for (const [scriptName, output] of Object.entries(scriptOutputs)) {
|
|
43
42
|
if (!output) {
|
|
44
|
-
// eslint-disable-next-line no-continue
|
|
45
43
|
continue;
|
|
46
44
|
}
|
|
47
45
|
nxJson.targetDefaults[scriptName] ??= {};
|