@smoothbricks/nx-plugin 0.5.0 → 0.5.2

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 (79) hide show
  1. package/README.md +107 -46
  2. package/dist/bin/smoo-nx-test-clocks.js +2 -2
  3. package/dist/bin/smoo-nx-test-walks.js +6 -9
  4. package/dist/cargo-closure-input.d.ts.map +1 -1
  5. package/dist/cargo-closure-input.js +25 -15
  6. package/dist/ensure-built-witness.d.ts +33 -5
  7. package/dist/ensure-built-witness.d.ts.map +1 -1
  8. package/dist/ensure-built-witness.js +84 -18
  9. package/dist/ensure-built.d.ts.map +1 -1
  10. package/dist/ensure-built.js +33 -14
  11. package/dist/executors/bounded-exec/cpu-pool.d.ts +14 -7
  12. package/dist/executors/bounded-exec/cpu-pool.d.ts.map +1 -1
  13. package/dist/executors/bounded-exec/cpu-pool.js +297 -38
  14. package/dist/executors/bounded-exec/cpu-tokens.d.ts +19 -7
  15. package/dist/executors/bounded-exec/cpu-tokens.d.ts.map +1 -1
  16. package/dist/executors/bounded-exec/cpu-tokens.js +21 -7
  17. package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
  18. package/dist/executors/bounded-exec/executor.js +12 -6
  19. package/dist/executors/bounded-exec/run-cpu-pool.d.ts.map +1 -1
  20. package/dist/executors/bounded-exec/run-cpu-pool.js +5 -4
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +4 -0
  23. package/dist/owned-installation.d.ts +6 -5
  24. package/dist/owned-installation.d.ts.map +1 -1
  25. package/dist/owned-installation.js +324 -201
  26. package/dist/producer-receipts.d.ts +10 -0
  27. package/dist/producer-receipts.d.ts.map +1 -1
  28. package/dist/producer-receipts.js +30 -5
  29. package/dist/test-walk-policy.d.ts +8 -0
  30. package/dist/test-walk-policy.d.ts.map +1 -1
  31. package/dist/test-walk-policy.js +34 -0
  32. package/dist/workspace-manifest.d.ts +5 -5
  33. package/dist/workspace-manifest.d.ts.map +1 -1
  34. package/managed/raw/patches/nx@23.2.1.patch +14 -3
  35. package/managed/raw/tooling/direnv/developer-links.ts +37 -10
  36. package/managed/raw/tooling/direnv/devenv.smoo.nix +1 -3
  37. package/managed/raw/tooling/direnv/linked-snapshots.ts +49 -12
  38. package/managed/raw/tooling/direnv/repo-path +1 -1
  39. package/managed/raw/tooling/direnv/setup-environment.ts +2 -0
  40. package/managed/raw/tooling/git-hooks/pre-push.sh +34 -11
  41. package/package.json +3 -3
  42. package/runtime-input.sh +21 -9
  43. package/src/__tests__/cargo-closure-filesets.ts +94 -0
  44. package/src/__tests__/counted-cargo.ts +1 -1
  45. package/src/__tests__/owned-installation.ts +5 -6
  46. package/src/bin/smoo-nx-test-clocks.ts +2 -2
  47. package/src/bin/smoo-nx-test-walks.ts +6 -9
  48. package/src/cargo-closure-filesets.test.ts +63 -0
  49. package/src/cargo-closure-input.test.ts +2 -2
  50. package/src/cargo-closure-input.ts +23 -15
  51. package/src/cargo-closure-key.test.ts +1 -1
  52. package/src/cargo-resolve-cache.test.ts +1 -1
  53. package/src/cross-check-policy.test.ts +53 -12
  54. package/src/ensure-built-witness.test.ts +53 -2
  55. package/src/ensure-built-witness.ts +103 -18
  56. package/src/ensure-built.test.ts +79 -5
  57. package/src/ensure-built.ts +51 -15
  58. package/src/executors/bounded-exec/cpu-pool.test.ts +132 -4
  59. package/src/executors/bounded-exec/cpu-pool.ts +300 -46
  60. package/src/executors/bounded-exec/cpu-tokens.test.ts +60 -15
  61. package/src/executors/bounded-exec/cpu-tokens.ts +34 -11
  62. package/src/executors/bounded-exec/executor.test.ts +72 -4
  63. package/src/executors/bounded-exec/executor.ts +12 -6
  64. package/src/executors/bounded-exec/run-cpu-pool.test.ts +3 -0
  65. package/src/executors/bounded-exec/run-cpu-pool.ts +5 -4
  66. package/src/index.ts +4 -0
  67. package/src/linked-snapshots.nx.test.ts +1 -1
  68. package/src/nextest-partitions.test.ts +1 -1
  69. package/src/nx-daemon-validity.test.ts +51 -0
  70. package/src/owned-installation.test.ts +105 -0
  71. package/src/owned-installation.ts +335 -93
  72. package/src/producer-receipts.test.ts +37 -15
  73. package/src/producer-receipts.ts +29 -5
  74. package/src/runtime-input.test.ts +22 -1
  75. package/src/task-results.test.ts +1 -1
  76. package/src/test-walk-policy.test.ts +35 -0
  77. package/src/test-walk-policy.ts +32 -0
  78. package/src/workspace-manifest.ts +5 -5
  79. package/test-timings.json +94 -92
