nx 24.0.6 → 24.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/dist/bin/init-local.js +2 -4
  2. package/dist/bin/nx-cloud.js +2 -1
  3. package/dist/bin/nx.js +12 -14
  4. package/dist/bin/run-executor.js +5 -0
  5. package/dist/src/adapter/compat.d.ts +1 -1
  6. package/dist/src/adapter/compat.js +1 -0
  7. package/dist/src/adapter/ngcli-adapter.js +7 -20
  8. package/dist/src/command-line/completion/scripts/bash.sh +9 -2
  9. package/dist/src/command-line/completion/scripts/fish.fish +10 -2
  10. package/dist/src/command-line/completion/scripts/zsh.zsh +8 -2
  11. package/dist/src/command-line/completion/scripts.js +18 -8
  12. package/dist/src/command-line/configure-ai-agents/configure-ai-agents.js +0 -1
  13. package/dist/src/command-line/conformance/command-object.d.ts +3 -0
  14. package/dist/src/command-line/conformance/command-object.js +66 -0
  15. package/dist/src/command-line/generate/generate.js +14 -27
  16. package/dist/src/command-line/generate/generator-utils.d.ts +1 -0
  17. package/dist/src/command-line/generate/generator-utils.js +9 -0
  18. package/dist/src/command-line/graph/graph.js +1 -7
  19. package/dist/src/command-line/import/import.js +26 -2
  20. package/dist/src/command-line/import/utils/ai-output.d.ts +9 -1
  21. package/dist/src/command-line/import/utils/ai-output.js +20 -1
  22. package/dist/src/command-line/import/utils/prepare-source-repo.js +0 -3
  23. package/dist/src/command-line/init/implementation/angular/standalone-workspace.js +2 -2
  24. package/dist/src/command-line/init/init-v2.js +2 -2
  25. package/dist/src/command-line/migrate/migrate.js +1 -4
  26. package/dist/src/command-line/migrate/prompt-files.js +5 -5
  27. package/dist/src/command-line/migrate/run/orchestrator.js +2 -3
  28. package/dist/src/command-line/migrate/run/worker.js +7 -5
  29. package/dist/src/command-line/migrate/run-migration-process.js +3 -2
  30. package/dist/src/command-line/nx-commands.d.ts +1 -1
  31. package/dist/src/command-line/nx-commands.js +82 -132
  32. package/dist/src/command-line/release/changelog.js +8 -39
  33. package/dist/src/command-line/release/command-object.d.ts +1 -0
  34. package/dist/src/command-line/release/command-object.js +4 -0
  35. package/dist/src/command-line/release/config/use-legacy-versioning.js +1 -1
  36. package/dist/src/command-line/release/release.js +6 -4
  37. package/dist/src/command-line/release/utils/diff.js +0 -14
  38. package/dist/src/command-line/release/utils/git.js +1 -1
  39. package/dist/src/command-line/release/utils/resolve-nx-json-error-message.js +2 -24
  40. package/dist/src/command-line/report/report.js +1 -1
  41. package/dist/src/command-line/run/executor-utils.js +1 -1
  42. package/dist/src/command-line/show/show-target/utils.js +1 -1
  43. package/dist/src/command-line/watch/watch.js +1 -1
  44. package/dist/src/commands-runner/get-command-projects.js +0 -3
  45. package/dist/src/config/misc-interfaces.d.ts +0 -1
  46. package/dist/src/config/nx-json.d.ts +117 -0
  47. package/dist/src/config/workspace-json-project-json.d.ts +6 -7
  48. package/dist/src/core/graph/main.js +1 -1
  49. package/dist/src/core/graph/styles.css +1 -1
  50. package/dist/src/core/graph/styles.js +1 -1
  51. package/dist/src/daemon/server/project-graph-incremental-recomputation.js +13 -20
  52. package/dist/src/devkit-exports.d.ts +1 -1
  53. package/dist/src/devkit-internals.d.ts +11 -4
  54. package/dist/src/devkit-internals.js +27 -5
  55. package/dist/src/executors/run-commands/run-commands.impl.d.ts +1 -1
  56. package/dist/src/executors/run-commands/run-commands.impl.js +35 -13
  57. package/dist/src/hasher/hash-task.js +4 -4
  58. package/dist/src/hasher/task-hasher.js +2 -2
  59. package/dist/src/migrations/update-24-1-0/replace-powerpack-conformance.d.ts +4 -0
  60. package/dist/src/migrations/update-24-1-0/replace-powerpack-conformance.js +117 -0
  61. package/dist/src/migrations/update-24-1-0/replace-powerpack-conformance.md +38 -0
  62. package/dist/src/native/index.d.ts +6 -4
  63. package/dist/src/native/index.js +5 -0
  64. package/dist/src/native/native-bindings.js +1 -0
  65. package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
  66. package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
  67. package/dist/src/native/transform-objects.d.ts +2 -0
  68. package/dist/src/native/transform-objects.js +15 -0
  69. package/dist/src/nx-cloud/utilities/environment.js +0 -17
  70. package/dist/src/plugins/js/lock-file/bun-parser.d.ts +1 -2
  71. package/dist/src/plugins/js/lock-file/bun-parser.js +5 -5
  72. package/dist/src/plugins/js/lock-file/lock-file-names.d.ts +6 -0
  73. package/dist/src/plugins/js/lock-file/lock-file-names.js +16 -0
  74. package/dist/src/plugins/js/lock-file/lock-file.d.ts +1 -2
  75. package/dist/src/plugins/js/lock-file/lock-file.js +24 -31
  76. package/dist/src/plugins/js/lock-file/npm-parser.js +1 -2
  77. package/dist/src/plugins/js/project-graph/affected/npm-packages.js +50 -2
  78. package/dist/src/plugins/js/project-graph/build-dependencies/target-project-locator.d.ts +5 -0
  79. package/dist/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +75 -13
  80. package/dist/src/plugins/js/utils/get-workspace-packages-from-graph.js +1 -1
  81. package/dist/src/plugins/js/utils/register.js +13 -6
  82. package/dist/src/project-graph/affected/affected-tasks.js +1 -1
  83. package/dist/src/project-graph/build-project-graph.js +5 -2
  84. package/dist/src/project-graph/nx-deps-cache.d.ts +3 -2
  85. package/dist/src/project-graph/nx-deps-cache.js +8 -2
  86. package/dist/src/project-graph/utils/project-graph-paths.d.ts +8 -0
  87. package/dist/src/project-graph/utils/project-graph-paths.js +170 -0
  88. package/dist/src/tasks-runner/batch/run-batch.js +3 -13
  89. package/dist/src/tasks-runner/cache.js +19 -18
  90. package/dist/src/tasks-runner/run-command.js +12 -10
  91. package/dist/src/tasks-runner/task-orchestrator.d.ts +1 -0
  92. package/dist/src/tasks-runner/task-orchestrator.js +14 -3
  93. package/dist/src/tasks-runner/utils.js +1 -12
  94. package/dist/src/ultracache/overrides.js +1 -1
  95. package/dist/src/utils/child-process.js +2 -1
  96. package/dist/src/utils/code-frames.js +0 -1
  97. package/dist/src/utils/db-connection.js +6 -4
  98. package/dist/src/utils/find-workspace-root.js +2 -4
  99. package/dist/src/utils/git-utils.d.ts +5 -0
  100. package/dist/src/utils/git-utils.js +23 -1
  101. package/dist/src/utils/handle-import.js +6 -0
  102. package/dist/src/utils/installation-directory.d.ts +16 -0
  103. package/dist/src/utils/installation-directory.js +96 -2
  104. package/dist/src/utils/json.d.ts +7 -0
  105. package/dist/src/utils/json.js +27 -0
  106. package/dist/src/utils/min-release-age/behavior/pnpm.js +9 -9
  107. package/dist/src/utils/min-release-age/behavior/yarn.js +2 -2
  108. package/dist/src/utils/nx-key.js +11 -8
  109. package/dist/src/utils/output.d.ts +5 -0
  110. package/dist/src/utils/output.js +11 -4
  111. package/dist/src/utils/owned-private-dir.d.ts +10 -0
  112. package/dist/src/utils/owned-private-dir.js +28 -0
  113. package/dist/src/utils/plugins/output.js +0 -2
  114. package/dist/src/utils/require-nx-key.js +6 -4
  115. package/dist/src/utils/workspace-root.d.ts +12 -0
  116. package/dist/src/utils/workspace-root.js +56 -7
  117. package/migrations.json +6 -0
  118. package/package.json +14 -12
  119. package/schemas/nx-schema.json +75 -9
  120. package/schemas/project-schema.json +5 -0
