nx 19.4.3 → 19.5.0-beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (310) hide show
  1. package/bin/init-local.js +2 -3
  2. package/package.json +30 -26
  3. package/src/adapter/angular-json.js +6 -6
  4. package/src/adapter/decorate-cli.js +1 -2
  5. package/src/adapter/ngcli-adapter.js +8 -8
  6. package/src/adapter/rxjs-for-await.js +5 -5
  7. package/src/command-line/add/add.js +2 -2
  8. package/src/command-line/affected/affected.js +2 -3
  9. package/src/command-line/connect/connect-to-nx-cloud.js +5 -6
  10. package/src/command-line/connect/view-logs.js +1 -2
  11. package/src/command-line/daemon/daemon.js +1 -2
  12. package/src/command-line/exec/exec.js +1 -2
  13. package/src/command-line/format/format.js +1 -2
  14. package/src/command-line/generate/generate.js +4 -5
  15. package/src/command-line/generate/generator-utils.js +2 -3
  16. package/src/command-line/graph/command-object.js +2 -2
  17. package/src/command-line/graph/graph.js +9 -5
  18. package/src/command-line/init/implementation/add-nx-to-monorepo.js +1 -2
  19. package/src/command-line/init/implementation/add-nx-to-nest.js +1 -2
  20. package/src/command-line/init/implementation/add-nx-to-npm-repo.js +1 -2
  21. package/src/command-line/init/implementation/angular/index.js +1 -2
  22. package/src/command-line/init/implementation/angular/integrated-workspace.js +1 -2
  23. package/src/command-line/init/implementation/angular/legacy-angular-versions.js +1 -2
  24. package/src/command-line/init/implementation/angular/standalone-workspace.js +1 -2
  25. package/src/command-line/init/implementation/dot-nx/add-nx-scripts.d.ts +1 -1
  26. package/src/command-line/init/implementation/dot-nx/add-nx-scripts.js +7 -7
  27. package/src/command-line/init/implementation/react/add-craco-commands-to-package-scripts.js +1 -2
  28. package/src/command-line/init/implementation/react/add-vite-commands-to-package-scripts.js +1 -2
  29. package/src/command-line/init/implementation/react/check-for-custom-webpack-setup.js +1 -2
  30. package/src/command-line/init/implementation/react/check-for-uncommitted-changes.js +1 -2
  31. package/src/command-line/init/implementation/react/clean-up-files.js +1 -2
  32. package/src/command-line/init/implementation/react/index.js +1 -2
  33. package/src/command-line/init/implementation/react/read-name-from-package-json.js +1 -2
  34. package/src/command-line/init/implementation/react/rename-js-to-jsx.js +1 -2
  35. package/src/command-line/init/implementation/react/tsconfig-setup.js +1 -2
  36. package/src/command-line/init/implementation/react/write-craco-config.js +1 -2
  37. package/src/command-line/init/implementation/react/write-vite-config.js +1 -2
  38. package/src/command-line/init/implementation/react/write-vite-index-html.js +1 -2
  39. package/src/command-line/init/implementation/utils.js +10 -11
  40. package/src/command-line/init/init-v1.js +1 -2
  41. package/src/command-line/init/init-v2.js +1 -2
  42. package/src/command-line/list/list.js +1 -2
  43. package/src/command-line/migrate/migrate.d.ts +1 -1
  44. package/src/command-line/migrate/migrate.js +5 -5
  45. package/src/command-line/new/new.js +1 -2
  46. package/src/command-line/release/changelog.js +3 -3
  47. package/src/command-line/release/config/config.js +3 -3
  48. package/src/command-line/release/config/filter-release-groups.js +1 -2
  49. package/src/command-line/release/config/version-plans.js +3 -4
  50. package/src/command-line/release/plan.js +2 -2
  51. package/src/command-line/release/publish.js +2 -2
  52. package/src/command-line/release/release.js +2 -2
  53. package/src/command-line/release/utils/batch-projects-by-generator-config.js +1 -2
  54. package/src/command-line/release/utils/exec-command.js +1 -2
  55. package/src/command-line/release/utils/git.js +11 -12
  56. package/src/command-line/release/utils/github.js +5 -6
  57. package/src/command-line/release/utils/launch-editor.js +1 -2
  58. package/src/command-line/release/utils/markdown.js +1 -2
  59. package/src/command-line/release/utils/print-changes.d.ts +0 -1
  60. package/src/command-line/release/utils/print-changes.js +2 -3
  61. package/src/command-line/release/utils/resolve-changelog-renderer.js +1 -2
  62. package/src/command-line/release/utils/resolve-nx-json-error-message.js +1 -2
  63. package/src/command-line/release/utils/resolve-semver-specifier.js +2 -3
  64. package/src/command-line/release/utils/semver.js +4 -5
  65. package/src/command-line/release/utils/shared.js +6 -6
  66. package/src/command-line/release/version.js +2 -2
  67. package/src/command-line/repair/repair.js +1 -2
  68. package/src/command-line/report/report.js +7 -7
  69. package/src/command-line/reset/reset.js +1 -2
  70. package/src/command-line/run/executor-utils.js +2 -3
  71. package/src/command-line/run/run-one.js +1 -2
  72. package/src/command-line/run/run.js +5 -6
  73. package/src/command-line/run-many/run-many.js +2 -3
  74. package/src/command-line/show/project.js +1 -2
  75. package/src/command-line/show/projects.js +1 -2
  76. package/src/command-line/watch/watch.js +8 -2
  77. package/src/command-line/yargs-utils/documentation.js +1 -2
  78. package/src/command-line/yargs-utils/shared-options.js +12 -13
  79. package/src/commands-runner/create-command-graph.js +1 -2
  80. package/src/commands-runner/get-command-projects.js +1 -2
  81. package/src/config/calculate-default-project-name.js +2 -3
  82. package/src/config/configuration.js +2 -2
  83. package/src/config/nx-json.js +2 -3
  84. package/src/config/project-graph.js +3 -3
  85. package/src/config/schema-utils.js +3 -4
  86. package/src/config/to-project-name.js +1 -2
  87. package/src/core/graph/main.js +1 -1
  88. package/src/daemon/cache.js +6 -6
  89. package/src/daemon/client/client.d.ts +1 -2
  90. package/src/daemon/client/client.js +13 -1
  91. package/src/daemon/client/daemon-socket-messenger.d.ts +0 -1
  92. package/src/daemon/client/generate-help-output.js +1 -2
  93. package/src/daemon/is-on-daemon.js +1 -2
  94. package/src/daemon/message-types/get-context-file-data.js +2 -2
  95. package/src/daemon/message-types/get-files-in-directory.js +2 -2
  96. package/src/daemon/message-types/get-nx-workspace-files.js +2 -2
  97. package/src/daemon/message-types/glob.js +2 -2
  98. package/src/daemon/message-types/hash-glob.js +2 -2
  99. package/src/daemon/message-types/task-history.js +3 -3
  100. package/src/daemon/message-types/update-context-files.js +2 -2
  101. package/src/daemon/server/file-watching/changed-projects.js +1 -2
  102. package/src/daemon/server/file-watching/file-watcher-sockets.d.ts +0 -1
  103. package/src/daemon/server/file-watching/file-watcher-sockets.js +4 -4
  104. package/src/daemon/server/handle-context-file-data.js +1 -2
  105. package/src/daemon/server/handle-get-files-in-directory.js +1 -2
  106. package/src/daemon/server/handle-get-task-history.js +1 -2
  107. package/src/daemon/server/handle-glob.js +1 -2
  108. package/src/daemon/server/handle-hash-glob.js +1 -2
  109. package/src/daemon/server/handle-hash-tasks.js +1 -2
  110. package/src/daemon/server/handle-nx-workspace-files.js +1 -2
  111. package/src/daemon/server/handle-outputs-tracking.js +2 -3
  112. package/src/daemon/server/handle-process-in-background.js +1 -2
  113. package/src/daemon/server/handle-request-project-graph.js +1 -2
  114. package/src/daemon/server/handle-request-shutdown.d.ts +0 -1
  115. package/src/daemon/server/handle-request-shutdown.js +1 -2
  116. package/src/daemon/server/handle-write-task-runs-to-history.js +1 -2
  117. package/src/daemon/server/outputs-tracking.js +7 -8
  118. package/src/daemon/server/plugins.js +2 -3
  119. package/src/daemon/server/project-graph-incremental-recomputation.js +3 -3
  120. package/src/daemon/server/server.d.ts +0 -1
  121. package/src/daemon/server/server.js +2 -3
  122. package/src/daemon/server/shutdown-utils.d.ts +0 -1
  123. package/src/daemon/server/shutdown-utils.js +9 -9
  124. package/src/daemon/server/watcher.d.ts +0 -1
  125. package/src/daemon/server/watcher.js +3 -4
  126. package/src/daemon/socket-utils.js +3 -3
  127. package/src/daemon/tmp-dir.js +6 -6
  128. package/src/devkit-exports.d.ts +1 -0
  129. package/src/devkit-exports.js +3 -1
  130. package/src/executors/noop/noop.impl.js +1 -1
  131. package/src/executors/run-commands/run-commands.impl.js +3 -3
  132. package/src/executors/run-script/run-script.impl.js +1 -1
  133. package/src/executors/utils/convert-nx-executor.js +1 -2
  134. package/src/generators/internal-utils/format-changed-files-with-prettier-if-available.js +1 -2
  135. package/src/generators/testing-utils/create-tree-with-empty-workspace.d.ts +1 -1
  136. package/src/generators/testing-utils/create-tree-with-empty-workspace.js +2 -3
  137. package/src/generators/testing-utils/create-tree.js +1 -2
  138. package/src/generators/tree.d.ts +0 -2
  139. package/src/generators/tree.js +3 -3
  140. package/src/generators/utils/glob.js +2 -3
  141. package/src/generators/utils/json.js +3 -4
  142. package/src/generators/utils/nx-json.js +2 -3
  143. package/src/generators/utils/project-configuration.js +7 -7
  144. package/src/hasher/create-task-hasher.js +1 -2
  145. package/src/hasher/file-hasher.js +2 -3
  146. package/src/hasher/hash-task.d.ts +0 -1
  147. package/src/hasher/hash-task.js +2 -3
  148. package/src/hasher/native-task-hasher-impl.d.ts +0 -1
  149. package/src/hasher/node-task-hasher-impl.d.ts +0 -1
  150. package/src/hasher/task-hasher.d.ts +0 -1
  151. package/src/hasher/task-hasher.js +10 -10
  152. package/src/migrations/update-15-0-0/migrate-to-inputs.js +1 -1
  153. package/src/migrations/update-15-0-0/prefix-outputs.js +1 -1
  154. package/src/migrations/update-16-0-0/remove-nrwl-cli.js +1 -1
  155. package/src/migrations/update-16-0-0/update-depends-on-to-tokens.js +1 -1
  156. package/src/migrations/update-16-0-0/update-nx-cloud-runner.js +1 -1
  157. package/src/migrations/update-16-2-0/remove-run-commands-output-path.js +1 -1
  158. package/src/migrations/update-16-8-0/escape-dollar-sign-env-variables.js +1 -1
  159. package/src/migrations/update-16-9-0/remove-project-name-and-root-format.js +1 -1
  160. package/src/migrations/update-17-0-0/move-cache-directory.js +1 -1
  161. package/src/migrations/update-17-0-0/rm-default-collection-npm-scope.js +1 -1
  162. package/src/migrations/update-17-0-0/use-minimal-config-for-tasks-runner-options.js +1 -1
  163. package/src/migrations/update-17-2-0/move-default-base.js +1 -1
  164. package/src/migrations/update-17-3-0/nx-release-path.js +2 -3
  165. package/src/migrations/update-17-3-0/update-nxw.js +1 -1
  166. package/src/migrations/update-18-0-0/disable-crystal-for-existing-workspaces.js +1 -1
  167. package/src/migrations/update-19-2-0/move-workspace-data-directory.js +3 -4
  168. package/src/migrations/update-19-2-4/set-project-name.js +1 -1
  169. package/src/native/assert-supported-platform.js +1 -2
  170. package/src/native/browser.js +1 -0
  171. package/src/native/index.d.ts +178 -138
  172. package/src/native/index.js +16 -0
  173. package/src/native/native-bindings.js +352 -238
  174. package/src/native/native-file-cache-location.js +1 -2
  175. package/src/native/nx.wasi-browser.js +108 -0
  176. package/src/native/nx.wasi.cjs +139 -0
  177. package/src/native/nx.wasm32-wasi.wasm +0 -0
  178. package/src/native/transform-objects.js +1 -2
  179. package/src/native/wasi-worker-browser.mjs +32 -0
  180. package/src/native/wasi-worker.mjs +63 -0
  181. package/src/nx-cloud/debug-logger.js +1 -2
  182. package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +1 -2
  183. package/src/nx-cloud/resolution-helpers.js +1 -2
  184. package/src/nx-cloud/update-manager.js +2 -2
  185. package/src/nx-cloud/utilities/axios.js +1 -2
  186. package/src/nx-cloud/utilities/get-cloud-options.js +1 -2
  187. package/src/nx-cloud/utilities/url-shorten.js +8 -9
  188. package/src/plugins/js/hasher/hasher.js +1 -2
  189. package/src/plugins/js/lock-file/lock-file.js +6 -6
  190. package/src/plugins/js/lock-file/npm-parser.js +3 -4
  191. package/src/plugins/js/lock-file/pnpm-parser.js +3 -4
  192. package/src/plugins/js/lock-file/project-graph-pruning.js +1 -2
  193. package/src/plugins/js/lock-file/utils/package-json.js +2 -3
  194. package/src/plugins/js/lock-file/utils/pnpm-normalizer.js +5 -6
  195. package/src/plugins/js/lock-file/yarn-parser.js +3 -4
  196. package/src/plugins/js/package-json/create-package-json.js +2 -3
  197. package/src/plugins/js/project-graph/build-dependencies/build-dependencies.js +1 -2
  198. package/src/plugins/js/project-graph/build-dependencies/explicit-package-json-dependencies.js +1 -2
  199. package/src/plugins/js/project-graph/build-dependencies/explicit-project-dependencies.js +1 -2
  200. package/src/plugins/js/project-graph/build-dependencies/strip-source-code.js +1 -2
  201. package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +2 -2
  202. package/src/plugins/js/project-graph/build-nodes/build-npm-package-nodes.js +1 -2
  203. package/src/plugins/js/utils/config.js +1 -2
  204. package/src/plugins/js/utils/register.d.ts +1 -0
  205. package/src/plugins/js/utils/register.js +7 -8
  206. package/src/plugins/js/utils/resolve-relative-to-dir.js +1 -2
  207. package/src/plugins/js/utils/typescript.js +5 -6
  208. package/src/plugins/js/versions.d.ts +1 -1
  209. package/src/plugins/js/versions.js +1 -1
  210. package/src/plugins/package-json-workspaces/create-nodes.js +5 -5
  211. package/src/plugins/project-json/build-nodes/project-json.js +3 -3
  212. package/src/project-graph/affected/affected-project-graph.js +1 -2
  213. package/src/project-graph/build-project-graph.js +3 -4
  214. package/src/project-graph/error-types.js +11 -11
  215. package/src/project-graph/file-map-utils.js +4 -5
  216. package/src/project-graph/file-utils.d.ts +1 -1
  217. package/src/project-graph/file-utils.js +7 -7
  218. package/src/project-graph/nx-deps-cache.js +8 -8
  219. package/src/project-graph/operators.js +5 -5
  220. package/src/project-graph/plugins/internal-api.js +4 -5
  221. package/src/project-graph/plugins/isolation/index.js +1 -2
  222. package/src/project-graph/plugins/isolation/messaging.d.ts +0 -2
  223. package/src/project-graph/plugins/isolation/messaging.js +4 -5
  224. package/src/project-graph/plugins/isolation/plugin-pool.js +1 -2
  225. package/src/project-graph/plugins/loader.js +7 -7
  226. package/src/project-graph/plugins/utils.js +4 -5
  227. package/src/project-graph/project-graph-builder.js +2 -2
  228. package/src/project-graph/project-graph.js +7 -8
  229. package/src/project-graph/utils/build-all-workspace-files.js +1 -2
  230. package/src/project-graph/utils/find-project-for-path.js +4 -5
  231. package/src/project-graph/utils/implicit-project-dependencies.js +1 -2
  232. package/src/project-graph/utils/normalize-project-nodes.js +2 -3
  233. package/src/project-graph/utils/project-configuration-utils.d.ts +8 -6
  234. package/src/project-graph/utils/project-configuration-utils.js +118 -54
  235. package/src/project-graph/utils/retrieve-workspace-files.d.ts +3 -3
  236. package/src/project-graph/utils/retrieve-workspace-files.js +6 -7
  237. package/src/tasks-runner/create-task-graph.js +3 -3
  238. package/src/tasks-runner/forked-process-task-runner.d.ts +0 -1
  239. package/src/tasks-runner/init-tasks-runner.js +1 -2
  240. package/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.js +1 -2
  241. package/src/tasks-runner/life-cycles/dynamic-run-one-terminal-output-life-cycle.js +1 -2
  242. package/src/tasks-runner/life-cycles/formatting-utils.js +2 -3
  243. package/src/tasks-runner/life-cycles/pretty-time.js +1 -2
  244. package/src/tasks-runner/life-cycles/view-logs-utils.js +1 -2
  245. package/src/tasks-runner/pseudo-ipc.d.ts +0 -1
  246. package/src/tasks-runner/pseudo-terminal.d.ts +0 -1
  247. package/src/tasks-runner/pseudo-terminal.js +5 -2
  248. package/src/tasks-runner/run-command.js +4 -5
  249. package/src/tasks-runner/task-env.d.ts +0 -1
  250. package/src/tasks-runner/task-env.js +5 -6
  251. package/src/tasks-runner/task-graph-utils.js +2 -3
  252. package/src/tasks-runner/utils.js +25 -26
  253. package/src/utils/ab-testing.js +2 -2
  254. package/src/utils/all-file-data.js +1 -2
  255. package/src/utils/assert-workspace-validity.js +1 -2
  256. package/src/utils/async-iterator.js +2 -3
  257. package/src/utils/cache-directory.js +2 -2
  258. package/src/utils/child-process.d.ts +0 -1
  259. package/src/utils/child-process.js +3 -3
  260. package/src/utils/chunkify.js +1 -2
  261. package/src/utils/code-frames.js +1 -2
  262. package/src/utils/collapse-expanded-outputs.js +1 -2
  263. package/src/utils/command-line-utils.js +5 -6
  264. package/src/utils/consume-messages-from-socket.js +1 -2
  265. package/src/utils/default-base.js +1 -2
  266. package/src/utils/dotenv.js +1 -2
  267. package/src/utils/exit-codes.d.ts +0 -1
  268. package/src/utils/exit-codes.js +1 -2
  269. package/src/utils/fileutils.d.ts +0 -1
  270. package/src/utils/fileutils.js +9 -10
  271. package/src/utils/find-matching-projects.js +2 -2
  272. package/src/utils/find-workspace-root.js +1 -2
  273. package/src/utils/get-package-name-from-import-path.js +1 -2
  274. package/src/utils/git-utils.js +4 -5
  275. package/src/utils/globs.js +1 -2
  276. package/src/utils/ignore.js +4 -4
  277. package/src/utils/installation-directory.js +2 -3
  278. package/src/utils/is-ci.js +1 -2
  279. package/src/utils/json-diff.js +5 -5
  280. package/src/utils/json.js +3 -3
  281. package/src/utils/logger.js +2 -2
  282. package/src/utils/nx-cloud-utils.js +3 -4
  283. package/src/utils/nx-plugin.deprecated.js +1 -4
  284. package/src/utils/object-sort.js +1 -2
  285. package/src/utils/package-json.js +8 -9
  286. package/src/utils/package-manager.js +13 -14
  287. package/src/utils/params.js +14 -14
  288. package/src/utils/path.js +3 -4
  289. package/src/utils/plugins/community-plugins.js +1 -2
  290. package/src/utils/plugins/core-plugins.js +2 -3
  291. package/src/utils/plugins/installed-plugins.js +3 -4
  292. package/src/utils/plugins/local-plugins.js +2 -3
  293. package/src/utils/plugins/plugin-capabilities.js +2 -3
  294. package/src/utils/plugins/shared.js +1 -2
  295. package/src/utils/print-help.js +1 -2
  296. package/src/utils/project-graph-utils.js +4 -5
  297. package/src/utils/serializable-error.js +1 -2
  298. package/src/utils/serialize-overrides-into-command-line.js +1 -2
  299. package/src/utils/serialize-target.js +1 -2
  300. package/src/utils/split-target.js +2 -3
  301. package/src/utils/strip-indents.js +1 -2
  302. package/src/utils/task-history.js +3 -3
  303. package/src/utils/update-nxw.js +1 -2
  304. package/src/utils/workspace-configuration-check.js +1 -2
  305. package/src/utils/workspace-context.js +10 -11
  306. package/src/utils/workspace-root.js +3 -3
  307. package/src/plugins/target-defaults/symbols.d.ts +0 -17
  308. package/src/plugins/target-defaults/symbols.js +0 -20
  309. package/src/plugins/target-defaults/target-defaults-plugin.d.ts +0 -121
  310. package/src/plugins/target-defaults/target-defaults-plugin.js +0 -176
