@smoothbricks/nx-plugin 0.7.13 → 0.7.14

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.
package/README.md CHANGED
@@ -907,9 +907,10 @@ integrity. Nx merges its default plugin's lockfile nodes after every configured
907
907
  on they would replace these: the plugin refuses the option then, and refuses a name the lockfile installs nowhere
908
908
  (`src/built-output-packages.ts`, `src/built-output-packages.test.ts`).
909
909
 
910
- The option covers the lockfile only. A manifest that declares a named package's version is still an input wherever its
911
- project's files are; a workspace keeps the version out of member manifests by declaring it once, in the root manifest's
912
- `catalog`, and `catalog:` in each member.
910
+ The option covers the lockfile only. A member manifest that declares a named package's version is still an input
911
+ wherever its project's files are; a workspace keeps the version out of member manifests by declaring it once, in the
912
+ root manifest's `catalog`, and `catalog:` in each member. Inferred validation inputs omit the root's install-only pins
913
+ as described below; targets producing shipped artifacts retain the raw manifests.
913
914
 
914
915
  ### Manifest versions and validation inputs
915
916
 
@@ -918,13 +919,22 @@ files are inputs of `lint`, `typecheck` and `typecheck-tests`, so a publish run
918
919
  over a change that alters no code. Those three targets therefore leave the raw manifests out of their filesets and hash
919
920
  them by field instead: a `json` input with `excludeFields` for `package.json#version`. The lockfile is no file input
920
921
  (see Lockfile scope), so the release's rewrite of its `workspaces` mirror re-keys nothing. Nx hashes the field input in
921
- its native hasher, so this costs no process. Everything else still counts: a dependency range, an export map, and every
922
+ its native hasher, so this costs no process. A member's dependency range and export map still count, as does every
922
923
  locked package the project reaches.
923
924
 
924
925
  The workspace root manifest also drops `scripts`, `smoo` and `nx` from these three targets' hash. No check reads them:
925
926
  scripts are commands a developer runs, `smoo.developerLinks` names links whose linked bytes reach a hash only through
926
- their own inputs, and the root project's `nx` configuration is hashed as that project's configuration. Hashing them made
927
- a root `postinstall` or developer-link edit re-key every lint and typecheck in the workspace.
927
+ their own inputs, and the root project's `nx` configuration is hashed as that project's configuration. The same root
928
+ field input is used in the root project's versionless named inputs, so its own manifest cannot reintroduce the fields.
929
+
930
+ The root's install-only fields are excluded too: `dependencies`, `devDependencies`, `optionalDependencies`,
931
+ `peerDependencies`, `overrides`, `resolutions`, `patchedDependencies`, `catalog` and `catalogs`, including
932
+ `workspaces.catalog` and `workspaces.catalogs` in the object form. Checks load installed packages, not these pins: the
933
+ bun lock-scope nodes still key those packages, and the patch files still key patch bytes. A pin-only edit therefore
934
+ keeps a check's key; a changed installed dependency still re-keys the tasks that reach it (subject to Built-output
935
+ packages above). Resolution fields such as `type`, `imports` and `exports`, workspace member patterns, and other root
936
+ fields remain hashed: an edit to something a check reads must still miss. Artifact-producing targets retain their raw
937
+ manifest inputs.
928
938
 
929
939
  Crate manifests are the one kind Nx cannot hash by field, because TOML has no such input. The plugin hashes them itself,
930
940
  in the process that builds the graph and is already reading them: a single forward scan over the bytes feeds the hasher
@@ -101,7 +101,7 @@
101
101
  "packages/nx-plugin/src/generators/make-public/schema.d.ts": "5e7bd2f1ce16795df4c919d6d53588ea85b574c84400940b6322275f96f60357",
102
102
  "packages/nx-plugin/src/go-tests.ts": "8e356b6ee276e6e836c404353b0ffb5ccec5beb261126f167f730e6e01e9c2b6",
103
103
  "packages/nx-plugin/src/graph-input-contract.ts": "8a1aec1294960ae80bcff55a0370c95004a911bf1afe6caa47e666da3baeac43",