@@ -92,6 +92,13 @@
92
92
  "$ref": "#/definitions/plugins"
93
93
  }
94
94
  },
95
+ "pluginsConfig": {
96
+ "type": "object",
97
+ "description": "Options for plugins that apply workspace-wide, keyed by plugin package name.",
98
+ "additionalProperties": {
99
+ "type": "object"
100
+ }
101
+ },
95
102
  "tui": {
96
103
  "type": "object",
97
104
  "description": "Settings for the Nx Terminal User Interface (TUI)",
@@ -125,10 +132,33 @@
125
132
  "type": "string",
126
133
  "description": "Default project. When project isn't provided, the default project will be used."
127
134
  },
135
+ "installation": {
136
+ "type": "object",
137
+ "description": "Configures the Nx installation for a repo. Useful for maintaining a separate set of dependencies for Nx and plugins compared to the root package.json, and for workspaces that don't have a root package.json and node_modules.",
138
+ "properties": {
139
+ "version": {
140
+ "type": "string",
141
+ "description": "Version of Nx to install."
142
+ },
143
+ "plugins": {
144
+ "type": "object",
145
+ "description": "Versions of the plugins to install, keyed by plugin package name.",
146
+ "additionalProperties": {
147
+ "type": "string"
148
+ }
149
+ }
150
+ },
151
+ "required": ["version"],
152
+ "additionalProperties": false
153
+ },
128
154
  "nxCloudAccessToken": {
129
155
  "type": "string",
130
156
  "description": "The access token to use for nx-cloud. If set, the default tasks runner will be nx-cloud."
131
157
  },
