@smoothbricks/nx-plugin 0.4.22 → 0.4.23

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 (62) hide show
  1. package/README.md +77 -21
  2. package/dist/bin/smoo-nx-exec.js +35 -11
  3. package/dist/cargo-closure-input.d.ts +63 -0
  4. package/dist/cargo-closure-input.d.ts.map +1 -0
  5. package/dist/cargo-closure-input.js +197 -0
  6. package/dist/cargo-source-hash.d.ts +37 -0
  7. package/dist/cargo-source-hash.d.ts.map +1 -1
  8. package/dist/cargo-source-hash.js +108 -190
  9. package/dist/cross-check-policy.d.ts +14 -0
  10. package/dist/cross-check-policy.d.ts.map +1 -1
  11. package/dist/cross-check-policy.js +15 -1
  12. package/dist/ensure-built.d.ts +3 -2
  13. package/dist/ensure-built.d.ts.map +1 -1
  14. package/dist/ensure-built.js +33 -56
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +112 -76
  17. package/dist/managed-files/ci-workflow.d.ts.map +1 -1
  18. package/dist/managed-files/ci-workflow.js +12 -15
  19. package/dist/managed-files/files.d.ts.map +1 -1
  20. package/dist/managed-files/files.js +10 -0
  21. package/dist/managed-files/publish-workflow.d.ts.map +1 -1
  22. package/dist/managed-files/publish-workflow.js +12 -6
  23. package/dist/manifest-hash.d.ts.map +1 -1
  24. package/dist/manifest-hash.js +24 -30
  25. package/dist/package-target-policy.js +1 -1
  26. package/dist/platform-targets.d.ts +7 -0
  27. package/dist/platform-targets.d.ts.map +1 -1
  28. package/dist/platform-targets.js +7 -0
  29. package/dist/workspace-config-policy.d.ts +1 -1
  30. package/dist/workspace-config-policy.d.ts.map +1 -1
  31. package/dist/workspace-config-policy.js +1 -1
  32. package/managed/raw/envrc +38 -1
  33. package/managed/raw/tooling/direnv/developer-links.ts +201 -0
  34. package/managed/raw/tooling/direnv/devenv.smoo.nix +75 -51
  35. package/managed/raw/tooling/direnv/secret-references.ts +3 -1
  36. package/managed/raw/tooling/direnv/setup-environment.ts +562 -78
  37. package/managed/raw/tooling/direnv/shared-caches.sh +53 -0
  38. package/managed/raw/tooling/git-hooks/pre-push.sh +22 -1
  39. package/managed/templates/github/workflows/managed-files.yml +4 -3
  40. package/nextest.toml +5 -5
  41. package/package.json +2 -2
  42. package/src/__tests__/fixture-nx-env.ts +31 -0
  43. package/src/__tests__/in-process-nx-index.ts +9 -0
  44. package/src/bin/smoo-nx-exec.ts +40 -11
  45. package/src/cargo-closure-input.test.ts +184 -0
  46. package/src/cargo-closure-input.ts +247 -0
  47. package/src/cargo-source-hash.test.ts +8 -9
  48. package/src/cargo-source-hash.ts +146 -47
  49. package/src/cross-check-policy.ts +15 -3
  50. package/src/ensure-built.test.ts +65 -5
  51. package/src/ensure-built.ts +40 -85
  52. package/src/index.test.ts +94 -53
  53. package/src/index.ts +164 -84
  54. package/src/managed-files/ci-workflow.ts +12 -15
  55. package/src/managed-files/files.ts +10 -0
  56. package/src/managed-files/generator.test.ts +29 -0
  57. package/src/managed-files/publish-workflow.ts +17 -6
  58. package/src/manifest-hash.test.ts +21 -1
  59. package/src/manifest-hash.ts +26 -29
  60. package/src/package-target-policy.ts +1 -1
  61. package/src/platform-targets.ts +8 -0
  62. package/src/workspace-config-policy.ts +6 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,aAAa,EAGnB,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAKL,yBAAyB,EAa1B,MAAM,sBAAsB,CAAC;AAiB9B,OAAO,EAAE,yBAAyB,EAAE,CAAC;AAErC,gEAAgE;AAChE,eAAO,MAAM,aAAa,WAAW,CAAC;AACtC,uEAAuE;AACvE,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAqQlD,KAAK,gBAAgB,GAAG,OAAO,GAAG,KAAK,CAAC;AACxC,KAAK,gBAAgB,GAAG,OAAO,GAAG,OAAO,CAAC;AAE1C,UAAU,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+7,13 @@ import { readJsonFile, } from 'nx/src/devkit-exports.js';
7
7
  import { AggregateCreateNodesError } from 'nx/src/project-graph/error-types.js';
8
8
  import { parse as parseToml } from 'smol-toml';
9
9
  import { BOUNDED_TEST_KILL_AFTER_MS, BOUNDED_TEST_TIMEOUT_MS } from './bounded-test-policy.js';
10
+ import { CARGO_CLOSURE_INPUT, cargoClosureInputs, indexedCargoManifests, resolveCargoClosureSource, } from './cargo-closure-input.js';
10
11
  import { CARGO_TOOLCHAIN_NAMED_INPUT, CARGO_TOOLCHAIN_PIN_INPUTS } from './cargo-toolchain-policy.js';
11
12
  import { attributeCargoWorkspacePackages, CARGO_TEST_ARCHIVE_FILE, CARGO_TEST_ARCHIVE_TARGET, CARGO_TEST_COMPILE_TARGET, CARGO_TEST_EXCEPTIONS_SUFFIX, CARGO_TEST_TARGET, cargoPackageTestInputs, cargoTestPackageTargetName, createCargoInputsCache, exceptionalTestFilter, listCargoCrossTestTargets, listCargoWorkspacePackages, NEXTEST_REPO_CONFIG_PATH, nextestToolConfigArg, } from './cargo-workspace.js';
12
13
  import { CARGO_CROSS_LINT_COMMAND, CARGO_CROSS_LINT_TARGET, CARGO_FETCH_COMMAND, CARGO_FETCH_TARGET, CARGO_FROZEN_PREFIX, CARGO_LINT_CLIPPY_COMMAND, cargoCrossTestArchiveFile, cargoCrossTestArchiveTargetName, cargoCrossTestTargetName, cargoFrozen, } from './cross-check-policy.js';
