@williamthorsen/nmr 2.0.2 → 2.1.0

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 (73) hide show
  1. package/.meta/changelog.json +72 -0
  2. package/.readyup/kits/default.js +66 -35
  3. package/.readyup/manifest.json +38 -39
  4. package/CHANGELOG.md +25 -0
  5. package/README.md +7 -9
  6. package/dist/esm/assertResolvableCommandLists.d.ts +18 -0
  7. package/dist/esm/{check-cache/config-check-cache.js → assertResolvableCommandLists.js} +20 -12
  8. package/dist/esm/check-cache/check-cache-entries.js +1 -1
  9. package/dist/esm/check-cache/check-cache-gate.js +1 -1
  10. package/dist/esm/check-cache/check-cache-record.js +1 -1
  11. package/dist/esm/check-cache/check-cache.js +1 -1
  12. package/dist/esm/commands/build-output.d.ts +2 -1
  13. package/dist/esm/commands/build.js +1 -1
  14. package/dist/esm/commands/fmt.js +1 -1
  15. package/dist/esm/commands/taze.js +2 -2
  16. package/dist/esm/config-validation.js +25 -3
  17. package/dist/esm/config.js +1 -1
  18. package/dist/esm/crossing-diagnostics.js +1 -1
  19. package/dist/esm/defineConfig.d.ts +1 -1
  20. package/dist/esm/delegation/delegate-host.js +2 -2
  21. package/dist/esm/delegation/remote-probe.js +1 -1
  22. package/dist/esm/delegation/user-config.d.ts +2 -1
  23. package/dist/esm/delegation/user-config.js +1 -1
  24. package/dist/esm/{help.js → describeHelp.js} +1 -1
  25. package/dist/esm/fan-out.d.ts +7 -0
  26. package/dist/esm/fan-out.js +7 -2
  27. package/dist/esm/invocation.d.ts +1 -1
  28. package/dist/esm/machine-lock.d.ts +0 -4
  29. package/dist/esm/machine-lock.js +2 -2
  30. package/dist/esm/presentation.js +1 -1
  31. package/dist/esm/report-format.d.ts +2 -8
  32. package/dist/esm/report-format.js +8 -8
  33. package/dist/esm/resolve-scripts.js +1 -1
  34. package/dist/esm/route.js +1 -1
  35. package/dist/esm/run-chain.js +1 -1
  36. package/dist/esm/runCli.js +2 -2
  37. package/dist/esm/tiers.js +1 -1
  38. package/dist/esm/types.d.ts +12 -0
  39. package/dist/esm/verbosity.d.ts +2 -1
  40. package/dist/esm/verbosity.js +1 -1
  41. package/dist/esm/vitest.js +2 -2
  42. package/docs/scripts.md +12 -0
  43. package/package.json +8 -8
  44. package/dist/esm/check-cache/config-check-cache.d.ts +0 -17
  45. /package/dist/esm/check-cache/{replay-assembly.d.ts → assembleReplay.d.ts} +0 -0
  46. /package/dist/esm/check-cache/{replay-assembly.js → assembleReplay.js} +0 -0
  47. /package/dist/esm/check-cache/{check-cache-delegation.d.ts → recordDelegatedPass.d.ts} +0 -0
  48. /package/dist/esm/check-cache/{check-cache-delegation.js → recordDelegatedPass.js} +0 -0
  49. /package/dist/esm/commands/{load-package-maturity-period.d.ts → loadPackageMaturityPeriod.d.ts} +0 -0
  50. /package/dist/esm/commands/{load-package-maturity-period.js → loadPackageMaturityPeriod.js} +0 -0
  51. /package/dist/esm/commands/{taze-passes.d.ts → planTazePasses.d.ts} +0 -0
  52. /package/dist/esm/commands/{taze-passes.js → planTazePasses.js} +0 -0
  53. /package/dist/esm/commands/{format-targets.d.ts → resolveFormatTargets.d.ts} +0 -0
  54. /package/dist/esm/commands/{format-targets.js → resolveFormatTargets.js} +0 -0
  55. /package/dist/esm/commands/{tsconfig-chain.d.ts → resolveTsconfigChain.d.ts} +0 -0
  56. /package/dist/esm/commands/{tsconfig-chain.js → resolveTsconfigChain.js} +0 -0
  57. /package/dist/esm/delegation/{remote-snapshot.d.ts → createSnapshot.d.ts} +0 -0
  58. /package/dist/esm/delegation/{remote-snapshot.js → createSnapshot.js} +0 -0
  59. /package/dist/esm/delegation/{remote-probe-host.d.ts → probeHostLocks.d.ts} +0 -0
  60. /package/dist/esm/delegation/{remote-probe-host.js → probeHostLocks.js} +0 -0
  61. /package/dist/esm/delegation/{delegation-target.d.ts → resolveDelegationTarget.d.ts} +0 -0
  62. /package/dist/esm/delegation/{delegation-target.js → resolveDelegationTarget.js} +0 -0
  63. /package/dist/esm/{help.d.ts → describeHelp.d.ts} +0 -0
  64. /package/dist/esm/helpers/{hook-name.d.ts → isHookName.d.ts} +0 -0
  65. /package/dist/esm/helpers/{hook-name.js → isHookName.js} +0 -0
  66. /package/dist/esm/helpers/{type-guards.d.ts → isStringRecord.d.ts} +0 -0
  67. /package/dist/esm/helpers/{type-guards.js → isStringRecord.js} +0 -0
  68. /package/dist/esm/{git-ignored-paths.d.ts → listGitIgnoredPaths.d.ts} +0 -0
  69. /package/dist/esm/{git-ignored-paths.js → listGitIgnoredPaths.js} +0 -0
  70. /package/dist/esm/{bin-path.d.ts → prependBinDirs.d.ts} +0 -0
  71. /package/dist/esm/{bin-path.js → prependBinDirs.js} +0 -0
  72. /package/dist/esm/{workspace-globs.d.ts → toWorkspacePackageGlobs.d.ts} +0 -0
  73. /package/dist/esm/{workspace-globs.js → toWorkspacePackageGlobs.js} +0 -0