158
+ "nxCloudId": {
159
+ "type": "string",
160
+ "description": "The Nx Cloud ID to connect the workspace with. If set, the default tasks runner will be nx-cloud."
161
+ },
132
162
  "nxCloudUrl": {
133
163
  "type": "string",
134
164
  "description": "Specifies the url pointing to an instance of nx cloud. Used for remote caching and displaying run links."
@@ -149,6 +179,10 @@
149
179
  "type": "string",
150
180
  "description": "Specifies the default location of the cache directory."
151
181
  },
182
+ "maxCacheSize": {
183
+ "type": ["string", "number"],
184
+ "description": "Sets the maximum size of the local cache. Accepts a number followed by an optional unit (B, KB, MB or GB), such as `100MB`. Set it to `0` to remove the limit."
185
+ },
152
186
  "useDaemonProcess": {
153
187
  "type": "boolean",
154
188
  "description": "Specifies whether the daemon should be used for the default tasks runner."
@@ -573,11 +607,18 @@
573
607
  "type": "string",
574
608
  "description": "The path to write the generated owners file to. Defaults based on format (e.g. '.github/CODEOWNERS')."
575
609
  },
610
+ "prefix": {
611
+ "type": "string",
612
+ "description": "Prefix applied to owner strings (e.g. '@org')."
613
+ },
576
614
  "patterns": {
577
615
  "type": "array",
578
616
  "description": "List of ownership patterns to apply.",
579
617
  "items": {
580
- "$ref": "#/definitions/ownersPattern"
618
+ "allOf": [
619
+ { "$ref": "#/definitions/ownersPattern" },
620
+ { "required": ["owners"] }
621
+ ]
581
622
  }
582
623
  },
