@nrwl/workspace 12.10.0-beta.3 → 12.10.0

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.
Files changed (42) hide show
  1. package/package.json +6 -5
  2. package/src/command-line/nx-commands.js +4 -4
  3. package/src/command-line/nx-commands.js.map +1 -1
  4. package/src/core/dep-graph/index.html +2 -1
  5. package/src/core/dep-graph/main.es5.js +1 -1
  6. package/src/core/dep-graph/main.esm.js +1 -1
  7. package/src/core/hasher/file-hasher.d.ts +12 -8
  8. package/src/core/hasher/file-hasher.js +18 -11
  9. package/src/core/hasher/file-hasher.js.map +1 -1
  10. package/src/core/hasher/git-hasher.d.ts +1 -0
  11. package/src/core/hasher/git-hasher.js +2 -1
  12. package/src/core/hasher/git-hasher.js.map +1 -1
  13. package/src/core/project-graph/daemon/{server.d.ts → client/client.d.ts} +6 -9
  14. package/src/core/project-graph/daemon/client/client.js +181 -0
  15. package/src/core/project-graph/daemon/client/client.js.map +1 -0
  16. package/src/core/project-graph/daemon/server/server.d.ts +8 -0
  17. package/src/core/project-graph/daemon/server/server.js +284 -0
  18. package/src/core/project-graph/daemon/server/server.js.map +1 -0
  19. package/src/core/project-graph/daemon/{exec → server}/start.d.ts +0 -0
  20. package/src/core/project-graph/daemon/{exec → server}/start.js +1 -1
  21. package/src/core/project-graph/daemon/server/start.js.map +1 -0
  22. package/src/core/project-graph/daemon/{exec → server}/stop.d.ts +0 -0
  23. package/src/core/project-graph/daemon/{exec → server}/stop.js +1 -1
  24. package/src/core/project-graph/daemon/server/stop.js.map +1 -0
  25. package/src/core/project-graph/daemon/server/watcher.d.ts +10 -0
  26. package/src/core/project-graph/daemon/server/watcher.js +138 -0
  27. package/src/core/project-graph/daemon/server/watcher.js.map +1 -0
  28. package/src/core/project-graph/daemon/socket-utils.d.ts +3 -0
  29. package/src/core/project-graph/daemon/socket-utils.js +29 -0
  30. package/src/core/project-graph/daemon/socket-utils.js.map +1 -0
  31. package/src/core/project-graph/operators.js +1 -1
  32. package/src/core/project-graph/operators.js.map +1 -1
  33. package/src/core/project-graph/project-graph.js +4 -6
  34. package/src/core/project-graph/project-graph.js.map +1 -1
  35. package/src/utils/versions.js +1 -1
  36. package/src/core/project-graph/daemon/exec/index.d.ts +0 -3
  37. package/src/core/project-graph/daemon/exec/index.js +0 -89
  38. package/src/core/project-graph/daemon/exec/index.js.map +0 -1
  39. package/src/core/project-graph/daemon/exec/start.js.map +0 -1
  40. package/src/core/project-graph/daemon/exec/stop.js.map +0 -1
  41. package/src/core/project-graph/daemon/server.js +0 -345
  42. package/src/core/project-graph/daemon/server.js.map +0 -1