@@ -0,0 +1,108 @@
1
+ import {
2
+ instantiateNapiModuleSync as __emnapiInstantiateNapiModuleSync,
3
+ getDefaultContext as __emnapiGetDefaultContext,
4
+ WASI as __WASI,
5
+ createOnMessage as __wasmCreateOnMessageForFsProxy,
6
+ } from '@napi-rs/wasm-runtime'
7
+
8
+ import __wasmUrl from './nx.wasm32-wasi.wasm?url'
9
+
10
+ const __wasi = new __WASI({
11
+ version: 'preview1',
12
+ })
13
+
14
+ const __emnapiContext = __emnapiGetDefaultContext()
15
+
16
+ const __sharedMemory = new WebAssembly.Memory({
17
+ initial: 16384,
18
+ maximum: 32768,
19
+ shared: true,
20
+ })
21
+
22
+ const __wasmFile = await fetch(__wasmUrl).then((res) => res.arrayBuffer())
23
+
24
+ const {
25
+ instance: __napiInstance,
26
+ module: __wasiModule,
27
+ napiModule: __napiModule,
28
+ } = __emnapiInstantiateNapiModuleSync(__wasmFile, {
29
+ context: __emnapiContext,
30
+ asyncWorkPoolSize: 4,
31
+ wasi: __wasi,
32
+ onCreateWorker() {
33
+ const worker = new Worker(new URL('./wasi-worker-browser.mjs', import.meta.url), {
34
+ type: 'module',
35
+ })
36
+
37
+ return worker
38
+ },
39
+ overwriteImports(importObject) {
40
+ importObject.env = {
41
+ ...importObject.env,
42
+ ...importObject.napi,
43
+ ...importObject.emnapi,
44
+ memory: __sharedMemory,
45
+ }
46
+ return importObject
47
+ },
48
+ beforeInit({ instance }) {
49
+ __napi_rs_initialize_modules(instance)
50
+ },
51
+ })
52
+
53
+ function __napi_rs_initialize_modules(__napiInstance) {
54
+ __napiInstance.exports['__napi_register__expand_outputs_0']?.()
55
+ __napiInstance.exports['__napi_register__get_files_for_outputs_1']?.()
56
+ __napiInstance.exports['__napi_register__remove_2']?.()
57
+ __napiInstance.exports['__napi_register__copy_3']?.()
58
+ __napiInstance.exports['__napi_register__hash_array_4']?.()
59
+ __napiInstance.exports['__napi_register__hash_file_5']?.()
60
+ __napiInstance.exports['__napi_register__ImportResult_struct_6']?.()
61
+ __napiInstance.exports['__napi_register__find_imports_7']?.()
62
+ __napiInstance.exports['__napi_register__transfer_project_graph_8']?.()
63
+ __napiInstance.exports['__napi_register__ExternalNode_struct_9']?.()
64
+ __napiInstance.exports['__napi_register__Target_struct_10']?.()
65
+ __napiInstance.exports['__napi_register__Project_struct_11']?.()
66
+ __napiInstance.exports['__napi_register__ProjectGraph_struct_12']?.()
67
+ __napiInstance.exports['__napi_register__HashPlanner_struct_13']?.()
68
+ __napiInstance.exports['__napi_register__HashPlanner_impl_17']?.()
69
+ __napiInstance.exports['__napi_register__HashDetails_struct_18']?.()
70
+ __napiInstance.exports['__napi_register__HasherOptions_struct_19']?.()
71
+ __napiInstance.exports['__napi_register__TaskHasher_struct_20']?.()
72
+ __napiInstance.exports['__napi_register__TaskHasher_impl_23']?.()
73
+ __napiInstance.exports['__napi_register__Task_struct_24']?.()
74
+ __napiInstance.exports['__napi_register__TaskTarget_struct_25']?.()
75
+ __napiInstance.exports['__napi_register__TaskGraph_struct_26']?.()
76
+ __napiInstance.exports['__napi_register__FileData_struct_27']?.()
77
+ __napiInstance.exports['__napi_register__InputsInput_struct_28']?.()
78
+ __napiInstance.exports['__napi_register__FileSetInput_struct_29']?.()
79
+ __napiInstance.exports['__napi_register__RuntimeInput_struct_30']?.()
80
+ __napiInstance.exports['__napi_register__EnvironmentInput_struct_31']?.()
81
+ __napiInstance.exports['__napi_register__ExternalDependenciesInput_struct_32']?.()
82
+ __napiInstance.exports['__napi_register__DepsOutputsInput_struct_33']?.()
83
+ __napiInstance.exports['__napi_register__NxJson_struct_34']?.()
84
+ __napiInstance.exports['__napi_register__WorkspaceContext_struct_35']?.()
85
+ __napiInstance.exports['__napi_register__WorkspaceContext_impl_44']?.()
86
+ __napiInstance.exports['__napi_register__WorkspaceErrors_45']?.()
87
+ __napiInstance.exports['__napi_register__NxWorkspaceFiles_struct_46']?.()
88
+ __napiInstance.exports['__napi_register__NxWorkspaceFilesExternals_struct_47']?.()
89
+ __napiInstance.exports['__napi_register__UpdatedWorkspaceFiles_struct_48']?.()
90
+ __napiInstance.exports['__napi_register__FileMap_struct_49']?.()
91
+ __napiInstance.exports['__napi_register____test_only_transfer_file_map_50']?.()
92
+ __napiInstance.exports['__napi_register__IS_WASM_51']?.()
93
+ }
94
+ export const HashPlanner = __napiModule.exports.HashPlanner
95
+ export const ImportResult = __napiModule.exports.ImportResult
96
+ export const TaskHasher = __napiModule.exports.TaskHasher
97
+ export const WorkspaceContext = __napiModule.exports.WorkspaceContext
98
+ export const copy = __napiModule.exports.copy
99
+ export const expandOutputs = __napiModule.exports.expandOutputs
100
+ export const findImports = __napiModule.exports.findImports
101
+ export const getFilesForOutputs = __napiModule.exports.getFilesForOutputs
102
+ export const hashArray = __napiModule.exports.hashArray
103
+ export const hashFile = __napiModule.exports.hashFile
104
+ export const IS_WASM = __napiModule.exports.IS_WASM
105
+ export const remove = __napiModule.exports.remove
106
+ export const testOnlyTransferFileMap = __napiModule.exports.testOnlyTransferFileMap
107
+ export const transferProjectGraph = __napiModule.exports.transferProjectGraph
108
+ export const WorkspaceErrors = __napiModule.exports.WorkspaceErrors
@@ -0,0 +1,139 @@
1
+ /* eslint-disable */
2
+ /* prettier-ignore */
3
+
4
+ /* auto-generated by NAPI-RS */
5
+
6
+ const __nodeFs = require('node:fs')
7
+ const __nodePath = require('node:path')
8
+ const { WASI: __nodeWASI } = require('node:wasi')
9
+ const { Worker } = require('node:worker_threads')
10
+
11
+ const {
12
+ instantiateNapiModuleSync: __emnapiInstantiateNapiModuleSync,
13
+ getDefaultContext: __emnapiGetDefaultContext,
14
+ createOnMessage: __wasmCreateOnMessageForFsProxy,
15
+ } = require('@napi-rs/wasm-runtime')
16
+
17
+ const __rootDir = __nodePath.parse(process.cwd()).root
18
+
19
+ const __wasi = new __nodeWASI({
20
+ version: 'preview1',
21
+ env: process.env,
22
+ preopens: {
23
+ [__rootDir]: __rootDir,
24
+ }
25
+ })
26
+
27
+ const __emnapiContext = __emnapiGetDefaultContext()
28
+
29
+ const __sharedMemory = new WebAssembly.Memory({
30
+ initial: 16384,
31
+ maximum: 32768,
32
+ shared: true,
33
+ })
34
+
35
+ let __wasmFilePath = __nodePath.join(__dirname, 'nx.wasm32-wasi.wasm')
36
+ const __wasmDebugFilePath = __nodePath.join(__dirname, 'nx.wasm32-wasi.debug.wasm')
37
+
38
+ if (__nodeFs.existsSync(__wasmDebugFilePath)) {
39
+ __wasmFilePath = __wasmDebugFilePath
40
+ } else if (!__nodeFs.existsSync(__wasmFilePath)) {
41
+ try {
42
+ __wasmFilePath = __nodePath.resolve('@nx/nx-wasm32-wasi')
43
+ } catch {
44
+ throw new Error('Cannot find nx.wasm32-wasi.wasm file, and @nx/nx-wasm32-wasi package is not installed.')
45
+ }
46
+ }
47
+
48
+ const { instance: __napiInstance, module: __wasiModule, napiModule: __napiModule } = __emnapiInstantiateNapiModuleSync(__nodeFs.readFileSync(__wasmFilePath), {
49
+ context: __emnapiContext,
50
+ asyncWorkPoolSize: (function() {
51
+ const threadsSizeFromEnv = Number(process.env.NAPI_RS_ASYNC_WORK_POOL_SIZE ?? process.env.UV_THREADPOOL_SIZE)
52
+ // NaN > 0 is false
53
+ if (threadsSizeFromEnv > 0) {
54
+ return threadsSizeFromEnv
55
+ } else {
56
+ return 4
57
+ }
58
+ })(),
59
+ wasi: __wasi,
60
+ onCreateWorker() {
61
+ const worker = new Worker(__nodePath.join(__dirname, 'wasi-worker.mjs'), {
62
+ env: process.env,
63
+ execArgv: ['--experimental-wasi-unstable-preview1'],
64
+ })
65
+ worker.onmessage = ({ data }) => {
66
+ __wasmCreateOnMessageForFsProxy(__nodeFs)(data)
67
+ }
68
+ return worker
69
+ },
70
+ overwriteImports(importObject) {
71
+ importObject.env = {
72
+ ...importObject.env,
73
+ ...importObject.napi,
74
+ ...importObject.emnapi,
75
+ memory: __sharedMemory,
76
+ }
77
+ return importObject
78
+ },
79
+ beforeInit({ instance }) {
80
+ __napi_rs_initialize_modules(instance)
81
+ }
82
+ })
83
+
84
+ function __napi_rs_initialize_modules(__napiInstance) {
85
+ __napiInstance.exports['__napi_register__expand_outputs_0']?.()
86
+ __napiInstance.exports['__napi_register__get_files_for_outputs_1']?.()
87
+ __napiInstance.exports['__napi_register__remove_2']?.()
88
+ __napiInstance.exports['__napi_register__copy_3']?.()
89
+ __napiInstance.exports['__napi_register__hash_array_4']?.()
90
+ __napiInstance.exports['__napi_register__hash_file_5']?.()
91
+ __napiInstance.exports['__napi_register__ImportResult_struct_6']?.()
92
+ __napiInstance.exports['__napi_register__find_imports_7']?.()
93
+ __napiInstance.exports['__napi_register__transfer_project_graph_8']?.()
94
+ __napiInstance.exports['__napi_register__ExternalNode_struct_9']?.()
95
+ __napiInstance.exports['__napi_register__Target_struct_10']?.()
96
+ __napiInstance.exports['__napi_register__Project_struct_11']?.()
97
+ __napiInstance.exports['__napi_register__ProjectGraph_struct_12']?.()
98
+ __napiInstance.exports['__napi_register__HashPlanner_struct_13']?.()
99
+ __napiInstance.exports['__napi_register__HashPlanner_impl_17']?.()
100
+ __napiInstance.exports['__napi_register__HashDetails_struct_18']?.()
101
+ __napiInstance.exports['__napi_register__HasherOptions_struct_19']?.()
102
+ __napiInstance.exports['__napi_register__TaskHasher_struct_20']?.()
103
+ __napiInstance.exports['__napi_register__TaskHasher_impl_23']?.()
104
+ __napiInstance.exports['__napi_register__Task_struct_24']?.()
105
+ __napiInstance.exports['__napi_register__TaskTarget_struct_25']?.()
106
+ __napiInstance.exports['__napi_register__TaskGraph_struct_26']?.()
107
+ __napiInstance.exports['__napi_register__FileData_struct_27']?.()
108
+ __napiInstance.exports['__napi_register__InputsInput_struct_28']?.()
109
+ __napiInstance.exports['__napi_register__FileSetInput_struct_29']?.()
110
+ __napiInstance.exports['__napi_register__RuntimeInput_struct_30']?.()
111
+ __napiInstance.exports['__napi_register__EnvironmentInput_struct_31']?.()
112
+ __napiInstance.exports['__napi_register__ExternalDependenciesInput_struct_32']?.()
113
+ __napiInstance.exports['__napi_register__DepsOutputsInput_struct_33']?.()
114
+ __napiInstance.exports['__napi_register__NxJson_struct_34']?.()
115
+ __napiInstance.exports['__napi_register__WorkspaceContext_struct_35']?.()
116
+ __napiInstance.exports['__napi_register__WorkspaceContext_impl_44']?.()
117
+ __napiInstance.exports['__napi_register__WorkspaceErrors_45']?.()
118
+ __napiInstance.exports['__napi_register__NxWorkspaceFiles_struct_46']?.()
119
+ __napiInstance.exports['__napi_register__NxWorkspaceFilesExternals_struct_47']?.()
120
+ __napiInstance.exports['__napi_register__UpdatedWorkspaceFiles_struct_48']?.()
121
+ __napiInstance.exports['__napi_register__FileMap_struct_49']?.()
122
+ __napiInstance.exports['__napi_register____test_only_transfer_file_map_50']?.()
123
+ __napiInstance.exports['__napi_register__IS_WASM_51']?.()
124
+ }
125
+ module.exports.HashPlanner = __napiModule.exports.HashPlanner
126
+ module.exports.ImportResult = __napiModule.exports.ImportResult
127
+ module.exports.TaskHasher = __napiModule.exports.TaskHasher
128
+ module.exports.WorkspaceContext = __napiModule.exports.WorkspaceContext
129
+ module.exports.copy = __napiModule.exports.copy
130
+ module.exports.expandOutputs = __napiModule.exports.expandOutputs
131
+ module.exports.findImports = __napiModule.exports.findImports
132
+ module.exports.getFilesForOutputs = __napiModule.exports.getFilesForOutputs
133
+ module.exports.hashArray = __napiModule.exports.hashArray
134
+ module.exports.hashFile = __napiModule.exports.hashFile
135
+ module.exports.IS_WASM = __napiModule.exports.IS_WASM
136
+ module.exports.remove = __napiModule.exports.remove
137
+ module.exports.testOnlyTransferFileMap = __napiModule.exports.testOnlyTransferFileMap
138
+ module.exports.transferProjectGraph = __napiModule.exports.transferProjectGraph
139
+ module.exports.WorkspaceErrors = __napiModule.exports.WorkspaceErrors
Binary file
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.transformProjectGraphForRust = void 0;
3
+ exports.transformProjectGraphForRust = transformProjectGraphForRust;
4
4
  function transformProjectGraphForRust(graph) {
5
5
  const dependencies = {};
6
6
  const nodes = {};
@@ -48,4 +48,3 @@ function transformProjectGraphForRust(graph) {
48
48
  dependencies,
49
49
  };
50
50
  }
