@deltabox/toolchain 1.3.0 → 1.5.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/CHANGELOG.md +96 -4
- package/README.md +32 -39
- package/dist/changelog.d.ts +2 -2
- package/dist/changelog.js +1 -1
- package/dist/cli/commands/providers.js +1 -1
- package/dist/cli/commands/sync.js +1 -1
- package/dist/cli/context.js +1 -1
- package/dist/cli/index.d.ts +4 -4
- package/dist/cli/index.js +1 -1
- package/dist/cli/register.d.ts +3 -3
- package/dist/cli/register.js +1 -1
- package/dist/config.d.ts +2 -2
- package/dist/config.js +1 -1
- package/dist/core.d.ts +4 -3
- package/dist/core.js +1 -1
- package/dist/index.d.ts +10 -8
- package/dist/index.js +1 -1
- package/dist/migrate.d.ts +3 -2
- package/dist/migrate.js +1 -1
- package/dist/package.js +1 -1
- package/dist/packages/changelog/src/cli/index.d.ts +2 -2
- package/dist/packages/changelog/src/index.d.ts +3 -3
- package/dist/packages/changelog/src/index.js +1 -1
- package/dist/packages/changelog/src/run-workflows.d.ts +2 -2
- package/dist/packages/changelog/src/sync.d.ts +13 -5
- package/dist/packages/changelog/src/sync.js +1 -1
- package/dist/packages/changelog/src/workflows.js +1 -1
- package/dist/packages/config/src/cli/index.d.ts +2 -2
- package/dist/packages/config/src/generators/index.d.ts +2 -2
- package/dist/packages/config/src/generators/index.js +1 -1
- package/dist/packages/config/src/generators/types.d.ts +16 -0
- package/dist/packages/config/src/generators/types.js +2 -1
- package/dist/packages/config/src/index.d.ts +3 -3
- package/dist/packages/config/src/index.js +1 -1
- package/dist/packages/config/src/schema.d.ts +1 -1
- package/dist/packages/config/src/schema.js +1 -1
- package/dist/packages/core/src/index.d.ts +5 -4
- package/dist/packages/core/src/index.js +1 -1
- package/dist/packages/core/src/loader.d.ts +3 -3
- package/dist/packages/core/src/loader.js +1 -1
- package/dist/packages/core/src/project-type.d.ts +2 -2
- package/dist/packages/core/src/provider-registry.d.ts +12 -0
- package/dist/packages/core/src/provider-registry.js +1 -0
- package/dist/packages/core/src/reset.d.ts +3 -3
- package/dist/packages/core/src/reset.js +1 -1
- package/dist/packages/core/src/sync.d.ts +2 -2
- package/dist/packages/core/src/vscode.d.ts +3 -3
- package/dist/packages/migrate/src/biome.d.ts +3 -3
- package/dist/packages/migrate/src/biome.js +1 -1
- package/dist/packages/migrate/src/cli/index.d.ts +5 -4
- package/dist/packages/migrate/src/cli/index.js +1 -1
- package/dist/packages/migrate/src/dprint.d.ts +2 -2
- package/dist/packages/migrate/src/dprint.js +1 -1
- package/dist/packages/migrate/src/eslint.d.ts +2 -2
- package/dist/packages/migrate/src/eslint.js +1 -1
- package/dist/packages/migrate/src/index.d.ts +3 -2
- package/dist/packages/migrate/src/index.js +1 -1
- package/dist/packages/migrate/src/prettier.d.ts +2 -2
- package/dist/packages/migrate/src/prettier.js +1 -1
- package/dist/packages/migrate/src/registry.d.ts +4 -4
- package/dist/packages/migrate/src/registry.js +1 -1
- package/dist/packages/migrate/src/types.d.ts +4 -4
- package/dist/packages/migrate/src/vite.d.ts +52 -0
- package/dist/packages/migrate/src/vite.js +5 -0
- package/dist/packages/project/src/cli/index.d.ts +2 -2
- package/dist/packages/project/src/config.js +1 -1
- package/dist/packages/project/src/index.d.ts +3 -3
- package/dist/packages/project/src/index.js +1 -1
- package/dist/packages/project/src/typescript.d.ts +1 -1
- package/dist/packages/project/src/typescript.js +1 -1
- package/dist/packages/shared/src/bin.d.ts +21 -0
- package/dist/packages/shared/src/bin.js +1 -0
- package/dist/packages/shared/src/config-schema.d.ts +30 -57
- package/dist/packages/shared/src/config-schema.js +1 -1
- package/dist/packages/shared/src/config-types.d.ts +30 -39
- package/dist/packages/shared/src/index.d.ts +8 -7
- package/dist/packages/shared/src/index.js +1 -1
- package/dist/packages/shared/src/logger.d.ts +7 -4
- package/dist/packages/shared/src/logger.js +1 -1
- package/dist/packages/shared/src/provider.d.ts +6 -6
- package/dist/packages/shared/src/toolchain.d.ts +17 -19
- package/dist/packages/shared/src/toolchain.js +1 -1
- package/dist/packages/shared/src/types.d.ts +9 -9
- package/dist/packages/template/src/cli/index.d.ts +2 -2
- package/dist/packages/template/src/cli/index.js +1 -1
- package/dist/packages/template/src/online.d.ts +3 -3
- package/dist/packages/template/src/registry.d.ts +8 -8
- package/dist/packages/template/src/types.d.ts +3 -3
- package/dist/packages/tsconfig/src/cli/index.d.ts +2 -2
- package/dist/packages/tsdown/src/cli/index.d.ts +2 -2
- package/dist/packages/vite/src/cli/index.d.ts +2 -2
- package/dist/packages/vite/src/index.d.ts +4 -3
- package/dist/packages/vite/src/index.js +1 -1
- package/dist/packages/vite/src/plugin.d.ts +8 -16
- package/dist/packages/vite/src/plugin.js +1 -1
- package/dist/packages/vite/src/provider.d.ts +2 -2
- package/dist/packages/vite/src/resolve.d.ts +19 -0
- package/dist/packages/vite/src/resolve.js +1 -0
- package/dist/packages/vite/src/sync.d.ts +10 -14
- package/dist/packages/vite/src/sync.js +2 -2
- package/dist/project.d.ts +2 -2
- package/dist/project.js +1 -1
- package/dist/providers.d.ts +8 -4
- package/dist/providers.js +1 -1
- package/dist/shared.d.ts +7 -6
- package/dist/shared.js +1 -1
- package/dist/vite.d.ts +4 -3
- package/dist/vite.js +1 -1
- package/package.json +25 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as e}from"node:path";import"node:url";import.meta.url;import{logger as t}from"../../../shared/src/logger.js";import"../../../shared/src/index.js";import{diffFiles as n,hasPending as r}from"../check.js";import{detectMigrations as i,listMigrations as a,migrations as o}from"../registry.js";function s(){return[{name:`migrate`,description:`Migrate Biome / ESLint / Prettier / Dprint config to
|
|
1
|
+
import{default as e}from"node:path";import"node:url";import.meta.url;import{logger as t}from"../../../shared/src/logger.js";import"../../../shared/src/index.js";import{diffFiles as n,hasPending as r}from"../check.js";import{detectMigrations as i,listMigrations as a,migrations as o}from"../registry.js";function s(){return[{name:`migrate`,description:`Migrate Biome / ESLint / Prettier / Dprint config to Oxc, or fold vite.config.* into dbx.config.`,options:[{flags:`--from <tool>`,description:`Source tool: biome | eslint | prettier | dprint | vite | all.`},{flags:`--to <tool>`,description:`Target tool (default: oxc).`,default:`oxc`},{flags:`--cwd <dir>`,description:`Project root (default: cwd).`},{flags:`--write`,description:`Write the files (default: dry-run).`},{flags:`--dry-run`,description:`Do not write anything (default).`},{flags:`--check`,description:`CI: exit non-zero when the oxc config is stale.`},{flags:`--target <target>`,description:`files (default) | vite.`},{flags:`--online`,description:`Allow network (e.g. @oxlint/migrate).`},{flags:`--json`,description:`Print the result as JSON.`}],run:async(a,s)=>{let c=a.cwd??s.cwd,l=!!a.check,u=!!a.write&&!a.dryRun&&!l,d=!!a.online,f=a.from,p=a.target??`files`,m=!f||f===`all`?i(c):o().filter(e=>e.from===f);if(m.length===0){t.info(f&&f!==`all`?`no "${f}" migration is registered.`:`nothing to migrate (no Biome/ESLint/Prettier/Dprint/vite config detected).`);return}let h=[];for(let e of m)h.push(await e.run({cwd:c,write:u,online:d,target:p}));if(l){let i=h.flatMap(e=>n(e.files??[])),o=i.filter(e=>e.status!==`same`);if(a.json)t.raw(JSON.stringify(h,null,4));else if(o.length){for(let n of o)t.info(`${n.status} ${e.relative(c,n.path)||n.path}`);t.info(`${o.length} file(s) out of date — run \`migrate --write\` to apply.`)}else t.info(`up to date.`);r(i)&&(process.exitCode=1)}else if(a.json)t.raw(JSON.stringify(h,null,4));else{for(let e of h){t.info(`${e.from} -> ${e.to} ${u?`wrote`:`would write`}`);for(let n of e.written)t.info(` ${u?`+`:`?`} ${n}`);for(let n of e.notes??[])t.info(` ${n}`);if(e.unmapped?.length){t.info(` unmapped (${e.unmapped.length}):`);for(let n of e.unmapped.slice(0,25))t.info(` - ${n.source}: ${n.reason}`)}}u||t.info(`dry-run — re-run with --write to apply.`)}}},{name:`migrate:list`,description:`List the registered migrations and whether each is detected.`,options:[{flags:`--cwd <dir>`,description:`Project root (default: cwd).`},{flags:`--json`,description:`Print as JSON.`}],run:(e,n)=>{let r=e.cwd??n.cwd,i=a(r);if(e.json)t.raw(JSON.stringify(i,null,4));else for(let e of i)t.info(` ${e.id.padEnd(16)} ${e.from} -> ${e.to} [${e.detected?`detected`:`not found`}]`),t.info(` ${e.description}`)}}]}export{s as migrateCommands};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
import {
|
|
3
|
+
import { ToolchainMigration } from "./types.js";
|
|
4
4
|
//#region packages/migrate/src/dprint.d.ts
|
|
5
5
|
type Json = Record<string, any>;
|
|
6
6
|
/** Locate a dprint config. */
|
|
@@ -13,6 +13,6 @@ export declare function mapDprintToOxfmt(dprint: Json): {
|
|
|
13
13
|
oxfmt: Json;
|
|
14
14
|
unmapped: string[];
|
|
15
15
|
};
|
|
16
|
-
export declare const dprintToOx:
|
|
16
|
+
export declare const dprintToOx: ToolchainMigration;
|
|
17
17
|
//#endregion
|
|
18
18
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as e}from"node:path";import"node:url";import.meta.url;import{renderViteTarget as t}from"./vite-target.js";import n from"node:fs";const r=[`dprint.json`,`dprint.jsonc`,`.dprint.json`];function i(t){for(let i of r){let r=e.join(t,i);if(!n.existsSync(r))continue;let a=n.readFileSync(r,`utf-8`).replace(/^\uFEFF/,``).replace(/\/\*[\s\S]*?\*\//g,``).replace(/(^|[^:])\/\/.*$/gm,`$1`).replace(/,(\s*[}\]])/g,`$1`);try{return{file:r,config:JSON.parse(a)}}catch{}}}function a(e){let t={},n=e.typescript??{};typeof e.lineWidth==`number`&&(t.printWidth=e.lineWidth),typeof e.indentWidth==`number`&&(t.tabWidth=e.indentWidth),typeof e.useTabs==`boolean`&&(t.useTabs=e.useTabs),(e.newLineKind===`lf`||e.newLineKind===`crlf`)&&(t.endOfLine=e.newLineKind),n.quoteStyle&&(t.singleQuote=String(n.quoteStyle).includes(`Single`)||n.quoteStyle===`alwaysSingle`),n.semiColons&&(t.semi=n.semiColons!==`asi`),n.trailingCommas&&(t.trailingComma=n.trailingCommas===`always`?`all`:n.trailingCommas===`never`?`none`:`es5`);let r=[],i=[`lineWidth`,`indentWidth`,`useTabs`,`newLineKind`,`typescript`,`plugins`];for(let t of Object.keys(e))i.includes(t)||r.push(`dprint section: ${t}`);return Array.isArray(e.plugins)&&e.plugins.length&&r.push(`plugins (Oxfmt has built-in equivalents for common cases)`),{oxfmt:t,unmapped:r}}const o={id:`dprint-to-
|
|
1
|
+
import{default as e}from"node:path";import"node:url";import.meta.url;import{renderViteTarget as t}from"./vite-target.js";import n from"node:fs";const r=[`dprint.json`,`dprint.jsonc`,`.dprint.json`];function i(t){for(let i of r){let r=e.join(t,i);if(!n.existsSync(r))continue;let a=n.readFileSync(r,`utf-8`).replace(/^\uFEFF/,``).replace(/\/\*[\s\S]*?\*\//g,``).replace(/(^|[^:])\/\/.*$/gm,`$1`).replace(/,(\s*[}\]])/g,`$1`);try{return{file:r,config:JSON.parse(a)}}catch{}}}function a(e){let t={},n=e.typescript??{};typeof e.lineWidth==`number`&&(t.printWidth=e.lineWidth),typeof e.indentWidth==`number`&&(t.tabWidth=e.indentWidth),typeof e.useTabs==`boolean`&&(t.useTabs=e.useTabs),(e.newLineKind===`lf`||e.newLineKind===`crlf`)&&(t.endOfLine=e.newLineKind),n.quoteStyle&&(t.singleQuote=String(n.quoteStyle).includes(`Single`)||n.quoteStyle===`alwaysSingle`),n.semiColons&&(t.semi=n.semiColons!==`asi`),n.trailingCommas&&(t.trailingComma=n.trailingCommas===`always`?`all`:n.trailingCommas===`never`?`none`:`es5`);let r=[],i=[`lineWidth`,`indentWidth`,`useTabs`,`newLineKind`,`typescript`,`plugins`];for(let t of Object.keys(e))i.includes(t)||r.push(`dprint section: ${t}`);return Array.isArray(e.plugins)&&e.plugins.length&&r.push(`plugins (Oxfmt has built-in equivalents for common cases)`),{oxfmt:t,unmapped:r}}const o={id:`dprint-to-oxc`,from:`dprint`,to:`oxfmt`,description:`Migrate a dprint.json (formatter) to Oxfmt.`,detect:e=>!!i(e),run:async r=>{let o=i(r.cwd);if(!o)throw Error(`dprint-to-oxc: no dprint.json found.`);let s=a(o.config),c=s.unmapped.map(e=>({source:e,reason:`no Oxfmt equivalent`})),l=[`Source: ${e.basename(o.file)}.`];if((r.target??`files`)===`vite`){let e=t(r.cwd,{fmt:s.oxfmt});return r.write&&n.writeFileSync(e.path,e.content,`utf-8`),{id:`dprint-to-oxc`,from:`dprint`,to:`oxfmt`,written:[e.path],files:[e],oxfmt:s.oxfmt,unmapped:c,notes:[...l,"Folded into vite.config.ts (`fmt`)."]}}let u={path:e.join(r.cwd,`.oxfmtrc.json`),content:`${JSON.stringify(s.oxfmt,null,4)}\n`};return r.write&&n.writeFileSync(u.path,u.content,`utf-8`),{id:`dprint-to-oxc`,from:`dprint`,to:`oxfmt`,written:[u.path],files:[u],oxfmt:s.oxfmt,unmapped:c,notes:l}}};export{o as dprintToOx,i as findDprintConfig,a as mapDprintToOxfmt};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
import {
|
|
3
|
+
import { ToolchainMigration } from "./types.js";
|
|
4
4
|
//#region packages/migrate/src/eslint.d.ts
|
|
5
5
|
type Json = Record<string, any>;
|
|
6
6
|
/** The ESLint config in `cwd`, preferring JSON (parseable) then JS. */
|
|
@@ -19,6 +19,6 @@ export declare function mapRuleName(name: string): {
|
|
|
19
19
|
* migrator writes to disk, so callers only run it when writing.
|
|
20
20
|
*/
|
|
21
21
|
export declare function runOxlintMigrate(cwd: string): Promise<Json | undefined>;
|
|
22
|
-
export declare const eslintToOx:
|
|
22
|
+
export declare const eslintToOx: ToolchainMigration;
|
|
23
23
|
//#endregion
|
|
24
24
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as e}from"node:path";import"node:url";import.meta.url;import{spawnCross as t}from"../../shared/src/run.js";import"../../shared/src/index.js";import{renderViteTarget as n}from"./vite-target.js";import r from"node:fs";const i=[`.eslintrc.json`,`.eslintrc`],a=[`eslint.config.js`,`eslint.config.mjs`,`eslint.config.cjs`,`eslint.config.ts`,`.eslintrc.js`,`.eslintrc.cjs`];function o(t){for(let n of i){let i=e.join(t,n);if(r.existsSync(i))return{file:i,json:!0}}for(let n of a){let i=e.join(t,n);if(r.existsSync(i))return{file:i,json:!1}}}function s(e){let t=Array.isArray(e)?e[0]:e;return t===2||t===`error`?`error`:t===1||t===`warn`?`warn`:`off`}function c(e){return e.startsWith(`@typescript-eslint/`)?{name:`typescript/${e.slice(19)}`,mapped:!0}:{name:e,mapped:!0}}function l(e,t,n){for(let[r,i]of Object.entries(e??{})){let e=c(r);t[e.name]=s(i),e.mapped||n.push({source:r,reason:`unknown plugin prefix`})}}function u(e,n,r){return new Promise(i=>{let a=t(e,n,{cwd:r,stdio:`inherit`});a.on(`error`,()=>i(1)),a.on(`exit`,e=>i(e??0))})}async function d(t){let n=e.join(t,`.oxlintrc.json`);if(await u(`npx`,[`--yes`,`@oxlint/migrate`],t)===0&&r.existsSync(n))try{return JSON.parse(r.readFileSync(n,`utf-8`).replace(/^\uFEFF/,``))}catch{return}}const f={id:`eslint-to-
|
|
1
|
+
import{default as e}from"node:path";import"node:url";import.meta.url;import{spawnCross as t}from"../../shared/src/run.js";import"../../shared/src/index.js";import{renderViteTarget as n}from"./vite-target.js";import r from"node:fs";const i=[`.eslintrc.json`,`.eslintrc`],a=[`eslint.config.js`,`eslint.config.mjs`,`eslint.config.cjs`,`eslint.config.ts`,`.eslintrc.js`,`.eslintrc.cjs`];function o(t){for(let n of i){let i=e.join(t,n);if(r.existsSync(i))return{file:i,json:!0}}for(let n of a){let i=e.join(t,n);if(r.existsSync(i))return{file:i,json:!1}}}function s(e){let t=Array.isArray(e)?e[0]:e;return t===2||t===`error`?`error`:t===1||t===`warn`?`warn`:`off`}function c(e){return e.startsWith(`@typescript-eslint/`)?{name:`typescript/${e.slice(19)}`,mapped:!0}:{name:e,mapped:!0}}function l(e,t,n){for(let[r,i]of Object.entries(e??{})){let e=c(r);t[e.name]=s(i),e.mapped||n.push({source:r,reason:`unknown plugin prefix`})}}function u(e,n,r){return new Promise(i=>{let a=t(e,n,{cwd:r,stdio:`inherit`});a.on(`error`,()=>i(1)),a.on(`exit`,e=>i(e??0))})}async function d(t){let n=e.join(t,`.oxlintrc.json`);if(await u(`npx`,[`--yes`,`@oxlint/migrate`],t)===0&&r.existsSync(n))try{return JSON.parse(r.readFileSync(n,`utf-8`).replace(/^\uFEFF/,``))}catch{return}}const f={id:`eslint-to-oxc`,from:`eslint`,to:`oxlint`,description:`Migrate ESLint to Oxlint (JSON configs; flat configs via @oxlint/migrate --online).`,detect:e=>!!o(e),run:async t=>{let i=o(t.cwd);if(!i)throw Error(`eslint-to-oxc: no ESLint config found.`);let a={},s=[],c=[`Source: ${e.basename(i.file)}.`];if(i.json)l(JSON.parse(r.readFileSync(i.file,`utf-8`).replace(/^\uFEFF/,``)).rules,a,s);else if(t.online&&t.write){let e=await d(t.cwd);e?(l(e.rules,a,s),c.push("Rules evaluated with `@oxlint/migrate` (online).")):c.push("`@oxlint/migrate` did not produce `.oxlintrc.json`; hand-map the rules.")}else t.online?c.push("Flat config: online evaluation runs `@oxlint/migrate`, which writes `.oxlintrc.json` — re-run with `--write`."):c.push("Flat config detected — re-run with `--online --write` to use `@oxlint/migrate`, or hand-map the rules.");let u={$schema:`./node_modules/oxlint/configuration_schema.json`,rules:a};if((t.target??`files`)===`vite`){let e=n(t.cwd,{lint:u});return t.write&&r.writeFileSync(e.path,e.content,`utf-8`),{id:f.id,from:`eslint`,to:`oxlint`,written:[e.path],files:[e],oxlint:u,unmapped:s,notes:[...c,"Folded into vite.config.ts (`lint`)."]}}let p={path:e.join(t.cwd,`.oxlintrc.json`),content:`${JSON.stringify(u,null,4)}\n`};return t.write&&r.writeFileSync(p.path,p.content,`utf-8`),{id:f.id,from:`eslint`,to:`oxlint`,written:[p.path],files:[p],oxlint:u,unmapped:s,notes:c}}};export{f as eslintToOx,o as findEslintConfig,c as mapRuleName,d as runOxlintMigrate};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
import { MigrateTarget, MigrateTool, MigrationContext, MigrationFile, MigrationResult,
|
|
3
|
+
import { MigrateTarget, MigrateTool, MigrationContext, MigrationFile, MigrationResult, ToolchainMigration, UnmappedItem } from "./types.js";
|
|
4
4
|
import { BIOME_CONFIG_FILES, biomeToOx, findBiomeConfig, readJsonc, stripJsonc } from "./biome.js";
|
|
5
5
|
import { FileDiff, FileStatus, diffFiles, hasPending } from "./check.js";
|
|
6
6
|
import { migrateCommands } from "./cli/index.js";
|
|
@@ -10,5 +10,6 @@ import { DEFAULT_IGNORE, OxfmtMapping, mapBiomeFormatter, mapBiomeIncludes, mapB
|
|
|
10
10
|
import { OxlintMapping, RULE_MAP, mapBiomeToOxlint } from "./oxlint-map.js";
|
|
11
11
|
import { findPrettierConfig, mapPrettierToOxfmt, prettierToOx, readPrettierIgnore } from "./prettier.js";
|
|
12
12
|
import { MigrationInfo, detectMigrations, findMigration, listMigrations, migrations, runDetectedMigrations, runMigration } from "./registry.js";
|
|
13
|
+
import { VITE_CONFIG_FILES, ensureViteFmtIgnore, extractViteObject, findDbxConfig, findViteConfig, foldViteIntoConfig, scanLiteralObject, viteToToolchain } from "./vite.js";
|
|
13
14
|
import { findTopLevelValue, matchBracket, mergeViteConfig, renderViteTarget, serializeTs, writeViteTarget } from "./vite-target.js";
|
|
14
|
-
export { BIOME_CONFIG_FILES, DEFAULT_IGNORE, FileDiff, FileStatus, MigrateTarget, MigrateTool, MigrationContext, MigrationFile, MigrationInfo, MigrationResult, OxfmtMapping, OxlintMapping, RULE_MAP,
|
|
15
|
+
export { BIOME_CONFIG_FILES, DEFAULT_IGNORE, FileDiff, FileStatus, MigrateTarget, MigrateTool, MigrationContext, MigrationFile, MigrationInfo, MigrationResult, OxfmtMapping, OxlintMapping, RULE_MAP, ToolchainMigration, UnmappedItem, VITE_CONFIG_FILES, biomeToOx, detectMigrations, diffFiles, dprintToOx, ensureViteFmtIgnore, eslintToOx, extractViteObject, findBiomeConfig, findDbxConfig, findDprintConfig, findEslintConfig, findMigration, findPrettierConfig, findTopLevelValue, findViteConfig, foldViteIntoConfig, hasPending, listMigrations, mapBiomeFormatter, mapBiomeIncludes, mapBiomeToOxfmt, mapBiomeToOxlint, mapDprintToOxfmt, mapOrganizeImports, mapPrettierToOxfmt, mapRuleName, matchBracket, mergeViteConfig, migrateCommands, migrations, prettierToOx, readJsonc, readPrettierIgnore, renderViteTarget, runDetectedMigrations, runMigration, runOxlintMigrate, scanLiteralObject, serializeTs, stripJsonc, viteToToolchain, writeViteTarget };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node:path";import"node:url";import.meta.url;import{diffFiles as e,hasPending as t}from"./check.js";import{DEFAULT_IGNORE as n,mapBiomeFormatter as r,mapBiomeIncludes as i,mapBiomeToOxfmt as a,mapOrganizeImports as o}from"./oxfmt-map.js";import{RULE_MAP as s,mapBiomeToOxlint as c}from"./oxlint-map.js";import{findTopLevelValue as l,matchBracket as u,mergeViteConfig as d,renderViteTarget as f,serializeTs as p,writeViteTarget as m}from"./vite-target.js";import{BIOME_CONFIG_FILES as h,biomeToOx as g,findBiomeConfig as _,readJsonc as v,stripJsonc as y}from"./biome.js";import{dprintToOx as b,findDprintConfig as x,mapDprintToOxfmt as S}from"./dprint.js";import{eslintToOx as C,findEslintConfig as w,mapRuleName as T,runOxlintMigrate as E}from"./eslint.js";import{findPrettierConfig as D,mapPrettierToOxfmt as O,prettierToOx as k,readPrettierIgnore as A}from"./prettier.js";import{
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;import{diffFiles as e,hasPending as t}from"./check.js";import{DEFAULT_IGNORE as n,mapBiomeFormatter as r,mapBiomeIncludes as i,mapBiomeToOxfmt as a,mapOrganizeImports as o}from"./oxfmt-map.js";import{RULE_MAP as s,mapBiomeToOxlint as c}from"./oxlint-map.js";import{findTopLevelValue as l,matchBracket as u,mergeViteConfig as d,renderViteTarget as f,serializeTs as p,writeViteTarget as m}from"./vite-target.js";import{BIOME_CONFIG_FILES as h,biomeToOx as g,findBiomeConfig as _,readJsonc as v,stripJsonc as y}from"./biome.js";import{dprintToOx as b,findDprintConfig as x,mapDprintToOxfmt as S}from"./dprint.js";import{eslintToOx as C,findEslintConfig as w,mapRuleName as T,runOxlintMigrate as E}from"./eslint.js";import{findPrettierConfig as D,mapPrettierToOxfmt as O,prettierToOx as k,readPrettierIgnore as A}from"./prettier.js";import{VITE_CONFIG_FILES as j,ensureViteFmtIgnore as M,extractViteObject as N,findDbxConfig as P,findViteConfig as F,foldViteIntoConfig as I,scanLiteralObject as L,viteToToolchain as R}from"./vite.js";import{detectMigrations as z,findMigration as B,listMigrations as V,migrations as H,runDetectedMigrations as U,runMigration as W}from"./registry.js";import{migrateCommands as G}from"./cli/index.js";export{h as BIOME_CONFIG_FILES,n as DEFAULT_IGNORE,s as RULE_MAP,j as VITE_CONFIG_FILES,g as biomeToOx,z as detectMigrations,e as diffFiles,b as dprintToOx,M as ensureViteFmtIgnore,C as eslintToOx,N as extractViteObject,_ as findBiomeConfig,P as findDbxConfig,x as findDprintConfig,w as findEslintConfig,B as findMigration,D as findPrettierConfig,l as findTopLevelValue,F as findViteConfig,I as foldViteIntoConfig,t as hasPending,V as listMigrations,r as mapBiomeFormatter,i as mapBiomeIncludes,a as mapBiomeToOxfmt,c as mapBiomeToOxlint,S as mapDprintToOxfmt,o as mapOrganizeImports,O as mapPrettierToOxfmt,T as mapRuleName,u as matchBracket,d as mergeViteConfig,G as migrateCommands,H as migrations,k as prettierToOx,v as readJsonc,A as readPrettierIgnore,f as renderViteTarget,U as runDetectedMigrations,W as runMigration,E as runOxlintMigrate,L as scanLiteralObject,p as serializeTs,y as stripJsonc,R as viteToToolchain,m as writeViteTarget};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
import {
|
|
3
|
+
import { ToolchainMigration } from "./types.js";
|
|
4
4
|
//#region packages/migrate/src/prettier.d.ts
|
|
5
5
|
type Json = Record<string, any>;
|
|
6
6
|
/** Locate a Prettier config (JSON files or the `prettier` package.json field). */
|
|
@@ -15,6 +15,6 @@ export declare function mapPrettierToOxfmt(prettier: Json): {
|
|
|
15
15
|
oxfmt: Json;
|
|
16
16
|
unmapped: string[];
|
|
17
17
|
};
|
|
18
|
-
export declare const prettierToOx:
|
|
18
|
+
export declare const prettierToOx: ToolchainMigration;
|
|
19
19
|
//#endregion
|
|
20
20
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{default as e}from"node:path";import"node:url";import.meta.url;import{renderViteTarget as t}from"./vite-target.js";import n from"node:fs";const r=[`.prettierrc`,`.prettierrc.json`,`.prettierrc.jsonc`,`prettier.config.json`],i=[`printWidth`,`tabWidth`,`useTabs`,`semi`,`singleQuote`,`jsxSingleQuote`,`quoteProps`,`trailingComma`,`bracketSpacing`,`bracketSameLine`,`arrowParens`,`endOfLine`,`singleAttributePerLine`,`htmlWhitespaceSensitivity`,`vueIndentScriptAndStyle`];function a(t){for(let i of r){let r=e.join(t,i);if(n.existsSync(r)){let e=n.readFileSync(r,`utf-8`).replace(/^\uFEFF/,``);try{return{file:r,config:JSON.parse(e)}}catch{}}}let i=e.join(t,`package.json`);if(n.existsSync(i))try{let e=JSON.parse(n.readFileSync(i,`utf-8`));if(e.prettier&&typeof e.prettier==`object`)return{file:i,config:e.prettier}}catch{}}function o(t){let r=e.join(t,`.prettierignore`);return n.existsSync(r)?n.readFileSync(r,`utf-8`).split(`
|
|
2
|
-
`).map(e=>e.trim()).filter(e=>e&&!e.startsWith(`#`)):[]}function s(e){let t={},n=[];for(let n of i)n in e&&(t[n]=e[n]);let r=Array.isArray(e.plugins)?e.plugins:[];for(let e of r)e.includes(`tailwindcss`)?t.sortTailwindcss=!0:e.includes(`packagejson`)?t.sortPackageJson=!0:n.push(`plugin: ${e}`);for(let t of Object.keys(e))!i.includes(t)&&t!==`plugins`&&t!==`overrides`&&n.push(`option: ${t}`),t===`overrides`&&n.push("option: overrides (convert to Oxfmt `overrides` manually)");return{oxfmt:t,unmapped:n}}const c={id:`prettier-to-
|
|
2
|
+
`).map(e=>e.trim()).filter(e=>e&&!e.startsWith(`#`)):[]}function s(e){let t={},n=[];for(let n of i)n in e&&(t[n]=e[n]);let r=Array.isArray(e.plugins)?e.plugins:[];for(let e of r)e.includes(`tailwindcss`)?t.sortTailwindcss=!0:e.includes(`packagejson`)?t.sortPackageJson=!0:n.push(`plugin: ${e}`);for(let t of Object.keys(e))!i.includes(t)&&t!==`plugins`&&t!==`overrides`&&n.push(`option: ${t}`),t===`overrides`&&n.push("option: overrides (convert to Oxfmt `overrides` manually)");return{oxfmt:t,unmapped:n}}const c={id:`prettier-to-oxc`,from:`prettier`,to:`oxfmt`,description:`Migrate a Prettier config to Oxfmt (.oxfmtrc.json).`,detect:e=>!!a(e),run:async r=>{let i=a(r.cwd);if(!i)throw Error(`prettier-to-oxc: no Prettier config found.`);let l=s(i.config),u=o(r.cwd);u.length&&(l.oxfmt.ignorePatterns=u);let d=l.unmapped.map(e=>({source:e,reason:`no Oxfmt equivalent`}));if((r.target??`files`)===`vite`){let a=t(r.cwd,{fmt:l.oxfmt});return r.write&&n.writeFileSync(a.path,a.content,`utf-8`),{id:c.id,from:`prettier`,to:`oxfmt`,written:[a.path],files:[a],oxfmt:l.oxfmt,unmapped:d,notes:[`Source: ${e.basename(i.file)}.`,"Folded into vite.config.ts (`fmt`)."]}}let f={path:e.join(r.cwd,`.oxfmtrc.json`),content:`${JSON.stringify(l.oxfmt,null,4)}\n`};return r.write&&n.writeFileSync(f.path,f.content,`utf-8`),{id:c.id,from:`prettier`,to:`oxfmt`,written:[f.path],files:[f],oxfmt:l.oxfmt,unmapped:d,notes:[`Source: ${e.basename(i.file)}.`]}}};export{a as findPrettierConfig,s as mapPrettierToOxfmt,c as prettierToOx,o as readPrettierIgnore};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
import { MigrateTool, MigrationContext, MigrationResult,
|
|
3
|
+
import { MigrateTool, MigrationContext, MigrationResult, ToolchainMigration } from "./types.js";
|
|
4
4
|
//#region packages/migrate/src/registry.d.ts
|
|
5
5
|
/** Every registered migration. */
|
|
6
|
-
export declare function migrations():
|
|
6
|
+
export declare function migrations(): ToolchainMigration[];
|
|
7
7
|
/** A migration summary for listings. */
|
|
8
8
|
export interface MigrationInfo {
|
|
9
9
|
id: string;
|
|
@@ -16,9 +16,9 @@ export interface MigrationInfo {
|
|
|
16
16
|
/** Describe every migration, flagging which are detected in `cwd`. */
|
|
17
17
|
export declare function listMigrations(cwd: string): MigrationInfo[];
|
|
18
18
|
/** The migrations whose source config is present in `cwd`. */
|
|
19
|
-
export declare function detectMigrations(cwd: string):
|
|
19
|
+
export declare function detectMigrations(cwd: string): ToolchainMigration[];
|
|
20
20
|
/** Find a migration by id, or by source tool. */
|
|
21
|
-
export declare function findMigration(idOrFrom: string):
|
|
21
|
+
export declare function findMigration(idOrFrom: string): ToolchainMigration | undefined;
|
|
22
22
|
/** Run one migration by id (or source tool name). */
|
|
23
23
|
export declare function runMigration(idOrFrom: string, ctx: MigrationContext): Promise<MigrationResult>;
|
|
24
24
|
/** Run every migration detected in `ctx.cwd`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node:path";import"node:url";import.meta.url;import{biomeToOx as e}from"./biome.js";import{dprintToOx as t}from"./dprint.js";import{eslintToOx as n}from"./eslint.js";import{prettierToOx as r}from"./prettier.js";function
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;import{biomeToOx as e}from"./biome.js";import{dprintToOx as t}from"./dprint.js";import{eslintToOx as n}from"./eslint.js";import{prettierToOx as r}from"./prettier.js";import{viteToToolchain as i}from"./vite.js";function a(){return[e,r,t,n,i]}function o(e){return a().map(t=>({id:t.id,from:t.from,to:t.to,description:t.description,detected:t.detect(e)}))}function s(e){return a().filter(t=>t.detect(e))}function c(e){return a().find(t=>t.id===e||t.from===e)}async function l(e,t){let n=c(e);if(!n)throw Error(`Unknown migration "${e}".`);return n.run(t)}async function u(e){let t=[];for(let n of s(e.cwd))t.push(await n.run(e));return t}export{s as detectMigrations,c as findMigration,o as listMigrations,a as migrations,u as runDetectedMigrations,l as runMigration};
|
|
@@ -5,12 +5,12 @@ import __tsdown_shims_url from 'node:url';
|
|
|
5
5
|
* The migration model.
|
|
6
6
|
*
|
|
7
7
|
* A *migration* converts a project's tooling config from a source tool (Biome,
|
|
8
|
-
* ESLint, Prettier, ...) to a target tool (Oxfmt / Oxlint, ie. "
|
|
8
|
+
* ESLint, Prettier, ...) to a target tool (Oxfmt / Oxlint, ie. "oxc"). Migrations
|
|
9
9
|
* are pluggable: registering one here exposes it through the `dbx
|
|
10
10
|
* migrate` CLI, the programmatic API and (over JSON) the VS Code extension.
|
|
11
11
|
*/
|
|
12
12
|
/** A tool a migration can read from or write to. */
|
|
13
|
-
export type MigrateTool = 'biome' | 'eslint' | 'prettier' | 'dprint' | 'oxfmt' | 'oxlint' | '
|
|
13
|
+
export type MigrateTool = 'biome' | 'eslint' | 'prettier' | 'dprint' | 'oxfmt' | 'oxlint' | 'oxc' | 'vite' | 'toolchain';
|
|
14
14
|
/** Where a migration writes its result. */
|
|
15
15
|
export type MigrateTarget = 'files' | 'vite';
|
|
16
16
|
export interface MigrationContext {
|
|
@@ -58,8 +58,8 @@ export interface MigrationResult {
|
|
|
58
58
|
notes?: string[];
|
|
59
59
|
}
|
|
60
60
|
/** A pluggable config migration. */
|
|
61
|
-
export interface
|
|
62
|
-
/** Stable id, eg. `biome-to-
|
|
61
|
+
export interface ToolchainMigration {
|
|
62
|
+
/** Stable id, eg. `biome-to-oxc`. */
|
|
63
63
|
id: string;
|
|
64
64
|
/** The source tool. */
|
|
65
65
|
from: MigrateTool;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { ToolchainMigration } from "./types.js";
|
|
4
|
+
//#region packages/migrate/src/vite.d.ts
|
|
5
|
+
/** The root Vite config file names, in priority order. */
|
|
6
|
+
export declare const VITE_CONFIG_FILES: readonly ['vite.config.ts', 'vite.config.mts', 'vite.config.js', 'vite.config.mjs'];
|
|
7
|
+
/** The Vite config in `cwd`, if present. */
|
|
8
|
+
export declare function findViteConfig(cwd: string): string | undefined;
|
|
9
|
+
/** The nearest `dbx.config.*` in `cwd`, if present. */
|
|
10
|
+
export declare function findDbxConfig(cwd: string): string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Extract the object literal passed to `defineConfig(...)`, or the
|
|
13
|
+
* default-exported object when there is no `defineConfig`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function extractViteObject(source: string): {
|
|
16
|
+
text: string;
|
|
17
|
+
} | {
|
|
18
|
+
error: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Whether `text` (an object literal, braces included) is made only of literals:
|
|
22
|
+
* objects, arrays, strings, numbers, booleans, `null`/`undefined` and bare keys.
|
|
23
|
+
* Any other identifier (a variable, import, plugin call), spread or template
|
|
24
|
+
* literal makes it non-foldable.
|
|
25
|
+
*/
|
|
26
|
+
export declare function scanLiteralObject(text: string): {
|
|
27
|
+
ok: true;
|
|
28
|
+
} | {
|
|
29
|
+
ok: false;
|
|
30
|
+
reason: string;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Fold `objectText` into the `toolchain.vite` of a `dbx.config.*` source by
|
|
34
|
+
* text-splicing (inserting or replacing the `vite` value), never rewriting the
|
|
35
|
+
* whole file. Returns the new source, or an error when the `toolchain` object
|
|
36
|
+
* cannot be located.
|
|
37
|
+
*/
|
|
38
|
+
export declare function foldViteIntoConfig(source: string, objectText: string): {
|
|
39
|
+
content: string;
|
|
40
|
+
} | {
|
|
41
|
+
error: string;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Ensure `fmt.ignorePatterns` contains `'/vite.config.ts'` in a folded Vite
|
|
45
|
+
* object literal, so Oxfmt does not reformat the generated root `vite.config.ts`
|
|
46
|
+
* shim (which would make `dbx sync --check` drift). Works on the object text
|
|
47
|
+
* (braces included) with the same balanced scanner used to fold it in.
|
|
48
|
+
*/
|
|
49
|
+
export declare function ensureViteFmtIgnore(objectText: string): string;
|
|
50
|
+
/** Fold a hand-written root `vite.config.*` into `dbx.config.*`. */
|
|
51
|
+
export declare const viteToToolchain: ToolchainMigration;
|
|
52
|
+
//#endregion
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{default as e}from"node:path";import"node:url";import.meta.url;import{CONFIG_FILE_NAMES as t}from"../../shared/src/toolchain.js";import"../../shared/src/index.js";import{findTopLevelValue as n,matchBracket as r}from"./vite-target.js";import i from"node:fs";const a=[`vite.config.ts`,`vite.config.mts`,`vite.config.js`,`vite.config.mjs`];function o(t){for(let n of a){let r=e.join(t,n);if(i.existsSync(r))return r}}function s(n){for(let r of t){let t=e.join(n,r);if(i.existsSync(t))return t}}function c(e,t){let n=e[t],r=e[t+1];if(n===`/`&&r===`/`){for(;t<e.length&&e[t]!==`
|
|
2
|
+
`;)t++;return t}if(n===`/`&&r===`*`){for(t+=2;t<e.length&&(e[t]!==`*`||e[t+1]!==`/`);)t++;return t+2}if(n===`"`||n===`'`){let r=n;for(t++;t<e.length&&e[t]!==r;)e[t]===`\\`&&t++,t++;return t+1}return t}function l(e,t){let n=e.lastIndexOf(`
|
|
3
|
+
`,t-1)+1;return e.slice(n).match(/^[ \t]*/)?.[0]??``}function u(e,t){return e.split(`
|
|
4
|
+
`).map((e,n)=>n===0?e:`${t}${e}`).join(`
|
|
5
|
+
`)}function d(e){let t=e.match(/\bdefineConfig\s*\(/),n=0;if(t&&t.index!==void 0)n=t.index+t[0].length;else{let t=e.match(/export\s+default\s*/);if(!t||t.index===void 0)return;n=t.index+t[0].length}let i=n;for(;i<e.length&&e[i]!==`{`;)i++;if(i>=e.length)return;let a=r(e,i);return a===-1?void 0:[i,a]}function f(e){let t=e.match(/\bdefineConfig\s*\(/),n=-1;if(t&&t.index!==void 0)n=t.index+t[0].length;else{let t=e.match(/export\s+default\s*/);t&&t.index!==void 0&&(n=t.index+t[0].length)}if(n===-1)return{error:"no `defineConfig(...)` call or default-exported object found"};for(;n<e.length&&/\s/.test(e[n]);)n++;if(e[n]!==`{`)return{error:`the config value is not an object literal (it is a variable or an expression)`};let i=r(e,n);return i===-1?{error:`unbalanced braces in the config object`}:{text:e.slice(n,i)}}function p(e){let t=0;for(;t<e.length;){let n=e[t];if(n==="`")return{ok:!1,reason:`template literal`};let r=c(e,t);if(r!==t)t=r;else{if(n===`.`&&e[t+1]===`.`&&e[t+2]===`.`)return{ok:!1,reason:"spread (`...`)"};if(/[A-Za-z_$]/.test(n)){let n=t;for(;n<e.length&&/[\w$]/.test(e[n]);)n++;let r=e.slice(t,n),i=n;for(;i<e.length&&/\s/.test(e[i]);)i++;if(e[i]!==`:`&&![`true`,`false`,`null`,`undefined`].includes(r))return{ok:!1,reason:`non-literal value \`${r}\``};t=n}else t++}}return{ok:!0}}function m(e,t){let r=d(e);if(!r)return{error:`could not locate the config root object`};let[i,a]=r,o=n(e,i,a,`toolchain`);if(!o)return{error:"the config has no `toolchain` object to add `vite` to"};let[s,c]=o,f=n(e,s,c,`vite`);if(f){let[n,r]=f,i=u(t,l(e,n));return{content:`${e.slice(0,n)}${i}${e.slice(r)}`}}let p=`${l(e,s)} `,m=u(t,p);return{content:`${e.slice(0,s+1)}\n${p}vite: ${m},${e.slice(s+1)}`}}const h=`/vite.config.ts`;function g(e){let t=e.indexOf(`{`);if(t===-1)return e;let i=r(e,t);if(i===-1)return e;let a=`'${h}'`,o=n(e,t,i,`fmt`);if(o&&e[o[0]]===`{`&&e[o[1]-1]===`}`){let[t,r]=o,i=n(e,t,r,`ignorePatterns`);if(i){let[t,n]=i;return e.slice(t,n).includes(h)?e:e[t]===`[`?`${e.slice(0,t+1)}${a}, ${e.slice(t+1)}`:`${e.slice(0,t)}[${a}]${e.slice(n)}`}return`${e.slice(0,t+1)} ignorePatterns: [${a}],${e.slice(t+1)}`}return o?`${e.slice(0,o[0])}{ ignorePatterns: [${a}] }${e.slice(o[1])}`:`${e.slice(0,t+1)} fmt: { ignorePatterns: [${a}] },${e.slice(t+1)}`}const _={id:`vite-to-toolchain`,from:`vite`,to:`toolchain`,description:"Fold a hand-written root vite.config.* into dbx.config.* (`toolchain.vite`).",detect:e=>!!o(e),run:async t=>{let n=o(t.cwd);if(!n)throw Error(`vite-to-toolchain: no vite.config.* found.`);let r=i.readFileSync(n,`utf-8`).replace(/^\uFEFF/,``),a=[`Source: ${e.basename(n)}.`],c=[],l=()=>({id:_.id,from:`vite`,to:`toolchain`,written:[],files:[],unmapped:c,notes:a}),u=s(t.cwd);if(!u)return c.push({source:e.basename(n),reason:`no dbx.config.* found to fold into`}),a.push(`Create a dbx.config.* first, then re-run this migration.`),l();if(u.endsWith(`.json`))return c.push({source:e.basename(u),reason:`JSON configs cannot hold the extracted object by text-splice`}),a.push(`Fold into the JSON config by hand.`),l();let d=f(r);if(`error`in d)return c.push({source:e.basename(n),reason:d.error}),a.push(`Left vite.config.* unchanged; fold it by hand.`),l();let v=p(d.text);if(!v.ok)return c.push({source:e.basename(n),reason:`cannot fold faithfully (${v.reason})`}),a.push(`The config references helpers/imports or non-literal expressions; fold it by hand.`),l();let y=m(i.readFileSync(u,`utf-8`).replace(/^\uFEFF/,``),g(d.text));if(`error`in y)return c.push({source:e.basename(u),reason:y.error}),a.push("Left dbx.config.* unchanged; fold `toolchain.vite` in by hand."),l();let b={path:u,content:y.content};return t.write&&i.writeFileSync(u,b.content,`utf-8`),a.push(`Folded into \`toolchain.vite\` (${e.basename(u)}); added \`${h}\` to \`fmt.ignorePatterns\`; run \`dbx sync\` to regenerate vite.config.ts.`),{id:_.id,from:`vite`,to:`toolchain`,written:[u],files:[b],notes:a}}};export{a as VITE_CONFIG_FILES,g as ensureViteFmtIgnore,f as extractViteObject,s as findDbxConfig,o as findViteConfig,m as foldViteIntoConfig,p as scanLiteralObject,_ as viteToToolchain};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
import {
|
|
3
|
+
import { ToolchainCommand } from "../../../shared/src/types.js";
|
|
4
4
|
import "../../../shared/src/index.js";
|
|
5
5
|
//#region packages/project/src/cli/index.d.ts
|
|
6
6
|
/** Build the project scaffolding commands. */
|
|
7
|
-
export declare function projectCommands():
|
|
7
|
+
export declare function projectCommands(): ToolchainCommand[];
|
|
8
8
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as e}from"node:path";import"node:url";import.meta.url;import{readJsonAt as t}from"../../shared/src/fs-utils.js";import"../../shared/src/index.js";import{detectProjectType as n}from"../../core/src/project-type.js";import{selectProjects as r}from"../../core/src/select.js";import"../../core/src/index.js";import{
|
|
1
|
+
import{default as e}from"node:path";import"node:url";import.meta.url;import{readJsonAt as t}from"../../shared/src/fs-utils.js";import"../../shared/src/index.js";import{detectProjectType as n}from"../../core/src/project-type.js";import{selectProjects as r}from"../../core/src/select.js";import"../../core/src/index.js";import{renderToolchainConfig as i}from"./typescript.js";import a from"node:fs";const o=`dbx.config.ts`;function s(t,n){if(!t)return{name:e.basename(n)};let r=t.match(/^(@[^/]+)\/(.+)$/);return r?.[1]&&r[2]?{name:r[2],scope:r[1]}:{name:t}}function c(c){let l=c.dryRun??!1,u=c.force??!1,d=r({root:c.root,...c.include?{include:c.include}:{},...c.exclude?{exclude:c.exclude}:{},...c.maxDepth===void 0?{}:{maxDepth:c.maxDepth}}),f=[],p=[],m=[];for(let r of d){let d=e.join(r.dir,o);if((r.hasConfig||a.existsSync(d))&&!u){m.push(r.rel),f.push({dir:r.dir,rel:r.rel,...r.name?{name:r.name}:{},type:c.type??n(r.dir),configPath:d,created:!1,skipped:`has config`});continue}let h=c.type??n(r.dir),g=t(r.dir,`package.json`),{name:_,scope:v}=s(r.name??g?.name,r.dir),y=i({name:_,...v?{scope:v}:{},type:h});l||a.writeFileSync(d,y,`utf-8`),p.push(r.rel),f.push({dir:r.dir,rel:r.rel,...r.name?{name:r.name}:{},type:h,configPath:d,created:!0})}return{configs:f,created:p,skipped:m,dryRun:l}}export{o as GENERATED_CONFIG_FILENAME,c as generateProjectConfigs};
|
|
@@ -2,9 +2,9 @@ import __tsdown_shims_path from 'node:path';
|
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
3
|
import { projectCommands } from "./cli/index.js";
|
|
4
4
|
import { GENERATED_CONFIG_FILENAME, GenerateProjectConfigsOptions, GenerateProjectConfigsResult, GeneratedProjectConfig, generateProjectConfigs } from "./config.js";
|
|
5
|
-
import { MonorepoRootContext, ProjectContext, WorkspaceContext, createMonorepoRootFiles, createRootProjectFiles, createWorkspaceFiles, renderGitignore,
|
|
5
|
+
import { MonorepoRootContext, ProjectContext, WorkspaceContext, createMonorepoRootFiles, createRootProjectFiles, createWorkspaceFiles, renderGitignore, renderToolchainConfig, renderTurboJson, renderWorkspaceTsconfig, writeGeneratedFiles } from "./typescript.js";
|
|
6
6
|
declare namespace index_d_exports {
|
|
7
|
-
export { GENERATED_CONFIG_FILENAME, GenerateProjectConfigsOptions, GenerateProjectConfigsResult, GeneratedProjectConfig, MonorepoRootContext, ProjectContext, WorkspaceContext, createMonorepoRootFiles, createRootProjectFiles, createWorkspaceFiles, generateProjectConfigs, projectCommands, renderGitignore,
|
|
7
|
+
export { GENERATED_CONFIG_FILENAME, GenerateProjectConfigsOptions, GenerateProjectConfigsResult, GeneratedProjectConfig, MonorepoRootContext, ProjectContext, WorkspaceContext, createMonorepoRootFiles, createRootProjectFiles, createWorkspaceFiles, generateProjectConfigs, projectCommands, renderGitignore, renderToolchainConfig, renderTurboJson, renderWorkspaceTsconfig, writeGeneratedFiles };
|
|
8
8
|
}
|
|
9
9
|
//#endregion
|
|
10
|
-
export { GENERATED_CONFIG_FILENAME, GenerateProjectConfigsOptions, GenerateProjectConfigsResult, GeneratedProjectConfig, MonorepoRootContext, ProjectContext, WorkspaceContext, createMonorepoRootFiles, createRootProjectFiles, createWorkspaceFiles, generateProjectConfigs, index_d_exports, projectCommands, renderGitignore,
|
|
10
|
+
export { GENERATED_CONFIG_FILENAME, GenerateProjectConfigsOptions, GenerateProjectConfigsResult, GeneratedProjectConfig, MonorepoRootContext, ProjectContext, WorkspaceContext, createMonorepoRootFiles, createRootProjectFiles, createWorkspaceFiles, generateProjectConfigs, index_d_exports, projectCommands, renderGitignore, renderToolchainConfig, renderTurboJson, renderWorkspaceTsconfig, writeGeneratedFiles };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node:path";import"node:url";import.meta.url;import{__exportAll as e}from"../../../_virtual/_rolldown/runtime.js";import{createMonorepoRootFiles as t,createRootProjectFiles as n,createWorkspaceFiles as r,renderGitignore as i,
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;import{__exportAll as e}from"../../../_virtual/_rolldown/runtime.js";import{createMonorepoRootFiles as t,createRootProjectFiles as n,createWorkspaceFiles as r,renderGitignore as i,renderToolchainConfig as a,renderTurboJson as o,renderWorkspaceTsconfig as s,writeGeneratedFiles as c}from"./typescript.js";import{GENERATED_CONFIG_FILENAME as l,generateProjectConfigs as u}from"./config.js";import{projectCommands as d}from"./cli/index.js";var f=/* @__PURE__ */ e({GENERATED_CONFIG_FILENAME:()=>l,createMonorepoRootFiles:()=>t,createRootProjectFiles:()=>n,createWorkspaceFiles:()=>r,generateProjectConfigs:()=>u,projectCommands:()=>d,renderGitignore:()=>i,renderToolchainConfig:()=>a,renderTurboJson:()=>o,renderWorkspaceTsconfig:()=>s,writeGeneratedFiles:()=>c});export{l as GENERATED_CONFIG_FILENAME,t as createMonorepoRootFiles,n as createRootProjectFiles,r as createWorkspaceFiles,u as generateProjectConfigs,d as projectCommands,i as renderGitignore,a as renderToolchainConfig,o as renderTurboJson,s as renderWorkspaceTsconfig,f as src_exports,c as writeGeneratedFiles};
|
|
@@ -34,7 +34,7 @@ export interface ProjectContext {
|
|
|
34
34
|
* `project.type` lets the sync know whether the folder is a monorepo root, a
|
|
35
35
|
* workspace, or a single project.
|
|
36
36
|
*/
|
|
37
|
-
export declare function
|
|
37
|
+
export declare function renderToolchainConfig(ctx: ProjectContext & {
|
|
38
38
|
type: ProjectType;
|
|
39
39
|
}): string;
|
|
40
40
|
/** A minimal tsconfig.json that extends the default template. */
|
|
@@ -19,4 +19,4 @@ export default defineConfig({
|
|
|
19
19
|
entry: { index: 'src/index.ts' },
|
|
20
20
|
});
|
|
21
21
|
`}]}function m(){return c({$schema:`https://turborepo.dev/schema.json`,ui:`stream-with-experimental-timestamps`,globalDependencies:[`tsconfig.json`,`tsconfig.base.json`,`tsdown.config.ts`,`yarn.lock`],globalPassThroughEnv:[`NODE_ENV`,`VITE_*`],tasks:{build:{inputs:[`$TURBO_DEFAULT$`,`.env*`],outputs:[`dist/**`],dependsOn:[`^lint`,`^typecheck`,`^test`,`^build`]},format:{dependsOn:[`^format`]},lint:{dependsOn:[`^lint`]},typecheck:{dependsOn:[`^typecheck`]},test:{dependsOn:[`^test`]}}})}function h(){return[`node_modules/`,`dist/`,`coverage/`,`.turbo/`,`*.tsbuildinfo`,``,`.env`,`.env.*`,`!.env.example`,`!.env.example.*`,``,`.DS_Store`,``,`# Yarn 4`,`.pnp.*`,`.yarn/*`,`!.yarn/patches`,`!.yarn/plugins`,`!.yarn/releases`,`!.yarn/sdks`,`!.yarn/versions`,``].join(`
|
|
22
|
-
`)}function g(t,n=process.cwd()){let r=[];for(let i of t){let t=e.resolve(n,i.path);o.mkdirSync(e.dirname(t),{recursive:!0}),o.writeFileSync(t,i.content,`utf-8`),r.push(t)}return r}export{f as createMonorepoRootFiles,d as createRootProjectFiles,p as createWorkspaceFiles,h as renderGitignore,l as
|
|
22
|
+
`)}function g(t,n=process.cwd()){let r=[];for(let i of t){let t=e.resolve(n,i.path);o.mkdirSync(e.dirname(t),{recursive:!0}),o.writeFileSync(t,i.content,`utf-8`),r.push(t)}return r}export{f as createMonorepoRootFiles,d as createRootProjectFiles,p as createWorkspaceFiles,h as renderGitignore,l as renderToolchainConfig,m as renderTurboJson,u as renderWorkspaceTsconfig,g as writeGeneratedFiles};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
//#region packages/shared/src/bin.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Locating a project's own `dbx` binary.
|
|
6
|
+
*
|
|
7
|
+
* The toolchain always prefers a project-local `dbx` over a global one, so the
|
|
8
|
+
* version a project pins is the one that runs and a stale global install cannot
|
|
9
|
+
* interfere. A consumer gets this from `node_modules/.bin/dbx`; a repo that *is*
|
|
10
|
+
* the toolchain (dogfooding from source) has no such shim, so its own package
|
|
11
|
+
* `bin` is used instead.
|
|
12
|
+
*/
|
|
13
|
+
/** The published toolchain package name. */
|
|
14
|
+
export declare const TOOLCHAIN_PACKAGE = "@deltabox/toolchain";
|
|
15
|
+
/**
|
|
16
|
+
* The `bin.dbx` entry of the nearest enclosing `@deltabox/toolchain` package
|
|
17
|
+
* (walking up from `cwd`), when the file exists on disk. Used to run the
|
|
18
|
+
* toolchain repo's own CLI instead of a global `dbx`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function findOwnCliEntry(cwd?: string): string | undefined;
|
|
21
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{default as e}from"node:path";import"node:url";import.meta.url;import t from"node:fs";const n=`@deltabox/toolchain`;function r(n=process.cwd()){let r=e.resolve(n);for(;;){let n=e.join(r,`package.json`);if(t.existsSync(n))try{let i=JSON.parse(t.readFileSync(n,`utf-8`));if(i.name===`@deltabox/toolchain`){let n=typeof i.bin==`string`?i.bin:i.bin?.dbx;if(n){let i=e.resolve(r,n);if(t.existsSync(i))return i}}}catch{}let i=e.dirname(r);if(i===r)return;r=i}}export{n as TOOLCHAIN_PACKAGE,r as findOwnCliEntry};
|
|
@@ -888,17 +888,20 @@ export declare const templatesConfigSchema: z.ZodObject<{
|
|
|
888
888
|
online: z.ZodOptional<z.ZodBoolean>;
|
|
889
889
|
}, z.core.$strip>>>;
|
|
890
890
|
}, z.core.$strip>;
|
|
891
|
-
/**
|
|
891
|
+
/**
|
|
892
|
+
* Vite+ configuration: the raw `vite.config.ts` object, held under
|
|
893
|
+
* `toolchain.vite`, plus the single toolchain opt-out `config`.
|
|
894
|
+
*
|
|
895
|
+
* Every other key is passed through verbatim to the generated
|
|
896
|
+
* `vite.config.ts` (see the `vite` sync task), so `dbx.config.*` is the only
|
|
897
|
+
* hand-authored root config. `config: false` leaves a hand-written
|
|
898
|
+
* `vite.config.ts` alone.
|
|
899
|
+
*/
|
|
892
900
|
export declare const viteConfigSchema: z.ZodObject<{
|
|
893
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
894
901
|
config: z.ZodOptional<z.ZodBoolean>;
|
|
895
|
-
|
|
896
|
-
testInclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
897
|
-
lintIgnore: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
898
|
-
overrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
899
|
-
}, z.core.$strip>;
|
|
902
|
+
}, z.core.$catchall<z.ZodUnknown>>;
|
|
900
903
|
/** The full `dbx.config` schema (minus the function-bearing `hooks`). */
|
|
901
|
-
export declare const
|
|
904
|
+
export declare const toolchainConfigSchema: z.ZodObject<{
|
|
902
905
|
project: z.ZodOptional<z.ZodObject<{
|
|
903
906
|
type: z.ZodOptional<z.ZodEnum<{
|
|
904
907
|
"monorepo-root": "monorepo-root";
|
|
@@ -1262,13 +1265,8 @@ export declare const toolingConfigSchema: z.ZodObject<{
|
|
|
1262
1265
|
}, z.core.$strip>>>;
|
|
1263
1266
|
}, z.core.$strip>]>>;
|
|
1264
1267
|
vite: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
1265
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
1266
1268
|
config: z.ZodOptional<z.ZodBoolean>;
|
|
1267
|
-
|
|
1268
|
-
testInclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1269
|
-
lintIgnore: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1270
|
-
overrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1271
|
-
}, z.core.$strip>]>>;
|
|
1269
|
+
}, z.core.$catchall<z.ZodUnknown>>]>>;
|
|
1272
1270
|
watch: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
1273
1271
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
1274
1272
|
debounce: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1654,13 +1652,8 @@ export declare const dbxConfigSchema: z.ZodObject<{
|
|
|
1654
1652
|
}, z.core.$strip>>>;
|
|
1655
1653
|
}, z.core.$strip>]>>;
|
|
1656
1654
|
vite: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
1657
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
1658
1655
|
config: z.ZodOptional<z.ZodBoolean>;
|
|
1659
|
-
|
|
1660
|
-
testInclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1661
|
-
lintIgnore: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1662
|
-
overrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1663
|
-
}, z.core.$strip>]>>;
|
|
1656
|
+
}, z.core.$catchall<z.ZodUnknown>>]>>;
|
|
1664
1657
|
watch: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
1665
1658
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
1666
1659
|
debounce: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1692,7 +1685,7 @@ export declare const CONFIG_TYPE_SCHEMAS: {
|
|
|
1692
1685
|
"monorepo-workspace": "monorepo-workspace";
|
|
1693
1686
|
project: "project";
|
|
1694
1687
|
}>;
|
|
1695
|
-
readonly
|
|
1688
|
+
readonly ToolchainProjectConfig: z.ZodObject<{
|
|
1696
1689
|
type: z.ZodOptional<z.ZodEnum<{
|
|
1697
1690
|
"monorepo-root": "monorepo-root";
|
|
1698
1691
|
"monorepo-workspace": "monorepo-workspace";
|
|
@@ -2153,7 +2146,7 @@ export declare const CONFIG_TYPE_SCHEMAS: {
|
|
|
2153
2146
|
tokens: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
2154
2147
|
}, z.core.$strip>]>>;
|
|
2155
2148
|
}, z.core.$strip>;
|
|
2156
|
-
readonly
|
|
2149
|
+
readonly ToolchainChangelogConfig: z.ZodObject<{
|
|
2157
2150
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
2158
2151
|
workflows: z.ZodOptional<z.ZodObject<{
|
|
2159
2152
|
ci: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
@@ -2455,12 +2448,12 @@ export declare const CONFIG_TYPE_SCHEMAS: {
|
|
|
2455
2448
|
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2456
2449
|
vscode: z.ZodOptional<z.ZodBoolean>;
|
|
2457
2450
|
}, z.core.$strip>;
|
|
2458
|
-
readonly
|
|
2451
|
+
readonly ToolchainBiomeConfig: z.ZodObject<{
|
|
2459
2452
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
2460
2453
|
vscode: z.ZodOptional<z.ZodBoolean>;
|
|
2461
2454
|
overrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2462
2455
|
}, z.core.$strip>;
|
|
2463
|
-
readonly
|
|
2456
|
+
readonly ToolchainTsconfigConfig: z.ZodObject<{
|
|
2464
2457
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
2465
2458
|
glob: z.ZodOptional<z.ZodString>;
|
|
2466
2459
|
appGlob: z.ZodOptional<z.ZodString>;
|
|
@@ -2470,18 +2463,18 @@ export declare const CONFIG_TYPE_SCHEMAS: {
|
|
|
2470
2463
|
indent: z.ZodOptional<z.ZodNumber>;
|
|
2471
2464
|
rootFile: z.ZodOptional<z.ZodString>;
|
|
2472
2465
|
}, z.core.$strip>;
|
|
2473
|
-
readonly
|
|
2466
|
+
readonly ToolchainWatchConfig: z.ZodObject<{
|
|
2474
2467
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
2475
2468
|
debounce: z.ZodOptional<z.ZodNumber>;
|
|
2476
2469
|
}, z.core.$strip>;
|
|
2477
|
-
readonly
|
|
2470
|
+
readonly ToolchainTemplateSourceType: z.ZodEnum<{
|
|
2478
2471
|
builtin: "builtin";
|
|
2479
2472
|
git: "git";
|
|
2480
2473
|
local: "local";
|
|
2481
2474
|
npm: "npm";
|
|
2482
2475
|
"vite-plus": "vite-plus";
|
|
2483
2476
|
}>;
|
|
2484
|
-
readonly
|
|
2477
|
+
readonly ToolchainTemplateKind: z.ZodEnum<{
|
|
2485
2478
|
application: "application";
|
|
2486
2479
|
folder: "folder";
|
|
2487
2480
|
pipeline: "pipeline";
|
|
@@ -2489,7 +2482,7 @@ export declare const CONFIG_TYPE_SCHEMAS: {
|
|
|
2489
2482
|
tooling: "tooling";
|
|
2490
2483
|
workspace: "workspace";
|
|
2491
2484
|
}>;
|
|
2492
|
-
readonly
|
|
2485
|
+
readonly ToolchainTemplateSource: z.ZodObject<{
|
|
2493
2486
|
type: z.ZodEnum<{
|
|
2494
2487
|
builtin: "builtin";
|
|
2495
2488
|
git: "git";
|
|
@@ -2514,7 +2507,7 @@ export declare const CONFIG_TYPE_SCHEMAS: {
|
|
|
2514
2507
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2515
2508
|
online: z.ZodOptional<z.ZodBoolean>;
|
|
2516
2509
|
}, z.core.$strip>;
|
|
2517
|
-
readonly
|
|
2510
|
+
readonly ToolchainTemplatesConfig: z.ZodObject<{
|
|
2518
2511
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
2519
2512
|
sources: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2520
2513
|
type: z.ZodEnum<{
|
|
@@ -2542,15 +2535,10 @@ export declare const CONFIG_TYPE_SCHEMAS: {
|
|
|
2542
2535
|
online: z.ZodOptional<z.ZodBoolean>;
|
|
2543
2536
|
}, z.core.$strip>>>;
|
|
2544
2537
|
}, z.core.$strip>;
|
|
2545
|
-
readonly
|
|
2546
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
2538
|
+
readonly ToolchainViteConfig: z.ZodObject<{
|
|
2547
2539
|
config: z.ZodOptional<z.ZodBoolean>;
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
lintIgnore: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2551
|
-
overrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2552
|
-
}, z.core.$strip>;
|
|
2553
|
-
readonly ToolingLoggerConfig: z.ZodObject<{
|
|
2540
|
+
}, z.core.$catchall<z.ZodUnknown>>;
|
|
2541
|
+
readonly ToolchainLoggerConfig: z.ZodObject<{
|
|
2554
2542
|
level: z.ZodOptional<z.ZodEnum<{
|
|
2555
2543
|
debug: "debug";
|
|
2556
2544
|
error: "error";
|
|
@@ -2561,10 +2549,10 @@ export declare const CONFIG_TYPE_SCHEMAS: {
|
|
|
2561
2549
|
color: z.ZodOptional<z.ZodBoolean>;
|
|
2562
2550
|
name: z.ZodOptional<z.ZodString>;
|
|
2563
2551
|
}, z.core.$strip>;
|
|
2564
|
-
readonly
|
|
2552
|
+
readonly ToolchainProvidersConfig: z.ZodObject<{
|
|
2565
2553
|
color: z.ZodOptional<z.ZodBoolean>;
|
|
2566
2554
|
}, z.core.$strip>;
|
|
2567
|
-
readonly
|
|
2555
|
+
readonly ToolchainConfigSections: z.ZodObject<{
|
|
2568
2556
|
project: z.ZodOptional<z.ZodObject<{
|
|
2569
2557
|
type: z.ZodOptional<z.ZodEnum<{
|
|
2570
2558
|
"monorepo-root": "monorepo-root";
|
|
@@ -2928,13 +2916,8 @@ export declare const CONFIG_TYPE_SCHEMAS: {
|
|
|
2928
2916
|
}, z.core.$strip>>>;
|
|
2929
2917
|
}, z.core.$strip>]>>;
|
|
2930
2918
|
vite: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
2931
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
2932
2919
|
config: z.ZodOptional<z.ZodBoolean>;
|
|
2933
|
-
|
|
2934
|
-
testInclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2935
|
-
lintIgnore: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2936
|
-
overrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2937
|
-
}, z.core.$strip>]>>;
|
|
2920
|
+
}, z.core.$catchall<z.ZodUnknown>>]>>;
|
|
2938
2921
|
watch: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
2939
2922
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
2940
2923
|
debounce: z.ZodOptional<z.ZodNumber>;
|
|
@@ -3319,13 +3302,8 @@ export declare const CONFIG_TYPE_SCHEMAS: {
|
|
|
3319
3302
|
}, z.core.$strip>>>;
|
|
3320
3303
|
}, z.core.$strip>]>>;
|
|
3321
3304
|
vite: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
3322
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
3323
3305
|
config: z.ZodOptional<z.ZodBoolean>;
|
|
3324
|
-
|
|
3325
|
-
testInclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3326
|
-
lintIgnore: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3327
|
-
overrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3328
|
-
}, z.core.$strip>]>>;
|
|
3306
|
+
}, z.core.$catchall<z.ZodUnknown>>]>>;
|
|
3329
3307
|
watch: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
3330
3308
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
3331
3309
|
debounce: z.ZodOptional<z.ZodNumber>;
|
|
@@ -3712,13 +3690,8 @@ export declare const CONFIG_SECTION_SCHEMAS: {
|
|
|
3712
3690
|
}, z.core.$strip>>>;
|
|
3713
3691
|
}, z.core.$strip>;
|
|
3714
3692
|
readonly vite: z.ZodObject<{
|
|
3715
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
3716
3693
|
config: z.ZodOptional<z.ZodBoolean>;
|
|
3717
|
-
|
|
3718
|
-
testInclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3719
|
-
lintIgnore: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3720
|
-
overrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3721
|
-
}, z.core.$strip>;
|
|
3694
|
+
}, z.core.$catchall<z.ZodUnknown>>;
|
|
3722
3695
|
readonly watch: z.ZodObject<{
|
|
3723
3696
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
3724
3697
|
debounce: z.ZodOptional<z.ZodNumber>;
|