@@ -1,345 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getProjectGraphFromServer = exports.isServerAvailable = exports.killSocketOrPath = exports.stopServer = exports.startServer = void 0;
4
- const tslib_1 = require("tslib");
5
- const devkit_1 = require("@nrwl/devkit");
6
- const app_root_1 = require("@nrwl/tao/src/utils/app-root");
7
- const fs_1 = require("fs");
8
- const net_1 = require("net");
9
- const os_1 = require("os");
10
- const path_1 = require("path");
11
- const perf_hooks_1 = require("perf_hooks");
12
- const file_hasher_1 = require("../../hasher/file-hasher");
13
- const git_hasher_1 = require("../../hasher/git-hasher");
14
- const hashing_impl_1 = require("../../hasher/hashing-impl");
15
- const project_graph_1 = require("../project-graph");
16
- /**
17
- * For IPC with with the daemon server we use unix sockets or windows pipes, depending on the user's operating system.
18
- * Further notes on the cross-platform concerns are covered below.
19
- *
20
- * Unix:
21
- *
22
- * - The path is a filesystem pathname. It gets truncated to an OS-dependent length of sizeof(sockaddr_un.sun_path) - 1.
23
- * Typical values are 107 bytes on Linux and 103 bytes on macOS.
24
- * - A Unix domain socket will be visible in the filesystem and will persist until unlinked
25
- *
26
- * Windows:
27
- *
28
- * - The local domain is implemented using a named pipe. The path must refer to an entry in \\?\pipe\ or \\.\pipe\.
29
- * - Unlike Unix domain sockets, Windows will close and remove the pipe when the owning process exits.
30
- *
31
- * We create the socket/pipe based on a path within the current workspace so that we maintain one unique daemon per
32
- * workspace to ensure that subtle differences between Nx workspaces cannot cause issues.
33
- */
34
- const workspaceSocketPath = path_1.join(app_root_1.appRootPath, './nx-daemon.sock');
35
- const isWindows = os_1.platform() === 'win32';
36
- const fullOSSocketPath = isWindows
37
- ? '\\\\.\\pipe\\nx\\' + path_1.resolve(workspaceSocketPath)
38
- : path_1.resolve(workspaceSocketPath);
39
- /**
40
- * We have two different use-cases for the "daemon" server:
41
- * 1) Running in a background process so that the daemon is purely an implementation detail.
42
- * 2) Running in the main process in order to aid with development/debugging (technically, of course, in this case
43
- * it isn't actually a daemon server at all, but for simplicity we stick with the same general name as its primary
44
- * reason for existence is to be run in a background process).
45
- *
46
- * For (1) we do not want to log things from the daemon server to stdout/stderr, so we instead write to a file.
47
- *
48
- * This file location will be set by the `./exec/index.ts` utilities when starting the server so that we can
49
- * provide feedback to the user as to its location via stdout on the parent process and still not cause the child
50
- * process to be "undetachable".
51
- *
52
- * For (2) we simply log to stdout.
53
- */
54
- let _serverLogOutputFile;
55
- function serverLog(...s) {
56
- /**
57
- * If _serverLogOutputFile has not be set when starting the server, it means we are
58
- * running it in the current process and we should log to stdout.
59
- */
60
- if (!_serverLogOutputFile) {
61
- console.log(formatLogMessage(`${s.join(' ')}`));
62
- return;
63
- }
64
- fs_1.appendFileSync(_serverLogOutputFile, formatLogMessage(`${s.join(' ')}\n`));
65
- }
66
- function formatLogMessage(message) {
67
- return `[NX Daemon Server] - ${new Date().toISOString()} - ${message}`;
68
- }
69
- /**
70
- * We cache the latest known HEAD value and an overall hash of the state of the untracked
71
- * and uncommitted files so that we can potentially skip some initialization work.
72
- */
73
- let cachedGitHead;
74
- let cachedUntrackedUncommittedState;
75
- function hashAndCacheUntrackedUncommittedState(untrackedAndUncommittedFileHashes) {
76
- const fileHashesMapAsFlatArray = [].concat(...Array.from(untrackedAndUncommittedFileHashes));
77
- cachedUntrackedUncommittedState = hashing_impl_1.defaultHashing.hashArray(fileHashesMapAsFlatArray);
78
- }
79
- /**
80
- * We cache the latest copy of the serialized project graph itself in memory so that in the
81
- * best case scenario we can skip all graph construction and serialization work entirely.
82
- */
83
- let cachedSerializedProjectGraph;
84
- function createAndSerializeProjectGraph() {
85
- perf_hooks_1.performance.mark('create-project-graph-start');
86
- const projectGraph = project_graph_1.createProjectGraph(undefined, undefined, undefined, '4.0');
87
- perf_hooks_1.performance.mark('create-project-graph-end');
88
- perf_hooks_1.performance.measure('total execution time for createProjectGraph()', 'create-project-graph-start', 'create-project-graph-end');
89
- perf_hooks_1.performance.mark('json-stringify-start');
90
- const serializedProjectGraph = JSON.stringify(projectGraph);
91
- perf_hooks_1.performance.mark('json-stringify-end');
92
- perf_hooks_1.performance.measure('serialize graph', 'json-stringify-start', 'json-stringify-end');
93
- return serializedProjectGraph;
94
- }
95
- /**
96
- * We need to make sure that we instantiate the PerformanceObserver only once, otherwise
97
- * we will end up with duplicate entries in the server logs.
98
- */
99
- let performanceObserver;
100
- /**
101
- * Create the server and register a connection callback.
102
- *
103
- * NOTE: It is important that we do not eagerly perform any work directly upon connection
104
- * of a client.
105
- *
106
- * This is because there are two different scenarios for connection that we need to support:
107
- * 1) Checking if the server is fundamentally available
108
- * 2) Requesting the project graph to be built
109
- *
110
- * For case (1) we want the operation to be as fast as possible - we just need to know if the
111
- * server exists to connect to, and so this is why we do not perform any work directly upon
112
- * connection.
113
- *
114
- * For case (2) we have a simple known data payload which the client will send to the server
115
- * in order to trigger the more expensive graph construction logic.
116
- *
117
- * The real reason we need have these two separate steps in which we decouple connection from
118
- * the request to actually build the project graph is down to the fact that on Windows, the named
119
- * pipe behaves subtly differently from Unix domain sockets in that when you check if it exists
120
- * as if it were a file (e.g. using fs.existsSync() or fs.open() or fs.statSync() etc), the native
121
- * code which runs behind the scenes on the OS will actually trigger a connection to the server.
122
- * Therefore if we were to simply perform the graph creation upon connection we would end up
123
- * repeating work and throwing `EPIPE` errors.
124
- */
125
- const REQUEST_PROJECT_GRAPH_PAYLOAD = 'REQUEST_PROJECT_GRAPH_PAYLOAD';
126
- const server = net_1.createServer((socket) => {
127
- if (!performanceObserver) {
128
- performanceObserver = new perf_hooks_1.PerformanceObserver((list) => {
129
- const entry = list.getEntries()[0];
130
- // Slight indentation to improve readability of the overall log file
131
- serverLog(` Time taken for '${entry.name}'`, `${entry.duration}ms`);
132
- });
133
- performanceObserver.observe({ entryTypes: ['measure'], buffered: false });
134
- }
135
- socket.on('data', (data) => {
136
- /**
137
- * If anything other than the known project graph creation request payload is sent to
138
- * the server, we throw an error.
139
- */
140
- const payload = data.toString();
141
- if (payload !== REQUEST_PROJECT_GRAPH_PAYLOAD) {
142
- throw new Error(`Unsupported payload sent to daemon server: ${payload}`);
143
- }
144
- perf_hooks_1.performance.mark('server-connection');
145
- serverLog('Client Request for Project Graph Received');
146
- const currentGitHead = git_hasher_1.gitRevParseHead(app_root_1.appRootPath);
147
- let serializedProjectGraph;
148
- /**
149
- * Cached HEAD has changed, we must perform full file-hashing initialization work and
150
- * recompute the project graph
151
- */
152
- if (currentGitHead !== cachedGitHead) {
153
- serverLog(` [SERVER STATE]: Cached HEAD does not match current (${currentGitHead}), performing full file hash init and recomputing project graph...`);
154
- /**
155
- * Update the cached values for the HEAD and untracked and uncommitted state which was computed
156
- * as part of full init()
157
- */
158
- const untrackedAndUncommittedFileHashes = file_hasher_1.defaultFileHasher.init();
159
- hashAndCacheUntrackedUncommittedState(untrackedAndUncommittedFileHashes);
160
- cachedGitHead = currentGitHead;
161
- serializedProjectGraph = createAndSerializeProjectGraph();
162
- }
163
- else {
164
- /**
165
- * We know at this point that the cached HEAD has not changed but we must still always use git
166
- * to check for untracked and uncommitted changes (and we then create and cache a hash which
167
- * represents their overall state).
168
- *
169
- * We cannot ever skip this particular git operation, but we can compare its result to our
170
- * previously cached hash which represents the overall state for untracked and uncommitted changes
171
- * and then potentially skip project graph creation altogether if it is unchanged and we have an
172
- * existing cached graph.
173
- */
174
- const previousUntrackedUncommittedState = cachedUntrackedUncommittedState;
175
- const untrackedAndUncommittedFileHashes = file_hasher_1.defaultFileHasher.incrementalUpdate();
176
- hashAndCacheUntrackedUncommittedState(untrackedAndUncommittedFileHashes);
177
- /**
178
- * Skip project graph creation if the untracked and uncommitted state is unchanged and we have
179
- * a cached version of the graph available in memory.
180
- */
181
- if (previousUntrackedUncommittedState === cachedUntrackedUncommittedState &&
182
- cachedSerializedProjectGraph) {
183
- serverLog(` [SERVER STATE]: State unchanged since last request, resolving in-memory cached project graph...`);
184
- serializedProjectGraph = cachedSerializedProjectGraph;
185
- }
186
- else {
187
- serverLog(` [SERVER STATE]: Hashed untracked/uncommitted file state changed (now ${cachedUntrackedUncommittedState}), recomputing project graph...`);
188
- serializedProjectGraph = createAndSerializeProjectGraph();
189
- }
190
- }
191
- /**
192
- * Cache the latest version of the project graph in memory so that we can potentially skip a lot
193
- * of expensive work on the next client request.
194
- *
195
- * For reference, on the very large test repo https://github.com/vsavkin/interstellar the project
196
- * graph nxdeps.json file is about 32MB, so memory utilization should not be a huge concern.
197
- */
198
- cachedSerializedProjectGraph = serializedProjectGraph;
199
- perf_hooks_1.performance.mark('serialized-project-graph-ready');
200
- perf_hooks_1.performance.measure('total for creating and serializing project graph', 'server-connection', 'serialized-project-graph-ready');
201
- socket.write(serializedProjectGraph, () => {
202
- perf_hooks_1.performance.mark('serialized-project-graph-written-to-client');
203
- perf_hooks_1.performance.measure('write project graph to socket', 'serialized-project-graph-ready', 'serialized-project-graph-written-to-client');
204
- /**
205
- * Close the connection once all data has been written to the socket so that the client
206
- * knows when to read it.
207
- */
208
- socket.end();
209
- perf_hooks_1.performance.measure('total for server response', 'server-connection', 'serialized-project-graph-written-to-client');
210
- const bytesWritten = Buffer.byteLength(serializedProjectGraph, 'utf-8');
211
- serverLog(`Closed Connection to Client (${bytesWritten} bytes transferred)`);
212
- });
213
- });
214
- });
215
- function startServer({ serverLogOutputFile, }) {
216
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
217
- _serverLogOutputFile = serverLogOutputFile;
218
- // See notes above on OS differences regarding clean up of existings connections.
219
- if (!isWindows) {
220
- killSocketOrPath();
221
- }
222
- return new Promise((resolve) => {
223
- server.listen(fullOSSocketPath, () => {
224
- serverLog(`Started listening on: ${fullOSSocketPath}`);
225
- return resolve(server);
226
- });
227
- });
228
- });
229
- }
230
- exports.startServer = startServer;
231
- function stopServer() {
232
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
233
- return new Promise((resolve, reject) => {
234
- server.close((err) => {
235
- if (err) {
236
- /**
237
- * If the server is running in a detached background process then server.close()
238
- * will throw this error even if server is actually alive. We therefore only reject
239
- * in case of any other unexpected errors.
240
- */
241
- if (!err.message.startsWith('Server is not running')) {
242
- return reject(err);
243
- }
244
- }
245
- killSocketOrPath();
246
- /**
247
- * The distinction regarding background process or not is not relevant for stopping the server,
248
- * always pretty print the message to stdout.
249
- */
250
- devkit_1.logger.info('NX Daemon Server - Stopped');
251
- return resolve();
252
- });
253
- });
254
- });
255
- }
256
- exports.stopServer = stopServer;
257
- function killSocketOrPath() {
258
- try {
259
- fs_1.unlinkSync(fullOSSocketPath);
260
- }
261
- catch (_a) { }
262
- }
263
- exports.killSocketOrPath = killSocketOrPath;
264
- /**
265
- * As noted in the comments above the createServer() call, in order to reliably (meaning it works
266
- * cross-platform) check whether or not the server is availabe to request a project graph from we
267
- * need to actually attempt connecting to it.
268
- *
269
- * Because of the behavior of named pipes on Windows, we cannot simply treat them as a file and
270
- * check for their existence on disk (unlike with Unix Sockets).
271
- */
272
- function isServerAvailable() {
273
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
274
- try {
275
- const socket = net_1.connect(fullOSSocketPath);
276
- return new Promise((resolve) => {
277
- socket.on('connect', () => {
278
- socket.destroy();
279
- resolve(true);
280
- });
281
- socket.on('error', () => {
282
- resolve(false);
283
- });
284
- });
285
- }
286
- catch (_a) {
287
- return Promise.resolve(false);
288
- }
289
- });
290
- }
291
- exports.isServerAvailable = isServerAvailable;
292
- /**
293
- * Establishes a client connection to the daemon server for use in project graph
294
- * creation utilities.
295
- *
296
- * All logs are performed by the devkit logger because this logic does not
297
- * run "on the server" per se and therefore does not write to its log output.
298
- */
299
- function getProjectGraphFromServer() {
300
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
301
- return new Promise((resolve, reject) => {
302
- const socket = net_1.connect(fullOSSocketPath);
303
- socket.on('error', (err) => {
304
- let errorMessage;
305
- if (err.message.startsWith('connect ENOENT')) {
306
- errorMessage = 'Error: The Daemon Server is not running';
307
- }
308
- if (err.message.startsWith('connect ECONNREFUSED')) {
309
- // If somehow the file descriptor had not been released during a previous shut down.
310
- if (fs_1.existsSync(fullOSSocketPath)) {
311
- errorMessage = `Error: A server instance had not been fully shut down. Please try running the command again.`;
312
- killSocketOrPath();
313
- }
314
- }
315
- devkit_1.logger.error(`NX Daemon Client - ${errorMessage || err}`);
316
- return reject(new Error(errorMessage) || err);
317
- });
318
- /**
319
- * Immediately after connecting to the server we send it the known project graph creation
320
- * request payload. See the notes above createServer() for more context as to why we explicitly
321
- * request the graph from the client like this.
322
- */
323
- socket.on('connect', () => {
324
- socket.write(REQUEST_PROJECT_GRAPH_PAYLOAD);
325
- let serializedProjectGraph = '';
326
- socket.on('data', (data) => {
327
- serializedProjectGraph += data.toString();
328
- });
329
- socket.on('end', () => {
330
- try {
331
- const projectGraph = JSON.parse(serializedProjectGraph);
332
- devkit_1.logger.info('NX Daemon Client - Resolved ProjectGraph');
333
- return resolve(projectGraph);
334
- }
335
- catch (_a) {
336
- devkit_1.logger.error('NX Daemon Client - Error: Could not deserialize the ProjectGraph');
337
- return reject();
338
- }
339
- });
340
- });
341
- });
342
- });
343
- }
344
- exports.getProjectGraphFromServer = getProjectGraphFromServer;
345
- //# sourceMappingURL=server.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../../../../../../packages/workspace/src/core/project-graph/daemon/server.ts"],"names":[],"mappings":";;;;AAAA,yCAAoD;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