@smoothbricks/nx-plugin 0.6.3-0 → 0.7.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.
- package/README.md +159 -121
- package/dist/.build-inputs.json +25 -20
- package/dist/bin/smoo-nx-go-test-build.d.ts +3 -0
- package/dist/bin/smoo-nx-go-test-build.d.ts.map +1 -0
- package/dist/bin/smoo-nx-go-test-build.js +79 -0
- package/dist/bin/smoo-nx-go-test-run.d.ts +3 -0
- package/dist/bin/smoo-nx-go-test-run.d.ts.map +1 -0
- package/dist/bin/smoo-nx-go-test-run.js +129 -0
- package/dist/bounded-test-policy.d.ts +1 -1
- package/dist/bounded-test-policy.d.ts.map +1 -1
- package/dist/bounded-test-policy.js +9 -8
- package/dist/cargo-workspace.d.ts +10 -20
- package/dist/cargo-workspace.d.ts.map +1 -1
- package/dist/cargo-workspace.js +12 -22
- package/dist/cross-check-policy.d.ts +2 -2
- package/dist/cross-check-policy.js +2 -2
- package/dist/deploy-policy.d.ts +6 -0
- package/dist/deploy-policy.d.ts.map +1 -1
- package/dist/deploy-policy.js +11 -0
- package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
- package/dist/executors/bounded-exec/executor.js +49 -37
- package/dist/executors/bounded-exec/mbx-pool.d.ts +39 -10
- package/dist/executors/bounded-exec/mbx-pool.d.ts.map +1 -1
- package/dist/executors/bounded-exec/mbx-pool.js +78 -24
- package/dist/executors/bounded-exec/progress.js +5 -5
- package/dist/executors/bounded-exec/runner-sizing.d.ts +40 -2
- package/dist/executors/bounded-exec/runner-sizing.d.ts.map +1 -1
- package/dist/executors/bounded-exec/runner-sizing.js +55 -4
- package/dist/executors/bounded-exec/runtime-pin.js +1 -1
- package/dist/executors/bounded-exec/verdict.d.ts +6 -0
- package/dist/executors/bounded-exec/verdict.d.ts.map +1 -1
- package/dist/executors/bounded-exec/verdict.js +6 -0
- package/dist/executors/wrangler-deploy/deploy-hash.d.ts +10 -0
- package/dist/executors/wrangler-deploy/deploy-hash.d.ts.map +1 -0
- package/dist/executors/wrangler-deploy/deploy-hash.js +14 -0
- package/dist/executors/wrangler-deploy/executor.d.ts +24 -0
- package/dist/executors/wrangler-deploy/executor.d.ts.map +1 -0
- package/dist/executors/wrangler-deploy/executor.js +43 -0
- package/dist/executors/wrangler-deploy/hasher.d.ts +27 -0
- package/dist/executors/wrangler-deploy/hasher.d.ts.map +1 -0
- package/dist/executors/wrangler-deploy/hasher.js +90 -0
- package/dist/executors/wrangler-deploy/schema.d.ts +5 -0
- package/dist/executors/wrangler-deploy/schema.d.ts.map +1 -0
- package/dist/go-tests.d.ts +30 -0
- package/dist/go-tests.d.ts.map +1 -0
- package/dist/go-tests.js +43 -0
- package/dist/index.d.ts +9 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +271 -230
- package/dist/managed-files/files.d.ts.map +1 -1
- package/dist/managed-files/files.js +5 -0
- package/dist/process-group.js +2 -2
- package/dist/runtime-input-policy.d.ts +3 -3
- package/dist/runtime-input-policy.js +3 -3
- package/dist/test-timings.d.ts +23 -4
- package/dist/test-timings.d.ts.map +1 -1
- package/dist/test-timings.js +72 -12
- package/dist/version-actions.cjs +10 -11
- package/dist/version-actions.d.cts.map +1 -1
- package/dist/workspace-config-policy.d.ts.map +1 -1
- package/dist/workspace-config-policy.js +17 -22
- package/dist/workspace-manifest.js +3 -3
- package/executors.json +6 -5
- package/managed/raw/patches/nx@23.2.1.patch +118 -24
- package/managed/raw/patches/ttsc@0.34.1.patch +64 -0
- package/managed/raw/tooling/direnv/developer-links.ts +121 -51
- package/managed/raw/tooling/direnv/installed-bun-links.ts +7 -6
- package/managed/raw/tooling/direnv/setup-environment.ts +14 -4
- package/managed/raw/tooling/git-hooks/pinned-revisions-served.ts +252 -0
- package/managed/raw/tooling/git-hooks/pre-push.sh +34 -32
- package/package.json +57 -7
- package/runtime/nx-publish/.build-inputs.json +11 -0
- package/runtime-input.sh +50 -23
- package/src/bin/smoo-nx-go-test-build.ts +83 -0
- package/src/bin/smoo-nx-go-test-run.ts +140 -0
- package/src/bounded-test-policy.ts +9 -8
- package/src/cargo-workspace.ts +12 -24
- package/src/cross-check-policy.ts +2 -2
- package/src/deploy-policy.ts +11 -0
- package/src/executors/bounded-exec/executor.ts +61 -42
- package/src/executors/bounded-exec/mbx-pool.ts +97 -33
- package/src/executors/bounded-exec/progress.ts +5 -5
- package/src/executors/bounded-exec/runner-sizing.ts +73 -7
- package/src/executors/bounded-exec/runtime-pin.ts +1 -1
- package/src/executors/bounded-exec/verdict.ts +7 -0
- package/src/executors/wrangler-deploy/deploy-hash.ts +15 -0
- package/src/executors/wrangler-deploy/executor.ts +63 -0
- package/src/executors/wrangler-deploy/hasher.ts +111 -0
- package/src/executors/wrangler-deploy/schema.json +16 -0
- package/src/executors/wrangler-deploy/schema.ts +4 -0
- package/src/go-tests.ts +67 -0
- package/src/index.ts +294 -253
- package/src/managed-files/files.ts +5 -0
- package/src/process-group.ts +2 -2
- package/src/runtime-input-policy.ts +3 -3
- package/src/test-timings.ts +72 -14
- package/src/version-actions.cts +10 -11
- package/src/workspace-config-policy.ts +20 -29
- package/src/workspace-manifest.ts +3 -3
- package/test-timings.json +131 -130
- package/dist/executors/clean-outputs/executor.d.ts +0 -26
- package/dist/executors/clean-outputs/executor.d.ts.map +0 -1
- package/dist/executors/clean-outputs/executor.js +0 -83
- package/dist/executors/clean-outputs/schema.d.ts +0 -4
- package/dist/executors/clean-outputs/schema.d.ts.map +0 -1
- package/src/executors/clean-outputs/executor.ts +0 -131
- package/src/executors/clean-outputs/schema.json +0 -15
- package/src/executors/clean-outputs/schema.ts +0 -3
- /package/dist/executors/{clean-outputs → wrangler-deploy}/schema.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner-sizing.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/runner-sizing.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,kGAAkG;AAClG,MAAM,MAAM,UAAU;AACpB,mFAAmF;AACjF,SAAS;AACX,mDAAmD;GACjD,cAAc;AAChB,2EAA2E;GACzE,cAAc;AAChB,yHAAyH;GACvH,eAAe;AACjB,kGAAkG;GAChG,OAAO;AACT,2FAA2F;GACzF,SAAS,CAAC;AAEd;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED;;;GAGG;AACH,MAAM,MAAM,MAAM,GACd;IAAE,IAAI,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"runner-sizing.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/runner-sizing.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,kGAAkG;AAClG,MAAM,MAAM,UAAU;AACpB,mFAAmF;AACjF,SAAS;AACX,mDAAmD;GACjD,cAAc;AAChB,2EAA2E;GACzE,cAAc;AAChB,yHAAyH;GACvH,eAAe;AACjB,kGAAkG;GAChG,OAAO;AACT,2FAA2F;GACzF,SAAS,CAAC;AAEd;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED;;;GAGG;AACH,MAAM,MAAM,MAAM,GACd;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,kBAAkB,CAAA;CAAE,GAChE;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,kBAAkB,CAAA;CAAE,GAClE;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACrD;IAAE,IAAI,EA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ACb,GAAG,EAAE,OAAO,GACX,MAAM,CAKR;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GACb;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAoDlD;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAuB5D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAcjF;AASD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAM7E"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { BUN_TEST,
|
|
1
|
+
import { BUN_TEST, GO_TEST_RUNNER, NEXTEST_RUN } from './verdict.js';
|
|
2
2
|
/** Every budgeted command learns its grant here, so a script that starts a runner can size it. */
|
|
3
3
|
export const CPU_TOKENS_ENV = 'BOUNDED_EXEC_CPU_TOKENS';
|
|
4
|
+
/**
|
|
5
|
+
* The cores mbx granted the reservation a leaf runs under: `mbx reserve --cpus N` names at most N to its command, as many
|
|
6
|
+
* as were free once one was.
|
|
7
|
+
*/
|
|
8
|
+
export const GRANTED_CPUS_ENV = 'MBX_RESERVE_CPUS';
|
|
4
9
|
const CARGO_BUILD = /(?<=^|[\s;&|()])(?:cargo(?:\s+-\S+)*\s+(?:build|test|check|clippy|rustc|doc|run|nextest\s+archive)|napi\s+build)(?=\s|$)/;
|
|
5
10
|
const TEST_THREADS = /--test-threads(?:=|\s+)(\d+)/g;
|
|
6
11
|
/** nextest's `--no-capture` (`--nocapture` past `--`): it runs tests serially and ignores `--test-threads`. */
|
|
@@ -33,9 +38,9 @@ const WORKER_FLAGS = {
|
|
|
33
38
|
ownDefault: (cores) => Math.max(cores - 1, 1),
|
|
34
39
|
serial: /(?<![\w-])(?:--no-file-parallelism|--file(?:P|-p)arallelism=false)(?![\w-])/,
|
|
35
40
|
},
|
|
36
|
-
/** `go test -p`: packages built and tested at once, `GOMAXPROCS` by default, normally one per core. */
|
|
41
|
+
/** `go test -p`: packages built and tested at once, `GOMAXPROCS` by default, normally one per core; prebuilt runs alike. */
|
|
37
42
|
'go-test': {
|
|
38
|
-
invocation:
|
|
43
|
+
invocation: GO_TEST_RUNNER,
|
|
39
44
|
flag: new RegExp(String.raw `(?<![\w-])-p(?:=|\s+)${WORD}`, 'g'),
|
|
40
45
|
sized: (count) => `-p=${count}`,
|
|
41
46
|
ownDefault: (cores, env) => parseInheritedTokens(env.GOMAXPROCS) ?? cores,
|
|
@@ -226,7 +231,7 @@ export function sizeRunner(demand, command, tokens) {
|
|
|
226
231
|
case 'go-test': {
|
|
227
232
|
const runner = WORKER_FLAGS[demand.kind];
|
|
228
233
|
return {
|
|
229
|
-
command: withInvocationFlag(command, runner.invocation, runner.flag, runner.sized(
|
|
234
|
+
command: withInvocationFlag(command, runner.invocation, runner.flag, runner.sized(count), true),
|
|
230
235
|
env: { [CPU_TOKENS_ENV]: held },
|
|
231
236
|
};
|
|
232
237
|
}
|
|
@@ -249,6 +254,52 @@ export function sizeRunner(demand, command, tokens) {
|
|
|
249
254
|
}
|
|
250
255
|
}
|
|
251
256
|
}
|
|
257
|
+
/**
|
|
258
|
+
* The shell statements that run first in a reserved leaf's reservation and size its runner to the grant, which only
|
|
259
|
+
* the command learns as it starts: `CPU_TOKENS_ENV` becomes the cores mbx granted (`GRANTED_CPUS_ENV`), never more
|
|
260
|
+
* than the leaf asked for, its `--cpus` (the runner's own count), which also stands in under an mbx that grants a
|
|
261
|
+
* reservation whole and names none. The test-thread variables a sizing sets follow from it, under their inherited
|
|
262
|
+
* ceilings, outranking the target's own as a numeric grant's do (`sizeRunner`).
|
|
263
|
+
*/
|
|
264
|
+
export function grantedSizing(demand) {
|
|
265
|
+
const asked = demand.want;
|
|
266
|
+
const named = `\${${GRANTED_CPUS_ENV}:-${asked}}`;
|
|
267
|
+
const tokens = `$${CPU_TOKENS_ENV}`;
|
|
268
|
+
const atMost = (ceiling) => ceiling === null ? `"${tokens}"` : `"$(( ${tokens} < ${ceiling} ? ${tokens} : ${ceiling} ))"`;
|
|
269
|
+
const statements = [`export ${CPU_TOKENS_ENV}="$(( ${named} < ${asked} ? ${named} : ${asked} ))"`];
|
|
270
|
+
switch (demand.kind) {
|
|
271
|
+
case 'nextest':
|
|
272
|
+
statements.push(`export NEXTEST_TEST_THREADS="${tokens}"`);
|
|
273
|
+
break;
|
|
274
|
+
case 'process':
|
|
275
|
+
// A process's script may start Cargo, whose test threads take no jobserver token: its whole grant.
|
|
276
|
+
statements.push(`export RUST_TEST_THREADS=${atMost(demand.testThreads.rust)}`, `export NEXTEST_TEST_THREADS=${atMost(demand.testThreads.nextest)}`);
|
|
277
|
+
break;
|
|
278
|
+
case 'bun-parallel':
|
|
279
|
+
case 'stryker':
|
|
280
|
+
break;
|
|
281
|
+
}
|
|
282
|
+
return statements.map((statement) => `${statement}; `).join('');
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* `command` with a reserved runner's named count read from its grant, `CPU_TOKENS_ENV` as `grantedSizing` sets it,
|
|
286
|
+
* where the runner's shell runs it; the runner then runs on all it holds.
|
|
287
|
+
*/
|
|
288
|
+
export function sizeRunnerToGrant(demand, command) {
|
|
289
|
+
const granted = `\${${CPU_TOKENS_ENV}}`;
|
|
290
|
+
switch (demand.kind) {
|
|
291
|
+
case 'nextest':
|
|
292
|
+
return command.replace(TEST_THREADS, `--test-threads=${granted}`);
|
|
293
|
+
case 'bun-parallel':
|
|
294
|
+
return command.replace(BUN_PARALLEL, `--parallel=${granted}`);
|
|
295
|
+
case 'stryker': {
|
|
296
|
+
const runner = WORKER_FLAGS.stryker;
|
|
297
|
+
return withInvocationFlag(command, runner.invocation, runner.flag, runner.sized(granted), true);
|
|
298
|
+
}
|
|
299
|
+
case 'process':
|
|
300
|
+
return command;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
252
303
|
/** A configured value may lower an inherited ceiling, never raise it. */
|
|
253
304
|
function inheritedCeiling(inherited, configured) {
|
|
254
305
|
const left = parseInheritedTokens(inherited);
|
|
@@ -5,7 +5,7 @@ import { promisify } from 'node:util';
|
|
|
5
5
|
/**
|
|
6
6
|
* A leg that runs `bun` runs the Bun its workspace declares.
|
|
7
7
|
*
|
|
8
|
-
* The root `package.json` names that Bun in `packageManager` (`bun@
|
|
8
|
+
* The root `package.json` names that Bun in `packageManager` (`bun@x.y.z`); the Bun the command gets is the first `bun`
|
|
9
9
|
* on the PATH it runs with. When the two disagree the leg is refused before it asks for anything, naming both versions
|
|
10
10
|
* and the binary. A Bun other than the declared one does not fail at startup: on Bun 1.4.2 `console.log` drops what a
|
|
11
11
|
* full pipe refuses, so a child's JSON document reaches the parent that reads it cut in the middle of a string, the
|
|
@@ -200,6 +200,12 @@ export declare const JUNIT_FILE = "report.xml";
|
|
|
200
200
|
export declare const BUN_TEST: RegExp;
|
|
201
201
|
export declare const NEXTEST_RUN: RegExp;
|
|
202
202
|
export declare const GO_TEST: RegExp;
|
|
203
|
+
/**
|
|
204
|
+
* `go test`, or `smoo-nx-go-test-run` running the test binaries `smoo-nx-go-test-build` made with `go test -c`, under
|
|
205
|
+
* any path: both write `go test -json` events on stdout and run `-p` packages at once. Only `go test` builds, so only
|
|
206
|
+
* it is asked for `-json` (withProgressReport) or given a build phase (withRunnerLifecycle).
|
|
207
|
+
*/
|
|
208
|
+
export declare const GO_TEST_RUNNER: RegExp;
|
|
203
209
|
/**
|
|
204
210
|
* `command` with its test runner asked to write a JUnit report into `directory`, the report
|
|
205
211
|
* `judgeRun` reads. Both runners are recognised by their invocation, so every target that runs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verdict.d.ts","sourceRoot":"","sources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IAAI,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,kBAAkB,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;CAAE,GACpH;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9E;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CA6BrG;AAED,kFAAkF;AAClF,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,kBAAkB,GAAG,MAAM,CAIvE;AACD,wBAAgB,eAAe,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,CA2BnE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAgBjE"}
|
|
@@ -257,6 +257,12 @@ const NEXTEST_REPORT_CONFIG_FILE = 'nextest-report.toml';
|
|
|
257
257
|
export const BUN_TEST = /(?<=^|[\s;&|()])((?:[^\s;&|()<>'"`\\=]*\/)?bun)\s+test(?=\s|$)/g;
|
|
258
258
|
export const NEXTEST_RUN = /(?<=^|[\s;&|()-])nextest\s+run(?=\s|$)/g;
|
|
259
259
|
export const GO_TEST = /(?<=^|[\s;&|()])go\s+test(?=\s|$)/;
|
|
260
|
+
/**
|
|
261
|
+
* `go test`, or `smoo-nx-go-test-run` running the test binaries `smoo-nx-go-test-build` made with `go test -c`, under
|
|
262
|
+
* any path: both write `go test -json` events on stdout and run `-p` packages at once. Only `go test` builds, so only
|
|
263
|
+
* it is asked for `-json` (withProgressReport) or given a build phase (withRunnerLifecycle).
|
|
264
|
+
*/
|
|
265
|
+
export const GO_TEST_RUNNER = /(?<=^|[\s;&|()])(?:go\s+test|(?:[^\s;&|()<>'"`\\=]*\/)?smoo-nx-go-test-run)(?=\s|$)/;
|
|
260
266
|
/**
|
|
261
267
|
* `command` with its test runner asked to write a JUnit report into `directory`, the report
|
|
262
268
|
* `judgeRun` reads. Both runners are recognised by their invocation, so every target that runs
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The hash a wrangler deploy runs under when its hasher could not confirm that the stage serves its artifact's
|
|
3
|
+
* version: the artifact hash, then a nonce no cache holds, so the run misses whatever an earlier run stored, rolled
|
|
4
|
+
* back to or not. A miss is the right answer there. The deploy still tags the artifact's version
|
|
5
|
+
* (`deployArtifactHash`), so once that version is live the next hash is the artifact's own.
|
|
6
|
+
*/
|
|
7
|
+
export declare function unconfirmedDeployHash(artifactHash: string, nonce: string): string;
|
|
8
|
+
/** The artifact hash a wrangler deploy task's hash carries: all of a confirmed one, the part before an unconfirmed one's nonce. */
|
|
9
|
+
export declare function deployArtifactHash(taskHash: string): string;
|
|
10
|
+
//# sourceMappingURL=deploy-hash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-hash.d.ts","sourceRoot":"","sources":["../../../src/executors/wrangler-deploy/deploy-hash.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjF;AAED,mIAAmI;AACnI,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAG3D"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The hash a wrangler deploy runs under when its hasher could not confirm that the stage serves its artifact's
|
|
3
|
+
* version: the artifact hash, then a nonce no cache holds, so the run misses whatever an earlier run stored, rolled
|
|
4
|
+
* back to or not. A miss is the right answer there. The deploy still tags the artifact's version
|
|
5
|
+
* (`deployArtifactHash`), so once that version is live the next hash is the artifact's own.
|
|
6
|
+
*/
|
|
7
|
+
export function unconfirmedDeployHash(artifactHash, nonce) {
|
|
8
|
+
return `${artifactHash}-${nonce}`;
|
|
9
|
+
}
|
|
10
|
+
/** The artifact hash a wrangler deploy task's hash carries: all of a confirmed one, the part before an unconfirmed one's nonce. */
|
|
11
|
+
export function deployArtifactHash(taskHash) {
|
|
12
|
+
const nonce = taskHash.indexOf('-');
|
|
13
|
+
return nonce === -1 ? taskHash : taskHash.slice(0, nonce);
|
|
14
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { WranglerDeployOptions } from './schema.js';
|
|
2
|
+
/** What the executor reads of Nx's context: the workspace and the project's root. */
|
|
3
|
+
interface WranglerDeployContext {
|
|
4
|
+
readonly root: string;
|
|
5
|
+
readonly projectName?: string | undefined;
|
|
6
|
+
readonly projectsConfigurations: {
|
|
7
|
+
readonly projects: Readonly<Record<string, {
|
|
8
|
+
readonly root: string;
|
|
9
|
+
}>>;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* `smoo wrangler deploy-stage --stage <stage>` in the project, as the workspace's own `smoo`, under the artifact hash
|
|
14
|
+
* of the hash the task ran under: `deploy-stage` tags the version it deploys with that hash, and the hasher compares
|
|
15
|
+
* the stage's live tag with it.
|
|
16
|
+
*/
|
|
17
|
+
export declare function runWranglerDeploy(options: WranglerDeployOptions, context: WranglerDeployContext, env: NodeJS.ProcessEnv): Promise<{
|
|
18
|
+
success: boolean;
|
|
19
|
+
}>;
|
|
20
|
+
export default function wranglerDeployExecutor(options: WranglerDeployOptions, context: WranglerDeployContext): Promise<{
|
|
21
|
+
success: boolean;
|
|
22
|
+
}>;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/executors/wrangler-deploy/executor.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD,qFAAqF;AACrF,UAAU,qBAAqB;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,sBAAsB,EAAE;QAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE;YAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC,CAAA;KAAE,CAAC;CAC7G;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,qBAAqB,EAC9B,GAAG,EAAE,MAAM,CAAC,UAAU,GACrB,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAiC/B;AAED,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAC5C,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAE/B"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { deployArtifactHash } from './deploy-hash.js';
|
|
4
|
+
import { workspaceBinPath } from './hasher.js';
|
|
5
|
+
/**
|
|
6
|
+
* `smoo wrangler deploy-stage --stage <stage>` in the project, as the workspace's own `smoo`, under the artifact hash
|
|
7
|
+
* of the hash the task ran under: `deploy-stage` tags the version it deploys with that hash, and the hasher compares
|
|
8
|
+
* the stage's live tag with it.
|
|
9
|
+
*/
|
|
10
|
+
export function runWranglerDeploy(options, context, env) {
|
|
11
|
+
const project = context.projectName === undefined ? undefined : context.projectsConfigurations.projects[context.projectName];
|
|
12
|
+
if (project === undefined) {
|
|
13
|
+
throw new Error('@smoothbricks/nx-plugin:wrangler-deploy requires a project context.');
|
|
14
|
+
}
|
|
15
|
+
const hash = env.NX_TASK_HASH;
|
|
16
|
+
const deployEnv = {
|
|
17
|
+
...env,
|
|
18
|
+
PATH: workspaceBinPath(context.root, env),
|
|
19
|
+
...(hash === undefined ? {} : { NX_TASK_HASH: deployArtifactHash(hash) }),
|
|
20
|
+
};
|
|
21
|
+
const command = `smoo wrangler deploy-stage --stage ${options.stage}`;
|
|
22
|
+
// eslint-disable-next-line deadline/no-unbounded-wait -- WHY unbounded: a deploy lasts as long as wrangler's upload and the live-version wait deploy-stage bounds itself, as it did under nx:run-commands
|
|
23
|
+
return new Promise((resolve) => {
|
|
24
|
+
const child = spawn('smoo', ['wrangler', 'deploy-stage', '--stage', options.stage], {
|
|
25
|
+
cwd: join(context.root, project.root),
|
|
26
|
+
env: deployEnv,
|
|
27
|
+
stdio: 'inherit',
|
|
28
|
+
});
|
|
29
|
+
child.on('error', (error) => {
|
|
30
|
+
console.error(`wrangler-deploy: \`${command}\` could not start: ${error.message}`);
|
|
31
|
+
resolve({ success: false });
|
|
32
|
+
});
|
|
33
|
+
child.on('close', (code, signal) => {
|
|
34
|
+
if (code !== 0) {
|
|
35
|
+
console.error(`wrangler-deploy: \`${command}\` ${signal === null ? `exited ${code}` : `was ended by ${signal}`}`);
|
|
36
|
+
}
|
|
37
|
+
resolve({ success: code === 0 });
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
export default function wranglerDeployExecutor(options, context) {
|
|
42
|
+
return runWranglerDeploy(options, context, process.env);
|
|
43
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { HasherContext } from 'nx/src/config/misc-interfaces';
|
|
2
|
+
import type { Task } from 'nx/src/config/task-graph';
|
|
3
|
+
import type { Hash } from 'nx/src/hasher/task-hasher';
|
|
4
|
+
/** What serves a stage: the tag of the version taking all its traffic (null for a version deployed untagged), or why that is not known. */
|
|
5
|
+
export type LiveTag = {
|
|
6
|
+
readonly kind: 'tag';
|
|
7
|
+
readonly tag: string | null;
|
|
8
|
+
} | {
|
|
9
|
+
readonly kind: 'unknown';
|
|
10
|
+
readonly reason: string;
|
|
11
|
+
};
|
|
12
|
+
/** The hash detail that says what the stage served when it was not the artifact's version. */
|
|
13
|
+
export declare const LIVE_VERSION_NODE = "wrangler:live-version";
|
|
14
|
+
/**
|
|
15
|
+
* A deploy's hash: `artifact`, Nx's hash of what the deploy uploads and the stage it names, while the stage serves the
|
|
16
|
+
* version tagged with it, so a cache hit replays a deploy that would change nothing. Any other live version, or none
|
|
17
|
+
* known, makes it `unconfirmedDeployHash`, which no cache holds, so the run deploys; a rollback is never answered
|
|
18
|
+
* from the cache. Hashing the live tag in instead would never converge: the deployed version is tagged with the hash.
|
|
19
|
+
*/
|
|
20
|
+
export declare function deployHash(artifact: Hash, live: LiveTag, nonce: string): Hash;
|
|
21
|
+
/** `env`'s PATH with the workspace's own bins first, as nx:run-commands runs a command. */
|
|
22
|
+
export declare function workspaceBinPath(root: string, env: NodeJS.ProcessEnv): string;
|
|
23
|
+
/** The tag serving `stage` for the project at `projectRoot`, read from Cloudflare now, never from a cached answer. */
|
|
24
|
+
export declare function probeLiveTag(root: string, projectRoot: string, stage: string, env?: NodeJS.ProcessEnv): Promise<LiveTag>;
|
|
25
|
+
/** Nx's custom hasher of `@smoothbricks/nx-plugin:wrangler-deploy`: `deployHash` of the task's own hash and its stage's live tag. */
|
|
26
|
+
export default function wranglerDeployHasher(task: Task, context: HasherContext): Promise<Hash>;
|
|
27
|
+
//# sourceMappingURL=hasher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hasher.d.ts","sourceRoot":"","sources":["../../../src/executors/wrangler-deploy/hasher.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AActD,2IAA2I;AAC3I,MAAM,MAAM,OAAO,GACf;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GACrD;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1D,8FAA8F;AAC9F,eAAO,MAAM,iBAAiB,0BAA0B,CAAC;AAEzD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAc7E;AAED,2FAA2F;AAC3F,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAG7E;AAED,sHAAsH;AACtH,wBAAsB,YAAY,CAChC,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,OAAO,CAAC,OAAO,CAAC,CA2BlB;AASD,qIAAqI;AACrI,wBAA8B,oBAAoB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAWpG"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
2
|
+
import { randomBytes } from 'node:crypto';
|
|
3
|
+
import { delimiter, join } from 'node:path';
|
|
4
|
+
import { promisify } from 'node:util';
|
|
5
|
+
import { workspaceRoot } from 'nx/src/utils/workspace-root';
|
|
6
|
+
import { deployVersionTag } from '../../deploy-policy.js';
|
|
7
|
+
import { isRecord } from '../../type-guards.js';
|
|
8
|
+
import { unconfirmedDeployHash } from './deploy-hash.js';
|
|
9
|
+
const execFileAsync = promisify(execFile);
|
|
10
|
+
/**
|
|
11
|
+
* `smoo wrangler deployed-version` asks Cloudflare twice through wrangler, in seconds. The bound is for one that never
|
|
12
|
+
* answers: the live version is then unknown, the hash misses, and the deploy reads Cloudflare itself.
|
|
13
|
+
*/
|
|
14
|
+
const LIVE_TAG_DEADLINE_MS = 120_000;
|
|
15
|
+
/** The hash detail that says what the stage served when it was not the artifact's version. */
|
|
16
|
+
export const LIVE_VERSION_NODE = 'wrangler:live-version';
|
|
17
|
+
/**
|
|
18
|
+
* A deploy's hash: `artifact`, Nx's hash of what the deploy uploads and the stage it names, while the stage serves the
|
|
19
|
+
* version tagged with it, so a cache hit replays a deploy that would change nothing. Any other live version, or none
|
|
20
|
+
* known, makes it `unconfirmedDeployHash`, which no cache holds, so the run deploys; a rollback is never answered
|
|
21
|
+
* from the cache. Hashing the live tag in instead would never converge: the deployed version is tagged with the hash.
|
|
22
|
+
*/
|
|
23
|
+
export function deployHash(artifact, live, nonce) {
|
|
24
|
+
const expected = deployVersionTag(artifact.value);
|
|
25
|
+
if (live.kind === 'tag' && expected !== null && live.tag === expected)
|
|
26
|
+
return artifact;
|
|
27
|
+
const served = expected === null
|
|
28
|
+
? `the artifact hash ${artifact.value} names no version tag`
|
|
29
|
+
: live.kind === 'unknown'
|
|
30
|
+
? live.reason
|
|
31
|
+
: `${live.tag ?? 'an untagged version'} is live, not ${expected}`;
|
|
32
|
+
return {
|
|
33
|
+
...artifact,
|
|
34
|
+
value: unconfirmedDeployHash(artifact.value, nonce),
|
|
35
|
+
details: { ...artifact.details, nodes: { ...artifact.details.nodes, [LIVE_VERSION_NODE]: served } },
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/** `env`'s PATH with the workspace's own bins first, as nx:run-commands runs a command. */
|
|
39
|
+
export function workspaceBinPath(root, env) {
|
|
40
|
+
const bins = join(root, 'node_modules', '.bin');
|
|
41
|
+
return env.PATH === undefined || env.PATH === '' ? bins : `${bins}${delimiter}${env.PATH}`;
|
|
42
|
+
}
|
|
43
|
+
/** The tag serving `stage` for the project at `projectRoot`, read from Cloudflare now, never from a cached answer. */
|
|
44
|
+
export async function probeLiveTag(root, projectRoot, stage, env = process.env) {
|
|
45
|
+
const args = ['wrangler', 'deployed-version', '--stage', stage, '--refresh'];
|
|
46
|
+
const command = `smoo ${args.join(' ')}`;
|
|
47
|
+
try {
|
|
48
|
+
const { stdout } = await execFileAsync('smoo', args, {
|
|
49
|
+
cwd: join(root, projectRoot),
|
|
50
|
+
env: { ...env, PATH: workspaceBinPath(root, env) },
|
|
51
|
+
encoding: 'utf8',
|
|
52
|
+
timeout: LIVE_TAG_DEADLINE_MS,
|
|
53
|
+
killSignal: 'SIGKILL',
|
|
54
|
+
maxBuffer: 64 * 1024,
|
|
55
|
+
});
|
|
56
|
+
const tag = stdout.trim();
|
|
57
|
+
if (tag === '' || /\s/.test(tag)) {
|
|
58
|
+
return { kind: 'unknown', reason: `\`${command}\` printed no single tag: ${JSON.stringify(stdout)}` };
|
|
59
|
+
}
|
|
60
|
+
// `deployed-version` says `untagged` for a version deployed outside Nx.
|
|
61
|
+
return { kind: 'tag', tag: tag === 'untagged' ? null : tag };
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
if (error instanceof Error && 'killed' in error && error.killed === true) {
|
|
65
|
+
return { kind: 'unknown', reason: `\`${command}\` gave no answer within ${LIVE_TAG_DEADLINE_MS} ms` };
|
|
66
|
+
}
|
|
67
|
+
const said = error instanceof Error && 'stderr' in error && typeof error.stderr === 'string' ? error.stderr.trim() : '';
|
|
68
|
+
const reason = said !== '' ? said : error instanceof Error ? error.message : String(error);
|
|
69
|
+
return { kind: 'unknown', reason: `\`${command}\` failed: ${reason}` };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/** The stage the task deploys: its `--stage` override, else its target's `stage` option. */
|
|
73
|
+
function deployStage(task, options) {
|
|
74
|
+
const overrides = task.overrides;
|
|
75
|
+
if (isRecord(overrides) && typeof overrides.stage === 'string')
|
|
76
|
+
return overrides.stage;
|
|
77
|
+
return isRecord(options) && typeof options.stage === 'string' ? options.stage : null;
|
|
78
|
+
}
|
|
79
|
+
/** Nx's custom hasher of `@smoothbricks/nx-plugin:wrangler-deploy`: `deployHash` of the task's own hash and its stage's live tag. */
|
|
80
|
+
export default async function wranglerDeployHasher(task, context) {
|
|
81
|
+
const artifact = await context.hasher.hashTask(task, context.taskGraph);
|
|
82
|
+
const project = context.projectsConfigurations.projects[task.target.project];
|
|
83
|
+
const stage = deployStage(task, project?.targets?.[task.target.target]?.options);
|
|
84
|
+
const live = project === undefined
|
|
85
|
+
? { kind: 'unknown', reason: `Nx names no project ${task.target.project}` }
|
|
86
|
+
: stage === null
|
|
87
|
+
? { kind: 'unknown', reason: 'the task names no --stage' }
|
|
88
|
+
: await probeLiveTag(workspaceRoot, project.root, stage);
|
|
89
|
+
return deployHash(artifact, live, randomBytes(8).toString('hex'));
|
|
90
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/executors/wrangler-deploy/schema.ts"],"names":[],"mappings":"AAAA,2GAA2G;AAC3G,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The manifest `smoo-nx-go-test-build` writes beside the test binaries it builds with `go test -c`, and
|
|
3
|
+
* `smoo-nx-go-test-run` runs. Every path in it is relative to the manifest's own directory, so the binaries and the
|
|
4
|
+
* packages they test are found wherever both are restored together, as an Nx cache restore puts them back.
|
|
5
|
+
*/
|
|
6
|
+
export declare const GO_TESTS_MANIFEST = "go-tests.json";
|
|
7
|
+
/** One package's test binary. */
|
|
8
|
+
export interface GoTestBinary {
|
|
9
|
+
/** The binary `go test -c` built for the package. */
|
|
10
|
+
readonly binary: string;
|
|
11
|
+
/** The package directory: `go test` runs a package's binary there, so its relative test data resolves alike. */
|
|
12
|
+
readonly dir: string;
|
|
13
|
+
/** The package's import path, every event's `Package`. */
|
|
14
|
+
readonly importPath: string;
|
|
15
|
+
}
|
|
16
|
+
export interface GoTestsManifest {
|
|
17
|
+
readonly version: 1;
|
|
18
|
+
/** One entry per package with test files, sorted by import path. */
|
|
19
|
+
readonly tests: readonly GoTestBinary[];
|
|
20
|
+
}
|
|
21
|
+
export type GoTestsRead = {
|
|
22
|
+
readonly ok: true;
|
|
23
|
+
readonly tests: readonly GoTestBinary[];
|
|
24
|
+
} | {
|
|
25
|
+
readonly ok: false;
|
|
26
|
+
readonly reason: string;
|
|
27
|
+
};
|
|
28
|
+
/** The binaries the manifest at `path` lists, their paths resolved against its directory, or why it lists none. */
|
|
29
|
+
export declare function readGoTestsManifest(path: string): GoTestsRead;
|
|
30
|
+
//# sourceMappingURL=go-tests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"go-tests.d.ts","sourceRoot":"","sources":["../src/go-tests.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;AAEjD,iCAAiC;AACjC,MAAM,WAAW,YAAY;IAC3B,qDAAqD;IACrD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,gHAAgH;IAChH,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IACpB,oEAAoE;IACpE,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;CACzC;AAED,MAAM,MAAM,WAAW,GACnB;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAA;CAAE,GAC9D;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpD,mHAAmH;AACnH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CA8B7D"}
|
package/dist/go-tests.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, isAbsolute, resolve } from 'node:path';
|
|
3
|
+
import { isRecord } from './type-guards.js';
|
|
4
|
+
/**
|
|
5
|
+
* The manifest `smoo-nx-go-test-build` writes beside the test binaries it builds with `go test -c`, and
|
|
6
|
+
* `smoo-nx-go-test-run` runs. Every path in it is relative to the manifest's own directory, so the binaries and the
|
|
7
|
+
* packages they test are found wherever both are restored together, as an Nx cache restore puts them back.
|
|
8
|
+
*/
|
|
9
|
+
export const GO_TESTS_MANIFEST = 'go-tests.json';
|
|
10
|
+
/** The binaries the manifest at `path` lists, their paths resolved against its directory, or why it lists none. */
|
|
11
|
+
export function readGoTestsManifest(path) {
|
|
12
|
+
let parsed;
|
|
13
|
+
try {
|
|
14
|
+
parsed = JSON.parse(readFileSync(path, 'utf8'));
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
return { ok: false, reason: `${path} cannot be read: ${error instanceof Error ? error.message : String(error)}` };
|
|
18
|
+
}
|
|
19
|
+
if (!isRecord(parsed) || parsed.version !== 1 || !Array.isArray(parsed.tests)) {
|
|
20
|
+
return { ok: false, reason: `${path} is no version 1 ${GO_TESTS_MANIFEST}: it needs {"version":1,"tests":[…]}` };
|
|
21
|
+
}
|
|
22
|
+
const base = dirname(path);
|
|
23
|
+
const tests = [];
|
|
24
|
+
const listed = new Set();
|
|
25
|
+
for (const [index, entry] of parsed.tests.entries()) {
|
|
26
|
+
if (!isRecord(entry) ||
|
|
27
|
+
!isRelativePath(entry.binary) ||
|
|
28
|
+
!isRelativePath(entry.dir) ||
|
|
29
|
+
typeof entry.importPath !== 'string' ||
|
|
30
|
+
entry.importPath === '') {
|
|
31
|
+
return { ok: false, reason: `${path}: tests[${index}] needs a relative binary and dir and an importPath` };
|
|
32
|
+
}
|
|
33
|
+
if (listed.has(entry.importPath)) {
|
|
34
|
+
return { ok: false, reason: `${path}: ${entry.importPath} is listed twice` };
|
|
35
|
+
}
|
|
36
|
+
listed.add(entry.importPath);
|
|
37
|
+
tests.push({ binary: resolve(base, entry.binary), dir: resolve(base, entry.dir), importPath: entry.importPath });
|
|
38
|
+
}
|
|
39
|
+
return { ok: true, tests };
|
|
40
|
+
}
|
|
41
|
+
function isRelativePath(value) {
|
|
42
|
+
return typeof value === 'string' && value !== '' && !isAbsolute(value);
|
|
43
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,13 @@ import { type ProducerReceiptsOptions } from './producer-receipts.js';
|
|
|
4
4
|
export declare const DEPLOY_TARGET = "deploy";
|
|
5
5
|
/** The purely file-derived half a deploy needs built first; cached. */
|
|
6
6
|
export declare const DEPLOY_BUILD_TARGET = "deploy-build";
|
|
7
|
+
/**
|
|
8
|
+
* The bytes of a file that arrives from elsewhere, as a runtime input: their SHA-256, streamed, or `absent`. A task
|
|
9
|
+
* that needs the file fails without it, and Nx caches no failure, so no cached run is keyed on `absent`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function arrivedFileHashInput(path: string): {
|
|
12
|
+
runtime: string;
|
|
13
|
+
};
|
|
7
14
|
/**
|
|
8
15
|
* Whether the workspace at `workspaceRoot` runs this plugin as an installed npm package, whose lockfile node an
|
|
9
16
|
* `externalDependencies` entry can name. In the repository that develops it the plugin is a workspace project: the
|
|
@@ -17,8 +24,8 @@ export declare function pluginInstalledIn(workspaceRoot: string, loadedFromNodeM
|
|
|
17
24
|
/**
|
|
18
25
|
* The npm packages a cached cargo target runs, for its `externalDependencies`.
|
|
19
26
|
* Cargo runs none. A target this plugin's executor runs, or whose command reads
|
|
20
|
-
* the installed plugin's files (the nextest tool config, the
|
|
21
|
-
*
|
|
27
|
+
* the installed plugin's files (the nextest tool config, the test-binaries
|
|
28
|
+
* helper), runs the plugin. Without the input Nx keys every task whose
|
|
22
29
|
* executor is not an `@nx/` one on every package in the lockfile, so a
|
|
23
30
|
* lockfile-only commit re-ran every cargo verdict.
|
|
24
31
|
*/
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EAGnB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EAGtB,KAAK,mBAAmB,EACzB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EAGnB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EAGtB,KAAK,mBAAmB,EACzB,MAAM,0BAA0B,CAAC;AAmElC,OAAO,EACL,KAAK,uBAAuB,EAG7B,MAAM,wBAAwB,CAAC;AAoBhC,gEAAgE;AAChE,eAAO,MAAM,aAAa,WAAW,CAAC;AACtC,uEAAuE;AACvE,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAiclD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAMtE;AA4aD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,MAAM,EACrB,qBAAqB,UAAkC,GACtD,OAAO,CAoBT;AACD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,mBAAmB,EAC3B,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,OAAO,GACjB,MAAM,EAAE,CAKV;AA6ID,wBAAgB,wBAAwB,CAAC,QAAQ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