nx 19.6.0-beta.1 → 19.6.0-beta.2
Sign up to get free protection for your applications and to get access to all the features.
- package/bin/post-install.js +8 -0
- package/package.json +12 -12
- package/schemas/nx-schema.json +25 -0
- package/schemas/project-schema.json +7 -0
- package/src/adapter/compat.d.ts +1 -1
- package/src/adapter/compat.js +1 -0
- package/src/command-line/nx-commands.js +3 -0
- package/src/command-line/sync/command-object.d.ts +6 -0
- package/src/command-line/sync/command-object.js +25 -0
- package/src/command-line/sync/sync.d.ts +6 -0
- package/src/command-line/sync/sync.js +30 -0
- package/src/config/nx-json.d.ts +23 -0
- package/src/config/workspace-json-project-json.d.ts +5 -0
- package/src/daemon/client/client.d.ts +5 -0
- package/src/daemon/client/client.js +33 -0
- package/src/daemon/message-types/flush-sync-generator-changes-to-disk.d.ts +6 -0
- package/src/daemon/message-types/flush-sync-generator-changes-to-disk.js +11 -0
- package/src/daemon/message-types/get-registered-sync-generators.d.ts +5 -0
- package/src/daemon/message-types/get-registered-sync-generators.js +11 -0
- package/src/daemon/message-types/get-sync-generator-changes.d.ts +6 -0
- package/src/daemon/message-types/get-sync-generator-changes.js +11 -0
- package/src/daemon/message-types/update-workspace-context.d.ts +8 -0
- package/src/daemon/message-types/update-workspace-context.js +11 -0
- package/src/daemon/server/handle-flush-sync-generator-changes-to-disk.d.ts +2 -0
- package/src/daemon/server/handle-flush-sync-generator-changes-to-disk.js +11 -0
- package/src/daemon/server/handle-get-registered-sync-generators.d.ts +2 -0
- package/src/daemon/server/handle-get-registered-sync-generators.js +11 -0
- package/src/daemon/server/handle-get-sync-generator-changes.d.ts +2 -0
- package/src/daemon/server/handle-get-sync-generator-changes.js +17 -0
- package/src/daemon/server/handle-update-workspace-context.d.ts +2 -0
- package/src/daemon/server/handle-update-workspace-context.js +11 -0
- package/src/daemon/server/project-graph-incremental-recomputation.d.ts +1 -0
- package/src/daemon/server/project-graph-incremental-recomputation.js +19 -2
- package/src/daemon/server/server.js +25 -0
- package/src/daemon/server/sync-generators.d.ts +6 -0
- package/src/daemon/server/sync-generators.js +202 -0
- package/src/daemon/socket-utils.js +18 -5
- package/src/daemon/tmp-dir.js +2 -1
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +1 -1
- package/src/tasks-runner/run-command.d.ts +1 -1
- package/src/tasks-runner/run-command.js +120 -2
- package/src/utils/plugins/output.js +1 -1
- package/src/utils/sync-generators.d.ts +22 -0
- package/src/utils/sync-generators.js +161 -0
- package/src/utils/workspace-context.d.ts +1 -0
- package/src/utils/workspace-context.js +16 -0
- package/src/daemon/message-types/update-context-files.d.ts +0 -7
- package/src/daemon/message-types/update-context-files.js +0 -11
@@ -5,6 +5,7 @@ exports.getNxWorkspaceFilesFromContext = getNxWorkspaceFilesFromContext;
|
|
5
5
|
exports.globWithWorkspaceContextSync = globWithWorkspaceContextSync;
|
6
6
|
exports.globWithWorkspaceContext = globWithWorkspaceContext;
|
7
7
|
exports.hashWithWorkspaceContext = hashWithWorkspaceContext;
|
8
|
+
exports.updateContextWithChangedFiles = updateContextWithChangedFiles;
|
8
9
|
exports.updateFilesInContext = updateFilesInContext;
|
9
10
|
exports.getAllFileDataInContext = getAllFileDataInContext;
|
10
11
|
exports.getFilesInDirectoryUsingContext = getFilesInDirectoryUsingContext;
|
@@ -56,6 +57,21 @@ async function hashWithWorkspaceContext(workspaceRoot, globs, exclude) {
|
|
56
57
|
}
|
57
58
|
return client_1.daemonClient.hashGlob(globs, exclude);
|
58
59
|
}
|
60
|
+
async function updateContextWithChangedFiles(createdFiles, updatedFiles, deletedFiles) {
|
61
|
+
if (!client_1.daemonClient.enabled()) {
|
62
|
+
updateFilesInContext([...createdFiles, ...updatedFiles], deletedFiles);
|
63
|
+
}
|
64
|
+
else if ((0, is_on_daemon_1.isOnDaemon)()) {
|
65
|
+
// make sure to only import this when running on the daemon
|
66
|
+
const { addUpdatedAndDeletedFiles } = await Promise.resolve().then(() => require('../daemon/server/project-graph-incremental-recomputation'));
|
67
|
+
// update files for the incremental graph recomputation on the daemon
|
68
|
+
addUpdatedAndDeletedFiles(createdFiles, updatedFiles, deletedFiles);
|
69
|
+
}
|
70
|
+
else {
|
71
|
+
// daemon is enabled but we are not running on it, ask the daemon to update the context
|
72
|
+
await client_1.daemonClient.updateWorkspaceContext(createdFiles, updatedFiles, deletedFiles);
|
73
|
+
}
|
74
|
+
}
|
59
75
|
function updateFilesInContext(updatedFiles, deletedFiles) {
|
60
76
|
return workspaceContext?.incrementalUpdate(updatedFiles, deletedFiles);
|
61
77
|
}
|
@@ -1,7 +0,0 @@
|
|
1
|
-
export declare const GLOB: "GLOB";
|
2
|
-
export type HandleUpdateContextMessage = {
|
3
|
-
type: typeof GLOB;
|
4
|
-
updatedFiles: string[];
|
5
|
-
deletedFiles: string[];
|
6
|
-
};
|
7
|
-
export declare function isHandleUpdateContextMessage(message: unknown): message is HandleUpdateContextMessage;
|
@@ -1,11 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.GLOB = void 0;
|
4
|
-
exports.isHandleUpdateContextMessage = isHandleUpdateContextMessage;
|
5
|
-
exports.GLOB = 'GLOB';
|
6
|
-
function isHandleUpdateContextMessage(message) {
|
7
|
-
return (typeof message === 'object' &&
|
8
|
-
message !== null &&
|
9
|
-
'type' in message &&
|
10
|
-
message['type'] === exports.GLOB);
|
11
|
-
}
|