@smoothbricks/cli 0.11.19 → 0.11.21
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 +68 -5
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +28 -4
- package/dist/lib/json.d.ts +22 -1
- package/dist/lib/json.d.ts.map +1 -1
- package/dist/lib/json.js +15 -3
- package/dist/monorepo/cargo-policy.d.ts +17 -0
- package/dist/monorepo/cargo-policy.d.ts.map +1 -1
- package/dist/monorepo/cargo-policy.js +73 -1
- package/dist/monorepo/index.d.ts.map +1 -1
- package/dist/monorepo/index.js +4 -2
- package/dist/monorepo/packs/index.d.ts.map +1 -1
- package/dist/monorepo/packs/index.js +6 -2
- package/dist/nx/index.d.ts +6 -1
- package/dist/nx/index.d.ts.map +1 -1
- package/dist/nx/index.js +14 -1
- package/dist/secrets/commands.d.ts +9 -5
- package/dist/secrets/commands.d.ts.map +1 -1
- package/dist/secrets/commands.js +122 -49
- package/dist/secrets/index.d.ts +42 -56
- package/dist/secrets/index.d.ts.map +1 -1
- package/dist/secrets/index.js +52 -79
- package/dist/secrets/resolver.d.ts +59 -0
- package/dist/secrets/resolver.d.ts.map +1 -0
- package/dist/secrets/resolver.js +100 -0
- package/dist/secrets/run.d.ts +23 -0
- package/dist/secrets/run.d.ts.map +1 -0
- package/dist/secrets/run.js +130 -0
- package/dist/secrets/status.d.ts +177 -0
- package/dist/secrets/status.d.ts.map +1 -0
- package/dist/secrets/status.js +724 -0
- package/dist/wrangler/deploy-stage.d.ts +1 -1
- package/dist/wrangler/deploy-stage.d.ts.map +1 -1
- package/dist/wrangler/deploy-stage.js +22 -20
- package/dist/wrangler/deployed-version.d.ts.map +1 -1
- package/dist/wrangler/deployed-version.js +7 -12
- package/dist/wrangler/flat-config.d.ts +1 -4
- package/dist/wrangler/flat-config.d.ts.map +1 -1
- package/dist/wrangler/flat-config.js +98 -44
- package/dist/wrangler/prepare-env.d.ts +4 -3
- package/dist/wrangler/prepare-env.d.ts.map +1 -1
- package/dist/wrangler/prepare-env.js +7 -5
- package/dist/wrangler/source-config.d.ts +24 -0
- package/dist/wrangler/source-config.d.ts.map +1 -0
- package/dist/wrangler/source-config.js +110 -0
- package/dist/wrangler/stage.d.ts +55 -23
- package/dist/wrangler/stage.d.ts.map +1 -1
- package/dist/wrangler/stage.js +81 -162
- package/managed/raw/tooling/direnv/devenv.smoo.nix +19 -3
- package/managed/raw/tooling/direnv/secret-references.ts +280 -76
- package/managed/raw/tooling/direnv/setup-environment.ts +58 -2
- package/managed/raw/tsconfig.lib.json +28 -0
- package/package.json +7 -2
- package/src/cli.ts +34 -5
- package/src/lib/json.ts +23 -1
- package/src/monorepo/cargo-policy.test.ts +91 -1
- package/src/monorepo/cargo-policy.ts +87 -1
- package/src/monorepo/index.ts +8 -2
- package/src/monorepo/package-policy.test.ts +50 -19
- package/src/monorepo/packs/index.ts +10 -2
- package/src/monorepo/secret-references.test.ts +412 -6
- package/src/monorepo/setup-environment.test.ts +181 -0
- package/src/nx/index.test.ts +8 -2
- package/src/nx/index.ts +20 -2
- package/src/secrets/commands.test.ts +186 -4
- package/src/secrets/commands.ts +142 -51
- package/src/secrets/index.test.ts +4 -10
- package/src/secrets/index.ts +54 -115
- package/src/secrets/resolver.ts +130 -0
- package/src/secrets/run.test.ts +359 -0
- package/src/secrets/run.ts +148 -0
- package/src/secrets/status.test.ts +164 -0
- package/src/secrets/status.ts +297 -0
- package/src/wrangler/deploy-stage.test.ts +95 -2
- package/src/wrangler/deploy-stage.ts +26 -23
- package/src/wrangler/deployed-version.ts +7 -11
- package/src/wrangler/flat-config.test.ts +9 -4
- package/src/wrangler/flat-config.ts +1 -20
- package/src/wrangler/format-parity.test.ts +433 -0
- package/src/wrangler/prepare-env.ts +7 -5
- package/src/wrangler/source-config.test.ts +102 -0
- package/src/wrangler/source-config.ts +110 -0
- package/src/wrangler/stage.test.ts +61 -32
- package/src/wrangler/stage.ts +124 -173
package/README.md
CHANGED
|
@@ -47,6 +47,11 @@ smoo release retag-unpublished <tag...> [--to <ref>] [--push] [--dispatch] [--re
|
|
|
47
47
|
smoo release bootstrap-npm-packages [--dry-run] [--skip-login] [--package <name...>]
|
|
48
48
|
smoo release trust-publisher [--bootstrap] [--dry-run] [--skip-login] [--package <name...>]
|
|
49
49
|
|
|
50
|
+
smoo secrets status [-R <owner/name|remote>] [--env <environment>] [--json]
|
|
51
|
+
smoo secrets set [name] [-R <owner/name|remote>] [--env <environment>]
|
|
52
|
+
smoo secrets sync [-R <owner/name|remote>] [--env <environment>]
|
|
53
|
+
smoo secrets run <group> <command...>
|
|
54
|
+
|
|
50
55
|
smoo github-ci nx-smart --target <target> [--name <check-name>] [--step <number>] [--mode <auto|affected|run-many>] [--stage <stage>]
|
|
51
56
|
smoo github-ci nx-run-many --targets <targets> [--projects <projects>] [--collect-outputs <directory>]
|
|
52
57
|
smoo github-ci nx-deploy [--stage <stage>] [--mode <auto|affected|run-many>] [--select-tag <tag>] [--verify]
|
|
@@ -577,10 +582,58 @@ Developer shells get the pair from the managed `tooling/direnv/secret-references
|
|
|
577
582
|
none (with the reason on stderr), and never replaces a server the environment already carries, so a CI job keeps the
|
|
578
583
|
internal address its own runners reach.
|
|
579
584
|
|
|
580
|
-
`tokenSecret` may name a `smoo.secrets` entry, and then it is
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
585
|
+
`tokenSecret` may name a `smoo.secrets` entry, and then it is in group `nx-cache`: shell entry never resolves it, so an
|
|
586
|
+
unreachable secret provider loses the cache rather than the install. `op read` being unavailable in a sandboxed
|
|
587
|
+
workspace therefore costs the cache, not the shell. See the section below for what a group is.
|
|
588
|
+
|
|
589
|
+
### Local secret commands and groups (`package.json` → `smoo.secrets`)
|
|
590
|
+
|
|
591
|
+
```json
|
|
592
|
+
{
|
|
593
|
+
"smoo": {
|
|
594
|
+
"secrets": {
|
|
595
|
+
"SMOO_TOKEN": { "command": ["op", "read", "op://vault/smoo/token"] },
|
|
596
|
+
"ACME_NPM_TOKEN": { "command": ["op", "read", "op://vault/registry/token"] },
|
|
597
|
+
"DEPLOY_TOKEN": { "command": ["op", "read", "op://vault/deploy/token"], "group": "deploy" }
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
```
|
|
602
|
+
|
|
603
|
+
Each entry names a command whose stdout is the value. An existing nonempty environment value always wins, and CI never
|
|
604
|
+
runs these commands at all: there, every variable comes from the job's secret store.
|
|
605
|
+
|
|
606
|
+
A group says which operation resolves the credential, and shell entry — every direnv reload, every
|
|
607
|
+
`devenv shell -- <command>` — resolves the `shell` group and nothing else. A provider authorises per requesting process
|
|
608
|
+
lineage, so a command placed at shell entry is a credential prompt on every reload; a credential only one deliberate
|
|
609
|
+
command needs belongs to that command:
|
|
610
|
+
|
|
611
|
+
```bash
|
|
612
|
+
smoo secrets run registry bun install
|
|
613
|
+
smoo secrets run registry bun add -d @acme/sdk
|
|
614
|
+
smoo secrets run nx-cache nx build app
|
|
615
|
+
```
|
|
616
|
+
|
|
617
|
+
The group is DERIVED from declarations the repository already carries, so almost nothing declares one:
|
|
618
|
+
|
|
619
|
+
- `registry` — a variable `.npmrc` interpolates as `${VAR}`. An installed checkout contacts no registry, so shell entry
|
|
620
|
+
defers it; a request that does contact one is what resolves it.
|
|
621
|
+
- `nx-cache` — the variable `smoo.remoteCache.tokenSecret` names.
|
|
622
|
+
- `shell` — everything else, resolved at shell entry because that is when it is needed.
|
|
623
|
+
|
|
624
|
+
`group` on an entry overrides the derivation, and any label the command line can name is a group: nothing about
|
|
625
|
+
`registry` or `nx-cache` is privileged in smoo, so a repository may declare `deploy` and run it the same way. An
|
|
626
|
+
override is stated in `smoo secrets status`, because a silent one is how the next reader loses an hour.
|
|
627
|
+
|
|
628
|
+
`smoo secrets run` with no group refuses and lists the groups this repository declares with the secrets in each. It
|
|
629
|
+
resolves exactly one group — a run for `registry` never triggers the cache token's provider command — and passes the
|
|
630
|
+
values in the child's environment only: never in argv, which `ps` shows to every user on the machine, never in a file,
|
|
631
|
+
and never on stdout. Everything after the group reaches the child verbatim, flags included, and the child's exit status
|
|
632
|
+
is reproduced, including death by signal as 128+signum.
|
|
633
|
+
|
|
634
|
+
Both contexts that cannot run a provider command refuse by name instead of promising a command that would not work
|
|
635
|
+
there: CI says to inject the variable from the secret store, and a cowshed workspace says to enroll registry credentials
|
|
636
|
+
through the gateway.
|
|
584
637
|
|
|
585
638
|
## Releases
|
|
586
639
|
|
|
@@ -729,7 +782,17 @@ Publish runs converge without self-spawning another workflow run.
|
|
|
729
782
|
|
|
730
783
|
### `smoo wrangler deploy-stage --stage <stage> [--config <path>]`
|
|
731
784
|
|
|
732
|
-
Without `--config`, deploys
|
|
785
|
+
Without `--config`, deploys the project's own source configuration with `--env <stage>`; a `prN` stage is derived from
|
|
786
|
+
`[env.staging]`. The source configuration is discovered in wrangler's own precedence — `wrangler.jsonc`,
|
|
787
|
+
`wrangler.json`, `wrangler.toml` — and the two JSON spellings are read with the JSONC parser wrangler uses for them, so
|
|
788
|
+
comments and trailing commas are fine. A project carrying more than one of those files is refused by name: wrangler
|
|
789
|
+
would read the first and ignore the rest without saying so, and that is how a repo ends up deploying a config nobody is
|
|
790
|
+
editing.
|
|
791
|
+
|
|
792
|
+
Both formats parse into one model, so a stage derives identically from either: the same plan, the same resources, the
|
|
793
|
+
same refusals. The committed file is never rewritten. A `prN` stage's derived configuration is written beside it as a
|
|
794
|
+
temporary `.wrangler.smoo-*.json` that the deploy deletes afterwards — JSON whichever format the source was, because
|
|
795
|
+
wrangler selects its parser by extension and a file read once by a machine has no reader for comments.
|
|
733
796
|
|
|
734
797
|
With `--config <path>` the target is a build-generated, env-block-free `wrangler.json` (what the Cloudflare Vite and
|
|
735
798
|
Astro adapters emit). `staging` and `production` deploy it as-is, with no `--env` flag. A `prN` stage treats it as the
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAcA,wBAAsB,MAAM,CAAC,IAAI,WAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAcxE;AAQD,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAiBhD"}
|
package/dist/cli.js
CHANGED
|
@@ -7,6 +7,7 @@ import { decode, findRepoRoot, printCommandOutput } from './lib/run.js';
|
|
|
7
7
|
import { ensureChromium } from './playwright/index.js';
|
|
8
8
|
import { resolvePrConflicts } from './pr/index.js';
|
|
9
9
|
import { secretsSet, secretsStatus, secretsSync } from './secrets/commands.js';
|
|
10
|
+
import { secretsRun } from './secrets/run.js';
|
|
10
11
|
import { cleanupPullRequest, deployStage } from './wrangler/deploy-stage.js';
|
|
11
12
|
import { deployedVersion } from './wrangler/deployed-version.js';
|
|
12
13
|
import { scaffold } from './wrangler/scaffold.js';
|
|
@@ -70,6 +71,11 @@ function buildProgram() {
|
|
|
70
71
|
.description('SmoothBricks monorepo tooling')
|
|
71
72
|
.version(cliPackageVersion, '-v, --version', 'print smoo version')
|
|
72
73
|
.exitOverride()
|
|
74
|
+
// `smoo secrets run <group> <command...>` hands the rest of argv to a
|
|
75
|
+
// child verbatim, flags included. Commander only stops parsing after the
|
|
76
|
+
// first operand when positional options are enabled here, on the parent
|
|
77
|
+
// of the command that declares `passThroughOptions`.
|
|
78
|
+
.enablePositionalOptions()
|
|
73
79
|
.showHelpAfterError();
|
|
74
80
|
const monorepo = program.command('monorepo').description('Manage SmoothBricks-style monorepos');
|
|
75
81
|
monorepo
|
|
@@ -424,14 +430,32 @@ function buildProgram() {
|
|
|
424
430
|
});
|
|
425
431
|
const secrets = program
|
|
426
432
|
.command('secrets')
|
|
427
|
-
.description('Reconcile declared secrets: what Workers need, what workflows pass, what the repository holds')
|
|
433
|
+
.description('Reconcile declared secrets: what Workers need, what workflows pass, what the repository holds')
|
|
434
|
+
.enablePositionalOptions();
|
|
435
|
+
secrets
|
|
436
|
+
.command('run [group] [command...]')
|
|
437
|
+
.description('Run one command with one group of declared secrets in its environment. Shell entry resolves the ' +
|
|
438
|
+
'`shell` group only, so a registry credential or the Nx cache token is resolved here, by the command ' +
|
|
439
|
+
'that needs it, instead of by every direnv reload. The group is required and positional: with none, ' +
|
|
440
|
+
'this lists the groups this repository declares and the secrets in each')
|
|
441
|
+
// Everything after the group reaches the child verbatim, flags included:
|
|
442
|
+
// `smoo secrets run registry bun add -d @acme/x` must run `bun add -d
|
|
443
|
+
// @acme/x`, not lose `-d` to this command's own parser.
|
|
444
|
+
.passThroughOptions()
|
|
445
|
+
.action(async (group, command) => {
|
|
446
|
+
process.exitCode = await secretsRun(await findRepoRoot(), group, command);
|
|
447
|
+
});
|
|
428
448
|
secrets
|
|
429
449
|
.command('status')
|
|
430
|
-
.description('Show every declared secret with the scopes holding it
|
|
450
|
+
.description('Show every declared secret with the scopes holding it. Exits 0 when every secret a managed workflow ' +
|
|
451
|
+
'passes has a value in a scope the job reads, and 1 when one does not or when the repository, its ' +
|
|
452
|
+
'secrets or a stage declaration could not be read')
|
|
431
453
|
.option('-R, --repo <owner/name|remote>', "repository or remote name; defaults to the current branch's upstream remote")
|
|
432
454
|
.option('--env <environment>', "also read this GitHub Environment; its value takes precedence over the repository's for a job bound to it")
|
|
455
|
+
.option('--json', 'write one JSON document to stdout instead of the table, for another tool to read; the exit code is ' +
|
|
456
|
+
'unchanged, so a status that refuses still refuses')
|
|
433
457
|
.action(async (options) => {
|
|
434
|
-
process.exitCode = secretsStatus(await findRepoRoot(), options);
|
|
458
|
+
process.exitCode = await secretsStatus(await findRepoRoot(), options);
|
|
435
459
|
});
|
|
436
460
|
secrets
|
|
437
461
|
.command('set [name]')
|
|
@@ -460,7 +484,7 @@ function buildProgram() {
|
|
|
460
484
|
wrangler
|
|
461
485
|
.command('deploy-stage')
|
|
462
486
|
.requiredOption('--stage <stage>', 'staging, production, or prN')
|
|
463
|
-
.option('--config <path>',
|
|
487
|
+
.option('--config <path>', "deploy a build-generated flat wrangler.json instead of the project's own config")
|
|
464
488
|
.option('--version-endpoint <url>', 'URL served by this worker whose trimmed body is the running version tag')
|
|
465
489
|
.action(async (options) => {
|
|
466
490
|
await deployStage(process.cwd(), {
|
package/dist/lib/json.d.ts
CHANGED
|
@@ -188,10 +188,31 @@ export interface PackageRemoteCacheConfig {
|
|
|
188
188
|
*/
|
|
189
189
|
tokenSecret: RepositorySecretName;
|
|
190
190
|
}
|
|
191
|
-
/**
|
|
191
|
+
/**
|
|
192
|
+
* A `smoo.secrets` group: which operation resolves the credential. One argv
|
|
193
|
+
* word of `smoo secrets run <group> <command...>`, so whitespace would make
|
|
194
|
+
* that command unwritable. Only the shape is validated — the values are the
|
|
195
|
+
* repository's, and a new group must not need a new smoo release.
|
|
196
|
+
*/
|
|
197
|
+
export type SecretGroupName = string & typia.tags.MinLength<1> & typia.tags.Pattern<'^\\S+$'>;
|
|
198
|
+
/**
|
|
199
|
+
* Local bootstrap fallback; existing environment values always take
|
|
200
|
+
* precedence, and CI injects these variables instead of running commands.
|
|
201
|
+
*
|
|
202
|
+
* Shell entry resolves the `shell` group and nothing else; every other group
|
|
203
|
+
* is resolved by `smoo secrets run <group> <command...>`, the one command
|
|
204
|
+
* that needs it. The group is DERIVED from what this manifest already
|
|
205
|
+
* declares — a variable `.npmrc` interpolates as `${VAR}` is `registry`, the
|
|
206
|
+
* variable `smoo.remoteCache.tokenSecret` names is `nx-cache`, everything
|
|
207
|
+
* else is `shell` — so `group` below is only for what those declarations
|
|
208
|
+
* cannot say. The routing lives in tooling/direnv/secret-references.ts,
|
|
209
|
+
* whose header states the rule and the derivation.
|
|
210
|
+
*/
|
|
192
211
|
export interface PackageSecretCommand {
|
|
193
212
|
/** Executed directly, without a shell; stdout supplies the secret value. */
|
|
194
213
|
command: NonEmptyArray<string>;
|
|
214
|
+
/** Overrides the derived group; absent derives one from this manifest and `.npmrc`. */
|
|
215
|
+
group?: SecretGroupName;
|
|
195
216
|
}
|
|
196
217
|
export interface PackageSmooConfig {
|
|
197
218
|
github?: PackageSmooGithub;
|
package/dist/lib/json.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/lib/json.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,KAAK,WAAW,EAAE,MAAM,OAAO,CAAC;AAEhD,sDAAsD;AACtD,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE/C,2DAA2D;AAC3D,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;AAE3C,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,KAAK,IAAI,aAAa,CAAC,CAAC,CAAC,CAEnE;AAED,mHAAmH;AACnH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAE1D;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,GACvC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,GACvB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAAC;AAEvD,oEAAoE;AACpE,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;AAEhE,qGAAqG;AACrG,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAEhF,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAA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AMT;AAED,wBAAgB,SAAS,CAAC,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAMrE;AAED,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAM5F;AAED,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,iBAAiB,EAC7B,GAAG,EAAE,MAAM,GAAG,KAAK,GAAG,WAAW,EACjC,KAAK,EAAE,MAAM,GACZ,OAAO,CAMT;AAED,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,iBAAiB,EAC7B,GAAG,EAAE,MAAM,GAAG,KAAK,GAAG,WAAW,EACjC,KAAK,EAAE,MAAM,GACZ,OAAO,CAMT"}
|
package/dist/lib/json.js
CHANGED
|
@@ -73,7 +73,7 @@ export const parsePackageJsonText = (() => {
|
|
|
73
73
|
return true;
|
|
74
74
|
return "object" === typeof value && null !== value && _io23(value, _vctx);
|
|
75
75
|
});
|
|
76
|
-
const _io23 = (input, _vctx = {}) => Array.isArray(input.command) && ("string" === typeof input.command[0] && (Array.isArray(input.command.slice(1)) && input.command.slice(1).every(elem => "string" === typeof elem)));
|
|
76
|
+
const _io23 = (input, _vctx = {}) => Array.isArray(input.command) && ("string" === typeof input.command[0] && (Array.isArray(input.command.slice(1)) && input.command.slice(1).every(elem => "string" === typeof elem))) && (undefined === input.group || "string" === typeof input.group && (1 <= _stringLength_1._stringLength(input.group) && RegExp("^\\S+$").test(input.group)));
|
|
77
77
|
const _io3 = (input, _vctx = {}) => undefined === input.packages || Array.isArray(input.packages) && input.packages.every(elem => "string" === typeof elem);
|
|
78
78
|
const _io4 = (input, _vctx = {}) => (undefined === input.access || "string" === typeof input.access) && (undefined === input.registry || "string" === typeof input.registry);
|
|
79
79
|
const _io5 = (input, _vctx = {}) => (undefined === input.type || "string" === typeof input.type) && (undefined === input.url || "string" === typeof input.url) && (undefined === input.directory || "string" === typeof input.directory);
|
|
@@ -405,7 +405,7 @@ const validatePackageJsonText = (() => {
|
|
|
405
405
|
return true;
|
|
406
406
|
return "object" === typeof value && null !== value && _io23(value, _vctx);
|
|
407
407
|
});
|
|
408
|
-
const _io23 = (input, _vctx = {}) => Array.isArray(input.command) && ("string" === typeof input.command[0] && (Array.isArray(input.command.slice(1)) && input.command.slice(1).every(elem => "string" === typeof elem)));
|
|
408
|
+
const _io23 = (input, _vctx = {}) => Array.isArray(input.command) && ("string" === typeof input.command[0] && (Array.isArray(input.command.slice(1)) && input.command.slice(1).every(elem => "string" === typeof elem))) && (undefined === input.group || "string" === typeof input.group && (1 <= _stringLength_1._stringLength(input.group) && RegExp("^\\S+$").test(input.group)));
|
|
409
409
|
const _io3 = (input, _vctx = {}) => undefined === input.packages || Array.isArray(input.packages) && input.packages.every(elem => "string" === typeof elem);
|
|
410
410
|
const _io4 = (input, _vctx = {}) => (undefined === input.access || "string" === typeof input.access) && (undefined === input.registry || "string" === typeof input.registry);
|
|
411
411
|
const _io5 = (input, _vctx = {}) => (undefined === input.type || "string" === typeof input.type) && (undefined === input.url || "string" === typeof input.url) && (undefined === input.directory || "string" === typeof input.directory);
|
|
@@ -827,6 +827,18 @@ const validatePackageJsonText = (() => {
|
|
|
827
827
|
path: _path + ".command",
|
|
828
828
|
expected: "NonEmptyArray<string>",
|
|
829
829
|
value: input.command
|
|
830
|
+
}), undefined === input.group || "string" === typeof input.group && (1 <= _stringLength_1._stringLength(input.group) || _report(_exceptionable, {
|
|
831
|
+
path: _path + ".group",
|
|
832
|
+
expected: "string & MinLength<1>",
|
|
833
|
+
value: input.group
|
|
834
|
+
})) && (RegExp("^\\S+$").test(input.group) || _report(_exceptionable, {
|
|
835
|
+
path: _path + ".group",
|
|
836
|
+
expected: "string & Pattern<\"^\\\\S+$\">",
|
|
837
|
+
value: input.group
|
|
838
|
+
})) || _report(_exceptionable, {
|
|
839
|
+
path: _path + ".group",
|
|
840
|
+
expected: "((string & MinLength<1> & Pattern<\"^\\\\S+$\">) | undefined)",
|
|
841
|
+
value: input.group
|
|
830
842
|
})].every(flag => flag);
|
|
831
843
|
const _vo3 = (input, _path, _exceptionable = true, _vctx = {}) => [undefined === input.packages || (Array.isArray(input.packages) || _report(_exceptionable, {
|
|
832
844
|
path: _path + ".packages",
|
|
@@ -1121,7 +1133,7 @@ const isPackageJsonValue = (() => {
|
|
|
1121
1133
|
return true;
|
|
1122
1134
|
return "object" === typeof value && null !== value && _io23(value, _vctx);
|
|
1123
1135
|
});
|
|
1124
|
-
const _io23 = (input, _vctx = {}) => Array.isArray(input.command) && ("string" === typeof input.command[0] && (Array.isArray(input.command.slice(1)) && input.command.slice(1).every(elem => "string" === typeof elem)));
|
|
1136
|
+
const _io23 = (input, _vctx = {}) => Array.isArray(input.command) && ("string" === typeof input.command[0] && (Array.isArray(input.command.slice(1)) && input.command.slice(1).every(elem => "string" === typeof elem))) && (undefined === input.group || "string" === typeof input.group && (1 <= _stringLength_1._stringLength(input.group) && RegExp("^\\S+$").test(input.group)));
|
|
1125
1137
|
const _io3 = (input, _vctx = {}) => undefined === input.packages || Array.isArray(input.packages) && input.packages.every(elem => "string" === typeof elem);
|
|
1126
1138
|
const _io4 = (input, _vctx = {}) => (undefined === input.access || "string" === typeof input.access) && (undefined === input.registry || "string" === typeof input.registry);
|
|
1127
1139
|
const _io5 = (input, _vctx = {}) => (undefined === input.type || "string" === typeof input.type) && (undefined === input.url || "string" === typeof input.url) && (undefined === input.directory || "string" === typeof input.directory);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ProjectTargets } from '../nx/index.js';
|
|
1
2
|
/**
|
|
2
3
|
* The one command this policy shells out to, behind a seam. `cargo hakari
|
|
3
4
|
* verify` is the only authority on whether a generated workspace-hack still
|
|
@@ -16,6 +17,22 @@ export interface CargoPolicyOptions {
|
|
|
16
17
|
shell?: CargoHakariShell;
|
|
17
18
|
}
|
|
18
19
|
export declare function validateCargoCachePolicy(root: string, options?: CargoPolicyOptions): number;
|
|
20
|
+
/**
|
|
21
|
+
* A cached cargo target must hash the toolchain that compiled it.
|
|
22
|
+
*
|
|
23
|
+
* Inference attaches the pin to every cargo target it infers, but a repository
|
|
24
|
+
* that DECLARES `inputs` for one replaces that list wholesale and silently
|
|
25
|
+
* drops it — the target then survives a toolchain bump with a stale verdict,
|
|
26
|
+
* and a pre-push cross-compile probe consults a cache entry that cannot
|
|
27
|
+
* express the change it is probing for. Measured before this policy existed:
|
|
28
|
+
* a one-byte bump to the declared pin left one repository's `cargo-lint-cross`
|
|
29
|
+
* hash unchanged.
|
|
30
|
+
*
|
|
31
|
+
* This is a generated safety property removed by a local override, which no
|
|
32
|
+
* amount of care at the override site will catch on its own, so it is checked
|
|
33
|
+
* against the RESOLVED graph rather than against any one file.
|
|
34
|
+
*/
|
|
35
|
+
export declare function validateCargoToolchainInputs(root: string, projects: readonly ProjectTargets[]): number;
|
|
19
36
|
/**
|
|
20
37
|
* The fix `smoo monorepo update` applies for the policy above: write the
|
|
21
38
|
* nightly resolver configuration, or generate and wire the workspace-hack a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cargo-policy.d.ts","sourceRoot":"","sources":["../../src/monorepo/cargo-policy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cargo-policy.d.ts","sourceRoot":"","sources":["../../src/monorepo/cargo-policy.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAqFrD;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;CACrG;AAusBD,MAAM,WAAW,kBAAkB;IACjC,2EAA2E;IAC3E,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,kBAAuB,GAAG,MAAM,CAwD/F;AAiDD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,cAAc,EAAE,GAAG,MAAM,CAoBtG;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,kBAAuB,GAAG,IAAI,CA8BjG"}
|
|
@@ -5,8 +5,9 @@ import * as _createStandardSchema_1 from "typia/lib/internal/_createStandardSche
|
|
|
5
5
|
import { spawnSync } from 'node:child_process';
|
|
6
6
|
import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
7
7
|
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
|
|
8
|
+
import { CARGO_TOOLCHAIN_NAMED_INPUT, isCargoToolchainInput } from '@smoothbricks/nx-plugin/cargo-toolchain-policy';
|
|
8
9
|
import typia from 'typia';
|
|
9
|
-
import { parsePackageJsonText } from '../lib/json.js';
|
|
10
|
+
import { parseNxJsonText, parsePackageJsonText } from '../lib/json.js';
|
|
10
11
|
const validateCargoManifest = (() => {
|
|
11
12
|
const _io0 = input => (undefined === input.workspace || "object" === typeof input.workspace && null !== input.workspace && false === Array.isArray(input.workspace) && _io1(input.workspace)) && (undefined === input["package"] || "object" === typeof input["package"] && null !== input["package"] && false === Array.isArray(input["package"]) && _io2(input["package"])) && (undefined === input.profile || "object" === typeof input.profile && null !== input.profile && false === Array.isArray(input.profile) && _io3(input.profile)) && (undefined === input.dependencies || "object" === typeof input.dependencies && null !== input.dependencies && false === Array.isArray(input.dependencies) && _io5(input.dependencies)) && (undefined === input["dev-dependencies"] || "object" === typeof input["dev-dependencies"] && null !== input["dev-dependencies"] && false === Array.isArray(input["dev-dependencies"]) && _io5(input["dev-dependencies"])) && (undefined === input["build-dependencies"] || "object" === typeof input["build-dependencies"] && null !== input["build-dependencies"] && false === Array.isArray(input["build-dependencies"]) && _io5(input["build-dependencies"]));
|
|
12
13
|
const _io1 = input => (undefined === input.members || Array.isArray(input.members) && input.members.every(elem => "string" === typeof elem)) && (undefined === input.exclude || Array.isArray(input.exclude) && input.exclude.every(elem => "string" === typeof elem));
|
|
@@ -1089,6 +1090,77 @@ export function validateCargoCachePolicy(root, options = {}) {
|
|
|
1089
1090
|
reportManifestDirectoryAdvisories(repositoryRoot, ignoredDirectories);
|
|
1090
1091
|
return failures;
|
|
1091
1092
|
}
|
|
1093
|
+
/** A command that compiles or checks Rust, whichever driver spells it. */
|
|
1094
|
+
const RUNS_CARGO = /(?:^|[\s;&|])cargo[\s-]|\bnapi build\b/;
|
|
1095
|
+
const CARGO_TOOLCHAIN_FIX = `Add "${CARGO_TOOLCHAIN_NAMED_INPUT}" to its inputs, or to the named input it uses`;
|
|
1096
|
+
function commandsOf(options) {
|
|
1097
|
+
const command = options?.command;
|
|
1098
|
+
const commands = options?.commands;
|
|
1099
|
+
return [
|
|
1100
|
+
typeof command === 'string' ? command : '',
|
|
1101
|
+
...(Array.isArray(commands) ? commands.filter((entry) => typeof entry === 'string') : []),
|
|
1102
|
+
].join('\n');
|
|
1103
|
+
}
|
|
1104
|
+
/**
|
|
1105
|
+
* Every fileset one declared input list reaches, with nx.json's named inputs
|
|
1106
|
+
* expanded. The plugin's own `cargoToolchain` is defined per PROJECT and wins
|
|
1107
|
+
* over nx.json, so naming it counts without an entry here; a repository that
|
|
1108
|
+
* redefines it workspace-wide is expanded and judged on what it resolves to.
|
|
1109
|
+
*/
|
|
1110
|
+
function resolveInputFilesets(declared, namedInputs, seen = new Set()) {
|
|
1111
|
+
const filesets = [];
|
|
1112
|
+
for (const entry of declared) {
|
|
1113
|
+
const name = entry.startsWith('^') ? entry.slice(1) : entry;
|
|
1114
|
+
const definition = namedInputs[name];
|
|
1115
|
+
if (definition === undefined) {
|
|
1116
|
+
filesets.push(entry);
|
|
1117
|
+
continue;
|
|
1118
|
+
}
|
|
1119
|
+
if (seen.has(name))
|
|
1120
|
+
continue;
|
|
1121
|
+
seen.add(name);
|
|
1122
|
+
const expanded = typeof definition === 'string' ? [definition] : definition;
|
|
1123
|
+
filesets.push(...resolveInputFilesets(expanded.filter((value) => typeof value === 'string'), namedInputs, seen));
|
|
1124
|
+
}
|
|
1125
|
+
return filesets;
|
|
1126
|
+
}
|
|
1127
|
+
/**
|
|
1128
|
+
* A cached cargo target must hash the toolchain that compiled it.
|
|
1129
|
+
*
|
|
1130
|
+
* Inference attaches the pin to every cargo target it infers, but a repository
|
|
1131
|
+
* that DECLARES `inputs` for one replaces that list wholesale and silently
|
|
1132
|
+
* drops it — the target then survives a toolchain bump with a stale verdict,
|
|
1133
|
+
* and a pre-push cross-compile probe consults a cache entry that cannot
|
|
1134
|
+
* express the change it is probing for. Measured before this policy existed:
|
|
1135
|
+
* a one-byte bump to the declared pin left one repository's `cargo-lint-cross`
|
|
1136
|
+
* hash unchanged.
|
|
1137
|
+
*
|
|
1138
|
+
* This is a generated safety property removed by a local override, which no
|
|
1139
|
+
* amount of care at the override site will catch on its own, so it is checked
|
|
1140
|
+
* against the RESOLVED graph rather than against any one file.
|
|
1141
|
+
*/
|
|
1142
|
+
export function validateCargoToolchainInputs(root, projects) {
|
|
1143
|
+
const nxJsonPath = join(resolve(root), 'nx.json');
|
|
1144
|
+
const namedInputs = existsSync(nxJsonPath)
|
|
1145
|
+
? (parseNxJsonText(readFileSync(nxJsonPath, 'utf8'))?.namedInputs ?? {})
|
|
1146
|
+
: {};
|
|
1147
|
+
let failures = 0;
|
|
1148
|
+
for (const project of projects) {
|
|
1149
|
+
for (const target of [...project.targets].sort()) {
|
|
1150
|
+
if (project.targetCache?.get(target) !== true)
|
|
1151
|
+
continue;
|
|
1152
|
+
if (!RUNS_CARGO.test(commandsOf(project.targetOptions?.get(target))))
|
|
1153
|
+
continue;
|
|
1154
|
+
const declared = project.targetInputs?.get(target) ?? [];
|
|
1155
|
+
if (declared.includes(CARGO_TOOLCHAIN_NAMED_INPUT))
|
|
1156
|
+
continue;
|
|
1157
|
+
if (resolveInputFilesets(declared, namedInputs).some(isCargoToolchainInput))
|
|
1158
|
+
continue;
|
|
1159
|
+
failures += report(`${project.project}:${target}`, `cached cargo target hashes no toolchain pin, so a toolchain bump cannot invalidate it. ${CARGO_TOOLCHAIN_FIX}.`);
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
return failures;
|
|
1163
|
+
}
|
|
1092
1164
|
/**
|
|
1093
1165
|
* The fix `smoo monorepo update` applies for the policy above: write the
|
|
1094
1166
|
* nightly resolver configuration, or generate and wire the workspace-hack a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/monorepo/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/monorepo/index.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AA2BxD,MAAM,WAAW,WAAW;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iFAAiF;IACjF,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,4BAA4B;IAC3C,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,0BAA0B;IACzC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAA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AgB,CACpC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,uBAAuB,EAChC,KAAK,GAAE,qBAAoD,GAC1D,OAAO,CAAC,IAAI,CAAC,CA8Bf;AAED,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,CAAC"}
|
package/dist/monorepo/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { appendFileSync, readFileSync, writeFileSync } from 'node:fs';
|
|
|
2
2
|
import { printCommandOutput, run, runResult } from '../lib/run.js';
|
|
3
3
|
import { escapeRegex, getWorkspacePackages, getWorkspacePatterns, listReleasePackages } from '../lib/workspace.js';
|
|
4
4
|
import { readProjectTargets } from '../nx/index.js';
|
|
5
|
-
import { applyCargoFeatureUnification, validateCargoCachePolicy } from './cargo-policy.js';
|
|
5
|
+
import { applyCargoFeatureUnification, validateCargoCachePolicy, validateCargoToolchainInputs, } from './cargo-policy.js';
|
|
6
6
|
import { formatCommitMessage, stagedDeletedPublicPackages, validateBreakingDisclosure, validateCommitMessage, } from './commit-msg.js';
|
|
7
7
|
import { applyWorkspaceGitConfig } from './git-config.js';
|
|
8
8
|
import { syncBunLockfileVersions } from './lockfile.js';
|
|
@@ -64,7 +64,8 @@ export async function checkManagedFiles(root, options = {}) {
|
|
|
64
64
|
}
|
|
65
65
|
const results = await applyManagedFiles(root, 'check');
|
|
66
66
|
printResults(results);
|
|
67
|
-
const
|
|
67
|
+
const projectTargets = await readProjectTargets(root);
|
|
68
|
+
const resolvedTargets = resolvedTargetsByProject(projectTargets);
|
|
68
69
|
const packageFailures = validateRootPackagePolicy(root) +
|
|
69
70
|
validateNxProjectNames(root) +
|
|
70
71
|
validateNxReleaseConfig(root) +
|
|
@@ -75,6 +76,7 @@ export async function checkManagedFiles(root, options = {}) {
|
|
|
75
76
|
validateWorkspaceDependencies(root, { resolvedTargetsByProject: resolvedTargets }) +
|
|
76
77
|
validateDevenvModuleImport(root) +
|
|
77
78
|
validateCargoCachePolicy(root) +
|
|
79
|
+
validateCargoToolchainInputs(root, projectTargets) +
|
|
78
80
|
validateSccachePatches(root);
|
|
79
81
|
if (results.some((result) => result.action === 'drifted') || packageFailures > 0) {
|
|
80
82
|
throw new Error('Managed monorepo files or package conventions are out of date. Run: smoo monorepo update');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/monorepo/packs/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,cAAc,EAAsB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/monorepo/packs/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,cAAc,EAAsB,MAAM,mBAAmB,CAAC;AAW5E,OAAO,EAKL,KAAK,sBAAsB,EAS5B,MAAM,sBAAsB,CAAC;AAU9B,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAClD,WAAW,CAAC,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACzD,YAAY,CAAC,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC1D,gBAAgB,CAAC,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IAClE,iBAAiB,CAAC,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;CACpE;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IAChC,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,mBAAmB,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;CAC9F;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB;AAmJD,0DAA0D;AAC1D,eAAO,MAAM,YAAY,gBAAQ,CAAC;AAElC,wBAAsB,YAAY,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAItE;AAED,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,eAAe,EACpB,OAAO,GAAE,mBAAwB,EACjC,KAAK,GAAE,oBAAyB,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CA0B7B;AAwMD,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAcxG"}
|
|
@@ -2,7 +2,7 @@ import { chmodSync, existsSync, statSync } from 'node:fs';
|
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { printCommandOutput, runResult, runStatus } from '../../lib/run.js';
|
|
4
4
|
import { readProjectTargets } from '../../nx/index.js';
|
|
5
|
-
import { applyCargoFeatureUnification, validateCargoCachePolicy } from '../cargo-policy.js';
|
|
5
|
+
import { applyCargoFeatureUnification, validateCargoCachePolicy, validateCargoToolchainInputs, } from '../cargo-policy.js';
|
|
6
6
|
import { validateGoToolchainAgreement } from '../go-toolchain.js';
|
|
7
7
|
import { syncBunLockfileVersions, validateBunLockfileVersions } from '../lockfile.js';
|
|
8
8
|
import { validateDevenvModuleImport, warnOnManagedFileDrift } from '../managed-files.js';
|
|
@@ -76,6 +76,11 @@ const packs = [
|
|
|
76
76
|
validatePreBuild(ctx) {
|
|
77
77
|
return validateCargoCachePolicy(ctx.root);
|
|
78
78
|
},
|
|
79
|
+
// Post-build: the toolchain identity is read off the RESOLVED graph, which
|
|
80
|
+
// means running the inference plugin, which means its dist has to exist.
|
|
81
|
+
async validatePostBuild(ctx) {
|
|
82
|
+
return validateCargoToolchainInputs(ctx.root, await readProjectTargets(ctx.root));
|
|
83
|
+
},
|
|
79
84
|
},
|
|
80
85
|
{
|
|
81
86
|
name: 'publishing',
|
|
@@ -347,7 +352,6 @@ export function resolvedTargetsByProject(projects) {
|
|
|
347
352
|
{
|
|
348
353
|
...(project.root ? { root: project.root } : {}),
|
|
349
354
|
targets: new Set(project.targets),
|
|
350
|
-
...(project.buildDependsOn ? { buildDependsOn: project.buildDependsOn } : {}),
|
|
351
355
|
...(project.targetDependencies ? { targetDependencies: project.targetDependencies } : {}),
|
|
352
356
|
...(project.targetExecutors ? { targetExecutors: project.targetExecutors } : {}),
|
|
353
357
|
...(project.targetOptions ? { targetOptions: project.targetOptions } : {}),
|
package/dist/nx/index.d.ts
CHANGED
|
@@ -3,9 +3,12 @@ export interface ProjectTargets {
|
|
|
3
3
|
project: string;
|
|
4
4
|
root?: string;
|
|
5
5
|
targets: string[];
|
|
6
|
-
|
|
6
|
+
/** Per-target `cache`, for policies that only govern what Nx can restore. */
|
|
7
|
+
targetCache?: Map<string, boolean>;
|
|
7
8
|
targetDependencies?: Map<string, string[]>;
|
|
8
9
|
targetExecutors?: Map<string, string>;
|
|
10
|
+
/** Per-target string inputs; object inputs (`runtime`, `json`, …) are dropped. */
|
|
11
|
+
targetInputs?: Map<string, string[]>;
|
|
9
12
|
targetOptions?: Map<string, NxTargetOptions>;
|
|
10
13
|
targetOutputs?: Map<string, string[]>;
|
|
11
14
|
targetScripts?: Map<string, string>;
|
|
@@ -22,6 +25,8 @@ export declare function targetDependenciesFromNxProjectJson(value: NxProjectJson
|
|
|
22
25
|
export declare function targetExecutorsFromNxProjectJson(value: NxProjectJson | null | undefined): Map<string, string>;
|
|
23
26
|
export declare function targetOptionsFromNxProjectJson(value: NxProjectJson | null | undefined): Map<string, NxTargetOptions>;
|
|
24
27
|
export declare function targetOutputsFromNxProjectJson(value: NxProjectJson | null | undefined): Map<string, string[]>;
|
|
28
|
+
export declare function targetInputsFromNxProjectJson(value: NxProjectJson | null | undefined): Map<string, string[]>;
|
|
29
|
+
export declare function targetCacheFromNxProjectJson(value: NxProjectJson | null | undefined): Map<string, boolean>;
|
|
25
30
|
export declare function targetScriptsFromNxProjectJson(value: NxProjectJson | null | undefined): Map<string, string>;
|
|
26
31
|
export declare function formatProjectTargetLines(projects: ProjectTargets[]): string;
|
|
27
32
|
export declare function projectNamesWithTarget(projects: ProjectTargets[], target: string): string[];
|
package/dist/nx/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/nx/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAe,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGlG,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/nx/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAe,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGlG,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,6EAA6E;IAC7E,WAAW,CAAC,E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U,CAAC,CAOhE;AA2DD,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,UAAU,GAAG,MAAM,EAAE,CAQtE;AAED,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,UAAU,GAAG,cAAc,EAAE,CAkBnF;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAEhF;AAED,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC"}
|
package/dist/nx/index.js
CHANGED
|
@@ -91,6 +91,18 @@ export function targetOptionsFromNxProjectJson(value) {
|
|
|
91
91
|
export function targetOutputsFromNxProjectJson(value) {
|
|
92
92
|
return targetStringArraysFromNxProjectJson(value, 'outputs');
|
|
93
93
|
}
|
|
94
|
+
export function targetInputsFromNxProjectJson(value) {
|
|
95
|
+
return targetStringArraysFromNxProjectJson(value, 'inputs');
|
|
96
|
+
}
|
|
97
|
+
export function targetCacheFromNxProjectJson(value) {
|
|
98
|
+
const cache = new Map();
|
|
99
|
+
for (const [targetName, target] of Object.entries(value?.targets ?? {})) {
|
|
100
|
+
if (typeof target.cache === 'boolean') {
|
|
101
|
+
cache.set(targetName, target.cache);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return cache;
|
|
105
|
+
}
|
|
94
106
|
export function targetScriptsFromNxProjectJson(value) {
|
|
95
107
|
const targets = value?.targets;
|
|
96
108
|
const scripts = new Map();
|
|
@@ -276,8 +288,9 @@ export function projectTargetsFromNxProjects(projects) {
|
|
|
276
288
|
project,
|
|
277
289
|
root: projectRootFromNxProjectJson(metadata),
|
|
278
290
|
targets: targetNamesFromNxProjectJson(metadata),
|
|
279
|
-
|
|
291
|
+
targetCache: targetCacheFromNxProjectJson(metadata),
|
|
280
292
|
targetDependencies,
|
|
293
|
+
targetInputs: targetInputsFromNxProjectJson(metadata),
|
|
281
294
|
targetExecutors: targetExecutorsFromNxProjectJson(metadata),
|
|
282
295
|
targetOptions: targetOptionsFromNxProjectJson(metadata),
|
|
283
296
|
targetOutputs: targetOutputsFromNxProjectJson(metadata),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `smoo secrets` — the operator side of the reconciliation in ./
|
|
2
|
+
* `smoo secrets` — the operator side of the reconciliation in ./status.ts.
|
|
3
3
|
*
|
|
4
4
|
* Values are handed to `gh` over stdin, never through argv (a process list is
|
|
5
5
|
* world-readable) and never printed. Reading one from the terminal disables
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* repository reports values that do exist as absent, and sends an operator
|
|
15
15
|
* hunting for a secret that is already set.
|
|
16
16
|
*/
|
|
17
|
-
import { type SecretRow } from './
|
|
17
|
+
import { type SecretRow } from './status.js';
|
|
18
18
|
/**
|
|
19
19
|
* Every secret this checkout declares that the repository does not hold, in
|
|
20
20
|
* the order an operator should fix them: the ones a workflow already promises
|
|
@@ -53,15 +53,19 @@ export declare function writeRepositorySecret(name: string, value: string, repo:
|
|
|
53
53
|
reason: string;
|
|
54
54
|
}>;
|
|
55
55
|
/**
|
|
56
|
-
* Print every known secret and the scopes holding it
|
|
56
|
+
* Print every known secret and the scopes holding it, or - with `json` - the
|
|
57
|
+
* same facts as one document on stdout and nothing else. Exit code 1 when a
|
|
57
58
|
* workflow promises a value no scope a bound job reads can supply — that
|
|
58
59
|
* combination is the one that fails a deploy, and it fails talking about the
|
|
59
|
-
* value rather than the missing secret.
|
|
60
|
+
* value rather than the missing secret. `--json` reports that refusal in
|
|
61
|
+
* `unsatisfied` and still exits 1: a machine-readable status that always
|
|
62
|
+
* succeeded would be a status nobody could gate on.
|
|
60
63
|
*/
|
|
61
64
|
export declare function secretsStatus(root: string, options: {
|
|
62
65
|
repo?: string;
|
|
63
66
|
env?: string;
|
|
64
|
-
|
|
67
|
+
json?: boolean;
|
|
68
|
+
}): Promise<number>;
|
|
65
69
|
/**
|
|
66
70
|
* Set one secret, or - with no name - walk every secret this checkout declares
|
|
67
71
|
* and the target scope does not hold, prompting once each. The walk is the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/secrets/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/secrets/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAcH,OAAO,EAIL,KAAK,SAAS,EAKf,MAAM,aAAa,CAAC;AAErB;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS,SAAS,EAAE,GAAG,SAAS,EAAE,CAG5E;AAED;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,SAAS,SAAS,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,CAOxG;AAED,6EAA6E;AAC7E,wBAAgB,YAAY,CAAC,GAAG,EAAE,SAAS,GAAG,MAAM,CAUnD;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,WAAW,CAAC,EAAE,MAAM,GACnB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAwB/D;AAED,sFAAsF;AACtF,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAYvD;AAoGD;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EACZ,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