583
624
  "sections": {
@@ -607,7 +648,7 @@
607
648
  },
608
649
  "patterns": {
609
650
  "type": "array",
610
- "description": "List of ownership patterns within this section.",
651
+ "description": "List of ownership patterns within this section. A pattern without owners uses the section's defaultOwners.",
611
652
  "items": {
612
653
  "$ref": "#/definitions/ownersPattern"
613
654
  }
@@ -710,20 +751,35 @@
710
751
  },
711
752
  "files": {
712
753
  "type": "array",
713
- "description": "File glob patterns this ownership pattern applies to (for non-project-based ownership).",
754
+ "description": "File glob patterns this ownership pattern applies to. With projects, they are relative to each matched project root.",
714
755
  "items": {
715
756
  "type": "string"
716
757
  }
717
758
  },
718
759
  "owners": {
719
- "type": "array",
720
- "description": "List of owners (e.g. GitHub usernames or team handles) for the matched projects or files.",
721
- "items": {
722
- "type": "string"
723
- }
760
+ "description": "List of owners (e.g. GitHub usernames or team handles) for the matched projects or files, or false to mark them as having no owners.",
761
+ "oneOf": [
762
+ {
763
+ "type": "array",
764
+ "items": {
765
+ "type": "string"
766
+ }
767
+ },
768
+ {
769
+ "type": "boolean",
770
+ "enum": [false]
771
+ }
772
+ ]
773
+ },
774
+ "applyPrefix": {
775
+ "type": "boolean",
776
+ "description": "Whether the root owners prefix applies to this pattern. Defaults to true."
777
+ },
778
+ "prefix": {
779
+ "type": "string",
780
+ "description": "Prefix for this pattern's owners, taking precedence over the root owners prefix."
724
781
  }
725
782
  },
726
- "required": ["owners"],
727
783
  "additionalProperties": false
728
784
  },
729
785
  "inputs": {
@@ -962,6 +1018,11 @@
962
1018
  "type": "object",
963
1019
  "description": "A filtered target defaults entry. The optional `filter` narrows where the entry applies; the remaining fields are the configuration applied when it matches. An entry with no `filter` is a catch-all baseline for its target key.",
964
1020
  "properties": {
1021
+ "...": {
1022
+ "type": "boolean",
1023
+ "const": true,
1024
+ "description": "Controls merge priority against a compatible inherited target: keys before this token defer to the inherited value, and keys after it take precedence. options, configurations, ultracache and metadata merge by their own rules wherever the token sits."
1025
+ },
965
1026
  "filter": {
966
1027
  "type": "object",
967
1028
  "description": "Narrows where this entry applies. When present, every listed criterion must match the target being resolved.",
@@ -1034,6 +1095,11 @@
1034
1095
  "type": "object",
1035
1096
  "description": "Target defaults",
1036
1097
  "properties": {
1098
+ "...": {
1099
+ "type": "boolean",
1100
+ "const": true,
1101
+ "description": "Controls merge priority against a compatible inherited target: keys before this token defer to the inherited value, and keys after it take precedence. options, configurations, ultracache and metadata merge by their own rules wherever the token sits."
1102
+ },
1037
1103
  "executor": {
1038
1104
  "description": "The function that Nx will invoke when you run this target",
1039
1105
  "type": "string"
@@ -38,6 +38,11 @@
38
38
  "additionalProperties": {
39
39
  "type": "object",
40
40
  "properties": {
41
+ "...": {
42
+ "type": "boolean",
43
+ "const": true,
44
+ "description": "Controls merge priority against a compatible inherited target: keys before this token defer to the inherited value, and keys after it take precedence. A target with a different executor, command or script replaces the inherited target regardless. options, configurations, ultracache and metadata merge by their own rules wherever the token sits."
45
+ },
41
46
  "executor": {
42
47
  "description": "The function that Nx will invoke when you run this target",
43
48
  "type": "string"