51
- exports.transformProjectGraphForRust = transformProjectGraphForRust;
@@ -0,0 +1,32 @@
1
+ import { instantiateNapiModuleSync, MessageHandler, WASI } from '@napi-rs/wasm-runtime'
2
+
3
+ const handler = new MessageHandler({
4
+ onLoad({ wasmModule, wasmMemory }) {
5
+ const wasi = new WASI({
6
+ print: function () {
7
+ // eslint-disable-next-line no-console
8
+ console.log.apply(console, arguments)
9
+ },
10
+ printErr: function() {
11
+ // eslint-disable-next-line no-console
12
+ console.error.apply(console, arguments)
13
+ },
14
+ })
15
+ return instantiateNapiModuleSync(wasmModule, {
16
+ childThread: true,
17
+ wasi,
18
+ overwriteImports(importObject) {
19
+ importObject.env = {
20
+ ...importObject.env,
21
+ ...importObject.napi,
22
+ ...importObject.emnapi,
23
+ memory: wasmMemory,
24
+ }
25
+ },
26
+ })
27
+ },
28
+ })
29
+
30
+ globalThis.onmessage = function (e) {
31
+ handler.handle(e)
32
+ }
@@ -0,0 +1,63 @@
1
+ import fs from "node:fs";
2
+ import { createRequire } from "node:module";
3
+ import { parse } from "node:path";
4
+ import { WASI } from "node:wasi";
5
+ import { parentPort, Worker } from "node:worker_threads";
6
+
7
+ const require = createRequire(import.meta.url);
8
+
9
+ const { instantiateNapiModuleSync, MessageHandler, getDefaultContext } = require("@napi-rs/wasm-runtime");
10
+
11
+ if (parentPort) {
12
+ parentPort.on("message", (data) => {
13
+ globalThis.onmessage({ data });
14
+ });
15
+ }
16
+
17
+ Object.assign(globalThis, {
18
+ self: globalThis,
19
+ require,
20
+ Worker,
21
+ importScripts: function (f) {
22
+ ;(0, eval)(fs.readFileSync(f, "utf8") + "//# sourceURL=" + f);
23
+ },
24
+ postMessage: function (msg) {
25
+ if (parentPort) {
26
+ parentPort.postMessage(msg);
27
+ }
28
+ },
29
+ });
30
+
31
+ const emnapiContext = getDefaultContext();
32
+
33
+ const __rootDir = parse(process.cwd()).root;
34
+
35
+ const handler = new MessageHandler({
36
+ onLoad({ wasmModule, wasmMemory }) {
37
+ const wasi = new WASI({
38
+ version: 'preview1',
39
+ env: process.env,
40
+ preopens: {
41
+ [__rootDir]: __rootDir,
42
+ },
43
+ });
44
+
45
+ return instantiateNapiModuleSync(wasmModule, {
46
+ childThread: true,
47
+ wasi,
48
+ context: emnapiContext,
49
+ overwriteImports(importObject) {
50
+ importObject.env = {
51
+ ...importObject.env,
52
+ ...importObject.napi,
53
+ ...importObject.emnapi,
54
+ memory: wasmMemory
55
+ };
56
+ },
57
+ });
58
+ },
59
+ });
60
+
61
+ globalThis.onmessage = function (e) {
62
+ handler.handle(e);
63
+ };
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.debugLog = void 0;
3
+ exports.debugLog = debugLog;
4
4
  function debugLog(...args) {
5
5
  if (process.env['NX_VERBOSE_LOGGING'] === 'true') {
6
6
  console.log('[NX CLOUD]', ...args);
7
7
  }
8
8
  }