13
14
  import { hashVersionlessCrateManifests } from './manifest-hash.js';
14
15
  import { isNonSourceDirectory } from './source-directories.js';
15
- import { isBuildOutputTargetName, isTestRunnerTargetName, PLATFORM_TARGET_GLOBS } from './workspace-config-policy.js';
16
+ import { isBuildOutputTargetName, isTestRunnerTargetName, PLATFORM_TARGET_GLOBS, RELEASE_CONFIGURATION, } from './workspace-config-policy.js';
16
17
  export { CARGO_TEST_COMPILE_TARGET };
17
18
  /** Makes a version live and proves it answers; never cached. */
18
19
  export const DEPLOY_TARGET = 'deploy';
@@ -412,13 +413,33 @@ const NAPI_TOOLCHAIN_TARGET_PREFIX = 'napi-toolchain-';
412
413
  export function napiToolchainTargetName(convention) {
413
414
  return `${NAPI_TOOLCHAIN_TARGET_PREFIX}${convention.architecture}-${convention.targetFamily}`;
414
415
  }
415
- function createCargoWasmTarget(projectRoot, config, repoRooted) {
416
- const cargoTargetDirectory = repoRooted
417
- ? 'target/cargo-wasm'
418
- : posix.join(posix.dirname(config.manifestPath), 'target/cargo-wasm');
419
- const wasmInput = `${cargoTargetDirectory}/wasm32-unknown-unknown/release/${config.libraryName}.wasm`;
416
+ const CARGO_PROFILE_FLAG = { dev: '', release: ' --release' };
417
+ /** The directory under `target/<triple>/` each profile writes. */
418
+ const CARGO_PROFILE_OUTPUT_DIR = { dev: 'debug', release: 'release' };
419
+ /**
420
+ * Cargo's default target directory for a crate, relative to the command's cwd:
421
+ * `target/` beside the workspace root that owns the crate, or beside the
422
+ * crate's own manifest when no workspace claims it. Naming it rather than
423
+ * passing `--target-dir` keeps the wasm build in the directory every other
424
+ * build of the same workspace writes.
425
+ */
426
+ function cargoWasmTargetDirectory(projectRoot, config, repoRooted, cargoWorkspace) {
427
+ const cwd = repoRooted ? '.' : projectRoot;
428
+ const crateDir = posix.join(cwd, posix.dirname(config.manifestPath));
429
+ const owner = cargoWorkspace !== undefined &&
430
+ cargoWorkspace.packages.some((plan) => posix.join(cargoWorkspace.projectRoot, plan.package.dir) === crateDir)
431
+ ? cargoWorkspace.projectRoot
432
+ : crateDir;
433
+ return posix.relative(cwd, posix.join(owner, 'target'));
434
+ }
435
+ function createCargoWasmTarget(projectRoot, config, repoRooted, cargoTargetDirectory) {
420
436
  const outputDirectory = repoRooted ? posix.join(projectRoot, config.outputDirectory) : config.outputDirectory;
421
437
  const cargoSelection = repoRooted ? `-p ${config.cargoPackage}` : `--manifest-path ${config.manifestPath}`;
438
+ const commands = (profile) => [
439
+ cargoFrozen(`build${CARGO_PROFILE_FLAG[profile]} --target wasm32-unknown-unknown ${cargoSelection}`),
440
+ ...config.targets.map(({ bindgenTarget, outputName }) => `wasm-bindgen --target ${bindgenTarget} --out-dir ${outputDirectory}/${outputName} ` +
441
+ `${cargoTargetDirectory}/wasm32-unknown-unknown/${CARGO_PROFILE_OUTPUT_DIR[profile]}/${config.libraryName}.wasm`),
442
+ ];
422
443
  return {
423
444
  executor: 'nx:run-commands',
424
445
  cache: true,
@@ -426,13 +447,11 @@ function createCargoWasmTarget(projectRoot, config, repoRooted) {
426
447
  inputs: repoRooted ? REPO_ROOT_CARGO_OUTPUT_INPUTS : CARGO_OUTPUT_INPUTS,
427
448
  outputs: [`{projectRoot}/${config.outputDirectory}`],
428
449
  options: {
429
- commands: [
430
- cargoFrozen(`build --release --target wasm32-unknown-unknown --target-dir ${cargoTargetDirectory} ${cargoSelection}`),
431
- ...config.targets.map(({ bindgenTarget, outputName }) => `wasm-bindgen --target ${bindgenTarget} --out-dir ${outputDirectory}/${outputName} ${wasmInput}`),
432
- ],
450
+ commands: commands('dev'),
433
451
  cwd: repoRooted ? '.' : projectRoot,
434
452
  parallel: false,
435
453
  },
454
+ configurations: { [RELEASE_CONFIGURATION]: { commands: commands('release') } },
436
455
  };
437
456
  }
438
457
  /**
@@ -448,13 +467,19 @@ function createCargoWasmTarget(projectRoot, config, repoRooted) {
448
467
  * timeout. Inference serializes writers that share the default target dir
449
468
  * (`napi-debug` after compile).
450
469
  *
451
- * Clippy writes ONE shared `--target-dir target/cargo-lint` rather than a
452
- * directory per crate. Per-crate dirs were never about overlap: clippy of a
453
- * crate is a check build of its whole closure, so 49 crates meant 49 closure
454
- * rebuilds and 11 GiB of target directories on one repository, and no
455
- * per-crate cache hit ever repaid that. Sharing the directory costs nothing:
456
- * cargo's own lock serializes the invocations that use it and each dependency
457
- * artifact is then compiled once for all of them.
470
+ * Clippy runs ONCE over the whole workspace, in that same `target/`, rather
471
+ * than once per crate. Clippy of a crate is a check build of its whole
472
+ * closure, so 49 crates meant 49 closure rebuilds and 11 GiB of target
473
+ * directories on one repository, and no per-crate cache hit ever repaid that.
474
+ * Sharing the build's directory costs nothing: cargo's own lock serializes
475
+ * the invocations that use it, and the host units a dev build compiled are
476
+ * reused instead of compiled again.
477
+ *
478
+ * Tests compile the dev profile only, so no test target carries a
479
+ * RELEASE_CONFIGURATION: Nx forwards a run's configuration down every
480
+ * `dependsOn` edge to each target that has it, and a release `build` must
481
+ * warm the dev test binaries the test run will use, not release ones nobody
482
+ * runs.
458
483
  */
459
484
  function createCargoTestCompileTarget(projectRoot) {
460
485
  return {
@@ -466,9 +491,6 @@ function createCargoTestCompileTarget(projectRoot) {
466
491
  command: cargoFrozen('test --workspace --no-run'),
467
492
  cwd: projectRoot,
468
493
  },
469
- configurations: {
470
- production: { command: cargoFrozen('test --workspace --release --no-run') },
471
- },
472
494
  };
473
495
  }
474
496
  /**
@@ -488,22 +510,19 @@ function createCargoTestCompileTarget(projectRoot) {
488
510
  * clippy selection exactly, so both gates unify features the same way.
489
511
  */
490
512
  function createCargoTestArchiveTarget(projectRoot, toolConfig) {
491
- const archiveCommand = (profile) => cargoFrozen(`nextest archive --workspace${profile} --archive-file ${CARGO_TEST_ARCHIVE_FILE} --user-config-file none ${toolConfig}`);
492
513
  return {
493
514
  executor: 'nx:run-commands',
494
515
  cache: true,
495
516
  inputs: CARGO_INPUTS,
496
517
  outputs: [`{projectRoot}/${CARGO_TEST_ARCHIVE_FILE}`],
497
518
  options: {
498
- commands: [`mkdir -p ${posix.dirname(CARGO_TEST_ARCHIVE_FILE)}`, archiveCommand('')],
519
+ commands: [
520
+ `mkdir -p ${posix.dirname(CARGO_TEST_ARCHIVE_FILE)}`,
521
+ cargoFrozen(`nextest archive --workspace --archive-file ${CARGO_TEST_ARCHIVE_FILE} --user-config-file none ${toolConfig}`),
522
+ ],
499
523
  cwd: projectRoot,
500
524
  parallel: false,
501
525
  },
502
- configurations: {
503
- production: {
504
- commands: [`mkdir -p ${posix.dirname(CARGO_TEST_ARCHIVE_FILE)}`, archiveCommand(' --release')],
505
- },
506
- },
507
526
  };
508
527
  }
509
528
  /**
@@ -539,8 +558,6 @@ function createCargoTestArchiveTarget(projectRoot, toolConfig) {
539
558
  function createCargoCrossTestTargets(projectRoot, toolConfig, crossTarget, archiveInputs) {
540
559
  const { target: triple, cargo } = crossTarget;
541
560
  const archiveFile = cargoCrossTestArchiveFile(triple);
542
- const archiveCommand = (profile) => `cargo-nextest nextest archive --workspace${profile} --target ${triple} --frozen ` +
543
- `--archive-file ${archiveFile} --user-config-file none ${toolConfig}`;
544
561
  return {
545
562
  [cargoCrossTestArchiveTargetName(triple)]: {
546
563
  executor: 'nx:run-commands',
@@ -565,7 +582,11 @@ function createCargoCrossTestTargets(projectRoot, toolConfig, crossTarget, archi
565
582
  outputs: [`{projectRoot}/${archiveFile}`],
566
583
  dependsOn: [CARGO_FETCH_TARGET],
567
584
  options: {
568
- commands: [`mkdir -p ${posix.dirname(archiveFile)}`, archiveCommand('')],
585
+ commands: [
586
+ `mkdir -p ${posix.dirname(archiveFile)}`,
587
+ `cargo-nextest nextest archive --workspace --target ${triple} --frozen ` +
588
+ `--archive-file ${archiveFile} --user-config-file none ${toolConfig}`,
589
+ ],
569
590
  cwd: projectRoot,
570
591
  parallel: false,
571
592
  // `CARGO` is cargo's own driver variable and the only seam nextest
@@ -576,11 +597,6 @@ function createCargoCrossTestTargets(projectRoot, toolConfig, crossTarget, archi
576
597
  // it applies to this archive and to nothing else cargo runs.
577
598
  ...(cargo === undefined ? {} : { env: { CARGO: cargo } }),
578
599
  },
579
- configurations: {
580
- production: {
581
- commands: [`mkdir -p ${posix.dirname(archiveFile)}`, archiveCommand(' --release')],
582
- },
583
- },
584
600
  },
585
601
  [cargoCrossTestTargetName(triple)]: {
586
602
  executor: '@smoothbricks/nx-plugin:bounded-exec',
@@ -595,9 +611,6 @@ function createCargoCrossTestTargets(projectRoot, toolConfig, crossTarget, archi
595
611
  timeoutMs: BOUNDED_TEST_TIMEOUT_MS,
596
612
  killAfterMs: BOUNDED_TEST_KILL_AFTER_MS,
597
613
  },
598
- // The archive already holds the profile it was built with, and nextest
599
- // rejects `--release` beside `--archive-file`.
600
- configurations: { production: {} },
601
614
  },
602
615
  };
603
616
  }
@@ -613,9 +626,6 @@ function createCargoTestTarget(projectRoot) {
613
626
  timeoutMs: BOUNDED_TEST_TIMEOUT_MS,
614
627
  killAfterMs: BOUNDED_TEST_KILL_AFTER_MS,
615
628
  },
616
- configurations: {
617
- production: { command: cargoFrozen('test --workspace --release') },
618
- },
619
629
  };
620
630
  }
621
631
  const PLUGIN_NEXTEST_CONFIG = fileURLToPath(new URL('../nextest.toml', import.meta.url));
@@ -692,6 +702,9 @@ function createNodesHandler(hostPlatform) {
692
702
  errors.push([packageJsonPath, error instanceof Error ? error : new Error(String(error))]);
693
703
  }
694
704
  }));
705
+ // A project that failed before reaching its closure never awaited Cargo;
706
+ // no process this call started may outlive it.
707
+ await Promise.all(cargoWorkspaces.map((workspace) => workspace.closureSource));
695
708
  if (errors.length > 0) {
696
709
  throw new AggregateCreateNodesError(errors, results);
697
710
  }
@@ -897,7 +910,7 @@ async function createProjectTargets(packageJsonPath, workspaceRoot, hostPlatform
897
910
  validationTargets.push('typecheck');
898
911
  }
899
912
  if (inferCargoWasm && cargoWasmConfig) {
900
- targets['cargo-wasm'] = createCargoWasmTarget(projectRoot, cargoWasmConfig, isRepoRootedCargoProject);
913
+ targets['cargo-wasm'] = createCargoWasmTarget(projectRoot, cargoWasmConfig, isRepoRootedCargoProject, cargoWasmTargetDirectory(projectRoot, cargoWasmConfig, isRepoRootedCargoProject, cargoWorkspace));
901
914
  }
902
915
  if (napiConfig) {
903
916
  Object.assign(targets, createNapiTargets(projectRoot, napiConfig, hostPlatform, isRepoRootedCargoProject));
@@ -998,12 +1011,13 @@ async function createProjectTargets(packageJsonPath, workspaceRoot, hostPlatform
998
1011
  aggregateDependencies.length > 0
999
1012
  ? { executor: 'nx:noop', cache: true, outputs: [], dependsOn: aggregateDependencies }
1000
1013
  : createCargoTestTarget(cargoWorkspaceRoot);
1001
- // One clippy over the whole workspace, in one target dir. Clippy of a crate
1002
- // is a check build of its closure; a target dir per crate compiled every
1003
- // shared dependency once per crate (49 closures, 11 GiB on one repository)
1004
- // and no per-crate cache hit ever repaid that. The workspace inputs are
1005
- // exactly the union of every crate's, so the verdict caches on the same
1006
- // key set the compile does. Non-root packages depend on this target.
1014
+ // One clippy over the whole workspace, in the build's target dir. Clippy
1015
+ // of a crate is a check build of its closure; a target dir per crate
1016
+ // compiled every shared dependency once per crate (49 closures, 11 GiB on
1017
+ // one repository) and no per-crate cache hit ever repaid that. The
1018
+ // workspace inputs are exactly the union of every crate's, so the verdict
1019
+ // caches on the same key set the compile does. Non-root packages depend on
1020
+ // this target.
1007
1021
  targets['cargo-lint'] = {
1008
1022
  executor: 'nx:run-commands',
1009
1023
  cache: true,
@@ -1120,7 +1134,6 @@ async function createProjectTargets(packageJsonPath, workspaceRoot, hostPlatform
1120
1134
  const target = targets[name];
1121
1135
  if (target?.executor === 'nx:noop') {
1122
1136
  target.outputs = [];
1123
- target.configurations = { production: {} };
1124
1137
  }
1125
1138
  }
1126
1139
  }
@@ -1291,7 +1304,7 @@ async function createProjectTargets(packageJsonPath, workspaceRoot, hostPlatform
1291
1304
  // The platform binaries therefore stay Nx siblings of cargo-test-compile and
1292
1305
  // serialize on cargo's flock instead of on a graph edge. That is the same
1293
1306
  // arrangement `cli-<arch>-<os>` and `napi-<arch>-<os>` already have with each
1294
- // other — both `napi build --release` on one target dir — so this adds a third
1307
+ // other — both `napi build` on one target dir — so this adds a third
1295
1308
  // participant to an existing wait, not a new hazard. The flock makes them wait;
1296
1309
  // it does not corrupt anything, and these are unbounded `nx:run-commands`
1297
1310
  // targets, so the wait is not charged against a test budget.
@@ -1398,11 +1411,11 @@ async function createProjectTargets(packageJsonPath, workspaceRoot, hostPlatform
1398
1411
  }
1399
1412
  // Every cargo build directory this project's own commands write. `clean`
1400
1413
  // cannot learn them from `outputs`: a clippy or nextest target dir is a
1401
- // multi-GB build tree that must never enter the Nx cache (`target/cargo-lint`
1402
- // alone was 11 GiB when each of 49 crates had its own), so the targets
1414
+ // multi-GB build tree that must never enter the Nx cache, so the targets
1403
1415
  // deliberately declare `outputs: []`. Reading `--target-dir` back off the
1404
1416
  // commands means the list cannot drift from what actually gets written, and a
1405
1417
  // directory is named relative to the command's own cwd, not the project root.
1418
+ // The workspace's default `target/` is not listed: every dev build shares it.
1406
1419
  const cargoBuildDirs = [
1407
1420
  ...new Set(Object.entries(targets).flatMap(([name, target]) => {
1408
1421
  const cwd = target.options?.cwd;
@@ -1483,6 +1496,18 @@ async function createProjectTargets(packageJsonPath, workspaceRoot, hostPlatform
1483
1496
  ? { [CARGO_TOOLCHAIN_NAMED_INPUT]: [...CARGO_TOOLCHAIN_PIN_INPUTS] }
1484
1497
  : {}),
1485
1498
  };
1499
+ // A custom Cargo target names this instead of a hand-kept crate list or a
1500
+ // per-project runtime command: Cargo decides the closure once per graph
1501
+ // computation and Nx hashes its files from its own index. Defined for a
1502
+ // project with a workspace crate under its root — the same projects the
1503
+ // `--closure <projectRoot>` command could describe.
1504
+ const closureSources = cargoWorkspaces.filter((workspace) => workspace.packages.some(({ package: pkg }) => {
1505
+ const crate = posix.join(workspace.projectRoot, pkg.dir);
1506
+ return projectRoot === '.' || crate === projectRoot || crate.startsWith(`${projectRoot}/`);
1507
+ }));
1508
+ if (closureSources.length > 0) {
1509
+ namedInputs[CARGO_CLOSURE_INPUT] = await cargoClosureInputs(projectRoot, await Promise.all(closureSources.map((workspace) => workspace.closureSource)));
1510
+ }
1486
1511
  return {
1487
1512
  projects: {
1488
1513
  [projectRoot]: {
@@ -1669,13 +1694,14 @@ function createNapiTargets(projectRoot, config, hostPlatform, repoRooted) {
1669
1694
  }
1670
1695
  const targets = {};
1671
1696
  const hostCompilerEnv = napiCompilerEnv(hostPlatform, hostPlatform);
1672
- // The addon the test suite loads. A dev-profile build shares target/debug
1673
- // with cargo-test's dependency graph, so after the tests compile this is
1674
- // nearly free — where the release platform build it replaces cost minutes
1675
- // and sat alone on the test critical path. The output lives OUTSIDE dist/
1676
- // because packages publish `files: ["dist"]` wholesale: a debug addon under
1677
- // dist/ would ship. native.ts resolves this directory only when the
1678
- // napi-test target sets NAPI_DEBUG_ADDON=1, so production loads never see it.
1697
+ // The addon the test suite loads. A plain dev build shares target/debug with
1698
+ // cargo-test's dependency graph, so after the tests compile this is nearly
1699
+ // free, where a `--target <triple>` platform build compiles the graph again
1700
+ // under target/<triple>/. The output lives OUTSIDE dist/ because packages
1701
+ // publish `files: ["dist"]` wholesale: an addon the test run wrote under
1702
+ // dist/ would ship in place of the release build. native.ts resolves this
1703
+ // directory only when the napi-test target sets NAPI_DEBUG_ADDON=1, so
1704
+ // production loads never see it.
1679
1705
  targets['napi-debug'] = {
1680
1706
  executor: 'nx:run-commands',
1681
1707
  cache: true,
@@ -1690,9 +1716,12 @@ function createNapiTargets(projectRoot, config, hostPlatform, repoRooted) {
1690
1716
  };
1691
1717
  if (nativeHostTargetName === null) {
1692
1718
  // The platform target for this host triple is the same compilation, so a
1693
- // second cargo-napi invocation only buys a duplicate dependency graph in
1694
- // target/release; native.ts already resolves the identical platform-suffixed
1695
- // filename from dist/native/<platform-dir> after dist/native/host.
1719
+ // second cargo-napi invocation only buys a duplicate dependency graph
1720
+ // (a plain build and a `--target` build write different target/
1721
+ // subdirectories); native.ts already resolves the identical
1722
+ // platform-suffixed filename from dist/native/<platform-dir> after
1723
+ // dist/native/host.
1724
+ const hostBuild = (profile) => `${napiCommand} build${CARGO_PROFILE_FLAG[profile]} --platform --no-js --dts ${config.binaryName}.napi.d.ts ${commonCommand} --output-dir ${outputPath('dist/native/host')}`;
1696
1725
  targets['cargo-napi'] = {
1697
1726
  executor: 'nx:run-commands',
1698
1727
  cache: true,
@@ -1701,9 +1730,10 @@ function createNapiTargets(projectRoot, config, hostPlatform, repoRooted) {
1701
1730
  outputs: ['{projectRoot}/dist/native/host'],
1702
1731
  options: {
1703
1732
  cwd: cargoCwd,
1704
- command: `${napiCommand} build --release --platform --no-js --dts ${config.binaryName}.napi.d.ts ${commonCommand} --output-dir ${outputPath('dist/native/host')}`,
1733
+ command: hostBuild('dev'),
1705
1734
  ...(hostCompilerEnv ? { env: hostCompilerEnv } : {}),
1706
1735
  },
1736
+ configurations: { [RELEASE_CONFIGURATION]: { command: hostBuild('release') } },
1707
1737
  };
1708
1738
  }
1709
1739
  for (const triple of config.targets) {
@@ -1735,6 +1765,7 @@ function createNapiTargets(projectRoot, config, hostPlatform, repoRooted) {
1735
1765
  const useNapiCross = usesNapiCross(convention, hostPlatform);
1736
1766
  const crossFlag = useNapiCross ? ' --use-napi-cross' : '';
1737
1767
  const compilerEnv = napiCompilerEnv(convention, hostPlatform);
1768
+ const platformBuild = (profile) => `${napiCommand} build${CARGO_PROFILE_FLAG[profile]} --platform --no-js --dts ${config.binaryName}.${convention.outputName}.d.ts --target ${triple}${crossFlag} ${commonCommand} --output-dir ${outputPath(outputDirectory)}`;
1738
1769
  targets[targetName] = {
1739
1770
  executor: 'nx:run-commands',
1740
1771
  cache: true,
@@ -1743,12 +1774,13 @@ function createNapiTargets(projectRoot, config, hostPlatform, repoRooted) {
1743
1774
  outputs: [`{projectRoot}/${outputDirectory}`],
1744
1775
  options: {
1745
1776
  cwd: cargoCwd,
1746
- command: `${napiCommand} build --release --platform --no-js --dts ${config.binaryName}.${convention.outputName}.d.ts --target ${triple}${crossFlag} ${commonCommand} --output-dir ${outputPath(outputDirectory)}`,
1777
+ command: platformBuild('dev'),
1747
1778
  // Genuine Linux cross-compiles use Clang plus napi-rs's downloaded
1748
1779
  // GNU sysroot. A native Linux target uses Nix's cc wrapper so C build
1749
1780
  // scripts resolve the host libc headers instead.
1750
1781
  ...(compilerEnv ? { env: compilerEnv } : {}),
1751
1782
  },
1783
+ configurations: { [RELEASE_CONFIGURATION]: { command: platformBuild('release') } },
1752
1784
  };
1753
1785
  }
1754
1786
  return targets;
@@ -1758,10 +1790,11 @@ function createNapiTestTarget(projectRoot, hasDedicatedBunfig) {
1758
1790
  return {
1759
1791
  executor: '@smoothbricks/nx-plugin:bounded-exec',
1760
1792
  cache: true,
1761
- // Deliberately NOT `build`: the aggregate drags the host-platform release
1762
- // binaries onto the test critical path, and the tests assert behavior, not
1763
- // optimization level. tsc-js supplies dist/ts for the suite's own imports;
1764
- // napi-debug supplies the addon.
1793
+ // Deliberately NOT `build`: the aggregate drags the host-platform binaries
1794
+ // onto the test critical path, and a `--target <triple>` platform build
1795
+ // compiles the whole graph again. tsc-js supplies dist/ts for the suite's
1796
+ // own imports; napi-debug supplies the addon from the graph cargo-test
1797
+ // already built.
1765
1798
  dependsOn: ['cargo-test', 'napi-debug', 'tsc-js', '^build'],
1766
1799
  options: {
1767
1800
  // cwd is src/, not the package root: `bun test <arg>` treats the arg as a
@@ -1872,7 +1905,7 @@ async function resolveCargoWorkspaces(packageJsonPaths, workspaceRoot) {
1872
1905
  // createProjectTargets records the path-specific parse failure below.
1873
1906
  }
1874
1907
  }
1875
- const workspaces = [];
1908
+ const found = [];
1876
1909
  for (const rootProject of projects) {
1877
1910
  const absoluteRoot = join(workspaceRoot, rootProject.root);
1878
1911
  const manifest = join(absoluteRoot, 'Cargo.toml');
@@ -1908,14 +1941,22 @@ async function resolveCargoWorkspaces(packageJsonPaths, workspaceRoot) {
1908
1941
  }
1909
1942
  packages.push({ package: pkg, pieces });
1910
1943
  }
1911
- workspaces.push({
1944
+ found.push({
1912
1945
  packages,
1913
1946
  rootProjectName: rootProject.name,
1914
1947
  projectRoot: rootProject.root,
1915
1948
  inputsCache: createCargoInputsCache(),
1916
1949
  });
1917
1950
  }
1918
- return workspaces;
1951
+ if (found.length === 0)
1952
+ return [];
1953
+ // Started only once every workspace listed cleanly, so a listing that throws
1954
+ // leaves no Cargo process behind.
1955
+ const indexedManifests = indexedCargoManifests(workspaceRoot);
1956
+ return found.map((workspace) => ({
1957
+ ...workspace,
1958
+ closureSource: resolveCargoClosureSource(posix.join(workspace.projectRoot, 'Cargo.toml'), workspaceRoot, indexedManifests),
1959
+ }));
1919
1960
  }
1920
1961
  /**
1921
1962
  * One bounded target per crate; a crate that declares `smoothbricks.test.shards`
@@ -2016,11 +2057,6 @@ async function addCargoTestTargets(targets, currentProjectName, projectRoot, wor
2016
2057
  timeoutMs: BOUNDED_TEST_TIMEOUT_MS,
2017
2058
  killAfterMs: BOUNDED_TEST_KILL_AFTER_MS,
2018
2059
  },
2019
- // The archive already holds the profile it was built with, and nextest
2020
- // rejects `--release` beside `--archive-file`. Nx propagates the
2021
- // configuration to this target's dependencies, so `:production` builds
2022
- // the release archive and this command runs exactly what it finds.
2023
- configurations: { production: {} },
2024
2060
  };
2025
2061
  }
2026
2062
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ci-workflow.d.ts","sourceRoot":"","sources":["../../src/managed-files/ci-workflow.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,aAAa,EACb,6BAA6B,EAE7B,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,6BAA6B,EAC7B,2BAA2B,EAC5B,MAAM,0BAA0B,CAAC;AAGlC,oBAAY,kBAAkB;IAC5B,QAAQ,aAAa;IACrB,eAAe,qBAAqB;IACpC,WAAW,iBAAiB;IAC5B,gBAAgB,sBAAsB;IACtC,SAAS,gBAAgB;IACzB,cAAc,qBAAqB;IACnC,KAAK,UAAU;IACf,YAAY,kBAAkB;IAC9B,IAAI,SAAS;IACb,SAAS,eAAe;IACxB,uBAAuB,8BAA8B;IACrD,iBAAiB,wBAAwB;IACzC,uBAAuB,+BAA+B;IACtD,yBAAyB,iCAAiC;IAC1D,UAAU,gBAAgB;IAC1B,iBAAiB,wBAAwB;IACzC,oBAAoB,2BAA2B;IAC/C,MAAM,WAAW;IACjB,WAAW,kBAAkB;IAC7B,cAAc,qBAAqB;IACnC,aAAa,oBAAoB;CAClC;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,kBAAkB,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC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AI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAEhE;AAQD;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,EAAE,CAGjF;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GAAG,MAAM,EAAE,CAMxG;AAmRD,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,EAC9C,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,QAAQ,GAAG,UAAU,EAC3B,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,SAAS,SAAc,GACtB,MAAM,EAAE,CAmBV"}
@@ -60,7 +60,7 @@ export function defineCiWorkflow(options) {
60
60
  if (options.browserTests) {
61
61
  steps.push({ kind: CiWorkflowStepKind.BrowserTests, name: '🌐 Browser Tests' });
62
62
  }
63
- steps.push({ kind: CiWorkflowStepKind.ManagedFilesCheck, name: '🩺 Check managed-file drift' }, { kind: CiWorkflowStepKind.ManagedFilesDispatch, name: '🔁 Dispatch managed-file drift healing' }, { kind: CiWorkflowStepKind.SaveNxCache, name: '💾 Save Nx cache' }, { kind: CiWorkflowStepKind.UploadTraceDbs, name: '📎 Upload trace DBs' }, { kind: CiWorkflowStepKind.SaveNixDevenv, name: '🧹 Cleanup and cache Nix/devenv' });
63
+ steps.push({ kind: CiWorkflowStepKind.ManagedFilesCheck, name: '🩺 Check monorepo policies and managed-file drift' }, { kind: CiWorkflowStepKind.ManagedFilesDispatch, name: '🔁 Dispatch managed-file drift healing' }, { kind: CiWorkflowStepKind.SaveNxCache, name: '💾 Save Nx cache' }, { kind: CiWorkflowStepKind.UploadTraceDbs, name: '📎 Upload trace DBs' }, { kind: CiWorkflowStepKind.SaveNixDevenv, name: '🧹 Cleanup and cache Nix/devenv' });
64
64
  return steps.map((step, index) => ({ ...step, number: index + 2 }));
65
65
  }
66
66
  /**
@@ -314,24 +314,21 @@ function yamlLinesForStep(step, options) {
314
314
  ` run: smoo github-ci nx-run-many --targets "${darwinCrossTestTargetNames(options).join(',')}"`,
315
315
  ];
316
316
  case CiWorkflowStepKind.ManagedFilesCheck:
317
- // The authoritative drift check is nearly free here (devenv is already
318
- // up). --warn never fails the job and publishes the step output
319
- // `drifted=<count>` for the dispatch step below.
320
- return [
321
- ` - name: ${step.name}`,
322
- ' id: managed-drift',
323
- ' if:',
324
- " ${{ github.event_name == 'push' && github.ref == format('refs/heads/{0}',",
325
- ' github.event.repository.default_branch) }}',
326
- ' run: smoo monorepo check --warn',
327
- ];
317
+ // Runs on every event, pull requests included: the package policies fail the job, since
318
+ // nothing heals them, while --warn keeps managed-file drift non-blocking and publishes the
319
+ // step output `drifted=<count>` for the dispatch step below. The check is nearly free here
320
+ // (devenv is already up).
321
+ return [` - name: ${step.name}`, ' id: managed-drift', ' run: smoo monorepo check --warn'];
328
322
  case CiWorkflowStepKind.ManagedFilesDispatch:
329
323
  // Dispatches the managed-files workflow, which maintains the persistent
330
- // review PR. workflow_dispatch is exempt from GitHub's GITHUB_TOKEN
331
- // recursion guard, so the default token suffices.
324
+ // review PR, from the default branch only. workflow_dispatch is exempt from
325
+ // GitHub's GITHUB_TOKEN recursion guard, so the default token suffices.
332
326
  return [
333
327
  ` - name: ${step.name}`,
334
- " if: steps.managed-drift.outputs.drifted != '' && steps.managed-drift.outputs.drifted != '0'",
328
+ ' if: >-',
329
+ " ${{ github.event_name == 'push' && github.ref == format('refs/heads/{0}',",
330
+ " github.event.repository.default_branch) && steps.managed-drift.outputs.drifted != '' &&",
331
+ " steps.managed-drift.outputs.drifted != '0' }}",
335
332
  ' run: smoo github-ci dispatch-workflow --workflow managed-files.yml --ref "$GITHUB_REF_NAME"',
336
333
  ];
337
334
  case CiWorkflowStepKind.Deploy:
@@ -1 +1 @@
1
- {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/managed-files/files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AAyB;;;GAAyE,CAAC;AAchH,qFAAqF;AACrF,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,EAAE,CAElF;AAED,0EAA0E;AAC1E,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,GAAG,WAAW,EAAE,CAM7E;AAED,+GAA+G;AAC/G,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,aAAa,GAAG,kBAAkB,GAAG,6BAA6B,EAC1E,OAAO,EAAE,kBAAkB,GAC1B,MAAM,CAMR"}
@@ -46,6 +46,11 @@ const managedFiles = [
46
46
  target: 'tooling/direnv/setup-environment.ts',
47
47
  executable: true,
48
48
  },
49
+ {
50
+ kind: 'raw',
51
+ source: 'tooling/direnv/developer-links.ts',
52
+ target: 'tooling/direnv/developer-links.ts',
53
+ },
49
54
  {
50
55
  kind: 'raw',
51
56
  source: 'tooling/direnv/secret-references.ts',
@@ -62,6 +67,11 @@ const managedFiles = [
62
67
  source: 'tooling/direnv/devenv.smoo.nix',
63
68
  target: 'tooling/direnv/devenv.smoo.nix',
64
69
  },
70
+ {
71
+ kind: 'raw',
72
+ source: 'tooling/direnv/shared-caches.sh',
73
+ target: 'tooling/direnv/shared-caches.sh',
74
+ },
65
75
  {
66
76
  kind: 'raw',
67
77
  source: 'tooling/git-hooks/pre-commit.sh',
@@ -1 +1 @@
1
- {"version":3,"file":"publish-workflow.d.ts","sourceRoot":"","sources":["../../src/managed-files/publish-workflow.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,6BAA6B,EAC7B,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,2BAA2B,EAC5B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAKL,KAAK,sBAAsB,EAI5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAgD,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAExG,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAA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AAC,CAwFnC;AA2BD;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,GAAE,gCAAqC,GAAG,MAAM,CAkBhG"}
1
+ {"version":3,"file":"publish-workflow.d.ts","sourceRoot":"","sources":["../../src/managed-files/publish-workflow.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,6BAA6B,EAC7B,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,2BAA2B,EAC5B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAKL,KAAK,sBAAsB,EAI5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAgD,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AASxG,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,YAAY,CAAC;AACtF,MAAM,MAAM,wBAAwB,GAChC,oBAAoB,GACpB,uBAAuB,GACvB,mBAAmB,GACnB,8BAA8B,GAC9B,SAAS,GACT,QAAQ,CAAC;AACb,MAAM,MAAM,uBAAuB,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAChE,MAAM,MAAM,0BAA0B,GAAG,MAAM,GAAG,YAAY,CAAC;AAE/D,oBAAY,uBAAuB;IACjC,QAAQ,aAAa;IACrB,eAAe,qBAAqB;IACpC,gBAAgB,sBAAsB;IACtC,WAAW,iBAAiB;IAC5B,sBAAsB,6BAA6B;IACnD,qBAAqB,6BAA6B;IAClD,qBAAqB,4BAA4B;IACjD,WAAW,iBAAiB;IAC5B,cAAc,oBAAoB;IAClC,yBAAyB,iCAAiC;IAC1D,KAAK,UAAU;IACf,IAAI,SAAS;IACb,SAAS,eAAe;IACxB,cAAc,qBAAqB;IACnC,sBAAsB,6BAA6B;IACnD,UAAU,gBAAgB;IAC1B,cAAc,oBAAoB;IAClC,gBAAgB,sBAAsB;IACtC,aAAa,oBAAoB;CAClC;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,uBAAu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gB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,aAAa,CAAC,KAAK,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClE;AAED,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,qBAAqB,CAAC;IAC9B,SAAS,EAAE,wBAAwB,CAAC;CACrC;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,6BAA6B,CAAC;IACvC,MAAM,EAAE,OAAO,CAAC;CACjB;AAID,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,gCAAqC,GAAG,yBAAyB,CA2F/G;AAkCD,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,yBAAyB,EACnC,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,wBAAwB,CAAC,CAwFnC;AA2BD;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,GAAE,gCAAqC,GAAG,MAAM,CAkBhG"}
@@ -1,8 +1,14 @@
1
1
  /* biome-ignore-all lint/suspicious/noTemplateCurlyInString: GitHub Actions expressions are emitted literally. */
2
- import { LINUX_PLATFORM_TARGET_GLOBS, MACOS_PLATFORM_TARGET_GLOBS } from '../platform-targets.js';
2
+ import { LINUX_PLATFORM_TARGET_GLOBS, MACOS_PLATFORM_TARGET_GLOBS, RELEASE_CONFIGURATION, } from '../platform-targets.js';
3
3
  import { isSmoothBricksCodebasePackageName } from '../workspace-package-policy.js';
4
4
  import { artifactStepLines, CiWorkflowStepKind, cargoCredentialJobEnvLines, cargoCredentialStepLines, deployStepSecretEnvLines, remoteCacheJobEnvLines, sourceCheckoutsStepLines, } from './ci-workflow.js';
5
5
  import { GITHUB_HOSTED_LINUX_RUNNER, renderRunsOnLine } from './github-runs-on.js';
6
+ /**
7
+ * Carried by every step that builds what ships: the build aggregate and each
8
+ * platform leg. Lint and unit tests keep the default configuration, cargo's
9
+ * dev profile, like every local and CI run.
10
+ */
11
+ const RELEASE_BUILD_ARGUMENT = `--configuration ${RELEASE_CONFIGURATION}`;
6
12
  export var PublishWorkflowStepKind;
7
13
  (function (PublishWorkflowStepKind) {
8
14
  PublishWorkflowStepKind["Checkout"] = "checkout";
@@ -446,7 +452,7 @@ function yamlLinesForStep(step, options) {
446
452
  // blocks on actual package issues (smoo monorepo validate).
447
453
  return conditionalRunStep(step, 'smoo monorepo check --warn');
448
454
  case PublishWorkflowStepKind.Build:
449
- return conditionalRunStep(step, `smoo github-ci nx-run-many --targets build --projects "${githubExpression('steps.version.outputs.projects')}"`);
455
+ return conditionalRunStep(step, `smoo github-ci nx-run-many --targets build --projects "${githubExpression('steps.version.outputs.projects')}" ${RELEASE_BUILD_ARGUMENT}`);
450
456
  case PublishWorkflowStepKind.Lint:
451
457
  return conditionalRunStep(step, `smoo github-ci nx-run-many --targets lint --projects "${githubExpression('steps.plan.outputs.projects')}"`);
452
458
  case PublishWorkflowStepKind.UnitTests:
@@ -589,9 +595,9 @@ function renderSingleJobPublishWorkflowSteps(steps, options) {
589
595
  lines.push(' - name: Check cross-platform toolchain prerequisites', ' working-directory: .', ' run: |', ' set -euo pipefail', ...producer.preflight.split('\n').map((line) => ` ${line}`), '');
590
596
  }
591
597
  if (step.kind === PublishWorkflowStepKind.Build) {
592
- lines.push(' - name: 🐧 Build supplemental Linux targets', " if: steps.version.outputs.mode != 'none'", ` run: smoo github-ci nx-run-many --targets "${LINUX_PLATFORM_TARGET_GLOBS.join(',')}" --projects "${githubExpression('steps.version.outputs.projects')}"`, '');
598
+ lines.push(' - name: 🐧 Build supplemental Linux targets', " if: steps.version.outputs.mode != 'none'", ` run: smoo github-ci nx-run-many --targets "${LINUX_PLATFORM_TARGET_GLOBS.join(',')}" --projects "${githubExpression('steps.version.outputs.projects')}" ${RELEASE_BUILD_ARGUMENT}`, '');
593
599
  if (crossOnThisRunner) {
594
- lines.push(' - name: 🍎 Build selected macOS and iOS release outputs', " if: steps.version.outputs.mode != 'none'", ` run: smoo github-ci nx-run-many --targets "${macosPlatformFamilies(options).join(',')}" --projects "${githubExpression('steps.version.outputs.projects')}"`, '');
600
+ lines.push(' - name: 🍎 Build selected macOS and iOS release outputs', " if: steps.version.outputs.mode != 'none'", ` run: smoo github-ci nx-run-many --targets "${macosPlatformFamilies(options).join(',')}" --projects "${githubExpression('steps.version.outputs.projects')}" ${RELEASE_BUILD_ARGUMENT}`, '');
595
601
  }
596
602
  }
597
603
  }
@@ -706,7 +712,7 @@ function renderLinuxReleaseCandidateSteps(steps, options) {
706
712
  lines.push(` - name: ${step.name}`, ' uses: actions/checkout@v6.0.2', ' with:', ` ref: ${githubExpression('github.sha')}`, ' filter: blob:none', ' fetch-depth: 0');
707
713
  }
708
714
  else if (step.kind === PublishWorkflowStepKind.Build) {
709
- lines.push(` - name: ${step.name}`, " if: steps.version.outputs.mode != 'none'", ' run:', ` smoo github-ci nx-run-many --targets build --projects "${githubExpression('steps.version.outputs.projects')}" --collect-outputs "${githubExpression('runner.temp')}/release-build-outputs"`);
715
+ lines.push(` - name: ${step.name}`, " if: steps.version.outputs.mode != 'none'", ' run:', ` smoo github-ci nx-run-many --targets build --projects "${githubExpression('steps.version.outputs.projects')}" ${RELEASE_BUILD_ARGUMENT} --collect-outputs "${githubExpression('runner.temp')}/release-build-outputs"`);
710
716
  }
711
717
  else {
712
718
  lines.push(...yamlLinesForStep(step, options));
@@ -717,7 +723,7 @@ function renderLinuxReleaseCandidateSteps(steps, options) {
717
723
  stepNumber += 1;
718
724
  }
719
725
  if (step.kind === PublishWorkflowStepKind.Build && hasLinuxPlatformTargets(options)) {
720
- lines.push('', ` # Step ${stepNumber}`, ' - name: 🐧 Build supplemental Linux targets', " if: steps.version.outputs.mode != 'none'", ' run:', ` smoo github-ci nx-run-many --targets "${LINUX_PLATFORM_TARGET_GLOBS.join(',')}" --projects "${githubExpression('steps.version.outputs.projects')}" --collect-outputs "${githubExpression('runner.temp')}/linux-platform-outputs"`);
726
+ lines.push('', ` # Step ${stepNumber}`, ' - name: 🐧 Build supplemental Linux targets', " if: steps.version.outputs.mode != 'none'", ' run:', ` smoo github-ci nx-run-many --targets "${LINUX_PLATFORM_TARGET_GLOBS.join(',')}" --projects "${githubExpression('steps.version.outputs.projects')}" ${RELEASE_BUILD_ARGUMENT} --collect-outputs "${githubExpression('runner.temp')}/linux-platform-outputs"`);
721
727
  stepNumber += 1;
722
728
  }
723
729
  lines.push('');
@@ -1 +1 @@
1
- {"version":3,"file":"manifest-hash.d.ts","sourceRoot":"","sources":["../src/manifest-hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AAoEpD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CA8CjF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,6BAA6B,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAgB/G"}
1
+ {"version":3,"file":"manifest-hash.d.ts","sourceRoot":"","sources":["../src/manifest-hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AAoEpD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CA8CjF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,6BAA6B,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAiB/G"}