@@ -10,12 +10,13 @@ import { GATEWAY_SOCKET } from './gateway-lease.js';
10
10
  * Every runner sizes itself to the whole host unless something budgets it, and without a gateway nothing did: under
11
11
  * `NX_PARALLEL=100%` Nx starts every target side by side and each one's runner takes the whole machine. The run
12
12
  * therefore serves its own pool of one token per core, as a gateway-granted executor serves its children, and every
13
- * task inherits it: `bounded-exec` and the `cargo` launcher take from it as from any parent pool, FIFO, the head
14
- * taking `min(want, free)` once one token is free, so the runners of one run together stay within the cores.
13
+ * task inherits it: `bounded-exec` takes from it as from any parent pool, FIFO, the head taking `min(want, free)` once
14
+ * one token is free, and a Cargo that Nx's own `nx:run-commands` starts reads its jobserver fifo through the
15
+ * `CARGO_MAKEFLAGS` the pool exports, so the runners of one run together stay within the cores.
15
16
  *
16
17
  * The run serves it only when nothing else budgets it: it inherits no pool, and the gateway's control socket does
17
- * not exist. Only `ENOENT` proves the gateway absent, as for the launcher; a socket that exists but does not answer
18
- * may be a live, saturated gateway, and a run budgeting itself beside it would count the host twice.
18
+ * not exist. Only `ENOENT` proves the gateway absent; a socket that exists but does not answer may be a live,
19
+ * saturated gateway, and a run budgeting itself beside it would count the host twice.
19
20
  */
20
21
  /** The pools this process serves, by Nx run id, until that run's `postTasksExecution`. */
21
22
  const pools = new Map();
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EAEtB,KAAK,mBAAmB,EACzB,MAAM,0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AAmB,EAC3B,WAAW,EAAE,MAAM,EACnB,SAAS,UAAsB,GAC9B,MAAM,EAAE,CAKV;AAkID,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,GAAG,aAAa,CAEvG;AAED,eAAO,MAAM,aAAa,EAAE,aAG3B,CAAC;AAeF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,iBAAiB,CAAC,uBAAuB,CAOxE,CAAC;AACF,eAAO,MAAM,kBAAkB,EAAE,kBAAkB,CAAC,uBAAuB,CAI1E,CAAC"}
package/dist/index.js CHANGED
@@ -20,6 +20,7 @@ import { runtimeInput, shellWord } from './runtime-input.js';
20
20
  import { isNonSourceDirectory } from './source-directories.js';
