@nrwl/workspace 13.10.0-beta.1 → 13.10.0-beta.4

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 (373) hide show
  1. package/index.d.ts +3 -5
  2. package/index.js +4 -8
  3. package/index.js.map +1 -1
  4. package/migrations.json +12 -6
  5. package/package.json +5 -8
  6. package/src/generators/move/lib/update-cypress-json.d.ts +1 -2
  7. package/src/generators/move/lib/update-cypress-json.js.map +1 -1
  8. package/src/generators/move/lib/update-project-root-files.js +3 -3
  9. package/src/generators/move/lib/update-project-root-files.js.map +1 -1
  10. package/src/generators/move/lib/update-storybook-config.js +3 -3
  11. package/src/generators/move/lib/update-storybook-config.js.map +1 -1
  12. package/src/generators/remove/lib/check-dependencies.js +3 -3
  13. package/src/generators/remove/lib/check-dependencies.js.map +1 -1
  14. package/src/generators/utils/decorate-angular-cli.js__tmpl__ +1 -1
  15. package/src/generators/workspace/files/nx.json__tmpl__ +1 -1
  16. package/src/migrations/update-13-10-0/update-decorate-cli.d.ts +3 -0
  17. package/src/migrations/update-13-10-0/update-decorate-cli.js +14 -0
  18. package/src/migrations/update-13-10-0/update-decorate-cli.js.map +1 -0
  19. package/src/migrations/update-13-10-0/update-tasks-runner.d.ts +3 -0
  20. package/src/migrations/update-13-10-0/update-tasks-runner.js +16 -0
  21. package/src/migrations/update-13-10-0/update-tasks-runner.js.map +1 -0
  22. package/src/tasks-runner/cache.d.ts +1 -40
  23. package/src/tasks-runner/cache.js +2 -280
  24. package/src/tasks-runner/cache.js.map +1 -1
  25. package/src/tasks-runner/life-cycle.d.ts +1 -43
  26. package/src/tasks-runner/life-cycle.js +2 -68
  27. package/src/tasks-runner/life-cycle.js.map +1 -1
  28. package/src/tasks-runner/tasks-runner-v2.d.ts +1 -18
  29. package/src/tasks-runner/tasks-runner-v2.js +4 -39
  30. package/src/tasks-runner/tasks-runner-v2.js.map +1 -1
  31. package/src/tasks-runner/utils.d.ts +1 -25
  32. package/src/tasks-runner/utils.js +2 -214
  33. package/src/tasks-runner/utils.js.map +1 -1
  34. package/src/tslint/nxEnforceModuleBoundariesRule.d.ts +1 -1
  35. package/src/tslint/nxEnforceModuleBoundariesRule.js +10 -11
  36. package/src/tslint/nxEnforceModuleBoundariesRule.js.map +1 -1
  37. package/src/utilities/assets.d.ts +0 -8
  38. package/src/utilities/assets.js +1 -23
  39. package/src/utilities/assets.js.map +1 -1
  40. package/src/utilities/buildable-libs-utils.d.ts +1 -0
  41. package/src/utilities/buildable-libs-utils.js +27 -20
  42. package/src/utilities/buildable-libs-utils.js.map +1 -1
  43. package/src/utilities/fileutils.d.ts +0 -3
  44. package/src/utilities/fileutils.js +1 -8
  45. package/src/utilities/fileutils.js.map +1 -1
  46. package/src/utilities/generate-globs.js +2 -2
  47. package/src/utilities/generate-globs.js.map +1 -1
  48. package/src/utilities/output.d.ts +1 -61
  49. package/src/utilities/output.js +2 -167
  50. package/src/utilities/output.js.map +1 -1
  51. package/src/utilities/plugins/plugin-capabilities.js +2 -2
  52. package/src/utilities/plugins/plugin-capabilities.js.map +1 -1
  53. package/src/utilities/typescript/compilation.js +1 -1
  54. package/src/utilities/typescript/compilation.js.map +1 -1
  55. package/src/utilities/typescript.js +5 -5
  56. package/src/utilities/typescript.js.map +1 -1
  57. package/src/utils/ast-utils.d.ts +1 -2
  58. package/src/utils/ast-utils.js.map +1 -1
  59. package/src/utils/project-type.d.ts +1 -1
  60. package/src/utils/rules/format-files.js +6 -6
  61. package/src/utils/rules/format-files.js.map +1 -1
  62. package/src/utils/runtime-lint-utils.d.ts +2 -3
  63. package/src/utils/runtime-lint-utils.js +2 -2
  64. package/src/utils/runtime-lint-utils.js.map +1 -1
  65. package/src/utils/testing-utils.js +1 -1
  66. package/src/utils/testing-utils.js.map +1 -1
  67. package/src/utils/versions.js +1 -1
  68. package/tasks-runners/default.d.ts +1 -1
  69. package/tasks-runners/default.js +1 -1
  70. package/src/command-line/affected.d.ts +0 -3
  71. package/src/command-line/affected.js +0 -117
  72. package/src/command-line/affected.js.map +0 -1
  73. package/src/command-line/connect-to-nx-cloud.d.ts +0 -2
  74. package/src/command-line/connect-to-nx-cloud.js +0 -78
  75. package/src/command-line/connect-to-nx-cloud.js.map +0 -1
  76. package/src/command-line/daemon.d.ts +0 -2
  77. package/src/command-line/daemon.js +0 -23
  78. package/src/command-line/daemon.js.map +0 -1
  79. package/src/command-line/dep-graph.d.ts +0 -24
  80. package/src/command-line/dep-graph.js +0 -370
  81. package/src/command-line/dep-graph.js.map +0 -1
  82. package/src/command-line/examples.d.ts +0 -5
  83. package/src/command-line/examples.js +0 -283
  84. package/src/command-line/examples.js.map +0 -1
  85. package/src/command-line/format.d.ts +0 -7
  86. package/src/command-line/format.js +0 -206
  87. package/src/command-line/format.js.map +0 -1
  88. package/src/command-line/lint.d.ts +0 -1
  89. package/src/command-line/lint.js +0 -32
  90. package/src/command-line/lint.js.map +0 -1
  91. package/src/command-line/list.d.ts +0 -13
  92. package/src/command-line/list.js +0 -41
  93. package/src/command-line/list.js.map +0 -1
  94. package/src/command-line/nx-commands.d.ts +0 -9
  95. package/src/command-line/nx-commands.js +0 -426
  96. package/src/command-line/nx-commands.js.map +0 -1
  97. package/src/command-line/print-affected.d.ts +0 -6
  98. package/src/command-line/print-affected.js +0 -82
  99. package/src/command-line/print-affected.js.map +0 -1
  100. package/src/command-line/report.d.ts +0 -24
  101. package/src/command-line/report.js +0 -135
  102. package/src/command-line/report.js.map +0 -1
  103. package/src/command-line/reset.d.ts +0 -1
  104. package/src/command-line/reset.js +0 -20
  105. package/src/command-line/reset.js.map +0 -1
  106. package/src/command-line/run-many.d.ts +0 -3
  107. package/src/command-line/run-many.js +0 -61
  108. package/src/command-line/run-many.js.map +0 -1
  109. package/src/command-line/run-one.d.ts +0 -6
  110. package/src/command-line/run-one.js +0 -31
  111. package/src/command-line/run-one.js.map +0 -1
  112. package/src/command-line/shared.d.ts +0 -5
  113. package/src/command-line/shared.js +0 -75
  114. package/src/command-line/shared.js.map +0 -1
  115. package/src/command-line/supported-nx-commands.d.ts +0 -1
  116. package/src/command-line/supported-nx-commands.js +0 -35
  117. package/src/command-line/supported-nx-commands.js.map +0 -1
  118. package/src/command-line/utils.d.ts +0 -40
  119. package/src/command-line/utils.js +0 -157
  120. package/src/command-line/utils.js.map +0 -1
  121. package/src/command-line/workspace-generators.d.ts +0 -1
  122. package/src/command-line/workspace-generators.js +0 -145
  123. package/src/command-line/workspace-generators.js.map +0 -1
  124. package/src/command-line/workspace-integrity-checks.d.ts +0 -11
  125. package/src/command-line/workspace-integrity-checks.js +0 -60
  126. package/src/command-line/workspace-integrity-checks.js.map +0 -1
  127. package/src/core/affected-project-graph/affected-project-graph-models.d.ts +0 -10
  128. package/src/core/affected-project-graph/affected-project-graph-models.js +0 -3
  129. package/src/core/affected-project-graph/affected-project-graph-models.js.map +0 -1
  130. package/src/core/affected-project-graph/affected-project-graph.d.ts +0 -3
  131. package/src/core/affected-project-graph/affected-project-graph.js +0 -88
  132. package/src/core/affected-project-graph/affected-project-graph.js.map +0 -1
  133. package/src/core/affected-project-graph/index.d.ts +0 -2
  134. package/src/core/affected-project-graph/index.js +0 -6
  135. package/src/core/affected-project-graph/index.js.map +0 -1
  136. package/src/core/affected-project-graph/locators/implicit-json-changes.d.ts +0 -4
  137. package/src/core/affected-project-graph/locators/implicit-json-changes.js +0 -54
  138. package/src/core/affected-project-graph/locators/implicit-json-changes.js.map +0 -1
  139. package/src/core/affected-project-graph/locators/npm-packages.d.ts +0 -4
  140. package/src/core/affected-project-graph/locators/npm-packages.js +0 -35
  141. package/src/core/affected-project-graph/locators/npm-packages.js.map +0 -1
  142. package/src/core/affected-project-graph/locators/tsconfig-json-changes.d.ts +0 -4
  143. package/src/core/affected-project-graph/locators/tsconfig-json-changes.js +0 -64
  144. package/src/core/affected-project-graph/locators/tsconfig-json-changes.js.map +0 -1
  145. package/src/core/affected-project-graph/locators/workspace-json-changes.d.ts +0 -4
  146. package/src/core/affected-project-graph/locators/workspace-json-changes.js +0 -48
  147. package/src/core/affected-project-graph/locators/workspace-json-changes.js.map +0 -1
  148. package/src/core/affected-project-graph/locators/workspace-projects.d.ts +0 -3
  149. package/src/core/affected-project-graph/locators/workspace-projects.js +0 -40
  150. package/src/core/affected-project-graph/locators/workspace-projects.js.map +0 -1
  151. package/src/core/assert-workspace-validity.d.ts +0 -2
  152. package/src/core/assert-workspace-validity.js +0 -67
  153. package/src/core/assert-workspace-validity.js.map +0 -1
  154. package/src/core/dep-graph/3rdpartylicenses.txt +0 -732
  155. package/src/core/dep-graph/index.html +0 -16
  156. package/src/core/dep-graph/main.esm.js +0 -2
  157. package/src/core/dep-graph/main.esm.js.LICENSE.txt +0 -39
  158. package/src/core/dep-graph/polyfills.esm.js +0 -1
  159. package/src/core/dep-graph/runtime.esm.js +0 -1
  160. package/src/core/dep-graph/styles.css +0 -3
  161. package/src/core/file-map-utils.d.ts +0 -10
  162. package/src/core/file-map-utils.js +0 -80
  163. package/src/core/file-map-utils.js.map +0 -1
  164. package/src/core/file-utils.d.ts +0 -32
  165. package/src/core/file-utils.js +0 -160
  166. package/src/core/file-utils.js.map +0 -1
  167. package/src/core/hasher/file-hasher-base.d.ts +0 -12
  168. package/src/core/hasher/file-hasher-base.js +0 -68
  169. package/src/core/hasher/file-hasher-base.js.map +0 -1
  170. package/src/core/hasher/file-hasher.d.ts +0 -2
  171. package/src/core/hasher/file-hasher.js +0 -22
  172. package/src/core/hasher/file-hasher.js.map +0 -1
  173. package/src/core/hasher/git-based-file-hasher.d.ts +0 -10
  174. package/src/core/hasher/git-based-file-hasher.js +0 -50
  175. package/src/core/hasher/git-based-file-hasher.js.map +0 -1
  176. package/src/core/hasher/git-hasher.d.ts +0 -7
  177. package/src/core/hasher/git-hasher.js +0 -134
  178. package/src/core/hasher/git-hasher.js.map +0 -1
  179. package/src/core/hasher/hasher.d.ts +0 -63
  180. package/src/core/hasher/hasher.js +0 -367
  181. package/src/core/hasher/hasher.js.map +0 -1
  182. package/src/core/hasher/hashing-impl.d.ts +0 -5
  183. package/src/core/hasher/hashing-impl.js +0 -23
  184. package/src/core/hasher/hashing-impl.js.map +0 -1
  185. package/src/core/hasher/node-based-file-hasher.d.ts +0 -7
  186. package/src/core/hasher/node-based-file-hasher.js +0 -78
  187. package/src/core/hasher/node-based-file-hasher.js.map +0 -1
  188. package/src/core/normalize-nx-json.d.ts +0 -8
  189. package/src/core/normalize-nx-json.js +0 -38
  190. package/src/core/normalize-nx-json.js.map +0 -1
  191. package/src/core/nx-deps/nx-deps-cache.d.ts +0 -39
  192. package/src/core/nx-deps/nx-deps-cache.js +0 -164
  193. package/src/core/nx-deps/nx-deps-cache.js.map +0 -1
  194. package/src/core/project-graph/build-dependencies/build-explicit-typescript-and-package-json-dependencies.d.ts +0 -5
  195. package/src/core/project-graph/build-dependencies/build-explicit-typescript-and-package-json-dependencies.js +0 -19
  196. package/src/core/project-graph/build-dependencies/build-explicit-typescript-and-package-json-dependencies.js.map +0 -1
  197. package/src/core/project-graph/build-dependencies/explicit-package-json-dependencies.d.ts +0 -3
  198. package/src/core/project-graph/build-dependencies/explicit-package-json-dependencies.js +0 -73
  199. package/src/core/project-graph/build-dependencies/explicit-package-json-dependencies.js.map +0 -1
  200. package/src/core/project-graph/build-dependencies/explicit-project-dependencies.d.ts +0 -3
  201. package/src/core/project-graph/build-dependencies/explicit-project-dependencies.js +0 -27
  202. package/src/core/project-graph/build-dependencies/explicit-project-dependencies.js.map +0 -1
  203. package/src/core/project-graph/build-dependencies/implicit-project-dependencies.d.ts +0 -2
  204. package/src/core/project-graph/build-dependencies/implicit-project-dependencies.js +0 -20
  205. package/src/core/project-graph/build-dependencies/implicit-project-dependencies.js.map +0 -1
  206. package/src/core/project-graph/build-dependencies/index.d.ts +0 -3
  207. package/src/core/project-graph/build-dependencies/index.js +0 -7
  208. package/src/core/project-graph/build-dependencies/index.js.map +0 -1
  209. package/src/core/project-graph/build-dependencies/typescript-import-locator.d.ts +0 -11
  210. package/src/core/project-graph/build-dependencies/typescript-import-locator.js +0 -114
  211. package/src/core/project-graph/build-dependencies/typescript-import-locator.js.map +0 -1
  212. package/src/core/project-graph/build-nodes/index.d.ts +0 -2
  213. package/src/core/project-graph/build-nodes/index.js +0 -6
  214. package/src/core/project-graph/build-nodes/index.js.map +0 -1
  215. package/src/core/project-graph/build-nodes/npm-packages.d.ts +0 -2
  216. package/src/core/project-graph/build-nodes/npm-packages.js +0 -22
  217. package/src/core/project-graph/build-nodes/npm-packages.js.map +0 -1
  218. package/src/core/project-graph/build-nodes/workspace-projects.d.ts +0 -2
  219. package/src/core/project-graph/build-nodes/workspace-projects.js +0 -49
  220. package/src/core/project-graph/build-nodes/workspace-projects.js.map +0 -1
  221. package/src/core/project-graph/build-project-graph.d.ts +0 -7
  222. package/src/core/project-graph/build-project-graph.js +0 -231
  223. package/src/core/project-graph/build-project-graph.js.map +0 -1
  224. package/src/core/project-graph/daemon/cache.d.ts +0 -6
  225. package/src/core/project-graph/daemon/cache.js +0 -56
  226. package/src/core/project-graph/daemon/cache.js.map +0 -1
  227. package/src/core/project-graph/daemon/client/client.d.ts +0 -26
  228. package/src/core/project-graph/daemon/client/client.js +0 -200
  229. package/src/core/project-graph/daemon/client/client.js.map +0 -1
  230. package/src/core/project-graph/daemon/client/exec-is-server-available.d.ts +0 -1
  231. package/src/core/project-graph/daemon/client/exec-is-server-available.js +0 -13
  232. package/src/core/project-graph/daemon/client/exec-is-server-available.js.map +0 -1
  233. package/src/core/project-graph/daemon/client/generate-help-output.d.ts +0 -1
  234. package/src/core/project-graph/daemon/client/generate-help-output.js +0 -31
  235. package/src/core/project-graph/daemon/client/generate-help-output.js.map +0 -1
  236. package/src/core/project-graph/daemon/server/logger.d.ts +0 -18
  237. package/src/core/project-graph/daemon/server/logger.js +0 -38
  238. package/src/core/project-graph/daemon/server/logger.js.map +0 -1
  239. package/src/core/project-graph/daemon/server/project-graph-incremental-recomputation.d.ts +0 -8
  240. package/src/core/project-graph/daemon/server/project-graph-incremental-recomputation.js +0 -191
  241. package/src/core/project-graph/daemon/server/project-graph-incremental-recomputation.js.map +0 -1
  242. package/src/core/project-graph/daemon/server/server.d.ts +0 -4
  243. package/src/core/project-graph/daemon/server/server.js +0 -236
  244. package/src/core/project-graph/daemon/server/server.js.map +0 -1
  245. package/src/core/project-graph/daemon/server/shutdown-utils.d.ts +0 -12
  246. package/src/core/project-graph/daemon/server/shutdown-utils.js +0 -32
  247. package/src/core/project-graph/daemon/server/shutdown-utils.js.map +0 -1
  248. package/src/core/project-graph/daemon/server/start.d.ts +0 -1
  249. package/src/core/project-graph/daemon/server/start.js +0 -19
  250. package/src/core/project-graph/daemon/server/start.js.map +0 -1
  251. package/src/core/project-graph/daemon/server/stop.d.ts +0 -1
  252. package/src/core/project-graph/daemon/server/stop.js +0 -19
  253. package/src/core/project-graph/daemon/server/stop.js.map +0 -1
  254. package/src/core/project-graph/daemon/server/watcher.d.ts +0 -12
  255. package/src/core/project-graph/daemon/server/watcher.js +0 -158
  256. package/src/core/project-graph/daemon/server/watcher.js.map +0 -1
  257. package/src/core/project-graph/daemon/socket-utils.d.ts +0 -15
  258. package/src/core/project-graph/daemon/socket-utils.js +0 -38
  259. package/src/core/project-graph/daemon/socket-utils.js.map +0 -1
  260. package/src/core/project-graph/daemon/tmp-dir.d.ts +0 -6
  261. package/src/core/project-graph/daemon/tmp-dir.js +0 -37
  262. package/src/core/project-graph/daemon/tmp-dir.js.map +0 -1
  263. package/src/core/project-graph/index.d.ts +0 -3
  264. package/src/core/project-graph/index.js +0 -10
  265. package/src/core/project-graph/index.js.map +0 -1
  266. package/src/core/project-graph/operators.d.ts +0 -14
  267. package/src/core/project-graph/operators.js +0 -119
  268. package/src/core/project-graph/operators.js.map +0 -1
  269. package/src/core/project-graph/project-graph-models.d.ts +0 -8
  270. package/src/core/project-graph/project-graph-models.js +0 -12
  271. package/src/core/project-graph/project-graph-models.js.map +0 -1
  272. package/src/core/project-graph/project-graph-worker.d.ts +0 -1
  273. package/src/core/project-graph/project-graph-worker.js +0 -19
  274. package/src/core/project-graph/project-graph-worker.js.map +0 -1
  275. package/src/core/project-graph/project-graph.d.ts +0 -16
  276. package/src/core/project-graph/project-graph.js +0 -167
  277. package/src/core/project-graph/project-graph.js.map +0 -1
  278. package/src/core/shared-interfaces.d.ts +0 -11
  279. package/src/core/shared-interfaces.js +0 -3
  280. package/src/core/shared-interfaces.js.map +0 -1
  281. package/src/core/target-project-locator.d.ts +0 -36
  282. package/src/core/target-project-locator.js +0 -164
  283. package/src/core/target-project-locator.js.map +0 -1
  284. package/src/init/init.d.ts +0 -1
  285. package/src/init/init.js +0 -13
  286. package/src/init/init.js.map +0 -1
  287. package/src/tasks-runner/batch/batch-messages.d.ts +0 -24
  288. package/src/tasks-runner/batch/batch-messages.js +0 -9
  289. package/src/tasks-runner/batch/batch-messages.js.map +0 -1
  290. package/src/tasks-runner/batch/run-batch.d.ts +0 -1
  291. package/src/tasks-runner/batch/run-batch.js +0 -57
  292. package/src/tasks-runner/batch/run-batch.js.map +0 -1
  293. package/src/tasks-runner/default-reporter.d.ts +0 -11
  294. package/src/tasks-runner/default-reporter.js +0 -79
  295. package/src/tasks-runner/default-reporter.js.map +0 -1
  296. package/src/tasks-runner/default-tasks-runner.d.ts +0 -19
  297. package/src/tasks-runner/default-tasks-runner.js +0 -48
  298. package/src/tasks-runner/default-tasks-runner.js.map +0 -1
  299. package/src/tasks-runner/empty-reporter.d.ts +0 -10
  300. package/src/tasks-runner/empty-reporter.js +0 -13
  301. package/src/tasks-runner/empty-reporter.js.map +0 -1
  302. package/src/tasks-runner/forked-process-task-runner.d.ts +0 -36
  303. package/src/tasks-runner/forked-process-task-runner.js +0 -257
  304. package/src/tasks-runner/forked-process-task-runner.js.map +0 -1
  305. package/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.d.ts +0 -25
  306. package/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.js +0 -349
  307. package/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.js.map +0 -1
  308. package/src/tasks-runner/life-cycles/dynamic-run-one-terminal-output-life-cycle.d.ts +0 -25
  309. package/src/tasks-runner/life-cycles/dynamic-run-one-terminal-output-life-cycle.js +0 -231
  310. package/src/tasks-runner/life-cycles/dynamic-run-one-terminal-output-life-cycle.js.map +0 -1
  311. package/src/tasks-runner/life-cycles/empty-terminal-output-life-cycle.d.ts +0 -6
  312. package/src/tasks-runner/life-cycles/empty-terminal-output-life-cycle.js +0 -19
  313. package/src/tasks-runner/life-cycles/empty-terminal-output-life-cycle.js.map +0 -1
  314. package/src/tasks-runner/life-cycles/pretty-time.d.ts +0 -4
  315. package/src/tasks-runner/life-cycles/pretty-time.js +0 -75
  316. package/src/tasks-runner/life-cycles/pretty-time.js.map +0 -1
  317. package/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.d.ts +0 -33
  318. package/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.js +0 -110
  319. package/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.js.map +0 -1
  320. package/src/tasks-runner/life-cycles/static-run-one-terminal-output-life-cycle.d.ts +0 -31
  321. package/src/tasks-runner/life-cycles/static-run-one-terminal-output-life-cycle.js +0 -97
  322. package/src/tasks-runner/life-cycles/static-run-one-terminal-output-life-cycle.js.map +0 -1
  323. package/src/tasks-runner/life-cycles/task-profiling-life-cycle.d.ts +0 -19
  324. package/src/tasks-runner/life-cycles/task-profiling-life-cycle.js +0 -67
  325. package/src/tasks-runner/life-cycles/task-profiling-life-cycle.js.map +0 -1
  326. package/src/tasks-runner/life-cycles/task-timings-life-cycle.d.ts +0 -13
  327. package/src/tasks-runner/life-cycles/task-timings-life-cycle.js +0 -33
  328. package/src/tasks-runner/life-cycles/task-timings-life-cycle.js.map +0 -1
  329. package/src/tasks-runner/remove-old-cache-records.d.ts +0 -1
  330. package/src/tasks-runner/remove-old-cache-records.js +0 -62
  331. package/src/tasks-runner/remove-old-cache-records.js.map +0 -1
  332. package/src/tasks-runner/reporter.d.ts +0 -14
  333. package/src/tasks-runner/reporter.js +0 -11
  334. package/src/tasks-runner/reporter.js.map +0 -1
  335. package/src/tasks-runner/run-command.d.ts +0 -19
  336. package/src/tasks-runner/run-command.js +0 -353
  337. package/src/tasks-runner/run-command.js.map +0 -1
  338. package/src/tasks-runner/run-one-reporter.d.ts +0 -12
  339. package/src/tasks-runner/run-one-reporter.js +0 -68
  340. package/src/tasks-runner/run-one-reporter.js.map +0 -1
  341. package/src/tasks-runner/task-graph-creator.d.ts +0 -11
  342. package/src/tasks-runner/task-graph-creator.js +0 -71
  343. package/src/tasks-runner/task-graph-creator.js.map +0 -1
  344. package/src/tasks-runner/task-orchestrator.d.ts +0 -37
  345. package/src/tasks-runner/task-orchestrator.js +0 -299
  346. package/src/tasks-runner/task-orchestrator.js.map +0 -1
  347. package/src/tasks-runner/tasks-runner.d.ts +0 -44
  348. package/src/tasks-runner/tasks-runner.js +0 -15
  349. package/src/tasks-runner/tasks-runner.js.map +0 -1
  350. package/src/tasks-runner/tasks-schedule.d.ts +0 -32
  351. package/src/tasks-runner/tasks-schedule.js +0 -130
  352. package/src/tasks-runner/tasks-schedule.js.map +0 -1
  353. package/src/utilities/array.d.ts +0 -17
  354. package/src/utilities/array.js +0 -26
  355. package/src/utilities/array.js.map +0 -1
  356. package/src/utilities/cache-directory.d.ts +0 -1
  357. package/src/utilities/cache-directory.js +0 -34
  358. package/src/utilities/cache-directory.js.map +0 -1
  359. package/src/utilities/is_ci.d.ts +0 -1
  360. package/src/utilities/is_ci.js +0 -21
  361. package/src/utilities/is_ci.js.map +0 -1
  362. package/src/utilities/json-diff.d.ts +0 -17
  363. package/src/utilities/json-diff.js +0 -112
  364. package/src/utilities/json-diff.js.map +0 -1
  365. package/src/utilities/perf-logging.d.ts +0 -1
  366. package/src/utilities/perf-logging.js +0 -12
  367. package/src/utilities/perf-logging.js.map +0 -1
  368. package/src/utilities/project-graph-utils.d.ts +0 -11
  369. package/src/utilities/project-graph-utils.js +0 -95
  370. package/src/utilities/project-graph-utils.js.map +0 -1
  371. package/src/utilities/strip-source-code.d.ts +0 -2
  372. package/src/utilities/strip-source-code.js +0 -85
  373. package/src/utilities/strip-source-code.js.map +0 -1
