@vzn/vx 0.0.322 → 0.0.324
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/config/index.ts +4 -0
- package/package.json +10 -5
- package/src/cli/init.ts +1 -1
- package/src/workspace/config-cache.ts +3 -0
- package/src/workspace/migration.ts +3 -3
package/README.md
CHANGED
|
@@ -85,7 +85,7 @@ npx vx run build --all # again: up-to-date in milliseconds
|
|
|
85
85
|
The one file `vx init` writes (in an Nx repo, `nx` for `turbo`):
|
|
86
86
|
|
|
87
87
|
```ts
|
|
88
|
-
import type { WorkspaceConfig } from '@vzn/vx'
|
|
88
|
+
import type { WorkspaceConfig } from '@vzn/vx/config'
|
|
89
89
|
import { turbo } from '@vzn/vx-migrate'
|
|
90
90
|
|
|
91
91
|
export default { plugins: [turbo()] } satisfies WorkspaceConfig
|
package/config/index.ts
ADDED
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vzn/vx",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.324",
|
|
4
4
|
"description": "A fast, correct task runner and build cache for JavaScript monorepos.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
8
|
"types": "./src/index.ts",
|
|
9
9
|
"import": "./src/index.ts"
|
|
10
|
+
},
|
|
11
|
+
"./config": {
|
|
12
|
+
"types": "./src/config.ts",
|
|
13
|
+
"import": "./src/config.ts"
|
|
10
14
|
}
|
|
11
15
|
},
|
|
12
16
|
"types": "./src/index.ts",
|
|
@@ -17,10 +21,10 @@
|
|
|
17
21
|
"node": ">=18"
|
|
18
22
|
},
|
|
19
23
|
"optionalDependencies": {
|
|
20
|
-
"@vzn/vx-linux-x64": "0.0.
|
|
21
|
-
"@vzn/vx-linux-arm64": "0.0.
|
|
22
|
-
"@vzn/vx-darwin-x64": "0.0.
|
|
23
|
-
"@vzn/vx-darwin-arm64": "0.0.
|
|
24
|
+
"@vzn/vx-linux-x64": "0.0.324",
|
|
25
|
+
"@vzn/vx-linux-arm64": "0.0.324",
|
|
26
|
+
"@vzn/vx-darwin-x64": "0.0.324",
|
|
27
|
+
"@vzn/vx-darwin-arm64": "0.0.324"
|
|
24
28
|
},
|
|
25
29
|
"dependencies": {
|
|
26
30
|
"@anthropic-ai/sandbox-runtime": "^0.0.76"
|
|
@@ -28,6 +32,7 @@
|
|
|
28
32
|
"files": [
|
|
29
33
|
"index.ts",
|
|
30
34
|
"src",
|
|
35
|
+
"config",
|
|
31
36
|
"launcher.cjs",
|
|
32
37
|
"README.md",
|
|
33
38
|
"LICENSE"
|
package/src/cli/init.ts
CHANGED
|
@@ -161,7 +161,7 @@ async function adopt(
|
|
|
161
161
|
const body = `import { ${imports} } from '@vzn/vx-migrate'\n\nexport default { plugins: [${plugins}] }`
|
|
162
162
|
const text = args.mjs
|
|
163
163
|
? `${body}\n`
|
|
164
|
-
: `import type { WorkspaceConfig } from '@vzn/vx'\n${body} satisfies WorkspaceConfig\n`
|
|
164
|
+
: `import type { WorkspaceConfig } from '@vzn/vx/config'\n${body} satisfies WorkspaceConfig\n`
|
|
165
165
|
const existing = WORKSPACE_CONFIG_FILENAMES.find((f) => existsSync(path.join(root, f)))
|
|
166
166
|
if (existing !== undefined && !args.force) {
|
|
167
167
|
const declared = readFileSync(path.join(root, existing), 'utf8').includes(`${runner}(`)
|
|
@@ -189,6 +189,8 @@ function staticImports(
|
|
|
189
189
|
|
|
190
190
|
/** The one bare specifier a pure config may import: core's identity helpers and types. */
|
|
191
191
|
const PURE_PACKAGE = '@vzn/vx'
|
|
192
|
+
/** The schema alone (`src/config.ts`): every value it exports is pure. */
|
|
193
|
+
const PURE_CONFIG_ENTRY = '@vzn/vx/config'
|
|
192
194
|
|
|
193
195
|
/**
|
|
194
196
|
* The `@vzn/vx` values a pure config may import. Core exports far more, and
|
|
@@ -465,6 +467,7 @@ export async function configEvalKey(a: ConfigEvalKeyArgs): Promise<ConfigEvalKey
|
|
|
465
467
|
h = xxh3(`${file}\0${identity}`, h)
|
|
466
468
|
closure.push(file)
|
|
467
469
|
for (const { spec, statement } of scanned.imports) {
|
|
470
|
+
if (spec === PURE_CONFIG_ENTRY) continue
|
|
468
471
|
if (spec === PURE_PACKAGE) {
|
|
469
472
|
if (/\bfrom\s*\0\d+\0\s*$/.test(statement) && !importsOnlyPure(statement)) return null
|
|
470
473
|
continue
|
|
@@ -415,7 +415,7 @@ const EXAMPLE_BODY = `export default {
|
|
|
415
415
|
|
|
416
416
|
function exampleConfig(format: MigrationFormat): string {
|
|
417
417
|
return format === 'ts'
|
|
418
|
-
? `import type { ProjectConfig } from '@vzn/vx'\n\n${EXAMPLE_BODY} satisfies ProjectConfig\n`
|
|
418
|
+
? `import type { ProjectConfig } from '@vzn/vx/config'\n\n${EXAMPLE_BODY} satisfies ProjectConfig\n`
|
|
419
419
|
: `${EXAMPLE_BODY}\n`
|
|
420
420
|
}
|
|
421
421
|
|
|
@@ -433,7 +433,7 @@ export default { plugins: [] }`
|
|
|
433
433
|
|
|
434
434
|
function workspaceFile(format: MigrationFormat): string {
|
|
435
435
|
return format === 'ts'
|
|
436
|
-
? `import type { WorkspaceConfig } from '@vzn/vx'\n\n${WORKSPACE_BODY} satisfies WorkspaceConfig\n`
|
|
436
|
+
? `import type { WorkspaceConfig } from '@vzn/vx/config'\n\n${WORKSPACE_BODY} satisfies WorkspaceConfig\n`
|
|
437
437
|
: `${WORKSPACE_BODY}\n`
|
|
438
438
|
}
|
|
439
439
|
|
|
@@ -474,7 +474,7 @@ function renderConfigFile(
|
|
|
474
474
|
const lines: string[] = [
|
|
475
475
|
`// Generated by \`${verb}\` from ${source}. Review the TODO(vx-migrate) comments.`,
|
|
476
476
|
]
|
|
477
|
-
if (format === 'ts') lines.push("import type { ProjectConfig } from '@vzn/vx'")
|
|
477
|
+
if (format === 'ts') lines.push("import type { ProjectConfig } from '@vzn/vx/config'")
|
|
478
478
|
if (p.importLines.length > 0) lines.push(...p.importLines)
|
|
479
479
|
lines.push('', 'export default {', ' tasks: {')
|
|
480
480
|
for (const t of p.tasks) {
|