@orkestrel/scaffold 0.0.111 → 0.0.113
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/dist/agents/skills/orkestrel-harden/scripts/titles.js +3 -3
- package/dist/agents/skills/orkestrel-publish/scripts/wave.js +37 -5
- package/dist/agents/templates/brief.md +1 -1
- package/dist/bin/main.js +1 -1
- package/dist/bin/main.js.map +1 -1
- package/dist/host/AGENTS.md +1 -1
- package/dist/host/agents/orchestration.md +1 -1
- package/dist/host/agents/platforms/windows.md +1 -1
- package/dist/host/agents/skills/orkestrel-dispatch/SKILL.md +1 -1
- package/dist/host/agents/skills/orkestrel-harden/scripts/titles.ts +3 -3
- package/dist/host/agents/skills/orkestrel-publish/references/wave.md +4 -1
- package/dist/host/agents/skills/orkestrel-publish/scripts/wave.ts +37 -5
- package/dist/host/agents/templates/brief.md +1 -1
- package/dist/host/claude/agents/orkestrel.md +1 -1
- package/dist/host/claude/agents/verifier.md +1 -1
- package/dist/host/claude/rules/architecture.md +4 -3
- package/dist/host/claude/rules/tests.md +18 -3
- package/dist/host/claude/rules/typescript.md +11 -2
- package/dist/host/claude/rules/workspace.md +4 -0
- package/dist/host/codex/agents/verifier.toml +2 -2
- package/dist/host/configs/policy.ts +49 -0
- package/dist/host/dotfiles/gitignore +1 -0
- package/dist/host/dotfiles/oxlintrc.json +6 -0
- package/dist/host/manifest.json +22 -22
- package/dist/host/tests/config.test.ts +65 -3
- package/dist/host/tests/policy.test.ts +21 -7
- package/dist/host/tests/setupPolicy.ts +147 -12
- package/dist/src/core/index.cjs +3 -1
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +1 -1
- package/dist/src/core/index.d.ts +1 -1
- package/dist/src/core/index.js +3 -1
- package/dist/src/core/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1578,7 +1578,7 @@ export declare class Compiler implements CompilerInterface {
|
|
|
1578
1578
|
export declare const CONFIG_TEMPLATES: Readonly<{
|
|
1579
1579
|
root: Readonly<{
|
|
1580
1580
|
tsconfig: "{\n\t\"compilerOptions\": {\n\t\t\"target\": \"ESNext\",\n\t\t\"module\": \"ESNext\",\n\t\t\"moduleResolution\": \"bundler\",\n\t\t\"allowImportingTsExtensions\": true,\n\t\t\"lib\": [\"ESNext\", \"DOM\", \"DOM.Iterable\"],\n\t\t\"types\": [\"node\", \"vite/client\", \"vitest/globals\"],\n\t\t\"moduleDetection\": \"force\",\n\t\t\"resolveJsonModule\": true,\n\t\t\"strict\": true,\n\t\t\"verbatimModuleSyntax\": true,\n\t\t\"noUncheckedIndexedAccess\": true,\n\t\t\"noUncheckedSideEffectImports\": true,\n\t\t\"exactOptionalPropertyTypes\": true,\n\t\t\"noUnusedLocals\": true,\n\t\t\"noUnusedParameters\": true,\n\t\t\"noImplicitOverride\": true,\n\t\t\"noFallthroughCasesInSwitch\": true,\n\t\t\"forceConsistentCasingInFileNames\": true,\n\t\t\"skipLibCheck\": true,\n\t\t\"noEmit\": true,\n{{paths}}\n\t},\n\t\"exclude\": [\"node_modules\", \"dist\", \"tmp\"]\n}\n";
|
|
1581
|
-
vite: "{{journey}}import type { PluginOption, UserConfig } from 'vite'\nimport { mergeConfig } from 'vite'\n{{imports}}import { defineConfig } from 'vitest/config'\nimport manifest from './package.json' with { type: 'json' }\nimport tsconfig from './tsconfig.json' with { type: 'json' }\n{{helpers}}{{browsers}}import { fileURLToPath, URL } from 'node:url'\n\n{{options}}export function resolveWorkspacePath(relativePath: string): string {\n\treturn fileURLToPath(new URL(relativePath, import.meta.url))\n}\n\nconst peerDependencies = 'peerDependencies' in manifest ? manifest.peerDependencies : undefined\nif (\n\tpeerDependencies !== undefined &&\n\t(typeof peerDependencies !== 'object' ||\n\t\tpeerDependencies === null ||\n\t\tArray.isArray(peerDependencies))\n) {\n\tthrow new Error('package peerDependencies must be an object')\n}\nexport const peers: readonly string[] =\n\tpeerDependencies === undefined ? [] : Object.keys(peerDependencies)\n\nconst resolve = {\n\talias: Object.fromEntries(\n\t\tObject.entries(tsconfig.compilerOptions.paths).map(([key, values]) => {\n\t\t\tconst [path] = values\n\t\t\tif (path === undefined) throw new Error('tsconfig path alias ' + key + ' has no target')\n\t\t\treturn [key, resolveWorkspacePath(path)]\n\t\t}),\n\t),\n}\n\n// Merges a caller's override onto the configuration a factory declares, so a\n// package's own configuration reaches the factory through its parameter instead of\n// wrapping the call from outside.\n//\n// Vitest calls every registered project factory with its own invocation record —\n// `command`, `mode`, `isSsrBuild`, `isPreview` — so a factory that also takes an\n// override receives that record in the same position. A `UserConfig` declares `mode`\n// but not `command`, and the invocation record always carries both, so a value\n// carrying the pair is that record rather than an override. The merge returns the\n// base in the record's `mode` and carries none of the record's other fields. Vitest\n// runs a project that declares no `mode` in its own run mode, `test`, rather than in\n// the `--mode` value it was invoked with, so a distribution proof run with\n// `--mode release` would read `test` and skip where it must fail. A record whose\n// `mode` is not a string throws. The `tests/config.test.ts` file drives every\n// registered factory through it.\n//\n// `mergeConfig` concatenates arrays, so an override carrying `plugins` would otherwise\n// add a second copy of a plugin the base already declares. Only named top-level\n// objects replace a base plugin of the same name, in the base's position, and one\n// override entry is taken at most once. An entry no base position took appends in its\n// written order; the caller's own entries never merge with each other. Nested arrays,\n// promises, falsy entries, and anonymous objects pass through unchanged. An override\n// cannot remove a base plugin. Every key other than `plugins` merges as `mergeConfig`\n// merges it, so an override's arrays elsewhere concatenate with the base's rather than\n// replacing them.\nexport function mergeOverride(base: UserConfig, override?: UserConfig): UserConfig {\n\tif (\n\t\toverride !== undefined &&\n\t\t'command' in override &&\n\t\t'mode' in override &&\n\t\ttypeof override.mode !== 'string'\n\t) {\n\t\tthrow new Error('The project invocation carries no string mode')\n\t}\n\tconst effective: UserConfig | undefined =\n\t\toverride !== undefined && 'command' in override && typeof override.mode === 'string'\n\t\t\t? { mode: override.mode }\n\t\t\t: override\n\tconst merged: UserConfig = effective === undefined ? { ...base } : mergeConfig(base, effective)\n\tconst name = merged.test?.name\n\tconst label = typeof name === 'string' ? name : name?.label\n\tconst browser = merged.test?.browser\n\tconst named: UserConfig =\n\t\tlabel !== undefined && browser?.instances !== undefined\n\t\t\t? {\n\t\t\t\t\t...merged,\n\t\t\t\t\ttest: {\n\t\t\t\t\t\t...merged.test,\n\t\t\t\t\t\tbrowser: {\n\t\t\t\t\t\t\t...browser,\n\t\t\t\t\t\t\tinstances: browser.instances.map((instance) => ({\n\t\t\t\t\t\t\t\t...instance,\n\t\t\t\t\t\t\t\tname: instance.name ?? `${label} (${instance.browser})`,\n\t\t\t\t\t\t\t})),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t: merged\n\tif (named.plugins === undefined || effective === undefined) return named\n\tconst candidates = [...(effective.plugins ?? [])]\n\tconst bases = [...(base.plugins ?? [])]\n\t// A base plugin takes the first candidate of its own name that no earlier base plugin took, and\n\t// candidates of other names never compete for it, so its pick is the candidate whose rank among\n\t// its name equals the number of earlier base plugins sharing that name.\n\tconst chosen = bases.map((plugin, position) =>\n\t\tisNamedPlugin(plugin)\n\t\t\t? candidates\n\t\t\t\t\t.flatMap((candidate, index) =>\n\t\t\t\t\t\tisNamedPlugin(candidate) && candidate.name === plugin.name ? [index] : [],\n\t\t\t\t\t)\n\t\t\t\t\t.at(\n\t\t\t\t\t\tbases\n\t\t\t\t\t\t\t.slice(0, position)\n\t\t\t\t\t\t\t.filter((earlier) => isNamedPlugin(earlier) && earlier.name === plugin.name).length,\n\t\t\t\t\t)\n\t\t\t: undefined,\n\t)\n\treturn {\n\t\t...named,\n\t\tplugins: [\n\t\t\t...bases.map((plugin, position) => {\n\t\t\t\tconst index = chosen[position]\n\t\t\t\treturn index === undefined ? plugin : (candidates[index] ?? plugin)\n\t\t\t}),\n\t\t\t...candidates.filter((_, index) => !chosen.includes(index)),\n\t\t],\n\t}\n}\n\nfunction isNamedPlugin(plugin: PluginOption): plugin is { name: string } {\n\treturn (\n\t\ttypeof plugin === 'object' &&\n\t\tplugin !== null &&\n\t\t!Array.isArray(plugin) &&\n\t\t!('then' in plugin && typeof plugin.then === 'function') &&\n\t\t'name' in plugin &&\n\t\ttypeof plugin.name === 'string'\n\t)\n}\n\n{{factories}}export default defineConfig({\n\tresolve,\n\ttest: {\n{{projects}}\n\t},\n})\n";
|
|
1581
|
+
vite: "{{journey}}import type { PluginOption, UserConfig } from 'vite'\nimport { mergeConfig } from 'vite'\n{{imports}}import { defineConfig } from 'vitest/config'\nimport manifest from './package.json' with { type: 'json' }\nimport tsconfig from './tsconfig.json' with { type: 'json' }\n{{helpers}}{{browsers}}import { fileURLToPath, URL } from 'node:url'\n\n{{options}}export function resolveWorkspacePath(relativePath: string): string {\n\treturn fileURLToPath(new URL(relativePath, import.meta.url))\n}\n\nconst peerDependencies = 'peerDependencies' in manifest ? manifest.peerDependencies : undefined\nif (\n\tpeerDependencies !== undefined &&\n\t(typeof peerDependencies !== 'object' ||\n\t\tpeerDependencies === null ||\n\t\tArray.isArray(peerDependencies))\n) {\n\tthrow new Error('package peerDependencies must be an object')\n}\nexport const peers: readonly string[] =\n\tpeerDependencies === undefined ? [] : Object.keys(peerDependencies)\n\nconst resolve = {\n\talias: Object.fromEntries(\n\t\tObject.entries(tsconfig.compilerOptions.paths).map(([key, values]) => {\n\t\t\tconst [path] = values\n\t\t\tif (path === undefined) throw new Error('tsconfig path alias ' + key + ' has no target')\n\t\t\treturn [key, resolveWorkspacePath(path)]\n\t\t}),\n\t),\n}\n\n// Merges a caller's override onto the configuration a factory declares, so a\n// package's own configuration reaches the factory through its parameter instead of\n// wrapping the call from outside.\n//\n// Vitest calls every registered project factory with its own invocation record —\n// `command`, `mode`, `isSsrBuild`, `isPreview` — so a factory that also takes an\n// override receives that record in the same position. A `UserConfig` declares `mode`\n// but not `command`, and the invocation record always carries both, so a value\n// carrying the pair is that record rather than an override. The merge returns the\n// base in the record's `mode` and carries none of the record's other fields. Vitest\n// runs a project that declares no `mode` in its own run mode, `test`, rather than in\n// the `--mode` value it was invoked with, so a distribution proof run with\n// `--mode release` would read `test` and skip where it must fail. A record whose\n// `mode` is not a string throws. The `tests/config.test.ts` file drives every\n// registered factory through it.\n//\n// `mergeConfig` concatenates arrays, so an override carrying `plugins` would otherwise\n// add a second copy of a plugin the base already declares. Only named top-level\n// objects replace a base plugin of the same name, in the base's position, and one\n// override entry is taken at most once. An entry no base position took appends in its\n// written order; the caller's own entries never merge with each other. Nested arrays,\n// promises, falsy entries, and anonymous objects pass through unchanged. An override\n// cannot remove a base plugin. Every key other than `plugins` merges as `mergeConfig`\n// merges it, so an override's arrays elsewhere concatenate with the base's rather than\n// replacing them.\nexport function mergeOverride(base: UserConfig, override?: UserConfig): UserConfig {\n\tif (\n\t\toverride !== undefined &&\n\t\t'command' in override &&\n\t\t'mode' in override &&\n\t\ttypeof override.mode !== 'string'\n\t) {\n\t\tthrow new Error('The project invocation carries no string mode')\n\t}\n\tconst effective: UserConfig | undefined =\n\t\toverride !== undefined && 'command' in override && typeof override.mode === 'string'\n\t\t\t? { mode: override.mode }\n\t\t\t: override\n\tconst merged: UserConfig = effective === undefined ? { ...base } : mergeConfig(base, effective)\n\tconst name = merged.test?.name\n\tconst label = typeof name === 'string' ? name : name?.label\n\tconst browser = merged.test?.browser\n\tconst named: UserConfig =\n\t\tlabel !== undefined && browser?.instances !== undefined\n\t\t\t? {\n\t\t\t\t\t...merged,\n\t\t\t\t\ttest: {\n\t\t\t\t\t\t...merged.test,\n\t\t\t\t\t\tbrowser: {\n\t\t\t\t\t\t\t...browser,\n\t\t\t\t\t\t\tinstances: browser.instances.map((instance) => ({\n\t\t\t\t\t\t\t\t...instance,\n\t\t\t\t\t\t\t\tname: instance.name ?? `${label} (${instance.browser})`,\n\t\t\t\t\t\t\t})),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t: merged\n\tif (named.plugins === undefined || effective === undefined) return named\n\tconst candidates = [...(effective.plugins ?? [])]\n\tconst bases = [...(base.plugins ?? [])]\n\t// A base plugin takes the first candidate of its own name that no earlier base plugin took, and\n\t// candidates of other names never compete for it, so its pick is the candidate whose rank among\n\t// its name equals the number of earlier base plugins sharing that name.\n\tconst chosen = bases.map((plugin, position) =>\n\t\tisNamedPlugin(plugin)\n\t\t\t? candidates\n\t\t\t\t\t.flatMap((candidate, index) =>\n\t\t\t\t\t\tisNamedPlugin(candidate) && candidate.name === plugin.name ? [index] : [],\n\t\t\t\t\t)\n\t\t\t\t\t.at(\n\t\t\t\t\t\tbases\n\t\t\t\t\t\t\t.slice(0, position)\n\t\t\t\t\t\t\t.filter((earlier) => isNamedPlugin(earlier) && earlier.name === plugin.name).length,\n\t\t\t\t\t)\n\t\t\t: undefined,\n\t)\n\treturn {\n\t\t...named,\n\t\tplugins: [\n\t\t\t...bases.map((plugin, position) => {\n\t\t\t\tconst index = chosen[position]\n\t\t\t\treturn index === undefined ? plugin : (candidates[index] ?? plugin)\n\t\t\t}),\n\t\t\t...candidates.filter((_, index) => !chosen.includes(index)),\n\t\t],\n\t}\n}\n\nfunction isNamedPlugin(plugin: PluginOption): plugin is { name: string } {\n\treturn (\n\t\ttypeof plugin === 'object' &&\n\t\tplugin !== null &&\n\t\t!Array.isArray(plugin) &&\n\t\t!('then' in plugin && typeof plugin.then === 'function') &&\n\t\t'name' in plugin &&\n\t\ttypeof plugin.name === 'string'\n\t)\n}\n\n{{factories}}export default defineConfig({\n\tresolve,\n\ttest: {\n\t\t// Vitest 5.0.5 hands cached code to the module runner as bytes, which breaks stack mapping.\n\t\tfsModuleCache: false,\n{{projects}}\n\t},\n})\n";
|
|
1582
1582
|
}>;
|
|
1583
1583
|
factories: Readonly<{
|
|
1584
1584
|
sheet: "export function sheetProject(name: string, override?: UserConfig): UserConfig {\n\tconst project: UserConfig = {\n\t\tresolve,\n\t\toptimizeDeps,\n\t\tpublicDir: false,\n\t\ttest: {\n\t\t\tname: { label: name, color: 'magenta' },\n\t\t\troot: resolveWorkspacePath('.'),\n\t\t\tisolate: false,\n\t\t\tsetupFiles: [\n\t\t\t\t'./tests/setup.ts',\n\t\t\t\t'./tests/setupBrowser.ts',\n\t\t\t\t...(existsSync(resolveWorkspacePath('tests/setupStyles.ts'))\n\t\t\t\t\t? ['./tests/setupStyles.ts']\n\t\t\t\t\t: []),\n\t\t\t],\n\t\t\tbrowser: {\n\t\t\t\tenabled: true,\n\t\t\t\tprovider: playwright(browserOptions),\n\t\t\t\tcommands,\n\t\t\t\tinstances: [{ browser: 'chromium', headless: true }],\n\t\t\t},\n\t\t\tfileParallelism: false,\n\t\t\tsequence: { groupOrder: 1 },\n\t\t},\n\t}\n\treturn mergeOverride(project, override)\n}\n";
|
package/dist/src/core/index.d.ts
CHANGED
|
@@ -1578,7 +1578,7 @@ export declare class Compiler implements CompilerInterface {
|
|
|
1578
1578
|
export declare const CONFIG_TEMPLATES: Readonly<{
|
|
1579
1579
|
root: Readonly<{
|
|
1580
1580
|
tsconfig: "{\n\t\"compilerOptions\": {\n\t\t\"target\": \"ESNext\",\n\t\t\"module\": \"ESNext\",\n\t\t\"moduleResolution\": \"bundler\",\n\t\t\"allowImportingTsExtensions\": true,\n\t\t\"lib\": [\"ESNext\", \"DOM\", \"DOM.Iterable\"],\n\t\t\"types\": [\"node\", \"vite/client\", \"vitest/globals\"],\n\t\t\"moduleDetection\": \"force\",\n\t\t\"resolveJsonModule\": true,\n\t\t\"strict\": true,\n\t\t\"verbatimModuleSyntax\": true,\n\t\t\"noUncheckedIndexedAccess\": true,\n\t\t\"noUncheckedSideEffectImports\": true,\n\t\t\"exactOptionalPropertyTypes\": true,\n\t\t\"noUnusedLocals\": true,\n\t\t\"noUnusedParameters\": true,\n\t\t\"noImplicitOverride\": true,\n\t\t\"noFallthroughCasesInSwitch\": true,\n\t\t\"forceConsistentCasingInFileNames\": true,\n\t\t\"skipLibCheck\": true,\n\t\t\"noEmit\": true,\n{{paths}}\n\t},\n\t\"exclude\": [\"node_modules\", \"dist\", \"tmp\"]\n}\n";
|
|
1581
|
-
vite: "{{journey}}import type { PluginOption, UserConfig } from 'vite'\nimport { mergeConfig } from 'vite'\n{{imports}}import { defineConfig } from 'vitest/config'\nimport manifest from './package.json' with { type: 'json' }\nimport tsconfig from './tsconfig.json' with { type: 'json' }\n{{helpers}}{{browsers}}import { fileURLToPath, URL } from 'node:url'\n\n{{options}}export function resolveWorkspacePath(relativePath: string): string {\n\treturn fileURLToPath(new URL(relativePath, import.meta.url))\n}\n\nconst peerDependencies = 'peerDependencies' in manifest ? manifest.peerDependencies : undefined\nif (\n\tpeerDependencies !== undefined &&\n\t(typeof peerDependencies !== 'object' ||\n\t\tpeerDependencies === null ||\n\t\tArray.isArray(peerDependencies))\n) {\n\tthrow new Error('package peerDependencies must be an object')\n}\nexport const peers: readonly string[] =\n\tpeerDependencies === undefined ? [] : Object.keys(peerDependencies)\n\nconst resolve = {\n\talias: Object.fromEntries(\n\t\tObject.entries(tsconfig.compilerOptions.paths).map(([key, values]) => {\n\t\t\tconst [path] = values\n\t\t\tif (path === undefined) throw new Error('tsconfig path alias ' + key + ' has no target')\n\t\t\treturn [key, resolveWorkspacePath(path)]\n\t\t}),\n\t),\n}\n\n// Merges a caller's override onto the configuration a factory declares, so a\n// package's own configuration reaches the factory through its parameter instead of\n// wrapping the call from outside.\n//\n// Vitest calls every registered project factory with its own invocation record —\n// `command`, `mode`, `isSsrBuild`, `isPreview` — so a factory that also takes an\n// override receives that record in the same position. A `UserConfig` declares `mode`\n// but not `command`, and the invocation record always carries both, so a value\n// carrying the pair is that record rather than an override. The merge returns the\n// base in the record's `mode` and carries none of the record's other fields. Vitest\n// runs a project that declares no `mode` in its own run mode, `test`, rather than in\n// the `--mode` value it was invoked with, so a distribution proof run with\n// `--mode release` would read `test` and skip where it must fail. A record whose\n// `mode` is not a string throws. The `tests/config.test.ts` file drives every\n// registered factory through it.\n//\n// `mergeConfig` concatenates arrays, so an override carrying `plugins` would otherwise\n// add a second copy of a plugin the base already declares. Only named top-level\n// objects replace a base plugin of the same name, in the base's position, and one\n// override entry is taken at most once. An entry no base position took appends in its\n// written order; the caller's own entries never merge with each other. Nested arrays,\n// promises, falsy entries, and anonymous objects pass through unchanged. An override\n// cannot remove a base plugin. Every key other than `plugins` merges as `mergeConfig`\n// merges it, so an override's arrays elsewhere concatenate with the base's rather than\n// replacing them.\nexport function mergeOverride(base: UserConfig, override?: UserConfig): UserConfig {\n\tif (\n\t\toverride !== undefined &&\n\t\t'command' in override &&\n\t\t'mode' in override &&\n\t\ttypeof override.mode !== 'string'\n\t) {\n\t\tthrow new Error('The project invocation carries no string mode')\n\t}\n\tconst effective: UserConfig | undefined =\n\t\toverride !== undefined && 'command' in override && typeof override.mode === 'string'\n\t\t\t? { mode: override.mode }\n\t\t\t: override\n\tconst merged: UserConfig = effective === undefined ? { ...base } : mergeConfig(base, effective)\n\tconst name = merged.test?.name\n\tconst label = typeof name === 'string' ? name : name?.label\n\tconst browser = merged.test?.browser\n\tconst named: UserConfig =\n\t\tlabel !== undefined && browser?.instances !== undefined\n\t\t\t? {\n\t\t\t\t\t...merged,\n\t\t\t\t\ttest: {\n\t\t\t\t\t\t...merged.test,\n\t\t\t\t\t\tbrowser: {\n\t\t\t\t\t\t\t...browser,\n\t\t\t\t\t\t\tinstances: browser.instances.map((instance) => ({\n\t\t\t\t\t\t\t\t...instance,\n\t\t\t\t\t\t\t\tname: instance.name ?? `${label} (${instance.browser})`,\n\t\t\t\t\t\t\t})),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t: merged\n\tif (named.plugins === undefined || effective === undefined) return named\n\tconst candidates = [...(effective.plugins ?? [])]\n\tconst bases = [...(base.plugins ?? [])]\n\t// A base plugin takes the first candidate of its own name that no earlier base plugin took, and\n\t// candidates of other names never compete for it, so its pick is the candidate whose rank among\n\t// its name equals the number of earlier base plugins sharing that name.\n\tconst chosen = bases.map((plugin, position) =>\n\t\tisNamedPlugin(plugin)\n\t\t\t? candidates\n\t\t\t\t\t.flatMap((candidate, index) =>\n\t\t\t\t\t\tisNamedPlugin(candidate) && candidate.name === plugin.name ? [index] : [],\n\t\t\t\t\t)\n\t\t\t\t\t.at(\n\t\t\t\t\t\tbases\n\t\t\t\t\t\t\t.slice(0, position)\n\t\t\t\t\t\t\t.filter((earlier) => isNamedPlugin(earlier) && earlier.name === plugin.name).length,\n\t\t\t\t\t)\n\t\t\t: undefined,\n\t)\n\treturn {\n\t\t...named,\n\t\tplugins: [\n\t\t\t...bases.map((plugin, position) => {\n\t\t\t\tconst index = chosen[position]\n\t\t\t\treturn index === undefined ? plugin : (candidates[index] ?? plugin)\n\t\t\t}),\n\t\t\t...candidates.filter((_, index) => !chosen.includes(index)),\n\t\t],\n\t}\n}\n\nfunction isNamedPlugin(plugin: PluginOption): plugin is { name: string } {\n\treturn (\n\t\ttypeof plugin === 'object' &&\n\t\tplugin !== null &&\n\t\t!Array.isArray(plugin) &&\n\t\t!('then' in plugin && typeof plugin.then === 'function') &&\n\t\t'name' in plugin &&\n\t\ttypeof plugin.name === 'string'\n\t)\n}\n\n{{factories}}export default defineConfig({\n\tresolve,\n\ttest: {\n{{projects}}\n\t},\n})\n";
|
|
1581
|
+
vite: "{{journey}}import type { PluginOption, UserConfig } from 'vite'\nimport { mergeConfig } from 'vite'\n{{imports}}import { defineConfig } from 'vitest/config'\nimport manifest from './package.json' with { type: 'json' }\nimport tsconfig from './tsconfig.json' with { type: 'json' }\n{{helpers}}{{browsers}}import { fileURLToPath, URL } from 'node:url'\n\n{{options}}export function resolveWorkspacePath(relativePath: string): string {\n\treturn fileURLToPath(new URL(relativePath, import.meta.url))\n}\n\nconst peerDependencies = 'peerDependencies' in manifest ? manifest.peerDependencies : undefined\nif (\n\tpeerDependencies !== undefined &&\n\t(typeof peerDependencies !== 'object' ||\n\t\tpeerDependencies === null ||\n\t\tArray.isArray(peerDependencies))\n) {\n\tthrow new Error('package peerDependencies must be an object')\n}\nexport const peers: readonly string[] =\n\tpeerDependencies === undefined ? [] : Object.keys(peerDependencies)\n\nconst resolve = {\n\talias: Object.fromEntries(\n\t\tObject.entries(tsconfig.compilerOptions.paths).map(([key, values]) => {\n\t\t\tconst [path] = values\n\t\t\tif (path === undefined) throw new Error('tsconfig path alias ' + key + ' has no target')\n\t\t\treturn [key, resolveWorkspacePath(path)]\n\t\t}),\n\t),\n}\n\n// Merges a caller's override onto the configuration a factory declares, so a\n// package's own configuration reaches the factory through its parameter instead of\n// wrapping the call from outside.\n//\n// Vitest calls every registered project factory with its own invocation record —\n// `command`, `mode`, `isSsrBuild`, `isPreview` — so a factory that also takes an\n// override receives that record in the same position. A `UserConfig` declares `mode`\n// but not `command`, and the invocation record always carries both, so a value\n// carrying the pair is that record rather than an override. The merge returns the\n// base in the record's `mode` and carries none of the record's other fields. Vitest\n// runs a project that declares no `mode` in its own run mode, `test`, rather than in\n// the `--mode` value it was invoked with, so a distribution proof run with\n// `--mode release` would read `test` and skip where it must fail. A record whose\n// `mode` is not a string throws. The `tests/config.test.ts` file drives every\n// registered factory through it.\n//\n// `mergeConfig` concatenates arrays, so an override carrying `plugins` would otherwise\n// add a second copy of a plugin the base already declares. Only named top-level\n// objects replace a base plugin of the same name, in the base's position, and one\n// override entry is taken at most once. An entry no base position took appends in its\n// written order; the caller's own entries never merge with each other. Nested arrays,\n// promises, falsy entries, and anonymous objects pass through unchanged. An override\n// cannot remove a base plugin. Every key other than `plugins` merges as `mergeConfig`\n// merges it, so an override's arrays elsewhere concatenate with the base's rather than\n// replacing them.\nexport function mergeOverride(base: UserConfig, override?: UserConfig): UserConfig {\n\tif (\n\t\toverride !== undefined &&\n\t\t'command' in override &&\n\t\t'mode' in override &&\n\t\ttypeof override.mode !== 'string'\n\t) {\n\t\tthrow new Error('The project invocation carries no string mode')\n\t}\n\tconst effective: UserConfig | undefined =\n\t\toverride !== undefined && 'command' in override && typeof override.mode === 'string'\n\t\t\t? { mode: override.mode }\n\t\t\t: override\n\tconst merged: UserConfig = effective === undefined ? { ...base } : mergeConfig(base, effective)\n\tconst name = merged.test?.name\n\tconst label = typeof name === 'string' ? name : name?.label\n\tconst browser = merged.test?.browser\n\tconst named: UserConfig =\n\t\tlabel !== undefined && browser?.instances !== undefined\n\t\t\t? {\n\t\t\t\t\t...merged,\n\t\t\t\t\ttest: {\n\t\t\t\t\t\t...merged.test,\n\t\t\t\t\t\tbrowser: {\n\t\t\t\t\t\t\t...browser,\n\t\t\t\t\t\t\tinstances: browser.instances.map((instance) => ({\n\t\t\t\t\t\t\t\t...instance,\n\t\t\t\t\t\t\t\tname: instance.name ?? `${label} (${instance.browser})`,\n\t\t\t\t\t\t\t})),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t: merged\n\tif (named.plugins === undefined || effective === undefined) return named\n\tconst candidates = [...(effective.plugins ?? [])]\n\tconst bases = [...(base.plugins ?? [])]\n\t// A base plugin takes the first candidate of its own name that no earlier base plugin took, and\n\t// candidates of other names never compete for it, so its pick is the candidate whose rank among\n\t// its name equals the number of earlier base plugins sharing that name.\n\tconst chosen = bases.map((plugin, position) =>\n\t\tisNamedPlugin(plugin)\n\t\t\t? candidates\n\t\t\t\t\t.flatMap((candidate, index) =>\n\t\t\t\t\t\tisNamedPlugin(candidate) && candidate.name === plugin.name ? [index] : [],\n\t\t\t\t\t)\n\t\t\t\t\t.at(\n\t\t\t\t\t\tbases\n\t\t\t\t\t\t\t.slice(0, position)\n\t\t\t\t\t\t\t.filter((earlier) => isNamedPlugin(earlier) && earlier.name === plugin.name).length,\n\t\t\t\t\t)\n\t\t\t: undefined,\n\t)\n\treturn {\n\t\t...named,\n\t\tplugins: [\n\t\t\t...bases.map((plugin, position) => {\n\t\t\t\tconst index = chosen[position]\n\t\t\t\treturn index === undefined ? plugin : (candidates[index] ?? plugin)\n\t\t\t}),\n\t\t\t...candidates.filter((_, index) => !chosen.includes(index)),\n\t\t],\n\t}\n}\n\nfunction isNamedPlugin(plugin: PluginOption): plugin is { name: string } {\n\treturn (\n\t\ttypeof plugin === 'object' &&\n\t\tplugin !== null &&\n\t\t!Array.isArray(plugin) &&\n\t\t!('then' in plugin && typeof plugin.then === 'function') &&\n\t\t'name' in plugin &&\n\t\ttypeof plugin.name === 'string'\n\t)\n}\n\n{{factories}}export default defineConfig({\n\tresolve,\n\ttest: {\n\t\t// Vitest 5.0.5 hands cached code to the module runner as bytes, which breaks stack mapping.\n\t\tfsModuleCache: false,\n{{projects}}\n\t},\n})\n";
|
|
1582
1582
|
}>;
|
|
1583
1583
|
factories: Readonly<{
|
|
1584
1584
|
sheet: "export function sheetProject(name: string, override?: UserConfig): UserConfig {\n\tconst project: UserConfig = {\n\t\tresolve,\n\t\toptimizeDeps,\n\t\tpublicDir: false,\n\t\ttest: {\n\t\t\tname: { label: name, color: 'magenta' },\n\t\t\troot: resolveWorkspacePath('.'),\n\t\t\tisolate: false,\n\t\t\tsetupFiles: [\n\t\t\t\t'./tests/setup.ts',\n\t\t\t\t'./tests/setupBrowser.ts',\n\t\t\t\t...(existsSync(resolveWorkspacePath('tests/setupStyles.ts'))\n\t\t\t\t\t? ['./tests/setupStyles.ts']\n\t\t\t\t\t: []),\n\t\t\t],\n\t\t\tbrowser: {\n\t\t\t\tenabled: true,\n\t\t\t\tprovider: playwright(browserOptions),\n\t\t\t\tcommands,\n\t\t\t\tinstances: [{ browser: 'chromium', headless: true }],\n\t\t\t},\n\t\t\tfileParallelism: false,\n\t\t\tsequence: { groupOrder: 1 },\n\t\t},\n\t}\n\treturn mergeOverride(project, override)\n}\n";
|
package/dist/src/core/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { fillTemplate } from "@orkestrel/template";
|
|
|
3
3
|
import { Emitter } from "@orkestrel/emitter";
|
|
4
4
|
var package_default = {
|
|
5
5
|
name: "@orkestrel/scaffold",
|
|
6
|
-
version: "0.0.
|
|
6
|
+
version: "0.0.113",
|
|
7
7
|
description: "Scaffold workspaces with commands: new, audit, repair, catalog, and overwrite.",
|
|
8
8
|
keywords: [
|
|
9
9
|
"audit",
|
|
@@ -984,6 +984,8 @@ function isNamedPlugin(plugin: PluginOption): plugin is { name: string } {
|
|
|
984
984
|
{{factories}}export default defineConfig({
|
|
985
985
|
resolve,
|
|
986
986
|
test: {
|
|
987
|
+
// Vitest 5.0.5 hands cached code to the module runner as bytes, which breaks stack mapping.
|
|
988
|
+
fsModuleCache: false,
|
|
987
989
|
{{projects}}
|
|
988
990
|
},
|
|
989
991
|
})
|