9
- exports.debugLog = debugLog;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.connectToNxCloud = void 0;
3
+ exports.connectToNxCloud = connectToNxCloud;
4
4
  const child_process_1 = require("child_process");
5
5
  const output_1 = require("../../../utils/output");
6
6
  const json_1 = require("../../../generators/utils/json");
@@ -149,7 +149,6 @@ async function connectToNxCloud(tree, schema) {
149
149
  return async () => await printSuccessMessage(responseFromCreateNxCloudWorkspace?.url ?? apiUrl, responseFromCreateNxCloudWorkspace?.token, schema.installationSource, usesGithub, schema.directory);
150
150
  }
151
151
  }
152
- exports.connectToNxCloud = connectToNxCloud;
153
152
  function sleep(ms) {
154
153
  return new Promise((resolve) => setTimeout(resolve, ms));
155
154
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findAncestorNodeModules = void 0;
3
+ exports.findAncestorNodeModules = findAncestorNodeModules;
4
4
  const fs_1 = require("fs");
5
5
  const path_1 = require("path");
6
6
  function findAncestorNodeModules(startPath, collector) {
@@ -17,4 +17,3 @@ function findAncestorNodeModules(startPath, collector) {
17
17
  }
18
18
  return collector;
19
19
  }
20
- exports.findAncestorNodeModules = findAncestorNodeModules;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.verifyOrUpdateNxCloudClient = exports.NxCloudClientUnavailableError = exports.NxCloudEnterpriseOutdatedError = void 0;
3
+ exports.NxCloudClientUnavailableError = exports.NxCloudEnterpriseOutdatedError = void 0;
4
+ exports.verifyOrUpdateNxCloudClient = verifyOrUpdateNxCloudClient;
4
5
  const fs_1 = require("fs");
5
6
  const zlib_1 = require("zlib");
6
7
  const path_1 = require("path");
@@ -82,7 +83,6 @@ async function verifyOrUpdateNxCloudClient(options) {
82
83
  nxCloudClient: require(currentBundle.fullPath),
83
84
  };
84
85
  }
