@vzn/vx 0.0.639 → 0.0.641
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 +1 -1
- package/docs/caching.md +158 -106
- package/docs/cli.md +80 -45
- package/docs/execution.md +11 -10
- package/docs/features.md +9 -8
- package/docs/patterns.md +1 -1
- package/docs/schema.md +252 -190
- package/docs/security.md +5 -4
- package/launcher.sh +9 -2
- package/package.json +5 -5
- package/schemas/show.json +14 -14
- package/skills/vx/SKILL.md +4 -3
- package/src/bin.ts +8 -6
- package/src/cache/archive.ts +248 -41
- package/src/cache/cache.ts +46 -19
- package/src/cache/file-hashes.ts +7 -12
- package/src/cache/fs-clock.ts +62 -0
- package/src/cache/git-inputs.ts +2 -2
- package/src/cache/index.ts +6 -0
- package/src/cache/inputs.ts +228 -111
- package/src/cache/key-fold.ts +23 -3
- package/src/cache/layer.ts +15 -8
- package/src/cache/layered-cache.ts +8 -7
- package/src/cache/linked-inputs.ts +87 -0
- package/src/cache/scoped-cache.ts +8 -2
- package/src/cli/foreign-flags.ts +1 -1
- package/src/cli/help.ts +7 -1
- package/src/cli/init.ts +23 -11
- package/src/cli/last.ts +24 -1
- package/src/cli/plugin-templates.ts +2 -2
- package/src/cli/select.ts +16 -6
- package/src/cli/show.ts +9 -6
- package/src/cli/upgrade.ts +132 -21
- package/src/cli/watch-filter.ts +23 -12
- package/src/cli/watch-fs.ts +2 -1
- package/src/cli/watch-judge.ts +49 -5
- package/src/cli/watch-set.ts +18 -8
- package/src/cli/watch.ts +74 -2
- package/src/cli/why.ts +5 -3
- package/src/config.ts +19 -15
- package/src/exec/executor.ts +4 -4
- package/src/graph/dependency-spec.ts +2 -2
- package/src/graph/folds.ts +236 -0
- package/src/graph/index.ts +8 -1
- package/src/graph/scheduler.ts +41 -15
- package/src/graph/task-graph.ts +135 -73
- package/src/handoff.ts +5 -0
- package/src/index.ts +2 -2
- package/src/orchestrator/affected-tasks.ts +20 -19
- package/src/orchestrator/download-policy.ts +16 -22
- package/src/orchestrator/excluded-keys.ts +4 -5
- package/src/orchestrator/execute-task.ts +29 -25
- package/src/orchestrator/hit-restore.ts +101 -27
- package/src/orchestrator/index.ts +1 -0
- package/src/orchestrator/keyed-projects.ts +12 -51
- package/src/orchestrator/local-shortcircuit.ts +9 -1
- package/src/orchestrator/persistent-task.ts +3 -3
- package/src/orchestrator/placement.ts +2 -2
- package/src/orchestrator/plan.ts +1 -1
- package/src/orchestrator/plugin-host.ts +66 -27
- package/src/orchestrator/plugin.ts +12 -2
- package/src/orchestrator/prepare.ts +12 -5
- package/src/orchestrator/projects.ts +7 -10
- package/src/orchestrator/run-report.ts +145 -46
- package/src/orchestrator/run-steps.ts +57 -0
- package/src/orchestrator/run.ts +76 -44
- package/src/orchestrator/sandbox-fix.ts +1 -1
- package/src/orchestrator/sandbox-request.ts +2 -2
- package/src/orchestrator/stable-keys.ts +59 -26
- package/src/orchestrator/steps.ts +26 -6
- package/src/orchestrator/task-hash.ts +31 -9
- package/src/orchestrator/telemetry-host.ts +3 -3
- package/src/orchestrator/telemetry.ts +9 -4
- package/src/orchestrator/upstream.ts +4 -181
- package/src/report/framed-output.ts +1 -1
- package/src/report/logger.ts +5 -2
- package/src/report/status-line.ts +7 -3
- package/src/report/summary.ts +6 -4
- package/src/settings.ts +11 -17
- package/src/util/index.ts +3 -0
- package/src/util/paths.ts +39 -5
- package/src/workspace/affected.ts +81 -2
- package/src/workspace/config-eval.ts +2 -2
- package/src/workspace/config-imports.ts +1 -1
- package/src/workspace/config-schema.ts +142 -143
- package/src/workspace/lockfile.ts +1 -1
- package/src/workspace/migration.ts +19 -3
- package/src/workspace/project-loader.ts +5 -4
|
@@ -67,7 +67,7 @@ const QUOTE_ARGS =
|
|
|
67
67
|
`vx_r="$vx_r\${vx_s%%"$vx_q"*}'\\''"; vx_s=\${vx_s#*"$vx_q"};; *) break;; esac; done; ` +
|
|
68
68
|
`vx_a="$vx_a '$vx_r$vx_s'"; done`
|
|
69
69
|
|
|
70
|
-
const isCacheTodo = (todo: string): boolean => todo.startsWith('cache: add `
|
|
70
|
+
const isCacheTodo = (todo: string): boolean => todo.startsWith('cache: add `inputs: {')
|
|
71
71
|
|
|
72
72
|
/** The one wording every mapper emits for a task it made persistent. */
|
|
73
73
|
export const PERSISTENT_TODO =
|
|
@@ -426,7 +426,7 @@ export async function applyMigration(args: ApplyMigrationArgs): Promise<number>
|
|
|
426
426
|
}
|
|
427
427
|
|
|
428
428
|
// The lock's own words become a row; a refusal prints above the report.
|
|
429
|
-
const lock = dry || args.lock === undefined ? undefined : await args.lock(root)
|
|
429
|
+
const lock = dry || args.lock === undefined ? undefined : lockAnswer(await args.lock(root))
|
|
430
430
|
if (lock !== undefined && lock.code !== 0) process.stderr.write(lock.said)
|
|
431
431
|
|
|
432
432
|
const rows: ui.FieldRow[] = [['from', source]]
|
|
@@ -488,6 +488,22 @@ export async function applyMigration(args: ApplyMigrationArgs): Promise<number>
|
|
|
488
488
|
return 0
|
|
489
489
|
}
|
|
490
490
|
|
|
491
|
+
/**
|
|
492
|
+
* The lock step's answer, checked: the tool calling this seam is another
|
|
493
|
+
* package and may be another version (vx-migrate 0.0.637's answered its
|
|
494
|
+
* exit code, which crashed the report).
|
|
495
|
+
*/
|
|
496
|
+
function lockAnswer(answer: unknown): { code: number; said: string } {
|
|
497
|
+
const a = answer as { code?: unknown; said?: unknown } | null
|
|
498
|
+
if (
|
|
499
|
+
typeof a === 'object' &&
|
|
500
|
+
a !== null &&
|
|
501
|
+
typeof a.code === 'number' &&
|
|
502
|
+
typeof a.said === 'string'
|
|
503
|
+
)
|
|
504
|
+
return { code: a.code, said: a.said }
|
|
505
|
+
return { code: 1, said: 'vx lock: the migration tool answered no result: run `vx lock`\n' }
|
|
506
|
+
}
|
|
491
507
|
/**
|
|
492
508
|
* What to do about written files .gitignore drops. A `!file` line cures a
|
|
493
509
|
* file, but git re-includes nothing inside an ignored directory: an
|
|
@@ -624,7 +640,7 @@ const EXAMPLE_BODY = `export default {
|
|
|
624
640
|
build: {
|
|
625
641
|
exec: { command: 'tsc -b' },
|
|
626
642
|
dependsOn: ['^build'],
|
|
627
|
-
|
|
643
|
+
inputs: { files: ['src/**'] }, cache: { outputs: { files: ['dist/**'] } },
|
|
628
644
|
},
|
|
629
645
|
},
|
|
630
646
|
}`
|
|
@@ -75,8 +75,9 @@ let serving = false
|
|
|
75
75
|
const HELD_QUERY = /\?vx-(?:held|literal)=([0-9a-f]+)$/
|
|
76
76
|
|
|
77
77
|
// Bun's resolver reads `\` as a separator, even in a file: URL, so a
|
|
78
|
-
// config under `a\b` was looked for under `a/b
|
|
79
|
-
//
|
|
78
|
+
// config under `a\b` was looked for under `a/b`, and `?` as a query, so
|
|
79
|
+
// one under `a?b` was looked for under `a`. Resolving it here keeps the
|
|
80
|
+
// path as written; only the served load can take it.
|
|
80
81
|
const LITERAL_QUERY = /\?vx-literal=[0-9a-f]+$/
|
|
81
82
|
|
|
82
83
|
function serveHeldSources(): void {
|
|
@@ -148,14 +149,14 @@ async function loadDefaultExport(
|
|
|
148
149
|
// URL yet, and a repeat load (the one that could replay an evaluation
|
|
149
150
|
// made under earlier env values) re-evaluates in a worker instead
|
|
150
151
|
// (`loadedConfigs`, item 678).
|
|
151
|
-
const literal = configPath
|
|
152
|
+
const literal = /[\\?]/.test(configPath)
|
|
152
153
|
const source =
|
|
153
154
|
kind === 'Project' || literal
|
|
154
155
|
? servableSource(bytes, /\.[cm]?ts$/.test(configPath) ? 'ts' : 'js')
|
|
155
156
|
: null
|
|
156
157
|
if (literal && source === null) {
|
|
157
158
|
throw new UserError(
|
|
158
|
-
`${kind} config ${configPath} sits under a path that holds a backslash, which Bun loads only as an ES module in UTF-8`,
|
|
159
|
+
`${kind} config ${configPath} sits under a path that holds ${configPath.includes('\\') ? 'a backslash' : 'a question mark'}, which Bun loads only as an ES module in UTF-8`,
|
|
159
160
|
)
|
|
160
161
|
}
|
|
161
162
|
const hash = xxh3hex(bytes)
|