@@ -1,38 +0,0 @@
1
- "use strict";
2
- /**
3
- * To improve the overall readibility of the logs, we categorize things by "trigger":
4
- *
5
- * - [REQUEST] meaning that the current set of actions were triggered by a client request to the server
6
- * - [WATCHER] meaning the the current set of actions were triggered by handling changes to the workspace files
7
- *
8
- * We keep those two "triggers" left aligned at the top level and then indent subsequent logs so that there is a
9
- * logical hierarchy/grouping.
10
- */
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.serverLogger = void 0;
13
- class ServerLogger {
14
- log(...s) {
15
- console.log(this.formatLogMessage(`${s
16
- .map((val) => {
17
- if (typeof val === 'string') {
18
- return val;
19
- }
20
- return JSON.stringify(val);
21
- })
22
- .join(' ')}`));
23
- }
24
- requestLog(...s) {
25
- this.log(`[REQUEST]: ${s.join(' ')}`);
26
- }
27
- watcherLog(...s) {
28
- this.log(`[WATCHER]: ${s.join(' ')}`);
29
- }
30
- formatLogMessage(message) {
31
- return `[NX Daemon Server] - ${this.getNow()} - ${message}`;
32
- }
33
- getNow() {
34
- return new Date(Date.now()).toISOString();
35
- }
36
- }
37
- exports.serverLogger = new ServerLogger();
38
- //# sourceMappingURL=logger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../../../../../../packages/workspace/src/core/project-graph/daemon/server/logger.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAEH,MAAM,YAAY;IAChB,GAAG,CAAC,GAAG,CAAY;QACjB,OAAO,CAAC,GAAG,CACT,IAAI,CAAC,gBAAgB,CACnB,GAAG,CAAC;aACD,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;YACX,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;gBAC3B,OAAO,GAAG,CAAC;aACZ;YACD,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC,CAAC;aACD,IAAI,CAAC,GAAG,CAAC,EAAE,CACf,CACF,CAAC;IACJ,CAAC;IAED,UAAU,CAAC,GAAG,CAAY;QACxB,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACxC,CAAC;IAED,UAAU,CAAC,GAAG,CAAY;QACxB,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACxC,CAAC;IAEO,gBAAgB,CAAC,OAAe;QACtC,OAAO,wBAAwB,IAAI,CAAC,MAAM,EAAE,MAAM,OAAO,EAAE,CAAC;IAC9D,CAAC;IAEO,MAAM;QACZ,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IAC5C,CAAC;CACF;AAEY,QAAA,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC"}
@@ -1,8 +0,0 @@
1
- export declare function getCachedSerializedProjectGraphPromise(): Promise<{
2
- error: Error;
3
- serializedProjectGraph: string;
4
- } | {
5
- error: any;
6
- serializedProjectGraph: any;
7
- }>;
8
- export declare function addUpdatedAndDeletedFiles(updatedFiles: string[], deletedFiles: string[]): void;
@@ -1,191 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addUpdatedAndDeletedFiles = exports.getCachedSerializedProjectGraphPromise = void 0;
4
- const tslib_1 = require("tslib");
5
- const perf_hooks_1 = require("perf_hooks");
6
- const file_utils_1 = require("../../../file-utils");
7
- const file_hasher_1 = require("../../../hasher/file-hasher");
8
- const logger_1 = require("./logger");
9
- const build_project_graph_1 = require("../../build-project-graph");
10
- const nx_deps_cache_1 = require("../../../nx-deps/nx-deps-cache");
11
- const fileutils_1 = require("../../../../utilities/fileutils");
12
- const hashing_impl_1 = require("../../../hasher/hashing-impl");
13
- const file_map_utils_1 = require("../../../file-map-utils");
14
- let cachedSerializedProjectGraphPromise;
15
- let projectFileMapWithFiles;
16
- let currentProjectGraphCache;
17
- const collectedUpdatedFiles = new Set();
18
- const collectedDeletedFiles = new Set();
19
- let storedWorkspaceConfigHash;
20
- let waitPeriod = 100;
21
- let scheduledTimeoutId;
22
- function getCachedSerializedProjectGraphPromise() {
23
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
24
- try {
25
- // recomputing it now on demand. we can ignore the scheduled timeout
26
- if (scheduledTimeoutId) {
27
- clearTimeout(scheduledTimeoutId);
28
- scheduledTimeoutId = undefined;
29
- }
30
- // reset the wait time
31
- waitPeriod = 100;
32
- yield resetInternalStateIfNxDepsMissing();
33
- if (collectedUpdatedFiles.size == 0 && collectedDeletedFiles.size == 0) {
34
- if (!cachedSerializedProjectGraphPromise) {
35
- cachedSerializedProjectGraphPromise =
36
- processFilesAndCreateAndSerializeProjectGraph();
37
- }
38
- }
39
- else {
40
- cachedSerializedProjectGraphPromise =
41
- processFilesAndCreateAndSerializeProjectGraph();
42
- }
43
- return yield cachedSerializedProjectGraphPromise;
44
- }
45
- catch (e) {
46
- return { error: e, serializedProjectGraph: null };
47
- }
48
- });
49
- }
50
- exports.getCachedSerializedProjectGraphPromise = getCachedSerializedProjectGraphPromise;
51
- function addUpdatedAndDeletedFiles(updatedFiles, deletedFiles) {
52
- for (let f of updatedFiles) {
53
- collectedDeletedFiles.delete(f);
54
- collectedUpdatedFiles.add(f);
55
- }
56
- for (let f of deletedFiles) {
57
- collectedUpdatedFiles.delete(f);
58
- collectedDeletedFiles.add(f);
59
- }
60
- if (!scheduledTimeoutId) {
61
- scheduledTimeoutId = setTimeout(() => {
62
- scheduledTimeoutId = undefined;
63
- if (waitPeriod < 4000) {
64
- waitPeriod = waitPeriod * 2;
65
- }
66
- cachedSerializedProjectGraphPromise =
67
- processFilesAndCreateAndSerializeProjectGraph();
68
- }, waitPeriod);
69
- }
70
- }
71
- exports.addUpdatedAndDeletedFiles = addUpdatedAndDeletedFiles;
72
- function computeWorkspaceConfigHash(workspaceJson) {
73
- return new hashing_impl_1.HashingImpl().hashArray([JSON.stringify(workspaceJson)]);
74
- }
75
- function processCollectedUpdatedAndDeletedFiles() {
76
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
77
- try {
78
- perf_hooks_1.performance.mark('hash-watched-changes-start');
79
- const updatedFiles = yield file_hasher_1.defaultFileHasher.hashFiles([
80
- ...collectedUpdatedFiles.values(),
81
- ]);
82
- const deletedFiles = [...collectedDeletedFiles.values()];
83
- perf_hooks_1.performance.mark('hash-watched-changes-end');
84
- perf_hooks_1.performance.measure('hash changed files from watcher', 'hash-watched-changes-start', 'hash-watched-changes-end');
85
- file_hasher_1.defaultFileHasher.incrementalUpdate(updatedFiles, deletedFiles);
86
- const workspaceJson = (0, file_utils_1.readWorkspaceJson)();
87
- const workspaceConfigHash = computeWorkspaceConfigHash(workspaceJson);
88
- logger_1.serverLogger.requestLog(`Updated file-hasher based on watched changes, recomputing project graph...`);
89
- // when workspace config changes we cannot incrementally update project file map
90
- if (workspaceConfigHash !== storedWorkspaceConfigHash) {
91
- storedWorkspaceConfigHash = workspaceConfigHash;
92
- projectFileMapWithFiles = (0, file_map_utils_1.createProjectFileMap)(workspaceJson, file_hasher_1.defaultFileHasher.allFileData());
93
- }
94
- else {
95
- projectFileMapWithFiles = projectFileMapWithFiles
96
- ? (0, file_map_utils_1.updateProjectFileMap)(workspaceJson, projectFileMapWithFiles.projectFileMap, projectFileMapWithFiles.allWorkspaceFiles, updatedFiles, deletedFiles)
97
- : (0, file_map_utils_1.createProjectFileMap)(workspaceJson, file_hasher_1.defaultFileHasher.allFileData());
98
- }
99
- collectedUpdatedFiles.clear();
100
- collectedDeletedFiles.clear();
101
- }
102
- catch (e) {
103
- // this is expected
104
- // for instance, workspace.json can be incorrect or a file we are trying to has
105
- // has been deleted
106
- // we are resetting internal state to start from scratch next time a file changes
107
- // given the user the opportunity to fix the error
108
- // if Nx requests the project graph prior to the error being fixed,
109
- // the error will be propagated
110
- logger_1.serverLogger.log(`Error detected when recomputing project file map: ${e.message}`);
111
- resetInternalState();
112
- return e;
113
- }
114
- });
115
- }
116
- function processFilesAndCreateAndSerializeProjectGraph() {
117
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
118
- const err = yield processCollectedUpdatedAndDeletedFiles();
119
- if (err) {
120
- return Promise.resolve({
121
- error: err,
122
- serializedProjectGraph: null,
123
- });
124
- }
125
- else {
126
- return createAndSerializeProjectGraph();
127
- }
128
- });
129
- }
130
- function copyFileData(d) {
131
- return d.map((t) => (Object.assign({}, t)));
132
- }
133
- function copyFileMap(m) {
134
- const c = {};
135
- for (let p of Object.keys(m)) {
136
- c[p] = copyFileData(m[p]);
137
- }
138
- return c;
139
- }
140
- function createAndSerializeProjectGraph() {
141
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
142
- try {
143
- perf_hooks_1.performance.mark('create-project-graph-start');
144
- const workspaceJson = (0, file_utils_1.readWorkspaceJson)();
145
- const { projectGraph, projectGraphCache } = yield (0, build_project_graph_1.buildProjectGraphUsingProjectFileMap)(workspaceJson, copyFileMap(projectFileMapWithFiles.projectFileMap), copyFileData(projectFileMapWithFiles.allWorkspaceFiles), currentProjectGraphCache || (0, nx_deps_cache_1.readCache)(), true);
146
- currentProjectGraphCache = projectGraphCache;
147
- perf_hooks_1.performance.mark('create-project-graph-end');
148
- perf_hooks_1.performance.measure('total execution time for createProjectGraph()', 'create-project-graph-start', 'create-project-graph-end');
149
- perf_hooks_1.performance.mark('json-stringify-start');
150
- const serializedProjectGraph = JSON.stringify(projectGraph);
151
- perf_hooks_1.performance.mark('json-stringify-end');
152
- perf_hooks_1.performance.measure('serialize graph', 'json-stringify-start', 'json-stringify-end');
153
- return {
154
- error: null,
155
- serializedProjectGraph,
156
- };
157
- }
158
- catch (e) {
159
- logger_1.serverLogger.log(`Error detected when creating a project graph: ${e.message}`);
160
- return {
161
- error: e,
162
- serializedProjectGraph: null,
163
- };
164
- }
165
- });
166
- }
167
- function resetInternalState() {
168
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
169
- cachedSerializedProjectGraphPromise = undefined;
170
- projectFileMapWithFiles = undefined;
171
- currentProjectGraphCache = undefined;
172
- collectedUpdatedFiles.clear();
173
- collectedDeletedFiles.clear();
174
- file_hasher_1.defaultFileHasher.clear();
175
- yield file_hasher_1.defaultFileHasher.ensureInitialized();
176
- waitPeriod = 100;
177
- });
178
- }
179
- function resetInternalStateIfNxDepsMissing() {
180
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
181
- try {
182
- if (!(0, fileutils_1.fileExists)(nx_deps_cache_1.nxDepsPath) && cachedSerializedProjectGraphPromise) {
183
- yield resetInternalState();
184
- }
185
- }
186
- catch (e) {
187
- yield resetInternalState();
188
- }
189
- });
190
- }
191
- //# sourceMappingURL=project-graph-incremental-recomputation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"project-graph-incremental-recomputation.js","sourceRoot":"","sources":["../../../../../../../../packages/workspace/src/core/project-graph/daemon/server/project-graph-incremental-recomputation.ts"],"names":[],"mappings":";;;;AACA,2CAAyC;AACzC,oDAAwD;AACxD,6DAAgE;AAChE,qCAAwC;AACxC,mEAAiF;AACjF,kEAIwC;AACxC,+DAA6D;AAC7D,+DAA2D;AAC3D,4DAGiC;AAEjC,IAAI,mCAGF,CAAC;AACH,IAAI,uBAES,CAAC;AACd,IAAI,wBAAuD,CAAC;AAE5D,MAAM,qBAAqB,GAAG,IAAI,GAAG,EAAU,CAAC;AAChD,MAAM,qBAAqB,GAAG,IAAI,GAAG,EAAU,CAAC;AAChD,IAAI,yBAA6C,CAAC;AAClD,IAAI,UAAU,GAAG,GAAG,CAAC;AACrB,IAAI,kBAAkB,CAAC;AAEvB,SAAsB,sCAAsC;;QAC1D,IAAI;YACF,oEAAoE;YACpE,IAAI,kBAAkB,EAAE;gBACtB,YAAY,CAAC,kBAAkB,CA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,CAAC,IAAI,mCAAmC,EAAE;gBAClE,MAAM,kBAAkB,EAAE,CAAC;aAC5B;SACF;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,kBAAkB,EAAE,CAAC;SAC5B;IACH,CAAC;CAAA"}
@@ -1,4 +0,0 @@
1
- /// <reference types="node" />
2
- import { Server } from 'net';
3
- export declare function startServer(): Promise<Server>;
4
- export declare function stopServer(): Promise<void>;
@@ -1,236 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stopServer = exports.startServer = void 0;
4
- const tslib_1 = require("tslib");
5
- const app_root_1 = require("nx/src/utils/app-root");
6
- const net_1 = require("net");
7
- const path_1 = require("path");
8
- const perf_hooks_1 = require("perf_hooks");
9
- const socket_utils_1 = require("../socket-utils");
10
- const logger_1 = require("./logger");
11
- const shutdown_utils_1 = require("./shutdown-utils");
12
- const watcher_1 = require("./watcher");
13
- const project_graph_incremental_recomputation_1 = require("./project-graph-incremental-recomputation");
14
- const fs_1 = require("fs");
15
- const hashing_impl_1 = require("../../../hasher/hashing-impl");
16
- const file_hasher_1 = require("@nrwl/workspace/src/core/hasher/file-hasher");
17
- function respondToClient(socket, message) {
18
- return new Promise((res) => {
19
- socket.write(message, () => {
20
- // Close the connection once all data has been written so that the client knows when to read it.
21
- socket.end();
22
- logger_1.serverLogger.log(`Closed Connection to Client`);
23
- res(null);
24
- });
25
- });
26
- }
27
- let watcherSubscription;
28
- let performanceObserver;
29
- let watcherError;
30
- function respondWithErrorAndExit(socket, description, error) {
31
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
32
- // print some extra stuff in the error message
33
- logger_1.serverLogger.requestLog(`Responding to the client with an error.`, description, error.message);
34
- console.error(error);
35
- error.message = `${error.message}\n\nBecause of the error the Nx daemon process has exited. The next Nx command is going to restart the daemon process.\nIf the error persists, please run "nx reset".`;
36
- yield respondToClient(socket, (0, socket_utils_1.serializeResult)(error, null));
37
- process.exit(1);
38
- });
39
- }
40
- const server = (0, net_1.createServer)((socket) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
41
- (0, shutdown_utils_1.resetInactivityTimeout)(handleInactivityTimeout);
42
- if (!performanceObserver) {
43
- performanceObserver = new perf_hooks_1.PerformanceObserver((list) => {
44
- const entry = list.getEntries()[0];
45
- logger_1.serverLogger.log(`Time taken for '${entry.name}'`, `${entry.duration}ms`);
46
- });
47
- performanceObserver.observe({ entryTypes: ['measure'] });
48
- }
49
- socket.on('data', (data) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
50
- if (watcherError) {
51
- yield respondWithErrorAndExit(socket, `File watcher error in the workspace '${app_root_1.appRootPath}'.`, watcherError);
52
- }
53
- if (lockFileChanged()) {
54
- yield respondWithErrorAndExit(socket, `Lock files changed`, {
55
- name: '',
56
- message: 'LOCK-FILES-CHANGED',
57
- });
58
- }
59
- (0, shutdown_utils_1.resetInactivityTimeout)(handleInactivityTimeout);
60
- const payload = data.toString();
61
- if (payload !== 'REQUEST_PROJECT_GRAPH_PAYLOAD') {
62
- yield respondWithErrorAndExit(socket, `Invalid payload from the client`, new Error(`Unsupported payload sent to daemon server: ${payload}`));
63
- }
64
- perf_hooks_1.performance.mark('server-connection');
65
- logger_1.serverLogger.requestLog('Client Request for Project Graph Received');
66
- const result = yield (0, project_graph_incremental_recomputation_1.getCachedSerializedProjectGraphPromise)();
67
- if (result.error) {
68
- yield respondWithErrorAndExit(socket, `Error when preparing serialized project graph.`, result.error);
69
- }
70
- const serializedResult = (0, socket_utils_1.serializeResult)(result.error, result.serializedProjectGraph);
71
- if (!serializedResult) {
72
- yield respondWithErrorAndExit(socket, `Error when serializing project graph result.`, new Error('Critical error when serializing server result, check server logs'));
73
- }
74
- perf_hooks_1.performance.mark('serialized-project-graph-ready');
75
- perf_hooks_1.performance.measure('total for creating and serializing project graph', 'server-connection', 'serialized-project-graph-ready');
76
- socket.write(serializedResult, () => {
77
- perf_hooks_1.performance.mark('serialized-project-graph-written-to-client');
78
- perf_hooks_1.performance.measure('write project graph to socket', 'serialized-project-graph-ready', 'serialized-project-graph-written-to-client');
79
- // Close the connection once all data has been written so that the client knows when to read it.
80
- socket.end();
81
- perf_hooks_1.performance.measure('total for server response', 'server-connection', 'serialized-project-graph-written-to-client');
82
- const bytesWritten = Buffer.byteLength(result.serializedProjectGraph, 'utf-8');
83
- logger_1.serverLogger.requestLog(`Closed Connection to Client (${bytesWritten} bytes transferred)`);
84
- });
85
- }));
86
- }));
87
- function handleInactivityTimeout() {
88
- (0, shutdown_utils_1.handleServerProcessTermination)({
89
- server,
90
- watcherSubscription,
91
- reason: `${shutdown_utils_1.SERVER_INACTIVITY_TIMEOUT_MS}ms of inactivity`,
92
- });
93
- }
94
- process
95
- .on('SIGINT', () => (0, shutdown_utils_1.handleServerProcessTermination)({
96
- server,
97
- watcherSubscription,
98
- reason: 'received process SIGINT',
99
- }))
100
- .on('SIGTERM', () => (0, shutdown_utils_1.handleServerProcessTermination)({
101
- server,
102
- watcherSubscription,
103
- reason: 'received process SIGTERM',
104
- }))
105
- .on('SIGHUP', () => (0, shutdown_utils_1.handleServerProcessTermination)({
106
- server,
107
- watcherSubscription,
108
- reason: 'received process SIGHUP',
109
- }));
110
- let existingLockHash;
111
- function lockFileChanged() {
112
- const hash = new hashing_impl_1.HashingImpl();
113
- const lockHashes = [
114
- (0, path_1.join)(app_root_1.appRootPath, 'package-lock.json'),
115
- (0, path_1.join)(app_root_1.appRootPath, 'yarn.lock'),
116
- (0, path_1.join)(app_root_1.appRootPath, 'pnpm-lock.yaml'),
117
- ]
118
- .filter((file) => (0, fs_1.existsSync)(file))
119
- .map((file) => hash.hashFile(file));
120
- const newHash = hash.hashArray(lockHashes);
121
- if (existingLockHash && newHash != existingLockHash) {
122
- existingLockHash = newHash;
123
- return true;
124
- }
125
- else {
126
- existingLockHash = newHash;
127
- return false;
128
- }
129
- }
130
- /**
131
- * When applicable files in the workspaces are changed (created, updated, deleted),
132
- * we need to recompute the cached serialized project graph so that it is readily
133
- * available for the next client request to the server.
134
- */
135
- const handleWorkspaceChanges = (err, changeEvents) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
136
- if (watcherError) {
137
- logger_1.serverLogger.watcherLog('Skipping handleWorkspaceChanges because of a previously recorded watcher error.');
138
- return;
139
- }
140
- try {
141
- (0, shutdown_utils_1.resetInactivityTimeout)(handleInactivityTimeout);
142
- if (lockFileChanged()) {
143
- yield (0, shutdown_utils_1.handleServerProcessTermination)({
144
- server,
145
- watcherSubscription,
146
- reason: 'Lock file changed',
147
- });
148
- return;
149
- }
150
- if (err || !changeEvents || !changeEvents.length) {
151
- logger_1.serverLogger.watcherLog('Unexpected watcher error', err.message);
152
- console.error(err);
153
- watcherError = err;
154
- return;
155
- }
156
- logger_1.serverLogger.watcherLog((0, watcher_1.convertChangeEventsToLogMessage)(changeEvents));
157
- const filesToHash = [];
158
- const deletedFiles = [];
159
- for (const event of changeEvents) {
160
- if (event.type === 'delete') {
161
- deletedFiles.push(event.path);
162
- }
163
- else {
164
- try {
165
- const s = (0, fs_1.statSync)((0, path_1.join)(app_root_1.appRootPath, event.path));
166
- if (!s.isDirectory()) {
167
- filesToHash.push(event.path);
168
- }
169
- }
170
- catch (e) {
171
- // this can happen when the update file was deleted right after
172
- }
173
- }
174
- }
175
- (0, project_graph_incremental_recomputation_1.addUpdatedAndDeletedFiles)(filesToHash, deletedFiles);
176
- }
177
- catch (err) {
178
- logger_1.serverLogger.watcherLog(`Unexpected error`, err.message);
179
- console.error(err);
180
- watcherError = err;
181
- }
182
- });
183
- function startServer() {
184
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
185
- // See notes in socket-utils.ts on OS differences regarding clean up of existings connections.
186
- if (!socket_utils_1.isWindows) {
187
- (0, socket_utils_1.killSocketOrPath)();
188
- }
189
- yield file_hasher_1.defaultFileHasher.ensureInitialized();
190
- return new Promise((resolve, reject) => {
191
- try {
192
- server.listen(socket_utils_1.FULL_OS_SOCKET_PATH, () => tslib_1.__awaiter(this, void 0, void 0, function* () {
193
- try {
194
- logger_1.serverLogger.log(`Started listening on: ${socket_utils_1.FULL_OS_SOCKET_PATH}`);
195
- // this triggers the storage of the lock file hash
196
- lockFileChanged();
197
- if (!watcherSubscription) {
198
- watcherSubscription = yield (0, watcher_1.subscribeToWorkspaceChanges)(server, handleWorkspaceChanges);
199
- logger_1.serverLogger.watcherLog(`Subscribed to changes within: ${app_root_1.appRootPath}`);
200
- }
201
- return resolve(server);
202
- }
203
- catch (err) {
204
- reject(err);
205
- }
206
- }));
207
- }
208
- catch (err) {
209
- reject(err);
210
- }
211
- });
212
- });
213
- }
214
- exports.startServer = startServer;
215
- function stopServer() {
216
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
217
- return new Promise((resolve, reject) => {
218
- server.close((err) => {
219
- if (err) {
220
- /**
221
- * If the server is running in a detached background process then server.close()
222
- * will throw this error even if server is actually alive. We therefore only reject
223
- * in case of any other unexpected errors.
224
- */
225
- if (!err.message.startsWith('Server is not running')) {
226
- return reject(err);
227
- }
228
- }
229
- (0, socket_utils_1.killSocketOrPath)();
230
- return resolve();
231
- });
232
- });
233
- });
234
- }
235
- exports.stopServer = stopServer;
236
- //# sourceMappingURL=server.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../../../../../../../packages/workspace/src/core/project-graph/daemon/server/server.ts"],"names":[],"mappings":";;;;AAAA,oDAAoD;AACpD,6BAAmD;AACnD,+BAA4B;AAC5B,2CAA8D;AAC9D,kDAKyB;AACzB,qCAAwC;AACxC,qDAI0B;AAC1B,uCAKmB;AACnB,uGAGmD;AACnD,2BAA0C;AAC1C,+DAA2D;AAC3D,6EAAgF;AAEhF,SAAS,eAAe,CAAC,MAAc,EAAE,OAAe;IACtD,OAAO,IAAI,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACzB,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE;YACzB,gGAAgG;YAChG,MAAM,CAAC,GAAG,EAAE,CAAC;Y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DAAkD;wBAClD,eAAe,EAAE,CAAC;wBAElB,IAAI,CAAC,mBAAmB,EAAE;4BACxB,mBAAmB,GAAG,MAAM,IAAA,qCAA2B,EACrD,MAAM,EACN,sBAAsB,CACvB,CAAC;4BACF,qBAAY,CAAC,UAAU,CACrB,iCAAiC,sBAAW,EAAE,CAC/C,CAAC;yBACH;wBACD,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;qBACxB;oBAAC,OAAO,GAAG,EAAE;wBACZ,MAAM,CAAC,GAAG,CAAC,CAAC;qBACb;gBACH,CAAC,CAAA,CAAC,CAAC;aACJ;YAAC,OAAO,GAAG,EAAE;gBACZ,MAAM,CAAC,GAAG,CAAC,CAAC;aACb;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CAAA;AAhCD,kCAgCC;AAED,SAAsB,UAAU;;QAC9B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;gBACnB,IAAI,GAAG,EAAE;oBACP;;;;uBAIG;oBACH,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,uBAAuB,CAAC,EAAE;wBACpD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;qBACpB;iBACF;gBAED,IAAA,+BAAgB,GAAE,CAAC;gBACnB,OAAO,OAAO,EAAE,CAAC;YACnB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CAAA;AAlBD,gCAkBC"}
@@ -1,12 +0,0 @@
1
- /// <reference types="node" />
2
- import type { Server } from 'net';
3
- import type { WatcherSubscription } from './watcher';
4
- export declare const SERVER_INACTIVITY_TIMEOUT_MS: 10800000;
5
- interface HandleServerProcessTerminationParams {
6
- server: Server;
7
- reason: string;
8
- watcherSubscription: WatcherSubscription | undefined;
9
- }
10
- export declare function handleServerProcessTermination({ server, reason, watcherSubscription, }: HandleServerProcessTerminationParams): Promise<void>;
11
- export declare function resetInactivityTimeout(cb: () => void): void;
12
- export {};
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resetInactivityTimeout = exports.handleServerProcessTermination = exports.SERVER_INACTIVITY_TIMEOUT_MS = void 0;
4
- const tslib_1 = require("tslib");
5
- const app_root_1 = require("nx/src/utils/app-root");
6
- const logger_1 = require("./logger");
7
- exports.SERVER_INACTIVITY_TIMEOUT_MS = 10800000; // 10800000 ms = 3 hours
8
- function handleServerProcessTermination({ server, reason, watcherSubscription, }) {
9
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
10
- try {
11
- server.close();
12
- if (watcherSubscription) {
13
- yield watcherSubscription.unsubscribe();
14
- logger_1.serverLogger.watcherLog(`Unsubscribed from changes within: ${app_root_1.appRootPath}`);
15
- }
16
- logger_1.serverLogger.log(`Server stopped because: "${reason}"`);
17
- }
18
- finally {
19
- process.exit(0);
20
- }
21
- });
22
- }
23
- exports.handleServerProcessTermination = handleServerProcessTermination;
24
- let serverInactivityTimerId;
25
- function resetInactivityTimeout(cb) {
26
- if (serverInactivityTimerId) {
27
- clearTimeout(serverInactivityTimerId);
28
- }
29
- serverInactivityTimerId = setTimeout(cb, exports.SERVER_INACTIVITY_TIMEOUT_MS);
30
- }
31
- exports.resetInactivityTimeout = resetInactivityTimeout;
32
- //# sourceMappingURL=shutdown-utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shutdown-utils.js","sourceRoot":"","sources":["../../../../../../../../packages/workspace/src/core/project-graph/daemon/server/shutdown-utils.ts"],"names":[],"mappings":";;;;AAAA,oDAAoD;AAEpD,qCAAwC;AAG3B,QAAA,4BAA4B,GAAG,QAAiB,CAAC,CAAC,wBAAwB;AAQvF,SAAsB,8BAA8B,CAAC,EACnD,MAAM,EACN,MAAM,EACN,mBAAmB,GACkB;;QACrC,IAAI;YACF,MAAM,CAAC,KAAK,EAAE,CAAC;YACf,IAAI,mBAAmB,EAAE;gBACvB,MAAM,mBAAmB,CAAC,WAAW,EAAE,CAAC;gBACxC,qBAAY,CAAC,UAAU,CACrB,qCAAqC,sBAAW,EAAE,CACnD,CAAC;aACH;YACD,qBAAY,CAAC,GAAG,CAAC,4BAA4B,MAAM,GAAG,CAAC,CAAC;SACzD;gBAAS;YACR,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACjB;IACH,CAAC;CAAA;AAjBD,wEAiBC;AAED,IAAI,uBAAmD,CAAC;AAExD,SAAgB,sBAAsB,CAAC,EAAc;IACnD,IAAI,uBAAuB,EAAE;QAC3B,YAAY,CAAC,uBAAuB,CAAC,CAAC;KACvC;IACD,uBAAuB,GAAG,UAAU,CAAC,EAAE,EAAE,oCAA4B,CAAC,CAAC;AACzE,CAAC;AALD,wDAKC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const output_1 = require("../../../../utilities/output");
5
- const server_1 = require("./server");
6
- const process = require("process");
7
- (() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
8
- try {
9
- yield (0, server_1.startServer)();
10
- }
11
- catch (err) {
12
- output_1.output.error({
13
- title: (err === null || err === void 0 ? void 0 : err.message) ||
14
- 'Something unexpected went wrong when starting the server',
15
- });
16
- process.exit(1);
17
- }
18
- }))();
19
- //# sourceMappingURL=start.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"start.js","sourceRoot":"","sources":["../../../../../../../../packages/workspace/src/core/project-graph/daemon/server/start.ts"],"names":[],"mappings":";;;AAAA,yDAAsD;AACtD,qCAAuC;AACvC,mCAAmC;AAEnC,CAAC,GAAS,EAAE;IACV,IAAI;QACF,MAAM,IAAA,oBAAW,GAAE,CAAC;KACrB;IAAC,OAAO,GAAG,EAAE;QACZ,eAAM,CAAC,KAAK,CAAC;YACX,KAAK,EACH,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO;gBACZ,0DAA0D;SAC7D,CAAC,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;AACH,CAAC,CAAA,CAAC,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const output_1 = require("../../../../utilities/output");
5
- const cache_1 = require("../cache");
6
- const server_1 = require("./server");
7
- (() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
8
- try {
9
- yield (0, server_1.stopServer)();
10
- yield (0, cache_1.safelyCleanUpExistingProcess)();
11
- }
12
- catch (err) {
13
- output_1.output.error({
14
- title: (err === null || err === void 0 ? void 0 : err.message) ||
15
- 'Something unexpected went wrong when stopping the server',
16
- });
17
- }
18
- }))();
19
- //# sourceMappingURL=stop.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stop.js","sourceRoot":"","sources":["../../../../../../../../packages/workspace/src/core/project-graph/daemon/server/stop.ts"],"names":[],"mappings":";;;AAAA,yDAAsD;AACtD,oCAAwD;AACxD,qCAAsC;AAEtC,CAAC,GAAS,EAAE;IACV,IAAI;QACF,MAAM,IAAA,mBAAU,GAAE,CAAC;QACnB,MAAM,IAAA,oCAA4B,GAAE,CAAC;KACtC;IAAC,OAAO,GAAG,EAAE;QACZ,eAAM,CAAC,KAAK,CAAC;YACX,KAAK,EACH,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO;gBACZ,0DAA0D;SAC7D,CAAC,CAAC;KACJ;AACH,CAAC,CAAA,CAAC,EAAE,CAAC"}
@@ -1,12 +0,0 @@
1
- /// <reference types="node" />
2
- import type { AsyncSubscription, Event } from '@parcel/watcher';
3
- import { Server } from 'net';
4
- export declare type WatcherSubscription = AsyncSubscription;
5
- export declare type SubscribeToWorkspaceChangesCallback = (err: Error | null, changeEvents: Event[] | null) => Promise<void>;
6
- export declare function subscribeToWorkspaceChanges(server: Server, cb: SubscribeToWorkspaceChangesCallback): Promise<AsyncSubscription>;
7
- /**
8
- * NOTE: An event type of "create" will also apply to the case where the user has restored
9
- * an original version of a file after modifying/deleting it by using git, so we adjust
10
- * our log language accordingly.
11
- */
12
- export declare function convertChangeEventsToLogMessage(changeEvents: Event[]): string;