85
- exports.verifyOrUpdateNxCloudClient = verifyOrUpdateNxCloudClient;
86
86
  const runnerBundleInstallDirectory = (0, path_1.join)(cache_directory_1.cacheDir, 'cloud');
87
87
  function getLatestInstalledRunnerBundle() {
88
88
  if (!(0, fs_1.existsSync)(runnerBundleInstallDirectory)) {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createApiAxiosInstance = void 0;
3
+ exports.createApiAxiosInstance = createApiAxiosInstance;
4
4
  const path_1 = require("path");
5
5
  const environment_1 = require("./environment");
6
6
  const axios = require('axios');
@@ -21,4 +21,3 @@ function createApiAxiosInstance(options) {
21
21
  headers: { authorization: accessToken },
22
22
  }));
23
23
  }
24
- exports.createApiAxiosInstance = createApiAxiosInstance;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCloudOptions = void 0;
3
+ exports.getCloudOptions = getCloudOptions;
4
4
  const nx_json_1 = require("../../config/nx-json");
5
5
  const run_command_1 = require("../../tasks-runner/run-command");
6
6
  function getCloudOptions() {
@@ -8,4 +8,3 @@ function getCloudOptions() {
8
8
  // TODO: The default is not always cloud? But it's not handled at the moment
9
9
  return (0, run_command_1.getRunnerOptions)('default', nxJson, {}, true);
10
10
  }
11
- exports.getCloudOptions = getCloudOptions;
@@ -1,6 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.compareCleanCloudVersions = exports.versionIsValid = exports.removeVersionModifier = exports.getNxCloudVersion = exports.getURLifShortenFailed = exports.removeTrailingSlash = exports.repoUsesGithub = exports.shortenedCloudUrl = void 0;
3
+ exports.shortenedCloudUrl = shortenedCloudUrl;
4
+ exports.repoUsesGithub = repoUsesGithub;
5
+ exports.removeTrailingSlash = removeTrailingSlash;
6
+ exports.getURLifShortenFailed = getURLifShortenFailed;
7
+ exports.getNxCloudVersion = getNxCloudVersion;
8
+ exports.removeVersionModifier = removeVersionModifier;
9
+ exports.versionIsValid = versionIsValid;
10
+ exports.compareCleanCloudVersions = compareCleanCloudVersions;
4
11
  const devkit_exports_1 = require("../../devkit-exports");
5
12
  const git_utils_1 = require("../../utils/git-utils");
6
13
  async function shortenedCloudUrl(installationSource, accessToken, usesGithub) {
@@ -37,7 +44,6 @@ async function shortenedCloudUrl(installationSource, accessToken, usesGithub) {
37
44
  return getURLifShortenFailed(usesGithub, githubSlug, apiUrl, source, accessToken);
38
45
  }
39
46
  }
40
- exports.shortenedCloudUrl = shortenedCloudUrl;
41
47
  async function repoUsesGithub(github) {
42
48
  const githubSlug = (0, git_utils_1.getGithubSlugOrNull)();
43
49
  const apiUrl = removeTrailingSlash(process.env.NX_CLOUD_API || process.env.NRWL_API || `https://cloud.nx.app`);
@@ -47,11 +53,9 @@ async function repoUsesGithub(github) {
47
53
  apiUrl.includes('eu.nx.app') ||
48
54
  installationSupportsGitHub));
49
55
  }
