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

Sign up to get free protection for your applications and to get access to all the features.
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,231 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildProjectGraphUsingProjectFileMap = exports.buildProjectGraph = void 0;
4
- const tslib_1 = require("tslib");
5
- const devkit_1 = require("@nrwl/devkit");
6
- const app_root_1 = require("nx/src/utils/app-root");
7
- const path_1 = require("path");
8
- const perf_hooks_1 = require("perf_hooks");
9
- const assert_workspace_validity_1 = require("../assert-workspace-validity");
10
- const file_utils_1 = require("../file-utils");
11
- const normalize_nx_json_1 = require("../normalize-nx-json");
12
- const nx_deps_cache_1 = require("../nx-deps/nx-deps-cache");
13
- const build_dependencies_1 = require("./build-dependencies");
14
- const build_nodes_1 = require("./build-nodes");
15
- const os = require("os");
16
- const build_explicit_typescript_and_package_json_dependencies_1 = require("./build-dependencies/build-explicit-typescript-and-package-json-dependencies");
17
- const nx_plugin_1 = require("nx/src/shared/nx-plugin");
18
- const file_hasher_1 = require("../hasher/file-hasher");
19
- const file_map_utils_1 = require("../file-map-utils");
20
- const typescript_1 = require("../../utilities/typescript");
21
- function buildProjectGraph() {
22
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
23
- const workspaceJson = (0, file_utils_1.readWorkspaceJson)();
24
- const { projectFileMap, allWorkspaceFiles } = (0, file_map_utils_1.createProjectFileMap)(workspaceJson, file_hasher_1.defaultFileHasher.allFileData());
25
- const cacheEnabled = process.env.NX_CACHE_PROJECT_GRAPH !== 'false';
26
- let cache = cacheEnabled ? (0, nx_deps_cache_1.readCache)() : null;
27
- return (yield buildProjectGraphUsingProjectFileMap(workspaceJson, projectFileMap, allWorkspaceFiles, cache, cacheEnabled)).projectGraph;
28
- });
29
- }
30
- exports.buildProjectGraph = buildProjectGraph;
31
- function buildProjectGraphUsingProjectFileMap(workspaceJson, projectFileMap, allWorkspaceFiles, cache, shouldWriteCache) {
32
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
33
- const nxJson = (0, file_utils_1.readNxJson)();
34
- const projectGraphVersion = '5.0';
35
- (0, assert_workspace_validity_1.assertWorkspaceValidity)(workspaceJson, nxJson);
36
- const normalizedNxJson = (0, normalize_nx_json_1.normalizeNxJson)(nxJson, Object.keys(workspaceJson.projects));
37
- const packageJsonDeps = readCombinedDeps();
38
- const rootTsConfig = readRootTsConfig();
39
- let filesToProcess;
40
- let cachedFileData;
41
- if (cache &&
42
- !(0, nx_deps_cache_1.shouldRecomputeWholeGraph)(cache, packageJsonDeps, workspaceJson, normalizedNxJson, rootTsConfig)) {
43
- const fromCache = (0, nx_deps_cache_1.extractCachedFileData)(projectFileMap, cache);
44
- filesToProcess = fromCache.filesToProcess;
45
- cachedFileData = fromCache.cachedFileData;
46
- }
47
- else {
48
- filesToProcess = projectFileMap;
49
- cachedFileData = {};
50
- }
51
- const context = createContext(workspaceJson, normalizedNxJson, projectFileMap, filesToProcess);
52
- let projectGraph = yield buildProjectGraphUsingContext(nxJson, context, cachedFileData, projectGraphVersion);
53
- const projectGraphCache = (0, nx_deps_cache_1.createCache)(nxJson, packageJsonDeps, projectGraph, rootTsConfig);
54
- if (shouldWriteCache) {
55
- (0, nx_deps_cache_1.writeCache)(projectGraphCache);
56
- }
57
- projectGraph.allWorkspaceFiles = allWorkspaceFiles;
58
- return {
59
- projectGraph,
60
- projectGraphCache,
61
- };
62
- });
63
- }
64
- exports.buildProjectGraphUsingProjectFileMap = buildProjectGraphUsingProjectFileMap;
65
- function readCombinedDeps() {
66
- const json = (0, devkit_1.readJsonFile)((0, path_1.join)(app_root_1.appRootPath, 'package.json'));
67
- return Object.assign(Object.assign({}, json.dependencies), json.devDependencies);
68
- }
69
- function buildProjectGraphUsingContext(nxJson, ctx, cachedFileData, projectGraphVersion) {
70
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
71
- perf_hooks_1.performance.mark('build project graph:start');
72
- const builder = new devkit_1.ProjectGraphBuilder();
73
- (0, build_nodes_1.buildWorkspaceProjectNodes)(ctx, builder);
74
- (0, build_nodes_1.buildNpmPackageNodes)(builder);
75
- for (const proj of Object.keys(cachedFileData)) {
76
- for (const f of builder.graph.nodes[proj].data.files) {
77
- const cached = cachedFileData[proj][f.file];
78
- if (cached && cached.deps) {
79
- f.deps = [...cached.deps];
80
- }
81
- }
82
- }
83
- yield buildExplicitDependencies(jsPluginConfig(nxJson), ctx, builder);
84
- (0, build_dependencies_1.buildImplicitProjectDependencies)(ctx, builder);
85
- builder.setVersion(projectGraphVersion);
86
- const initProjectGraph = builder.getUpdatedProjectGraph();
87
- const r = updateProjectGraphWithPlugins(ctx, initProjectGraph);
88
- perf_hooks_1.performance.mark('build project graph:end');
89
- perf_hooks_1.performance.measure('build project graph', 'build project graph:start', 'build project graph:end');
90
- return r;
91
- });
92
- }
93
- function jsPluginConfig(nxJson) {
94
- var _a, _b;
95
- return (_b = (_a = nxJson === null || nxJson === void 0 ? void 0 : nxJson.pluginsConfig) === null || _a === void 0 ? void 0 : _a['@nrwl/js']) !== null && _b !== void 0 ? _b : {};
96
- }
97
- function buildExplicitDependencies(jsPluginConfig, ctx, builder) {
98
- let totalNumOfFilesToProcess = totalNumberOfFilesToProcess(ctx);
99
- // using workers has an overhead, so we only do it when the number of
100
- // files we need to process is >= 100 and there are more than 2 CPUs
101
- // to be able to use at least 2 workers (1 worker per CPU and
102
- // 1 CPU for the main thread)
103
- if (totalNumOfFilesToProcess < 100 || getNumberOfWorkers() <= 2) {
104
- return buildExplicitDependenciesWithoutWorkers(jsPluginConfig, ctx, builder);
105
- }
106
- else {
107
- return buildExplicitDependenciesUsingWorkers(jsPluginConfig, ctx, totalNumOfFilesToProcess, builder);
108
- }
109
- }
110
- function totalNumberOfFilesToProcess(ctx) {
111
- let totalNumOfFilesToProcess = 0;
112
- Object.values(ctx.filesToProcess).forEach((t) => (totalNumOfFilesToProcess += t.length));
113
- return totalNumOfFilesToProcess;
114
- }
115
- function splitFilesIntoBins(ctx, totalNumOfFilesToProcess, numberOfWorkers) {
116
- // we want to have numberOfWorkers * 5 bins
117
- const filesPerBin = Math.round(totalNumOfFilesToProcess / numberOfWorkers / 5) + 1;
118
- const bins = [];
119
- let currentProjectFileMap = {};
120
- let currentNumberOfFiles = 0;
121
- for (const source of Object.keys(ctx.filesToProcess)) {
122
- for (const f of Object.values(ctx.filesToProcess[source])) {
123
- if (!currentProjectFileMap[source])
124
- currentProjectFileMap[source] = [];
125
- currentProjectFileMap[source].push(f);
126
- currentNumberOfFiles++;
127
- if (currentNumberOfFiles >= filesPerBin) {
128
- bins.push(currentProjectFileMap);
129
- currentProjectFileMap = {};
130
- currentNumberOfFiles = 0;
131
- }
132
- }
133
- }
134
- bins.push(currentProjectFileMap);
135
- return bins;
136
- }
137
- function createWorkerPool(numberOfWorkers) {
138
- const res = [];
139
- for (let i = 0; i < numberOfWorkers; ++i) {
140
- res.push(new (require('worker_threads').Worker)((0, path_1.join)(__dirname, './project-graph-worker.js'), {
141
- env: process.env,
142
- }));
143
- }
144
- return res;
145
- }
146
- function buildExplicitDependenciesWithoutWorkers(jsPluginConfig, ctx, builder) {
147
- (0, build_explicit_typescript_and_package_json_dependencies_1.buildExplicitTypescriptAndPackageJsonDependencies)(jsPluginConfig, ctx.workspace, builder.graph, ctx.filesToProcess).forEach((r) => {
148
- builder.addExplicitDependency(r.sourceProjectName, r.sourceProjectFile, r.targetProjectName);
149
- });
150
- }
151
- function buildExplicitDependenciesUsingWorkers(jsPluginConfig, ctx, totalNumOfFilesToProcess, builder) {
152
- const numberOfWorkers = getNumberOfWorkers();
153
- const bins = splitFilesIntoBins(ctx, totalNumOfFilesToProcess, numberOfWorkers);
154
- const workers = createWorkerPool(numberOfWorkers);
155
- let numberOfExpectedResponses = bins.length;
156
- return new Promise((res, reject) => {
157
- for (let w of workers) {
158
- w.on('message', (explicitDependencies) => {
159
- explicitDependencies.forEach((r) => {
160
- builder.addExplicitDependency(r.sourceProjectName, r.sourceProjectFile, r.targetProjectName);
161
- });
162
- if (bins.length > 0) {
163
- w.postMessage({ filesToProcess: bins.shift() });
164
- }
165
- // we processed all the bins
166
- if (--numberOfExpectedResponses === 0) {
167
- for (let w of workers) {
168
- w.terminate();
169
- }
170
- res(null);
171
- }
172
- });
173
- w.on('error', reject);
174
- w.on('exit', (code) => {
175
- if (code !== 0) {
176
- reject(new Error(`Unable to complete project graph creation. Worker stopped with exit code: ${code}`));
177
- }
178
- });
179
- w.postMessage({
180
- workspace: ctx.workspace,
181
- projectGraph: builder.graph,
182
- jsPluginConfig,
183
- });
184
- w.postMessage({ filesToProcess: bins.shift() });
185
- }
186
- });
187
- }
188
- function getNumberOfWorkers() {
189
- return process.env.NX_PROJECT_GRAPH_MAX_WORKERS
190
- ? +process.env.NX_PROJECT_GRAPH_MAX_WORKERS
191
- : os.cpus().length - 1;
192
- }
193
- function createContext(workspaceJson, nxJson, fileMap, filesToProcess) {
194
- const projects = Object.keys(workspaceJson.projects).reduce((map, projectName) => {
195
- map[projectName] = Object.assign({}, workspaceJson.projects[projectName]);
196
- return map;
197
- }, {});
198
- return {
199
- workspace: Object.assign(Object.assign(Object.assign({}, workspaceJson), nxJson), { projects }),
200
- fileMap,
201
- filesToProcess,
202
- };
203
- }
204
- function updateProjectGraphWithPlugins(context, initProjectGraph) {
205
- const plugins = (0, nx_plugin_1.loadNxPlugins)(context.workspace.plugins).filter((x) => !!x.processProjectGraph);
206
- return (plugins || []).reduce((graph, plugin) => {
207
- try {
208
- return plugin.processProjectGraph(graph, context);
209
- }
210
- catch (e) {
211
- const message = `Failed to process the project graph with "${plugin.name}". This will error in the future!`;
212
- if (process.env.NX_VERBOSE_LOGGING === 'true') {
213
- console.error(e);
214
- devkit_1.logger.error(message);
215
- return graph;
216
- }
217
- else {
218
- devkit_1.logger.warn(message);
219
- devkit_1.logger.warn(`Run with NX_VERBOSE_LOGGING=true to see the error.`);
220
- }
221
- return graph;
222
- }
223
- }, initProjectGraph);
224
- }
225
- function readRootTsConfig() {
226
- const tsConfigPath = (0, typescript_1.getRootTsConfigPath)();
227
- if (tsConfigPath) {
228
- return (0, devkit_1.readJsonFile)(tsConfigPath);
229
- }
230
- }
231
- //# sourceMappingURL=build-project-graph.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-project-graph.js","sourceRoot":"","sources":["../../../../../../packages/workspace/src/core/project-graph/build-project-graph.ts"],"names":[],"mappings":";;;;AAAA,yCAYsB;AACtB,oDAAoD;AACpD,+BAA4B;AAC5B,2CAAyC;AACzC,4EAAuE;AACvE,8CAA8D;AAC9D,4DAAuD;AACvD,4DAOkC;AAClC,6DAAwE;AACxE,+CAGuB;AACvB,yBAAyB;AACzB,0JAAiJ;AACjJ,uDAAwD;AACxD,uDAA0D;AAC1D,sDAAyD;AACzD,2DAAiE;AAEjE,SAAsB,iBAAiB;;QACrC,MAAM,aAAa,GAAG,IAAA,8BAAiB,GAAE,CAAC;QAC1C,MAAM,EAAE,cAAc,EAAE,iBAAiB,EAAE,GAAG,IAAA,qCAAoB,EAChE,aAAa,EACb,+BAAiB,CAAC,WAAW,EAAE,CAChC,CAAC;QAEF,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,sBAAsB,KAAK,OAAO,CAAC;QACpE,IAAI,KAAK,GAAG,YAAY,CAAC,CAAC,CAAC,IAAA,yBAAS,GAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QAE9C,OAAO,CACL,MAAM,oCAAoC,CACxC,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,KAAK,EACL,YAAY,CACb,CACF,CAAC,YAAY,CAAC;IACjB,CAAC;CAAA;AAnBD,8CAmBC;AAED,SAAsB,oCAAoC,CACxD,aAAyC,EACzC,cAA8B,EAC9B,iBAA6B,EAC7B,KAA+B,EAC/B,gBAAyB;;QAKzB,MAAM,MAAM,GAAG,IAAA,uBAAU,GAAE,CAAC;QAC5B,MAAM,mBAAmB,GAAG,KAAK,CAAC;QAClC,IAAA,mDAAuB,EAAC,aAAa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O,CAAC,CAAC,MAAM,CAC7D,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAC/B,CAAC;IACF,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;QAC9C,IAAI;YACF,OAAO,MAAM,CAAC,mBAAmB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;SACnD;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,OAAO,GAAG,6CAA6C,MAAM,CAAC,IAAI,mCAAmC,CAAC;YAC5G,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,KAAK,MAAM,EAAE;gBAC7C,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBACjB,eAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBACtB,OAAO,KAAK,CAAC;aACd;iBAAM;gBACL,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACrB,eAAM,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAC;aACnE;YACD,OAAO,KAAK,CAAC;SACd;IACH,CAAC,EAAE,gBAAgB,CAAC,CAAC;AACvB,CAAC;AAED,SAAS,gBAAgB;IACvB,MAAM,YAAY,GAAG,IAAA,gCAAmB,GAAE,CAAC;IAC3C,IAAI,YAAY,EAAE;QAChB,OAAO,IAAA,qBAAY,EAAC,YAAY,CAAC,CAAC;KACnC;AACH,CAAC"}
@@ -1,6 +0,0 @@
1
- export interface DaemonProcessJson {
2
- processId: number;
3
- }
4
- export declare function writeDaemonJsonProcessCache(daemonJson: DaemonProcessJson): Promise<void>;
5
- export declare function safelyCleanUpExistingProcess(): Promise<void>;
6
- export declare function getDaemonProcessId(): number | null;
@@ -1,56 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDaemonProcessId = exports.safelyCleanUpExistingProcess = exports.writeDaemonJsonProcessCache = void 0;
4
- const tslib_1 = require("tslib");
5
- const fs_extra_1 = require("fs-extra");
6
- const path_1 = require("path");
7
- const tmp_dir_1 = require("./tmp-dir");
8
- const serverProcessJsonPath = (0, path_1.join)(tmp_dir_1.DAEMON_DIR_FOR_CURRENT_WORKSPACE, 'server-process.json');
9
- function readDaemonProcessJsonCache() {
10
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
11
- if (!(0, fs_extra_1.existsSync)(serverProcessJsonPath)) {
12
- return null;
13
- }
14
- return yield (0, fs_extra_1.readJson)(serverProcessJsonPath);
15
- });
16
- }
17
- function deleteDaemonJsonProcessCache() {
18
- try {
19
- (0, fs_extra_1.unlinkSync)(serverProcessJsonPath);
20
- }
21
- catch (_a) { }
22
- }
23
- function writeDaemonJsonProcessCache(daemonJson) {
24
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
25
- yield (0, fs_extra_1.writeJson)(serverProcessJsonPath, daemonJson);
26
- });
27
- }
28
- exports.writeDaemonJsonProcessCache = writeDaemonJsonProcessCache;
29
- function safelyCleanUpExistingProcess() {
30
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
31
- const daemonProcessJson = yield readDaemonProcessJsonCache();
32
- if (daemonProcessJson && daemonProcessJson.processId) {
33
- try {
34
- process.kill(daemonProcessJson.processId);
35
- }
36
- catch (_a) { }
37
- }
38
- deleteDaemonJsonProcessCache();
39
- });
40
- }
41
- exports.safelyCleanUpExistingProcess = safelyCleanUpExistingProcess;
42
- // Must be sync for the help output use case
43
- function getDaemonProcessId() {
44
- if (!(0, fs_extra_1.existsSync)(serverProcessJsonPath)) {
45
- return null;
46
- }
47
- try {
48
- const daemonProcessJson = require(serverProcessJsonPath);
49
- return daemonProcessJson.processId;
50
- }
51
- catch (_a) {
52
- return null;
53
- }
54
- }
55
- exports.getDaemonProcessId = getDaemonProcessId;
56
- //# sourceMappingURL=cache.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cache.js","sourceRoot":"","sources":["../../../../../../../packages/workspace/src/core/project-gra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@nrwl/devkit';
3
- import { ChildProcess } from 'child_process';
4
- export declare function startInBackground(): Promise<ChildProcess['pid']>;
5
- export declare function startInCurrentProcess(): void;
6
- export declare function stop(): void;
7
- /**
8
- * As noted in the comments above the createServer() call, in order to reliably (meaning it works
9
- * cross-platform) check whether the server is available to request a project graph from we
10
- * need to actually attempt connecting to it.
11
- *
12
- * Because of the behavior of named pipes on Windows, we cannot simply treat them as a file and
13
- * check for their existence on disk (unlike with Unix Sockets).
14
- */
15
- export declare function isServerAvailable(): Promise<boolean>;
16
- /**
17
- * Establishes a client connection to the daemon server for use in project graph
18
- * creation utilities.
19
- *
20
- * All logs are performed by the devkit logger because this logic does not
21
- * run "on the server" per se and therefore does not write to its log output.
22
- *
23
- * TODO: Gracefully handle a server shutdown (for whatever reason) while a client
24
- * is connecting and querying it.
25
- */
26
- export declare function getProjectGraphFromServer(): Promise<ProjectGraph>;
@@ -1,200 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getProjectGraphFromServer = exports.isServerAvailable = exports.stop = exports.startInCurrentProcess = exports.startInBackground = void 0;
4
- const tslib_1 = require("tslib");
5
- const app_root_1 = require("nx/src/utils/app-root");
6
- const child_process_1 = require("child_process");
7
- const fs_1 = require("fs");
8
- const fs_extra_1 = require("fs-extra");
9
- const net_1 = require("net");
10
- const path_1 = require("path");
11
- const perf_hooks_1 = require("perf_hooks");
12
- const output_1 = require("../../../../utilities/output");
13
- const cache_1 = require("../cache");
14
- const socket_utils_1 = require("../socket-utils");
15
- const tmp_dir_1 = require("../tmp-dir");
16
- function startInBackground() {
17
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
18
- yield (0, cache_1.safelyCleanUpExistingProcess)();
19
- (0, fs_extra_1.ensureDirSync)(tmp_dir_1.DAEMON_DIR_FOR_CURRENT_WORKSPACE);
20
- (0, fs_extra_1.ensureFileSync)(tmp_dir_1.DAEMON_OUTPUT_LOG_FILE);
21
- const out = (0, fs_1.openSync)(tmp_dir_1.DAEMON_OUTPUT_LOG_FILE, 'a');
22
- const err = (0, fs_1.openSync)(tmp_dir_1.DAEMON_OUTPUT_LOG_FILE, 'a');
23
- const backgroundProcess = (0, child_process_1.spawn)(process.execPath, [(0, path_1.join)(__dirname, '../server/start.js')], {
24
- cwd: app_root_1.appRootPath,
25
- stdio: ['ignore', out, err],
26
- detached: true,
27
- windowsHide: true,
28
- shell: false,
29
- });
30
- backgroundProcess.unref();
31
- // Persist metadata about the background process so that it can be cleaned up later if needed
32
- yield (0, cache_1.writeDaemonJsonProcessCache)({
33
- processId: backgroundProcess.pid,
34
- });
35
- /**
36
- * Ensure the server is actually available to connect to via IPC before resolving
37
- */
38
- let attempts = 0;
39
- return new Promise((resolve, reject) => {
40
- const id = setInterval(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
41
- if (yield isServerAvailable()) {
42
- clearInterval(id);
43
- resolve(backgroundProcess.pid);
44
- }
45
- else if (attempts > 200) {
46
- // daemon fails to start, the process probably exited
47
- // we print the logs and exit the client
48
- reject(daemonProcessException('Failed to start the Nx Daemon process.'));
49
- }
50
- else {
51
- attempts++;
52
- }
53
- }), 10);
54
- });
55
- });
56
- }
57
- exports.startInBackground = startInBackground;
58
- function daemonProcessException(message) {
59
- try {
60
- let log = (0, fs_1.readFileSync)(tmp_dir_1.DAEMON_OUTPUT_LOG_FILE).toString().split('\n');
61
- if (log.length > 20) {
62
- log = log.slice(log.length - 20);
63
- }
64
- return new Error([
65
- message,
66
- 'Messages from the log:',
67
- ...log,
68
- '\n',
69
- `More information: ${tmp_dir_1.DAEMON_OUTPUT_LOG_FILE}`,
70
- ].join('\n'));
71
- }
72
- catch (e) {
73
- return new Error(message);
74
- }
75
- }
76
- function startInCurrentProcess() {
77
- output_1.output.log({
78
- title: `Daemon Server - Starting in the current process...`,
79
- });
80
- (0, child_process_1.spawnSync)(process.execPath, [(0, path_1.join)(__dirname, '../server/start.js')], {
81
- cwd: app_root_1.appRootPath,
82
- stdio: 'inherit',
83
- });
84
- }
85
- exports.startInCurrentProcess = startInCurrentProcess;
86
- function stop() {
87
- (0, child_process_1.spawnSync)(process.execPath, ['../server/stop.js'], {
88
- cwd: __dirname,
89
- stdio: 'inherit',
90
- });
91
- output_1.output.log({ title: 'Daemon Server - Stopped' });
92
- }
93
- exports.stop = stop;
94
- /**
95
- * As noted in the comments above the createServer() call, in order to reliably (meaning it works
96
- * cross-platform) check whether the server is available to request a project graph from we
97
- * need to actually attempt connecting to it.
98
- *
99
- * Because of the behavior of named pipes on Windows, we cannot simply treat them as a file and
100
- * check for their existence on disk (unlike with Unix Sockets).
101
- */
102
- function isServerAvailable() {
103
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
104
- return new Promise((resolve) => {
105
- try {
106
- const socket = (0, net_1.connect)(socket_utils_1.FULL_OS_SOCKET_PATH, () => {
107
- socket.destroy();
108
- resolve(true);
109
- });
110
- socket.once('error', () => {
111
- resolve(false);
112
- });
113
- }
114
- catch (err) {
115
- resolve(false);
116
- }
117
- });
118
- });
119
- }
120
- exports.isServerAvailable = isServerAvailable;
121
- /**
122
- * Establishes a client connection to the daemon server for use in project graph
123
- * creation utilities.
124
- *
125
- * All logs are performed by the devkit logger because this logic does not
126
- * run "on the server" per se and therefore does not write to its log output.
127
- *
128
- * TODO: Gracefully handle a server shutdown (for whatever reason) while a client
129
- * is connecting and querying it.
130
- */
131
- function getProjectGraphFromServer() {
132
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
133
- return new Promise((resolve, reject) => {
134
- perf_hooks_1.performance.mark('getProjectGraphFromServer-start');
135
- const socket = (0, net_1.connect)(socket_utils_1.FULL_OS_SOCKET_PATH);
136
- socket.on('error', (err) => {
137
- if (!err.message) {
138
- return reject(err);
139
- }
140
- if (err.message.startsWith('LOCK-FILES-CHANGED')) {
141
- return getProjectGraphFromServer().then(resolve, reject);
142
- }
143
- let error;
144
- if (err.message.startsWith('connect ENOENT')) {
145
- error = daemonProcessException('The Daemon Server is not running');
146
- }
147
- else if (err.message.startsWith('connect ECONNREFUSED')) {
148
- error = daemonProcessException(`A server instance had not been fully shut down. Please try running the command again.`);
149
- (0, socket_utils_1.killSocketOrPath)();
150
- }
151
- else if (err.message.startsWith('read ECONNRESET')) {
152
- error = daemonProcessException(`Unable to connect to the daemon process.`);
153
- }
154
- return reject(error || err);
155
- });
156
- /**
157
- * Immediately after connecting to the server we send it the known project graph creation
158
- * request payload. See the notes above createServer() for more context as to why we explicitly
159
- * request the graph from the client like this.
160
- */
161
- socket.on('connect', () => {
162
- socket.write('REQUEST_PROJECT_GRAPH_PAYLOAD');
163
- let serializedProjectGraphResult = '';
164
- socket.on('data', (data) => {
165
- serializedProjectGraphResult += data.toString();
166
- });
167
- socket.on('end', () => {
168
- try {
169
- perf_hooks_1.performance.mark('json-parse-start');
170
- const projectGraphResult = JSON.parse(serializedProjectGraphResult);
171
- perf_hooks_1.performance.mark('json-parse-end');
172
- perf_hooks_1.performance.measure('deserialize graph result on the client', 'json-parse-start', 'json-parse-end');
173
- if (projectGraphResult.error) {
174
- reject(projectGraphResult.error);
175
- }
176
- else {
177
- perf_hooks_1.performance.measure('total for getProjectGraphFromServer()', 'getProjectGraphFromServer-start', 'json-parse-end');
178
- return resolve(projectGraphResult.projectGraph);
179
- }
180
- }
181
- catch (e) {
182
- const endOfGraph = serializedProjectGraphResult.length > 300
183
- ? serializedProjectGraphResult.substring(serializedProjectGraphResult.length - 300)
184
- : serializedProjectGraphResult;
185
- reject(daemonProcessException([
186
- 'Could not deserialize project graph.',
187
- `Message: ${e.message}`,
188
- '\n',
189
- `Received:`,
190
- endOfGraph,
191
- '\n',
192
- ].join('\n')));
193
- }
194
- });
195
- });
196
- });
197
- });
198
- }
199
- exports.getProjectGraphFromServer = getProjectGraphFromServer;
200
- //# sourceMappingURL=client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../../../../packages/workspace/src/core/project-graph/daemon/client/client.ts"],"names":[],"mappings":";;;;AAC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,wBAAW,CAAC,OAAO,CACjB,uCAAuC,EACvC,iCAAiC,EACjC,gBAAgB,CACjB,CAAC;4BACF,OAAO,OAAO,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;yBACjD;qBACF;oBAAC,OAAO,CAAC,EAAE;wBACV,MAAM,UAAU,GACd,4BAA4B,CAAC,MAAM,GAAG,GAAG;4BACvC,CAAC,CAAC,4BAA4B,CAAC,SAAS,CACpC,4BAA4B,CAAC,MAAM,GAAG,GAAG,CAC1C;4BACH,CAAC,CAAC,4BAA4B,CAAC;wBACnC,MAAM,CACJ,sBAAsB,CACpB;4BACE,sCAAsC;4BACtC,YAAY,CAAC,CAAC,OAAO,EAAE;4BACvB,IAAI;4BACJ,WAAW;4BACX,UAAU;4BACV,IAAI;yBACL,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CACF,CAAC;qBACH;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CAAA;AApFD,8DAoFC"}
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const client_1 = require("./client");
5
- (() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
6
- try {
7
- console.log(yield (0, client_1.isServerAvailable)());
8
- }
9
- catch (_a) {
10
- console.log(false);
11
- }
12
- }))();
13
- //# sourceMappingURL=exec-is-server-available.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"exec-is-server-available.js","sourceRoot":"","sources":["../../../../../../../../packages/workspace/src/core/project-graph/daemon/client/exec-is-server-available.ts"],"names":[],"mappings":";;;AAAA,qCAA6C;AAE7C,CAAC,GAAS,EAAE;IACV,IAAI;QACF,OAAO,CAAC,GAAG,CAAC,MAAM,IAAA,0BAAiB,GAAE,CAAC,CAAC;KACxC;IAAC,WAAM;QACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KACpB;AACH,CAAC,CAAA,CAAC,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- export declare function generateDaemonHelpOutput(isGenerateDocsProcess?: boolean): string;
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateDaemonHelpOutput = void 0;
4
- const child_process_1 = require("child_process");
5
- const cache_1 = require("../cache");
6
- const tmp_dir_1 = require("../tmp-dir");
7
- function generateDaemonHelpOutput(isGenerateDocsProcess = false) {
8
- var _a;
9
- if (isGenerateDocsProcess) {
10
- return `The Nx Daemon is a local server which runs in the background in order to intelligently cache information about the workspace's project graph.`;
11
- }
12
- /**
13
- * A workaround for cases such as yargs output where we need to synchronously
14
- * get the value of this async operation.
15
- */
16
- const res = (0, child_process_1.spawnSync)(process.execPath, ['./exec-is-server-available.js'], {
17
- cwd: __dirname,
18
- });
19
- const isServerAvailable = ((_a = res === null || res === void 0 ? void 0 : res.stdout) === null || _a === void 0 ? void 0 : _a.toString().trim()) === 'true';
20
- if (!isServerAvailable) {
21
- return '';
22
- }
23
- const pid = (0, cache_1.getDaemonProcessId)();
24
- return `Nx Daemon is currently running:
25
- - Logs: ${tmp_dir_1.DAEMON_OUTPUT_LOG_FILE}${pid
26
- ? `
27
- - Process ID: ${pid}`
28
- : ''}`;
29
- }
30
- exports.generateDaemonHelpOutput = generateDaemonHelpOutput;
31
- //# sourceMappingURL=generate-help-output.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generate-help-output.js","sourceRoot":"","sources":["../../../../../../../../packages/workspace/src/core/project-graph/daemon/client/generate-help-output.ts"],"names":[],"mappings":";;;AAAA,iDAA0C;AAC1C,oCAA8C;AAC9C,wCAAoD;AAEpD,SAAgB,wBAAwB,CACtC,qBAAqB,GAAG,KAAK;;IAE7B,IAAI,qBAAqB,EAAE;QACzB,OAAO,+IAA+I,CAAC;KACxJ;IAED;;;OAGG;IACH,MAAM,GAAG,GAAG,IAAA,yBAAS,EAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,+BAA+B,CAAC,EAAE;QACzE,GAAG,EAAE,SAAS;KACf,CAAC,CAAC;IAEH,MAAM,iBAAiB,GAAG,CAAA,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,MAAM,0CAAE,QAAQ,GAAG,IAAI,EAAE,MAAK,MAAM,CAAC;IACpE,IAAI,CAAC,iBAAiB,EAAE;QACtB,OAAO,EAAE,CAAC;KACX;IAED,MAAM,GAAG,GAAG,IAAA,0BAAkB,GAAE,CAAC;IACjC,OAAO;YACG,gCAAsB,GAC9B,GAAG;QACD,CAAC,CAAC;kBACU,GAAG,EAAE;QACjB,CAAC,CAAC,EACN,EAAE,CAAC;AACL,CAAC;AA5BD,4DA4BC"}
@@ -1,18 +0,0 @@
1
- /**
2
- * To improve the overall readibility of the logs, we categorize things by "trigger":
3
- *
4
- * - [REQUEST] meaning that the current set of actions were triggered by a client request to the server
5
- * - [WATCHER] meaning the the current set of actions were triggered by handling changes to the workspace files
6
- *
7
- * We keep those two "triggers" left aligned at the top level and then indent subsequent logs so that there is a
8
- * logical hierarchy/grouping.
9
- */
10
- declare class ServerLogger {
11
- log(...s: unknown[]): void;
12
- requestLog(...s: unknown[]): void;
13
- watcherLog(...s: unknown[]): void;
14
- private formatLogMessage;
15
- private getNow;
16
- }
17
- export declare const serverLogger: ServerLogger;
18
- export {};