21
21
  import { postTasksExecution as postTaskResults, preTasksExecution as preTaskResults } from './task-results.js';
22
22
  import { SHARD_TIMINGS_EXECUTOR, SHARD_TIMINGS_TARGET, timingsShardedSuite } from './test-timings.js';
23
+ import { assertUpstreamBasePrecondition } from './test-walk-policy.js';
23
24
  import { isBuildOutputTargetName, isTestRunnerTargetName, PLATFORM_TARGET_GLOBS, RELEASE_CONFIGURATION, } from './workspace-config-policy.js';
24
25
  import { globIndexedFiles } from './workspace-index.js';
25
26
  export { CARGO_TEST_COMPILE_TARGET };
@@ -841,6 +842,9 @@ function isBuildOutputPackageJson(packageJsonPath) {
841
842
  * (`run-cpu-pool.ts`), and closes it when the run ends.
842
843
  */
843
844
  export const preTasksExecution = async (options, context) => {
845
+ // Before any task is hashed: a workspace that declares the test-walk check
846
+ // must be able to name its upstream base, or the run fails with that reason.
847
+ assertUpstreamBasePrecondition(context.workspaceRoot);
844
848
  preTaskResults(options, context);
845
849
  await preProducerReceipts(options, context);
846
850
  await serveRunCpuPool(context);
@@ -1,4 +1,4 @@
1
- /** One test file's installation: made on first use and shared by its fixtures, retired by the file's `afterAll`. */
1
+ /** One test file's installation: taken on first use and shared by its fixtures, retired by the file's `afterAll`. */
2
2
  export interface TestFileInstallation {
3
3
  /** The `node_modules` a fixture workspace links. */
4
4
  readonly nodeModules: () => Promise<string>;
@@ -6,9 +6,10 @@ export interface TestFileInstallation {
6
6
  readonly retire: () => Promise<void>;
7
7
  }
8
8
  /**
9
- * The installation one test file owns: a copy of the closure `censusRoot` (the workspace whose Nx, plugin and
10
- * TypeScript the fixtures stand for) resolves, made in the empty directory `makeRoot` creates on first use. Call once
11
- * per file, at module scope: Bun runs many test files in one process, and each must own its copy.
9
+ * The installation one test file owns: the copy of the closure `censusRoot` (the workspace whose Nx, plugin and
10
+ * TypeScript the fixtures stand for) resolves, kept as `name` in `censusRoot`'s tool cache and proved on first use.
11
+ * Call once per file, at module scope, with a name no other file uses: Bun runs many test files in one process, and
12
+ * each must own its copy. Two runs of one file at once share it, and a copy one of them makes again fails the other.
12
13
  */
13
- export declare function ownedInstallation(censusRoot: string, makeRoot: () => Promise<string>): TestFileInstallation;
14
+ export declare function ownedInstallation(censusRoot: string, name: string): TestFileInstallation;
14
15
  //# sourceMappingURL=owned-installation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"owned-installation.d.ts","sourceRoot":"","sources":["../src/owned-installation.ts"],"names":[],"mappings":"AAqJA,oHAAoH;AACpH,MAAM,WAAW,oBAAoB;IACnC,oDAAoD;IACpD,QAAQ,CAAC,WAAW,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5C,+FAA+F;IAC/F,QAAQ,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,GAAG,oBAAoB,CAW3G"}
1
+ {"version":3,"file":"owned-installation.d.ts","sourceRoot":"","sources":["../src/owned-installation.ts"],"names":[],"mappings":"AAsYA,qHAAqH;AACrH,MAAM,WAAW,oBAAoB;IACnC,oDAAoD;IACpD,QAAQ,CAAC,WAAW,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5C,+FAA+F;IAC/F,QAAQ,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,oBAAoB,CAWxF"}