50
- exports.repoUsesGithub = repoUsesGithub;
51
56
  function removeTrailingSlash(apiUrl) {
52
57
  return apiUrl[apiUrl.length - 1] === '/' ? apiUrl.slice(0, -1) : apiUrl;
53
58
  }
54
- exports.removeTrailingSlash = removeTrailingSlash;
55
59
  function getSource(installationSource) {
56
60
  if (installationSource.includes('nx-init')) {
57
61
  return 'nx-init';
@@ -77,7 +81,6 @@ function getURLifShortenFailed(usesGithub, githubSlug, apiUrl, source, accessTok
77
81
  }
78
82
  return `${apiUrl}/setup/connect-workspace/manual?accessToken=${accessToken}&source=${source}`;
79
83
  }
80
- exports.getURLifShortenFailed = getURLifShortenFailed;
81
84
  async function getInstallationSupportsGitHub(apiUrl) {
82
85
  try {
83
86
  const response = await require('axios').get(`${apiUrl}/nx-cloud/system/features`);
@@ -113,19 +116,16 @@ async function getNxCloudVersion(apiUrl) {
113
116
  return null;
114
117
  }
115
118
  }
116
- exports.getNxCloudVersion = getNxCloudVersion;
117
119
  function removeVersionModifier(versionString) {
118
120
  // Cloud version string is in the format of YYMM.DD.BuildNumber-Modifier
119
121
  return versionString.split(/[\.-]/).slice(0, 3).join('.');
120
122
  }
121
- exports.removeVersionModifier = removeVersionModifier;
122
123
  function versionIsValid(version) {
123
124
  // Updated Regex pattern to require YYMM.DD.BuildNumber format
124
125
  // All parts are required, including the BuildNumber.
125
126
  const pattern = /^\d{4}\.\d{2}\.\d+$/;
126
127
  return pattern.test(version);
127
128
  }
128
- exports.versionIsValid = versionIsValid;
129
129
  function compareCleanCloudVersions(version1, version2) {
130
130
  const parseVersion = (version) => {
131
131
  // The format we're using is YYMM.DD.BuildNumber
@@ -149,4 +149,3 @@ function compareCleanCloudVersions(version1, version2) {
149
149
  }
150
150
  return 0;
151
151
  }
152
- exports.compareCleanCloudVersions = compareCleanCloudVersions;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hashTsConfig = void 0;
3
+ exports.hashTsConfig = hashTsConfig;
4
4
  const fileutils_1 = require("../../../utils/fileutils");
5
5
  const typescript_1 = require("../utils/typescript");
6
6
  const find_project_for_path_1 = require("../../../project-graph/utils/find-project-for-path");
@@ -28,7 +28,6 @@ function hashTsConfig(p, projectRootMappings, { selectivelyHashTsConfig }) {
28
28
  return JSON.stringify(tsConfigJson);
29
29
  }
30
30
  }
31
- exports.hashTsConfig = hashTsConfig;
32
31
  function removeOtherProjectsPathRecords(p, tsConfigJson, projectRootMapping) {
33
32
  const { paths, ...compilerOptions } = tsConfigJson.compilerOptions;
34
33
  const filteredPaths = {};
@@ -4,7 +4,12 @@
4
4
  * It encapsulates the package manager specific logic and implementation details.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.createLockFile = exports.getLockFileName = exports.lockFileExists = exports.getLockFileDependencies = exports.getLockFileNodes = exports.LOCKFILES = void 0;
7
+ exports.LOCKFILES = void 0;
8
+ exports.getLockFileNodes = getLockFileNodes;
9
+ exports.getLockFileDependencies = getLockFileDependencies;
10
+ exports.lockFileExists = lockFileExists;
11
+ exports.getLockFileName = getLockFileName;
12
+ exports.createLockFile = createLockFile;
8
13
  const fs_1 = require("fs");
9
14
  const path_1 = require("path");
10
15
  const package_manager_1 = require("../../../utils/package-manager");
@@ -62,7 +67,6 @@ function getLockFileNodes(packageManager, contents, lockFileHash, context) {
62
67
  }
63
68
  throw new Error(`Unknown package manager: ${packageManager}`);
64
69
  }
65
- exports.getLockFileNodes = getLockFileNodes;
66
70
  /**
67
71
  * Parses lock file and maps dependencies and metadata to {@link LockFileGraph}
68
72
  */
@@ -93,7 +97,6 @@ function getLockFileDependencies(packageManager, contents, lockFileHash, context
93
97
  }
94
98
  throw new Error(`Unknown package manager: ${packageManager}`);
95
99
  }
96
- exports.getLockFileDependencies = getLockFileDependencies;
97
100
  function lockFileExists(packageManager) {
98
101
  if (packageManager === 'yarn') {
99
102
  return (0, fs_1.existsSync)(YARN_LOCK_PATH);
@@ -109,7 +112,6 @@ function lockFileExists(packageManager) {
109
112
  }
110
113
  throw new Error(`Unknown package manager ${packageManager} or lock file missing`);
111
114
  }
112
- exports.lockFileExists = lockFileExists;
113
115
  /**
114
116
  * Returns lock file name based on the detected package manager in the root
115
117
  * @param packageManager
@@ -130,7 +132,6 @@ function getLockFileName(packageManager) {
130
132
  }
131
133
  throw new Error(`Unknown package manager: ${packageManager}`);
132
134
  }
133
- exports.getLockFileName = getLockFileName;
134
135
  function getLockFilePath(packageManager) {
135
136
  if (packageManager === 'yarn') {
136
137
  return YARN_LOCK_PATH;
@@ -195,7 +196,6 @@ function createLockFile(packageJson, graph, packageManager = (0, package_manager
195
196
  return content;
196
197
  }
197
198
  }
198
- exports.createLockFile = createLockFile;
199
199
  // generate body lines for error message
200
200
  function errorBodyLines(originalError, additionalInfo = []) {
201
201
  return [
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stringifyNpmLockfile = exports.getNpmLockfileDependencies = exports.getNpmLockfileNodes = void 0;
3
+ exports.getNpmLockfileNodes = getNpmLockfileNodes;
4
+ exports.getNpmLockfileDependencies = getNpmLockfileDependencies;
5
+ exports.stringifyNpmLockfile = stringifyNpmLockfile;
4
6
  const fs_1 = require("fs");
5
7
  const semver_1 = require("semver");
6
8
  const workspace_root_1 = require("../../../utils/workspace-root");
@@ -27,12 +29,10 @@ function getNpmLockfileNodes(lockFileContent, lockFileHash) {
27
29
  // we use key => node map to avoid duplicate work when parsing keys
28
30
  return getNodes(data, keyMap);
29
31
  }
30
- exports.getNpmLockfileNodes = getNpmLockfileNodes;
31
32
  function getNpmLockfileDependencies(lockFileContent, lockFileHash, ctx) {
32
33
  const data = parsePackageLockFile(lockFileContent, lockFileHash);
33
34
  return getDependencies(data, keyMap, ctx);
34
35
  }
35
- exports.getNpmLockfileDependencies = getNpmLockfileDependencies;
36
36
  function getNodes(data, keyMap) {
37
37
  const nodes = new Map();
38
38
  if (data.lockfileVersion > 1) {
@@ -253,7 +253,6 @@ function stringifyNpmLockfile(graph, rootLockFileContent, packageJson) {
253
253
  }
254
254
  return JSON.stringify(output, null, 2);
255
255
  }
256
- exports.stringifyNpmLockfile = stringifyNpmLockfile;
257
256
  function mapV3Snapshots(mappedPackages, packageJson) {
258
257
  const output = {};
259
258
  output[''] = packageJson;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stringifyPnpmLockfile = exports.getPnpmLockfileDependencies = exports.getPnpmLockfileNodes = void 0;
3
+ exports.getPnpmLockfileNodes = getPnpmLockfileNodes;
4
+ exports.getPnpmLockfileDependencies = getPnpmLockfileDependencies;
5
+ exports.stringifyPnpmLockfile = stringifyPnpmLockfile;
4
6
  const pnpm_normalizer_1 = require("./utils/pnpm-normalizer");
5
7
  const package_json_1 = require("./utils/package-json");
6
8
  const object_sort_1 = require("../../../utils/object-sort");
@@ -29,7 +31,6 @@ function getPnpmLockfileNodes(lockFileContent, lockFileHash) {
29
31
  const isV5 = (0, pnpm_normalizer_1.isV5Syntax)(data);
30
32
  return getNodes(data, keyMap, isV5);
31
33
  }
32
- exports.getPnpmLockfileNodes = getPnpmLockfileNodes;
33
34
  function getPnpmLockfileDependencies(lockFileContent, lockFileHash, ctx) {
34
35
  const data = parsePnpmLockFile(lockFileContent, lockFileHash);
35
36
  if (+data.lockfileVersion.toString() >= 10) {
@@ -38,7 +39,6 @@ function getPnpmLockfileDependencies(lockFileContent, lockFileHash, ctx) {
38
39
  const isV5 = (0, pnpm_normalizer_1.isV5Syntax)(data);
39
40
  return getDependencies(data, keyMap, isV5, ctx);
40
41
  }
41
- exports.getPnpmLockfileDependencies = getPnpmLockfileDependencies;
42
42
  function matchPropValue(record, key, originalPackageName) {
43
43
  if (!record) {
44
44
  return undefined;
@@ -290,7 +290,6 @@ function stringifyPnpmLockfile(graph, rootLockFileContent, packageJson) {
290
290
  };
291
291
  return (0, pnpm_normalizer_1.stringifyToPnpmYaml)(output);
292
292
  }
293
- exports.stringifyPnpmLockfile = stringifyPnpmLockfile;
294
293
  function mapSnapshots(packages, nodes, lockfileVersion) {
295
294
  const result = {};
296
295
  Object.values(nodes).forEach((node) => {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.pruneProjectGraph = void 0;
3
+ exports.pruneProjectGraph = pruneProjectGraph;
4
4
  const semver_1 = require("semver");
5
5
  const project_graph_builder_1 = require("../../../project-graph/project-graph-builder");
6
6
  const operators_1 = require("../../../project-graph/operators");
@@ -17,7 +17,6 @@ function pruneProjectGraph(graph, prunedPackageJson) {
17
17
  rehoistNodes(graph, combinedDependencies, builder);
18
18
  return builder.getUpdatedProjectGraph();
19
19
  }
20
- exports.pruneProjectGraph = pruneProjectGraph;
21
20
  // ensure that dependency ranges from package.json (e.g. ^1.0.0)
22
21
  // are replaced with the actual version based on the available nodes (e.g. 1.0.1)
23
22
  function normalizeDependencies(packageJson, graph) {