package/docs/scripts.md CHANGED
@@ -41,6 +41,17 @@ A script value is a string or an array of steps. Only the built-in defaults and
41
41
 
42
42
  Each array element is a command name, optionally preceded by nmr's own flags, split on whitespace: `-R test` runs the element in every package, the way `nmr -R test` does. An element containing a quoted argument or shell syntax is rejected when the config loads: Name that command as a script of its own and reference the name.
43
43
 
44
+ #### Package order in a fan-out
45
+
46
+ An `-R` or `-F` fan-out of `build` runs the packages in topological order, so that each package builds after its workspace dependencies. Every other fan-out passes `--no-sort` to pnpm and starts each package's command without waiting for its dependencies to finish theirs: `test`, the `test:*` commands, and `typecheck` read the `dist` that an earlier `build` wrote, not anything that the same command writes in another package. A command that does read what its dependencies' runs of it produce, such as a code generator whose output a dependent package imports, keeps the order once `fanOut.extraSortedCommands` lists it:
47
+
48
+ ```ts
49
+ // .config/nmr.config.ts
50
+ export default defineConfig({ fanOut: { extraSortedCommands: ['generate'] } });
51
+ ```
52
+
53
+ The list adds to `build` and cannot remove it, and a name in it that does not resolve to any command fails when the config loads.
54
+
44
55
  #### Running a step in the background
45
56
 
46
57
  A composite runs its steps in series. An element declared with `shouldRunInBackground` starts and is left running while the steps after it run:
@@ -125,6 +136,7 @@ A minimal `.config/nmr.config.ts` is in the [README](../README.md#configuration)
125
136
  | `delegate` | `false` | Keeps every check on the machine that has the tree, whatever `NMR_DELEGATE` or the [user config](delegate.md#the-user-config) says; a delegation flag still sends a run elsewhere (root config only) |
126
137
  | `workspaceScripts` | `Record<string, ScriptValue>` | Scripts added or overridden in the workspace registry (tier 2) |
127
138
  | `rootScripts` | `Record<string, ScriptValue>` | Scripts added or overridden in the root registry (tier 2) |
139
+ | `fanOut` | `{ extraSortedCommands?: string[] }` | Commands whose fan-out runs packages in topological order, besides `build`; see [package order in a fan-out](#package-order-in-a-fan-out) (root config only) |
128
140
  | `output` | `{ commandVerbosity?: CommandVerbosity; extraAgentEnvVars?: string[] }` | How loudly runs report command output; see [configuring](reporting.md#configuring) |
129
141
  | `selfHostedRunner` | `{ exempt: string }` | Why a qualifying repo keeps CI off the self-hosted runners; stops [nmr's readyup kit](../README.md#conformance-checks) from recommending `CI_RUNS_ON` (root config only). The reason is structural: a circular dependency, a platform or capacity the runners lack, or network reach. A missing tool is installed by a workflow step instead |
130
142
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@williamthorsen/nmr",
3
- "version": "2.0.2",
3
+ "version": "2.1.0",
4
4
  "private": false,
5
5
  "description": "Context-aware script runner for pnpm monorepos",
6
6
  "keywords": [
@@ -80,9 +80,9 @@
80
80
  "!docs/*.v*.md"
81
81
  ],
82
82
  "dependencies": {
83
- "@williamthorsen/nmr-core": "0.16.1",
84
- "@williamthorsen/toolbelt.errors": "0.9.1",
85
- "@williamthorsen/toolbelt.filesystem": "0.10.1",
83
+ "@williamthorsen/nmr-core": "0.16.2",
84
+ "@williamthorsen/toolbelt.errors": "0.10.0",
85
+ "@williamthorsen/toolbelt.filesystem": "0.10.2",
86
86
  "glob": "14.0.4",
87
87
  "prettier": "3.9.10",
88
88
  "prettier-plugin-sh": "0.20.2",
@@ -90,13 +90,13 @@
90
90
  "unconfig": "7.5.0"
91
91
  },
92
92
  "devDependencies": {
93
- "@williamthorsen/toolbelt.testing": "0.8.1",
94
- "@williamthorsen/toolbelt.vitest": "0.13.3",
93
+ "@williamthorsen/toolbelt.testing": "0.8.2",
94
+ "@williamthorsen/toolbelt.vitest": "0.13.4",
95
95
  "esbuild": "0.28.2",
96
- "readyup": "0.45.1",
96
+ "readyup": "0.46.1",
97
97
  "tinyglobby": "0.2.17",
98
98
  "typescript": "6.0.3",
99
- "vite": "8.3.7",
99
+ "vite": "8.3.8",
100
100
  "vitest": "5.1.0",
101
101
  "yaml": "2.9.1"
102
102
  },
@@ -1,17 +0,0 @@
1
- import type { NmrConfig } from '../types.js';
2
- /**
3
- * Rejects a `checkCache` name that does not resolve to any command. Both fields are read by name alone, so a
4
- * misspelt entry is inert: The command that it meant to name goes on running, indistinguishable from one that
5
- * cannot be cached at all.
6
- *
7
- * Because the test is resolvability rather than membership of the cacheable set, an `excludeCommands` entry
8
- * written against a name that a later release moves out of the defaults remains valid.
9
- *
10
- * Reads nothing while every name resolves in the merged registries, and reads a package's own `scripts` only
11
- * once a name is missing from them: Those are a resolution tier of their own; a name declared only there is
12
- * valid.
13
- *
14
- * Does nothing outside a monorepo root, where `checkCache` is a key that this tier does not honor. `assertTierKeys`
15
- * reports that, and of the two messages it is the one that names the real mistake.
16
- */
17
- export declare function assertResolvableCheckCacheCommands(config: NmrConfig, configPath: string, baseDir: string): void;
File without changes
File without changes
File without changes