104
- "packages/nx-plugin/src/index.ts": "45d965a45f9769dc8d08fda1cedf81e4f1b7df6d98724351f33ae6d059917b73",
104
+ "packages/nx-plugin/src/index.ts": "8d021d230250f960beea3dcc7d52c0321839c40ce34e4972104254a4e0b05146",
105
105
  "packages/nx-plugin/src/managed-assets.ts": "9cea959c09f3163992e666eecc5a65ec1f1b63c81fc56c5e99088507d02c5e3b",
106
106
  "packages/nx-plugin/src/managed-files/ci-workflow.ts": "c48f80cf3b215a8b41fdeb220e653a3a26ee288e833b1bb215f8f15de006e5ae",
107
107
  "packages/nx-plugin/src/managed-files/context.ts": "472553c8e15f5bb72f7167ca3f3c5ce5171f479a3cdf2fb4b9f86d1f1addf4b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1E,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAGhC,CAAC;AAEF,+GAA+G;AAC/G,eAAO,MAAM,cAAc,EAAE,cAI5B,CAAC;;;;;;;;;AAiDF,+GAA+G;AAC/G,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EACjC,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,MAAM,EACvB,cAAc,EAAE,MAAM,GACrB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAmCxB"}
package/dist/index.js CHANGED
@@ -89,17 +89,36 @@ function typecheckTargets(packageJsonPath, packageJson) {
89
89
  * node and the project's through its `^` input, so a release's rewrite of the
90
90
  * lockfile's `workspaces` mirror re-keys nothing.
91
91
  *
92
- * The root manifest drops `scripts`, `smoo` and `nx`. No lint or
93
- * typecheck reads them: `scripts` are commands a developer runs, `smoo` holds
94
- * the developer links whose linked bytes reach the hash only through their own
95
- * inputs, and the root project's `nx` configuration is hashed as that
96
- * project's configuration. Hashing them made a root `postinstall` edit or a
97
- * developer-link edit re-key every lint task (74, measured in a consumer
98
- * workspace). The dependency fields, `overrides`, `patchedDependencies` and
99
- * `workspaces` stay hashed.
92
+ * No check reads the root's scripts, developer-link configuration or Nx
93
+ * configuration; Nx already hashes the resolved project configuration. Nor
94
+ * does a check read install-only dependency ranges, overrides or catalogs:
95
+ * the bun lock-scope nodes key the installed packages they resolve to, and
96
+ * patch files key the patch bytes. Keeping those pins here would re-key every
97
+ * check on a catalog bump even when a built-output package's bytes agree.
98
+ * Resolution fields (type, imports, exports) and workspace member patterns
99
+ * remain inputs; only the catalogs nested beside those patterns are dropped.
100
100
  */
101
101
  const VERSIONLESS_TOOLCHAIN_MANIFEST_INPUTS = [
102
- { json: '{workspaceRoot}/package.json', excludeFields: ['version', 'scripts', 'smoo', 'nx'] },
102
+ {
103
+ json: '{workspaceRoot}/package.json',
104
+ excludeFields: [
105
+ 'version',
106
+ 'scripts',
107
+ 'smoo',
108
+ 'nx',
109
+ 'dependencies',
110
+ 'devDependencies',
111
+ 'optionalDependencies',
112
+ 'peerDependencies',
113
+ 'overrides',
114
+ 'resolutions',
115
+ 'patchedDependencies',
116
+ 'catalog',
117
+ 'catalogs',
118
+ 'workspaces.catalog',
119
+ 'workspaces.catalogs',
120
+ ],
121
+ },
103
122
  ];
104
123
  /** A path segment Nx's workspace file map never carries, so a fileset naming it hashes nothing. */
105
124
  const NODE_MODULES_SEGMENT = /(?:^|\/)node_modules(?:\/|$)/;
@@ -1301,7 +1320,13 @@ async function createProjectTargets(packageJsonPath, workspaceRoot, hostPlatform
1301
1320
  const crateInputs = versionless !== null && hasCrateManifests ? await versionlessCrateInputs(projectRoot, workspaceRoot) : [];
1302
1321
  const versionlessProjectInputs = versionless === null
1303
1322
  ? []
1304
- : [...VERSIONLESS_PACKAGE_INPUTS, ...crateInputs, ...(projectRoot === '.' ? ROOT_LOCKFILE_EXCLUSIONS : [])];
1323
+ : [
1324
+ ...(projectRoot === '.'
1325
+ ? ['!{projectRoot}/package.json', ...VERSIONLESS_TOOLCHAIN_MANIFEST_INPUTS]
1326
+ : VERSIONLESS_PACKAGE_INPUTS),
1327
+ ...crateInputs,
1328
+ ...(projectRoot === '.' ? ROOT_LOCKFILE_EXCLUSIONS : []),
1329
+ ];
1305
1330
  // The options a TypeScript task's answer really depends on, which is the
1306
1331
  // whole `extends` chain of the configs its commands name and not just those
1307
1332
  // two files. Resolved once per project: every target below shares it.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smoothbricks/nx-plugin",
3
- "version": "0.7.13",
3
+ "version": "0.7.14",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "main": "./loader.js",
package/src/index.ts CHANGED
@@ -180,17 +180,36 @@ function typecheckTargets(packageJsonPath: string, packageJson: PackageJson): Ty
180
180
  * node and the project's through its `^` input, so a release's rewrite of the
181
181
  * lockfile's `workspaces` mirror re-keys nothing.
182
182
  *
183
- * The root manifest drops `scripts`, `smoo` and `nx`. No lint or
184
- * typecheck reads them: `scripts` are commands a developer runs, `smoo` holds
185
- * the developer links whose linked bytes reach the hash only through their own
186
- * inputs, and the root project's `nx` configuration is hashed as that
187
- * project's configuration. Hashing them made a root `postinstall` edit or a
188
- * developer-link edit re-key every lint task (74, measured in a consumer
189
- * workspace). The dependency fields, `overrides`, `patchedDependencies` and
190
- * `workspaces` stay hashed.
183
+ * No check reads the root's scripts, developer-link configuration or Nx
184
+ * configuration; Nx already hashes the resolved project configuration. Nor
185
+ * does a check read install-only dependency ranges, overrides or catalogs:
186
+ * the bun lock-scope nodes key the installed packages they resolve to, and
187
+ * patch files key the patch bytes. Keeping those pins here would re-key every
188
+ * check on a catalog bump even when a built-output package's bytes agree.
189
+ * Resolution fields (type, imports, exports) and workspace member patterns
190
+ * remain inputs; only the catalogs nested beside those patterns are dropped.
191
191
  */
192
192
  const VERSIONLESS_TOOLCHAIN_MANIFEST_INPUTS = [
193
- { json: '{workspaceRoot}/package.json', excludeFields: ['version', 'scripts', 'smoo', 'nx'] },
193
+ {
194
+ json: '{workspaceRoot}/package.json',
195
+ excludeFields: [
196
+ 'version',
197
+ 'scripts',
198
+ 'smoo',
199
+ 'nx',
200
+ 'dependencies',
201
+ 'devDependencies',
202
+ 'optionalDependencies',
203
+ 'peerDependencies',
204
+ 'overrides',
205
+ 'resolutions',
206
+ 'patchedDependencies',
207
+ 'catalog',
208
+ 'catalogs',
209
+ 'workspaces.catalog',
210
+ 'workspaces.catalogs',
211
+ ],
212
+ },
194
213
  ];
195
214
 
196
215
  /** A path segment Nx's workspace file map never carries, so a fileset naming it hashes nothing. */
@@ -1639,7 +1658,13 @@ async function createProjectTargets(
1639
1658
  const versionlessProjectInputs =
1640
1659
  versionless === null
1641
1660
  ? []
1642
- : [...VERSIONLESS_PACKAGE_INPUTS, ...crateInputs, ...(projectRoot === '.' ? ROOT_LOCKFILE_EXCLUSIONS : [])];
1661
+ : [
1662
+ ...(projectRoot === '.'
1663
+ ? ['!{projectRoot}/package.json', ...VERSIONLESS_TOOLCHAIN_MANIFEST_INPUTS]
1664
+ : VERSIONLESS_PACKAGE_INPUTS),
1665
+ ...crateInputs,
1666
+ ...(projectRoot === '.' ? ROOT_LOCKFILE_EXCLUSIONS : []),
1667
+ ];
1643
1668
  // The options a TypeScript task's answer really depends on, which is the
1644
1669
  // whole `extends` chain of the configs its commands name and not just those
1645
1670
  // two files. Resolved once per project: every target below shares it.