@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{TEMPLATE_MANIFEST as n,writeTemplateManifest as r}from"../local.js";import{parseSourceSpec as i}from"../online.js";import{addTemplateSource as a,loadTemplates as o,readTemplateRegistry as s,removeTemplateSource as c}from"../registry.js";import{scaffoldTemplate as l}from"../scaffold.js";import u from"node:fs";const
|
|
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{TEMPLATE_MANIFEST as n,writeTemplateManifest as r}from"../local.js";import{parseSourceSpec as i}from"../online.js";import{addTemplateSource as a,loadTemplates as o,readTemplateRegistry as s,removeTemplateSource as c}from"../registry.js";import{scaffoldTemplate as l}from"../scaffold.js";import u from"node:fs";import{cancel as d,isCancel as f,select as p,text as m}from"@clack/prompts";const h={flags:`--cwd <dir>`,description:`Project root (default: cwd).`},g={flags:`--kind <kind>`,description:`project | workspace | application | folder | tooling | pipeline.`};function _(e){return{id:e.id,name:e.name,...e.description?{description:e.description}:{},kind:e.kind,type:e.source.type,online:!!e.online,...e.tags?{tags:e.tags}:{},...e.variables?{variables:e.variables}:{}}}function v(e){let t={};for(let n of e??[]){let e=n.indexOf(`=`);e!==-1&&(t[n.slice(0,e)]=n.slice(e+1))}return t}function y(e){return(e??[]).map(e=>{let t=e.indexOf(`:`);return t===-1?{name:e}:{name:e.slice(0,t),default:e.slice(t+1)}})}function b(e){return!!(process.stdin.isTTY&&process.stdout.isTTY)&&e.json!==!0}function x(){d(`Cancelled.`),process.exitCode=1}function S(){return[{name:`template:list`,description:`List templates (builtin + local + opted-in online sources).`,options:[h,{flags:`--online`,description:`Resolve online sources (npm/git).`},{flags:`--offline`,description:`Force offline (skip npm/git).`},g,{flags:`--registry`,description:`List only the .dbx/toolchain/templates.json sources.`},{flags:`--json`,description:`Print the templates as JSON.`}],run:async(e,n)=>{let r=e.cwd??n.cwd;if(e.registry){let n=s(r).sources;if(e.json){t.raw(JSON.stringify(n.map(e=>({key:`${e.type}:${e.locate}`,...e})),null,4));return}if(n.length===0){t.info(`the template registry is empty.`);return}for(let e of n)t.info(` ${`${e.type}:${e.locate}`.padEnd(40)} ${e.name??e.id??``}`);return}let i=!!e.online&&!e.offline,a=await o({cwd:r,config:n.config,online:i}),c=e.kind,l=c?a.filter(e=>e.kind===c):a;if(e.json)t.raw(JSON.stringify(l.map(_),null,4));else if(l.length===0)t.info(`no templates found.`);else for(let e of l){let n=[e.kind,e.source.type,e.online?`online`:`offline`].join(`, `);t.info(` ${e.id.padEnd(24)} ${e.name} [${n}]${e.description?`\n ${e.description}`:``}`)}}},{name:`template:init`,description:`Write a template.json to a directory, making it a local template.`,args:[{name:`dir`,description:`Directory (default: cwd).`,required:!1}],options:[h,g,{flags:`--name <name>`,description:`Display name (default: folder name).`},{flags:`--description <text>`,description:`Description.`},{flags:`--var <pair...>`,description:`Variable name[:default] (repeatable).`},{flags:`--tag <tag...>`,description:`Tag (repeatable).`},{flags:`--force`,description:`Overwrite an existing template.json.`},{flags:`--add`,description:`Also record the folder in .dbx/toolchain/templates.json.`},{flags:`--json`,description:`Print the manifest as JSON.`}],run:(i,o)=>{let s=e.resolve(o.cwd,String(i.dir??`.`)),c=e.join(s,n);if(u.existsSync(c)&&!i.force)throw Error(`template.json already exists at ${c} (use --force).`);let l=y(i.var),d={name:String(i.name??e.basename(s)),kind:i.kind??`folder`,...i.description?{description:String(i.description)}:{},...l.length?{variables:l}:{},...i.tag?{tags:i.tag}:{}};r(s,d),i.add&&a(o.cwd,{type:`local`,locate:s,kind:d.kind}),i.json?t.raw(JSON.stringify(d,null,4)):(t.info(`wrote ${c}`),i.add&&t.info(`registered the folder as a template.`))}},{name:`template:add`,description:`Record a template source in .dbx/toolchain/templates.json.`,args:[{name:`source`,description:`local path | git URL | @scope/create | type:locate`}],options:[h,{flags:`--type <type>`,description:`Force: builtin | local | npm | git | vite-plus.`},{flags:`--name <name>`,description:`Display name.`},g,{flags:`--ref <ref>`,description:`Git branch/tag/commit.`},{flags:`--subdir <dir>`,description:`Subdirectory within the source.`},{flags:`--json`,description:`Print the updated registry as JSON.`}],run:(n,o)=>{let s=i(String(n.source),o.cwd);n.type&&(s.type=n.type),n.name&&(s.name=String(n.name)),n.kind&&(s.kind=n.kind),n.ref&&(s.ref=String(n.ref)),n.subdir&&(s.subdir=String(n.subdir)),s.type===`local`&&!u.existsSync(e.join(s.locate,`template.json`))&&r(s.locate,{name:s.name??e.basename(s.locate),kind:n.kind??`folder`});let c=a(o.cwd,s);n.json?t.raw(JSON.stringify(c,null,4)):t.info(`added ${s.type}:${s.locate} (${c.sources.length} source(s)).`)}},{name:`template:remove`,description:`Remove a source from .dbx/toolchain/templates.json.`,args:[{name:`id`,description:`Source id or type:locate.`}],options:[h,{flags:`--json`,description:`Print the registry as JSON.`}],run:(e,n)=>{let{registry:r,removed:i}=c(n.cwd,String(e.id));e.json?t.raw(JSON.stringify(r,null,4)):i===0?(t.error(`no source matching "${e.id}".`),process.exitCode=1):t.info(`removed ${i} source(s) (${r.sources.length} left).`)}},{name:`template:info`,description:`Show one template by id.`,args:[{name:`id`,description:`The template id.`}],options:[h,{flags:`--online`,description:`Resolve online sources.`}],run:async(e,n)=>{let r=e.cwd??n.cwd,i=(await o({cwd:r,config:n.config,online:!!e.online})).find(t=>t.id===e.id);i?t.raw(JSON.stringify(_(i),null,4)):(t.error(`unknown template "${e.id}".`),process.exitCode=1)}},{name:`create`,description:`Scaffold a project from a template (builtin, local or Vite+).`,options:[{flags:`-t, --template <id>`,description:`Template id (see template:list).`},g,{flags:`-n, --name <name>`,description:`Project / package name.`},{flags:`-s, --scope <scope>`,description:`npm scope, eg. @acme.`},{flags:`-o, --out <dir>`,description:`Output directory (default: cwd).`},h,{flags:`--var <pair...>`,description:`Template variables as key=value (repeatable).`},{flags:`--online`,description:`Resolve online templates too.`},{flags:`--json`,description:`Print the result as JSON.`}],run:async(e,n)=>{let r=e.out??n.cwd,i=e.kind,a=await o({cwd:n.cwd,config:n.config,online:!0}),s=b(e),c=String(e.template??``),u=e.name,d=e.scope;if(s&&!c&&!i){if(a.length===0)throw Error("No templates available. Pass --template <id> (see `dbx template:list`).");let e=await p({message:`Pick a template`,options:a.map(e=>({value:e.id,label:e.name,...e.description?{hint:e.description}:{}}))});if(f(e))return x();c=String(e)}if(s&&!u){let e=await m({message:`Project name`,placeholder:n.config.project?.name??`app`,defaultValue:n.config.project?.name??`app`});if(f(e))return x();u=String(e)}if(s&&!d){let e=await m({message:`npm scope (optional)`,placeholder:n.config.project?.scope??`@${u??`app`}`});if(f(e))return x();d=String(e)||void 0}let h=a.find(e=>e.id===c);if(!h&&!c&&i&&(h=a.find(e=>e.kind===i)),!h&&c&&(h={id:c,name:c,kind:i??`project`,source:{type:`vite-plus`,locate:c},online:!0}),!h)throw Error("No template selected. Pass --template <id> or --kind <kind> (see `dbx template:list`).");let g={...n.config.project,name:u??n.config.project?.name??`app`,...d?{scope:d}:{}},_=v(e.var),y=await l(h,{cwd:r,tokens:g,variables:_});if(e.json)t.raw(JSON.stringify({template:h.id,out:r,...y},null,4));else if(h.source.type===`vite-plus`||h.source.type===`npm`||h.source.type===`git`)y.code&&(process.exitCode=y.code);else for(let e of y.written)t.info(`Created ${e}`)}}]}export{S as templateCommands};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
import {
|
|
3
|
+
import { ToolchainTemplateSource } from "../../shared/src/config-types.js";
|
|
4
4
|
import "../../shared/src/index.js";
|
|
5
5
|
import { Template } from "./types.js";
|
|
6
6
|
//#region packages/template/src/online.d.ts
|
|
7
7
|
/** List the templates an npm `@scope/create` package publishes. */
|
|
8
8
|
export declare function loadNpmTemplates(pkg: string): Promise<Template[]>;
|
|
9
9
|
/** A single template backed by a git repository. */
|
|
10
|
-
export declare function gitTemplate(source:
|
|
10
|
+
export declare function gitTemplate(source: ToolchainTemplateSource): Template;
|
|
11
11
|
/**
|
|
12
12
|
* Parse a `template:add` spec: `type:locate` (eg. `local:./tpl`, `git:https://…`,
|
|
13
13
|
* `npm:@acme/create`) or an inferred source (a path that exists -> local, an
|
|
14
14
|
* `@scope/name` -> npm, a URL/scp -> git).
|
|
15
15
|
*/
|
|
16
|
-
export declare function parseSourceSpec(spec: string, cwd?: string):
|
|
16
|
+
export declare function parseSourceSpec(spec: string, cwd?: string): ToolchainTemplateSource;
|
|
17
17
|
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { ToolchainTemplateSource } from "../../shared/src/config-types.js";
|
|
4
|
+
import { ToolchainConfig } from "../../shared/src/toolchain.js";
|
|
5
5
|
import "../../shared/src/index.js";
|
|
6
6
|
import { Template } from "./types.js";
|
|
7
7
|
//#region packages/template/src/registry.d.ts
|
|
@@ -10,14 +10,14 @@ export declare const REGISTRY_DIR = ".dbx/toolchain";
|
|
|
10
10
|
export declare const REGISTRY_FILE = "templates.json";
|
|
11
11
|
/** The on-disk registry of template sources. */
|
|
12
12
|
export interface TemplateRegistry {
|
|
13
|
-
sources:
|
|
13
|
+
sources: ToolchainTemplateSource[];
|
|
14
14
|
}
|
|
15
15
|
/** Read `<cwd>/.dbx/toolchain/templates.json` (empty when missing/invalid). */
|
|
16
16
|
export declare function readTemplateRegistry(cwd: string): TemplateRegistry;
|
|
17
17
|
/** Write `<cwd>/.dbx/toolchain/templates.json`. */
|
|
18
|
-
export declare function writeTemplateRegistry(cwd: string, sources:
|
|
18
|
+
export declare function writeTemplateRegistry(cwd: string, sources: ToolchainTemplateSource[]): void;
|
|
19
19
|
/** Append a source to the registry, deduplicating on `type:locate`. */
|
|
20
|
-
export declare function addTemplateSource(cwd: string, source:
|
|
20
|
+
export declare function addTemplateSource(cwd: string, source: ToolchainTemplateSource): TemplateRegistry;
|
|
21
21
|
/**
|
|
22
22
|
* Remove a source from the registry by `type:locate` (or by id). Returns the
|
|
23
23
|
* updated registry and how many sources were removed.
|
|
@@ -30,16 +30,16 @@ export interface LoadTemplatesOptions {
|
|
|
30
30
|
/** Project root. */
|
|
31
31
|
cwd: string;
|
|
32
32
|
/** The loaded tooling config (its `templates.sources` are included). */
|
|
33
|
-
config?:
|
|
33
|
+
config?: ToolchainConfig;
|
|
34
34
|
/** Resolve online sources (`npm`/`git`). Default: false. */
|
|
35
35
|
online?: boolean;
|
|
36
36
|
/** Include the builtin templates (default: true). */
|
|
37
37
|
builtin?: boolean;
|
|
38
38
|
/** Extra sources on top of the config + registry. */
|
|
39
|
-
sources?:
|
|
39
|
+
sources?: ToolchainTemplateSource[];
|
|
40
40
|
}
|
|
41
41
|
/** Every source considered: builtin + config `templates.sources` + registry + extras. */
|
|
42
|
-
export declare function collectSources(options: LoadTemplatesOptions):
|
|
42
|
+
export declare function collectSources(options: LoadTemplatesOptions): ToolchainTemplateSource[];
|
|
43
43
|
/**
|
|
44
44
|
* Resolve every template: builtin, local directories (offline, always), and —
|
|
45
45
|
* when `online` — npm `@scope/create` manifests + git repositories.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
import {
|
|
3
|
+
import { ToolchainTemplateKind, ToolchainTemplateSource } from "../../shared/src/config-types.js";
|
|
4
4
|
import "../../shared/src/index.js";
|
|
5
5
|
//#region packages/template/src/types.d.ts
|
|
6
6
|
/** What a template produces (shared with the registry source model). */
|
|
7
|
-
export type TemplateKind =
|
|
7
|
+
export type TemplateKind = ToolchainTemplateKind;
|
|
8
8
|
/** A value a local template prompts for / substitutes. */
|
|
9
9
|
export interface TemplateVariable {
|
|
10
10
|
/** The token name (also the `{{ token }}` used in files). */
|
|
@@ -23,7 +23,7 @@ export interface Template {
|
|
|
23
23
|
description?: string;
|
|
24
24
|
kind: TemplateKind;
|
|
25
25
|
/** How/where the template is loaded from. */
|
|
26
|
-
source:
|
|
26
|
+
source: ToolchainTemplateSource;
|
|
27
27
|
tags?: string[];
|
|
28
28
|
/** Whether creating from it needs network access. */
|
|
29
29
|
online?: boolean;
|
|
@@ -1,11 +1,11 @@
|
|
|
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/tsconfig/src/cli/index.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* The `tsconfig` command. Defaults come from `dbx.config.tsconfig.*;
|
|
8
8
|
* (via the command context); any CLI flag overrides them.
|
|
9
9
|
*/
|
|
10
|
-
export declare function tsconfigCommands():
|
|
10
|
+
export declare function tsconfigCommands(): ToolchainCommand[];
|
|
11
11
|
//#endregion
|
|
@@ -1,11 +1,11 @@
|
|
|
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/tsdown/src/cli/index.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* The cleanup commands (`cleanup`, `cleanup:turbo`). The working directory
|
|
8
8
|
* comes from `context.cwd` (the root the config was loaded from).
|
|
9
9
|
*/
|
|
10
|
-
export declare function cleanupCommands():
|
|
10
|
+
export declare function cleanupCommands(): ToolchainCommand[];
|
|
11
11
|
//#endregion
|
|
@@ -1,12 +1,12 @@
|
|
|
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
|
import { resolveVpCommand } from "../commands.js";
|
|
6
6
|
//#region packages/vite/src/cli/index.d.ts
|
|
7
7
|
/** The guard key for a `run` invocation, or `undefined` for other commands. */
|
|
8
8
|
export declare function runGuard(args: string[], cwd: string): string | undefined;
|
|
9
9
|
/** Every Vite+ passthrough command (the generic `vite` + one per subcommand). */
|
|
10
|
-
export declare function viteCommands():
|
|
10
|
+
export declare function viteCommands(): ToolchainCommand[];
|
|
11
11
|
//#endregion
|
|
12
12
|
export { resolveVpCommand };
|
|
@@ -2,8 +2,9 @@ import __tsdown_shims_path from 'node:path';
|
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
3
|
import { VP_COMMANDS, VpCommandInfo, VpGroup, resolveVpCommand, viteCommandName } from "./commands.js";
|
|
4
4
|
import { runGuard, viteCommands } from "./cli/index.js";
|
|
5
|
-
import { DBX_TASKS, DbxPluginOptions, DbxSource,
|
|
5
|
+
import { DBX_TASKS, DbxPluginOptions, DbxSource, ResolvedDbx, dbx, resolveDbx, runDbx } from "./plugin.js";
|
|
6
6
|
import { viteProvider } from "./provider.js";
|
|
7
|
-
import {
|
|
7
|
+
import { ResolveViteOptions, resolveVite } from "./resolve.js";
|
|
8
|
+
import { VITE_CONFIG_SHIM, renderViteConfig, viteConfigObject, viteSyncTask } from "./sync.js";
|
|
8
9
|
import { ResolvedVp, RunVpOptions, VpResult, VpSource, describeVp, hasVp, resolveVp, runVp, vpVersion, which } from "./vp.js";
|
|
9
|
-
export { DBX_TASKS,
|
|
10
|
+
export { DBX_TASKS, DbxPluginOptions, DbxSource, ResolveViteOptions, ResolvedDbx, ResolvedVp, RunVpOptions, VITE_CONFIG_SHIM, VP_COMMANDS, VpCommandInfo, VpGroup, VpResult, VpSource, dbx, describeVp, hasVp, renderViteConfig, resolveDbx, resolveVite, resolveVp, resolveVpCommand, runDbx, runGuard, runVp, viteCommandName, viteCommands, viteConfigObject, viteProvider, viteSyncTask, vpVersion, which };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node:path";import"node:url";import.meta.url;import{VP_COMMANDS as e,resolveVpCommand as t,viteCommandName as n}from"./commands.js";import{describeVp as r,hasVp as i,resolveVp as a,runVp as o,vpVersion as s,which as c}from"./vp.js";import{runGuard as l,viteCommands as u}from"./cli/index.js";import{DBX_TASKS as d,dbx as f,
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;import{VP_COMMANDS as e,resolveVpCommand as t,viteCommandName as n}from"./commands.js";import{describeVp as r,hasVp as i,resolveVp as a,runVp as o,vpVersion as s,which as c}from"./vp.js";import{runGuard as l,viteCommands as u}from"./cli/index.js";import{DBX_TASKS as d,dbx as f,resolveDbx as p,runDbx as m}from"./plugin.js";import{viteProvider as h}from"./provider.js";import{VITE_CONFIG_SHIM as g,renderViteConfig as _,viteConfigObject as v,viteSyncTask as y}from"./sync.js";import{resolveVite as b}from"./resolve.js";export{d as DBX_TASKS,g as VITE_CONFIG_SHIM,e as VP_COMMANDS,f as dbx,r as describeVp,i as hasVp,_ as renderViteConfig,p as resolveDbx,b as resolveVite,a as resolveVp,t as resolveVpCommand,m as runDbx,l as runGuard,o as runVp,n as viteCommandName,u as viteCommands,v as viteConfigObject,h as viteProvider,y as viteSyncTask,s as vpVersion,c as which};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
import { Plugin
|
|
3
|
+
import { Plugin } from "/home/runner/work/toolchain/toolchain/node_modules/vite/dist/node/index.js";
|
|
4
4
|
//#region packages/vite/src/plugin.d.ts
|
|
5
5
|
/** How a `dbx` binary was resolved. */
|
|
6
6
|
export type DbxSource = 'local' | 'global' | 'npx';
|
|
@@ -14,8 +14,11 @@ export interface ResolvedDbx {
|
|
|
14
14
|
source: DbxSource;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
* Resolve the `dbx` binary
|
|
18
|
-
* `
|
|
17
|
+
* Resolve the `dbx` binary, always preferring the project's own over a global
|
|
18
|
+
* install: `DBX_BIN` override -> project-local shim -> the repo's own
|
|
19
|
+
* `@deltabox/toolchain` bin -> global `PATH` -> `npx --yes @deltabox/toolchain`.
|
|
20
|
+
* A project-local binary is what the project pins, so a stale global `dbx` can
|
|
21
|
+
* never be used by accident.
|
|
19
22
|
*/
|
|
20
23
|
export declare function resolveDbx(cwd?: string): ResolvedDbx;
|
|
21
24
|
/** Run `dbx <args>` in `cwd`, streaming output. Resolves with the exit code. */
|
|
@@ -47,19 +50,8 @@ export interface DbxPluginOptions {
|
|
|
47
50
|
/**
|
|
48
51
|
* A Vite / Vite+ plugin that runs `@deltabox/toolchain` in the Vite pipeline:
|
|
49
52
|
* `dbx sync` before dev/build (or `dbx sync --check` in CI) and a debounced
|
|
50
|
-
* re-sync when a dbx input changes. Add it to `plugins
|
|
51
|
-
*
|
|
53
|
+
* re-sync when a dbx input changes. Add it to `plugins`; spread {@link DBX_TASKS}
|
|
54
|
+
* into `run.tasks` for the `vp run dbx:*` tasks.
|
|
52
55
|
*/
|
|
53
56
|
export declare function dbx(options?: DbxPluginOptions): Plugin;
|
|
54
|
-
/** A Vite+ config: Vite's `UserConfig` plus the Vite+ `run` block. */
|
|
55
|
-
export type DbxViteConfig = UserConfig & {
|
|
56
|
-
run?: {
|
|
57
|
-
tasks?: Record<string, unknown>;
|
|
58
|
-
} & Record<string, unknown>;
|
|
59
|
-
};
|
|
60
|
-
/**
|
|
61
|
-
* Wrap a Vite+ config with dbx: prepend the {@link dbx} plugin and register the
|
|
62
|
-
* `dbx:sync` / `dbx:check` tasks.
|
|
63
|
-
*/
|
|
64
|
-
export declare function defineDbxConfig(config: DbxViteConfig, options?: DbxPluginOptions): DbxViteConfig;
|
|
65
57
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as e}from"node:path";import"node:url";import.meta.url;import{
|
|
1
|
+
import{default as e}from"node:path";import"node:url";import.meta.url;import{findOwnCliEntry as t}from"../../shared/src/bin.js";import{spawnCross as n}from"../../shared/src/run.js";import"../../shared/src/index.js";import{which as r}from"./vp.js";import i from"node:fs";const a=process.platform===`win32`;function o(t){let n=e.join(t,`node_modules`,`.bin`,`dbx`);return a?[`${n}.cmd`,`${n}.exe`,`${n}.ps1`,n]:[n]}function s(e=process.cwd()){let n=process.env.DBX_BIN;if(n)return{exe:n,args:[],source:`local`};for(let t of o(e))if(i.existsSync(t))return{exe:t,args:[],source:`local`};let s=t(e);if(s)return{exe:process.execPath,args:[s],source:`local`};let c=r(`dbx`);return c?{exe:c,args:[],source:`global`}:{exe:a?`npx.cmd`:`npx`,args:[`--yes`,`@deltabox/toolchain`],source:`npx`}}function c(e,t=process.cwd()){let r=s(t);return new Promise(i=>{let a=n(r.exe,[...r.args,...e],{cwd:t,env:process.env,stdio:`inherit`});a.on(`error`,()=>i(1)),a.on(`exit`,e=>i(e??0))})}const l={"dbx:sync":{command:`dbx sync`},"dbx:check":{command:`dbx sync --check`}},u=[/dbx\.config\.[cm]?[jt]s$/,/tsconfig\.(?:default|monorepo)\.json$/];function d(e={}){let t=e.check??!!process.env.CI,n=e.sync??!0,r=e.watch??!0,i=e.debounce??150,a=e.cwd??process.cwd(),o,s=!1,l=async()=>{if(!s){s=!0;try{await c([`sync`],a)}finally{s=!1}}},d=()=>{o&&clearTimeout(o),o=setTimeout(()=>{l()},i)};return{name:`deltabox-toolchain`,enforce:`pre`,configResolved(t){a=e.cwd??t.root},async buildStart(){t?await c([`sync`,`--check`],a)!==0&&this.error("deltabox-toolchain: generated files are out of date — run `dbx sync`."):n&&await l()},watchChange(e){r&&n&&u.some(t=>t.test(e))&&d()}}}export{l as DBX_TASKS,d as dbx,s as resolveDbx,c as runDbx};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
import {
|
|
3
|
+
import { ToolchainProvider } from "../../shared/src/provider.js";
|
|
4
4
|
import "../../shared/src/index.js";
|
|
5
5
|
//#region packages/vite/src/provider.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Build the Vite+ provider descriptor. The command list mirrors {@link VP_COMMANDS}
|
|
8
8
|
* so the CLI and the extension stay in sync automatically.
|
|
9
9
|
*/
|
|
10
|
-
export declare function viteProvider():
|
|
10
|
+
export declare function viteProvider(): ToolchainProvider;
|
|
11
11
|
//#endregion
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { DbxConfig } from "../../shared/src/toolchain.js";
|
|
4
|
+
import "../../shared/src/index.js";
|
|
5
|
+
import { ViteUserConfig } from "vite-plus";
|
|
6
|
+
//#region packages/vite/src/resolve.d.ts
|
|
7
|
+
export interface ResolveViteOptions {
|
|
8
|
+
/** Project root to look for `dbx.config.*` in (default: `process.cwd()`). */
|
|
9
|
+
cwd?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Resolve the Vite+ config from `dbx.config.*`'s `toolchain.vite`.
|
|
13
|
+
*
|
|
14
|
+
* Returns a promise (the config file is imported asynchronously). Vite awaits a
|
|
15
|
+
* config's default export, so `export default defineConfig(resolveVite())` works
|
|
16
|
+
* — the promise is resolved before the config is used.
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveVite(dbxConfig?: DbxConfig, options?: ResolveViteOptions): Promise<ViteUserConfig>;
|
|
19
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;import{applyReplacementsDeep as e}from"../../shared/src/template.js";import{resolveTokens as t,sectionConfig as n}from"../../shared/src/toolchain.js";import"../../shared/src/index.js";import{loadToolchainConfig as r}from"../../core/src/loader.js";import"../../core/src/index.js";import{viteConfigObject as i}from"./sync.js";async function a(a,o={}){let s;if(a)s=a.toolchain??{};else{let e=await r(o.cwd??process.cwd());if(!e.path)throw Error(`resolveVite: no dbx.config.* found — create one, or pass a config to resolveVite().`);s=e.config}let c=n(s.vite)??{};return e(i(c),t(s))}export{a as resolveVite};
|
|
@@ -1,25 +1,21 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
import {
|
|
4
|
-
import { ToolingViteConfig } from "../../shared/src/config-types.js";
|
|
3
|
+
import { ToolchainViteConfig } from "../../shared/src/config-types.js";
|
|
5
4
|
import { SyncTask } from "../../shared/src/toolchain.js";
|
|
6
5
|
import "../../shared/src/index.js";
|
|
7
6
|
//#region packages/vite/src/sync.d.ts
|
|
8
|
-
/** The
|
|
9
|
-
export declare
|
|
10
|
-
/** The default Oxlint ignore globs. */
|
|
11
|
-
export declare const DEFAULT_LINT_IGNORE: string[];
|
|
7
|
+
/** The `vite` section with the toolchain opt-out (`config`) removed. */
|
|
8
|
+
export declare function viteConfigObject(config?: ToolchainViteConfig): Record<string, unknown>;
|
|
12
9
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* consumer's `overrides` deep-merged on top and `{{ token }}`s resolved.
|
|
10
|
+
* The managed `vite.config.ts`: a header, the imports and a one-line shim that
|
|
11
|
+
* resolves the real config from `dbx.config.*` at load time.
|
|
16
12
|
*/
|
|
17
|
-
export declare
|
|
18
|
-
/**
|
|
19
|
-
export declare function renderViteConfig(
|
|
13
|
+
export declare const VITE_CONFIG_SHIM: string;
|
|
14
|
+
/** The managed `vite.config.ts` source (a fixed shim). */
|
|
15
|
+
export declare function renderViteConfig(): string;
|
|
20
16
|
/**
|
|
21
|
-
* The vite sync task: writes `vite.config.ts` when the `vite` section is
|
|
22
|
-
* (and `config` is not `false`). Runs for every project kind.
|
|
17
|
+
* The vite sync task: writes the `vite.config.ts` shim when the `vite` section is
|
|
18
|
+
* enabled (and `config` is not `false`). Runs for every project kind.
|
|
23
19
|
*/
|
|
24
20
|
export declare function viteSyncTask(): SyncTask;
|
|
25
21
|
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"node:path";import"node:url";import.meta.url;import{
|
|
2
|
-
`)
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;import{sectionConfig as e,sectionEnabled as t}from"../../shared/src/toolchain.js";import"../../shared/src/index.js";function n(e={}){let{config:t,...n}=e;return n}const r=["// Generated by @deltabox/toolchain — edit the vite section in dbx.config and run `dbx sync`.",`import { resolveVite } from '@deltabox/toolchain/vite';`,`import { defineConfig } from 'vite-plus';`,``,`export default defineConfig(resolveVite());`,``].join(`
|
|
2
|
+
`);function i(){return r}function a(){return{name:`vite`,projectTypes:[`monorepo-root`,`monorepo-workspace`,`project`],enabled:e=>t(e.vite),run:t=>(e(t.config.vite)??{}).config===!1?[]:[{path:`vite.config.ts`,content:i()}]}}export{r as VITE_CONFIG_SHIM,i as renderViteConfig,n as viteConfigObject,a as viteSyncTask};
|
package/dist/project.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ import __tsdown_shims_path from 'node:path';
|
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
3
|
import { projectCommands } from "./packages/project/src/cli/index.js";
|
|
4
4
|
import { GENERATED_CONFIG_FILENAME, GenerateProjectConfigsOptions, GenerateProjectConfigsResult, GeneratedProjectConfig, generateProjectConfigs } from "./packages/project/src/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 "./packages/project/src/typescript.js";
|
|
6
6
|
import "./packages/project/src/index.js";
|
|
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 };
|
package/dist/project.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node:path";import"node:url";import.meta.url;import{createMonorepoRootFiles as e,createRootProjectFiles as t,createWorkspaceFiles as n,renderGitignore as r,
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;import{createMonorepoRootFiles as e,createRootProjectFiles as t,createWorkspaceFiles as n,renderGitignore as r,renderToolchainConfig as i,renderTurboJson as a,renderWorkspaceTsconfig as o,writeGeneratedFiles as s}from"./packages/project/src/typescript.js";import{GENERATED_CONFIG_FILENAME as c,generateProjectConfigs as l}from"./packages/project/src/config.js";import{projectCommands as u}from"./packages/project/src/cli/index.js";import"./packages/project/src/index.js";export{c as GENERATED_CONFIG_FILENAME,e as createMonorepoRootFiles,t as createRootProjectFiles,n as createWorkspaceFiles,l as generateProjectConfigs,u as projectCommands,r as renderGitignore,i as renderToolchainConfig,a as renderTurboJson,o as renderWorkspaceTsconfig,s as writeGeneratedFiles};
|
package/dist/providers.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
import {
|
|
3
|
+
import { ToolchainProvider, ToolchainProviderAction, ToolchainProviderCommand, providerActions } from "./packages/shared/src/provider.js";
|
|
4
4
|
import "./packages/shared/src/index.js";
|
|
5
5
|
import { viteProvider } from "./packages/vite/src/provider.js";
|
|
6
6
|
import "./packages/vite/src/index.js";
|
|
7
7
|
//#region src/providers.d.ts
|
|
8
|
-
/**
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* The registered providers: the built-ins, then any custom ones from the
|
|
10
|
+
* project's registry (`.dbx/toolchain/providers.json`), deduped by id. Each
|
|
11
|
+
* carries its resolved actions (defaults applied).
|
|
12
|
+
*/
|
|
13
|
+
export declare function toolchainProviders(cwd?: string): ToolchainProvider[];
|
|
10
14
|
//#endregion
|
|
11
|
-
export { type
|
|
15
|
+
export { type ToolchainProvider, type ToolchainProviderAction, type ToolchainProviderCommand, providerActions, viteProvider };
|
package/dist/providers.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node:path";import"node:url";import.meta.url;import{providerActions as e}from"./packages/shared/src/provider.js";import"./packages/shared/src/index.js";import{
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;import{providerActions as e}from"./packages/shared/src/provider.js";import"./packages/shared/src/index.js";import{readProviderRegistry as t}from"./packages/core/src/provider-registry.js";import"./packages/core/src/index.js";import{viteProvider as n}from"./packages/vite/src/provider.js";import"./packages/vite/src/index.js";function r(r=process.cwd()){let i=/* @__PURE__ */ new Set,a=[];for(let o of[n(),...t(r)])i.has(o.id)||(i.add(o.id),a.push({...o,actions:e(o)}));return a}export{e as providerActions,r as toolchainProviders,n as viteProvider};
|
package/dist/shared.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { TOOLCHAIN_PACKAGE, findOwnCliEntry } from "./packages/shared/src/bin.js";
|
|
3
4
|
import { mergeJsonAt, readJsonAt, readJsonFile, toJson, writeJsonFile } from "./packages/shared/src/fs-utils.js";
|
|
4
5
|
import { Colors, LOG_LEVELS, LogChannel, LogLevel, Logger, LoggerConfig, LoggerOptions, configureLogger, createLogger, getLogOverrides, getLogger, isLogLevel, logger, normalizeLogLevel, setLogConfig, setLogOverrides, stripAnsi } from "./packages/shared/src/logger.js";
|
|
5
6
|
import { Sortable, deepMerge, isPlainObject, mapValues, resolveSort, sort } from "./packages/shared/src/object-utils.js";
|
|
6
|
-
import {
|
|
7
|
+
import { ToolchainProvider, ToolchainProviderAction, ToolchainProviderCommand, providerActions } from "./packages/shared/src/provider.js";
|
|
7
8
|
import { RunOptions, run, spawnCross } from "./packages/shared/src/run.js";
|
|
8
9
|
import { asString, camelCase, camelCaseId, capitalize, constantCase, ensureLeadingSlash, ensureSlashes, ensureTrailingSlash, formatCliFlag, hasText, indent, isLocalhost, kebabCase, pascalCase, removeDoubleSlashes, removeLeadingSlash, removeTrailingSlash, sanitizeSlashes, snakeCase, str, titleCase } from "./packages/shared/src/string-utils.js";
|
|
9
10
|
import { ReplacementOptions, ReplacementValue, Replacements, Replacer, applyReplacements, applyReplacementsDeep, createReplacer, defineReplacements, extractTokens, hasUnresolvedTokens, tokenPattern } from "./packages/shared/src/template.js";
|
|
10
|
-
import { ChangelogWorkflowsConfig, DbxConfigSections, ProjectType,
|
|
11
|
-
import { Awaitable, GeneratedFile, JsonValue, PackageJson,
|
|
12
|
-
import { CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, biomeConfigSchema, changelogConfigSchema, changelogWorkflowsConfigSchema, dbxConfigSchema, loggerConfigSchema, projectConfigSchema, projectTypeSchema, providersConfigSchema, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema,
|
|
13
|
-
import { CONFIG_FILE_NAMES, DbxConfig, ManagedFile, SyncContext, SyncSummary, SyncTask,
|
|
11
|
+
import { ChangelogWorkflowsConfig, DbxConfigSections, ProjectType, ToolchainBiomeConfig, ToolchainChangelogConfig, ToolchainConfigSections, ToolchainLoggerConfig, ToolchainProjectConfig, ToolchainProvidersConfig, ToolchainTemplateKind, ToolchainTemplateSource, ToolchainTemplateSourceType, ToolchainTemplatesConfig, ToolchainTsconfigConfig, ToolchainViteConfig, ToolchainWatchConfig, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig } from "./packages/shared/src/config-types.js";
|
|
12
|
+
import { Awaitable, GeneratedFile, JsonValue, PackageJson, ToolchainArgument, ToolchainCommand, ToolchainCommandContext, ToolchainOption } from "./packages/shared/src/types.js";
|
|
13
|
+
import { CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, biomeConfigSchema, changelogConfigSchema, changelogWorkflowsConfigSchema, dbxConfigSchema, loggerConfigSchema, projectConfigSchema, projectTypeSchema, providersConfigSchema, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema } from "./packages/shared/src/config-schema.js";
|
|
14
|
+
import { CONFIG_FILE_NAMES, DbxConfig, ManagedFile, SyncContext, SyncSummary, SyncTask, ToolchainConfig, ToolchainHooks, ToolchainSection, defineConfig, repoSlugFromUrl, resolveTokens, sectionConfig, sectionEnabled } from "./packages/shared/src/toolchain.js";
|
|
14
15
|
import { YamlValue, toYaml } from "./packages/shared/src/yaml.js";
|
|
15
16
|
import "./packages/shared/src/index.js";
|
|
16
|
-
export { Awaitable, CONFIG_FILE_NAMES, CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, ChangelogWorkflowsConfig, Colors, DbxConfig, DbxConfigSections, GeneratedFile, JsonValue, LOG_LEVELS, LogChannel, LogLevel, Logger, LoggerConfig, LoggerOptions, ManagedFile, PackageJson, ProjectType, ReplacementOptions, ReplacementValue, Replacements, Replacer, RunOptions, Sortable, SyncContext, SyncSummary, SyncTask,
|
|
17
|
+
export { Awaitable, CONFIG_FILE_NAMES, CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, ChangelogWorkflowsConfig, Colors, DbxConfig, DbxConfigSections, GeneratedFile, JsonValue, LOG_LEVELS, LogChannel, LogLevel, Logger, LoggerConfig, LoggerOptions, ManagedFile, PackageJson, ProjectType, ReplacementOptions, ReplacementValue, Replacements, Replacer, RunOptions, Sortable, SyncContext, SyncSummary, SyncTask, TOOLCHAIN_PACKAGE, ToolchainArgument, ToolchainBiomeConfig, ToolchainChangelogConfig, ToolchainCommand, ToolchainCommandContext, ToolchainConfig, ToolchainConfigSections, ToolchainHooks, ToolchainLoggerConfig, ToolchainOption, ToolchainProjectConfig, ToolchainProvider, ToolchainProviderAction, ToolchainProviderCommand, ToolchainProvidersConfig, ToolchainSection, ToolchainTemplateKind, ToolchainTemplateSource, ToolchainTemplateSourceType, ToolchainTemplatesConfig, ToolchainTsconfigConfig, ToolchainViteConfig, ToolchainWatchConfig, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig, type YamlValue, applyReplacements, applyReplacementsDeep, asString, biomeConfigSchema, camelCase, camelCaseId, capitalize, changelogConfigSchema, changelogWorkflowsConfigSchema, configureLogger, constantCase, createLogger, createReplacer, dbxConfigSchema, deepMerge, defineConfig, defineReplacements, ensureLeadingSlash, ensureSlashes, ensureTrailingSlash, extractTokens, findOwnCliEntry, formatCliFlag, getLogOverrides, getLogger, hasText, hasUnresolvedTokens, indent, isLocalhost, isLogLevel, isPlainObject, kebabCase, logger, loggerConfigSchema, mapValues, mergeJsonAt, normalizeLogLevel, pascalCase, projectConfigSchema, projectTypeSchema, providerActions, providersConfigSchema, readJsonAt, readJsonFile, removeDoubleSlashes, removeLeadingSlash, removeTrailingSlash, repoSlugFromUrl, resolveSort, resolveTokens, run, sanitizeSlashes, sectionConfig, sectionEnabled, setLogConfig, setLogOverrides, snakeCase, sort, spawnCross, str, stripAnsi, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, titleCase, toJson, toYaml, tokenPattern, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema, writeJsonFile };
|
package/dist/shared.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node:path";import"node:url";import.meta.url;import{
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;import{TOOLCHAIN_PACKAGE as e,findOwnCliEntry as t}from"./packages/shared/src/bin.js";import{deepMerge as n,isPlainObject as r,mapValues as i,resolveSort as a,sort as o}from"./packages/shared/src/object-utils.js";import{mergeJsonAt as s,readJsonAt as c,readJsonFile as l,toJson as u,writeJsonFile as d}from"./packages/shared/src/fs-utils.js";import{LOG_LEVELS as f,configureLogger as p,createLogger as m,getLogOverrides as h,getLogger as g,isLogLevel as _,logger as v,normalizeLogLevel as y,setLogConfig as b,setLogOverrides as x,stripAnsi as S}from"./packages/shared/src/logger.js";import{providerActions as C}from"./packages/shared/src/provider.js";import{run as w,spawnCross as T}from"./packages/shared/src/run.js";import{asString as E,camelCase as D,camelCaseId as O,capitalize as k,constantCase as A,ensureLeadingSlash as j,ensureSlashes as M,ensureTrailingSlash as N,formatCliFlag as P,hasText as F,indent as I,isLocalhost as L,kebabCase as R,pascalCase as z,removeDoubleSlashes as B,removeLeadingSlash as V,removeTrailingSlash as H,sanitizeSlashes as U,snakeCase as W,str as G,titleCase as K}from"./packages/shared/src/string-utils.js";import{applyReplacements as q,applyReplacementsDeep as J,createReplacer as Y,defineReplacements as X,extractTokens as Z,hasUnresolvedTokens as Q,tokenPattern as $}from"./packages/shared/src/template.js";import{CONFIG_SECTION_DESCRIPTIONS as ee,CONFIG_SECTION_SCHEMAS as te,CONFIG_TYPE_SCHEMAS as ne,biomeConfigSchema as re,changelogConfigSchema as ie,changelogWorkflowsConfigSchema as ae,dbxConfigSchema as oe,loggerConfigSchema as se,projectConfigSchema as ce,projectTypeSchema as le,providersConfigSchema as ue,templateKindSchema as de,templateSourceSchema as fe,templateSourceTypeSchema as pe,templatesConfigSchema as me,toolchainConfigSchema as he,tsconfigConfigSchema as ge,viteConfigSchema as _e,watchConfigSchema as ve,workflowConfigSchema as ye,workflowSettingSchema as be,workflowStepSchema as xe,workflowStepsConfigSchema as Se}from"./packages/shared/src/config-schema.js";import{CONFIG_FILE_NAMES as Ce,defineConfig as we,repoSlugFromUrl as Te,resolveTokens as Ee,sectionConfig as De,sectionEnabled as Oe}from"./packages/shared/src/toolchain.js";import{toYaml as ke}from"./packages/shared/src/yaml.js";import"./packages/shared/src/index.js";export{Ce as CONFIG_FILE_NAMES,ee as CONFIG_SECTION_DESCRIPTIONS,te as CONFIG_SECTION_SCHEMAS,ne as CONFIG_TYPE_SCHEMAS,f as LOG_LEVELS,e as TOOLCHAIN_PACKAGE,q as applyReplacements,J as applyReplacementsDeep,E as asString,re as biomeConfigSchema,D as camelCase,O as camelCaseId,k as capitalize,ie as changelogConfigSchema,ae as changelogWorkflowsConfigSchema,p as configureLogger,A as constantCase,m as createLogger,Y as createReplacer,oe as dbxConfigSchema,n as deepMerge,we as defineConfig,X as defineReplacements,j as ensureLeadingSlash,M as ensureSlashes,N as ensureTrailingSlash,Z as extractTokens,t as findOwnCliEntry,P as formatCliFlag,h as getLogOverrides,g as getLogger,F as hasText,Q as hasUnresolvedTokens,I as indent,L as isLocalhost,_ as isLogLevel,r as isPlainObject,R as kebabCase,v as logger,se as loggerConfigSchema,i as mapValues,s as mergeJsonAt,y as normalizeLogLevel,z as pascalCase,ce as projectConfigSchema,le as projectTypeSchema,C as providerActions,ue as providersConfigSchema,c as readJsonAt,l as readJsonFile,B as removeDoubleSlashes,V as removeLeadingSlash,H as removeTrailingSlash,Te as repoSlugFromUrl,a as resolveSort,Ee as resolveTokens,w as run,U as sanitizeSlashes,De as sectionConfig,Oe as sectionEnabled,b as setLogConfig,x as setLogOverrides,W as snakeCase,o as sort,T as spawnCross,G as str,S as stripAnsi,de as templateKindSchema,fe as templateSourceSchema,pe as templateSourceTypeSchema,me as templatesConfigSchema,K as titleCase,u as toJson,ke as toYaml,$ as tokenPattern,he as toolchainConfigSchema,ge as tsconfigConfigSchema,_e as viteConfigSchema,ve as watchConfigSchema,ye as workflowConfigSchema,be as workflowSettingSchema,xe as workflowStepSchema,Se as workflowStepsConfigSchema,d as writeJsonFile};
|
package/dist/vite.d.ts
CHANGED
|
@@ -2,9 +2,10 @@ import __tsdown_shims_path from 'node:path';
|
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
3
|
import { VP_COMMANDS, VpCommandInfo, VpGroup, resolveVpCommand, viteCommandName } from "./packages/vite/src/commands.js";
|
|
4
4
|
import { runGuard, viteCommands } from "./packages/vite/src/cli/index.js";
|
|
5
|
-
import { DBX_TASKS, DbxPluginOptions, DbxSource,
|
|
5
|
+
import { DBX_TASKS, DbxPluginOptions, DbxSource, ResolvedDbx, dbx, resolveDbx, runDbx } from "./packages/vite/src/plugin.js";
|
|
6
6
|
import { viteProvider } from "./packages/vite/src/provider.js";
|
|
7
|
-
import {
|
|
7
|
+
import { ResolveViteOptions, resolveVite } from "./packages/vite/src/resolve.js";
|
|
8
|
+
import { VITE_CONFIG_SHIM, renderViteConfig, viteConfigObject, viteSyncTask } from "./packages/vite/src/sync.js";
|
|
8
9
|
import { ResolvedVp, RunVpOptions, VpResult, VpSource, describeVp, hasVp, resolveVp, runVp, vpVersion, which } from "./packages/vite/src/vp.js";
|
|
9
10
|
import "./packages/vite/src/index.js";
|
|
10
|
-
export { DBX_TASKS,
|
|
11
|
+
export { DBX_TASKS, DbxPluginOptions, DbxSource, ResolveViteOptions, ResolvedDbx, ResolvedVp, RunVpOptions, VITE_CONFIG_SHIM, VP_COMMANDS, VpCommandInfo, VpGroup, VpResult, VpSource, dbx, describeVp, hasVp, renderViteConfig, resolveDbx, resolveVite, resolveVp, resolveVpCommand, runDbx, runGuard, runVp, viteCommandName, viteCommands, viteConfigObject, viteProvider, viteSyncTask, vpVersion, which };
|
package/dist/vite.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node:path";import"node:url";import.meta.url;import{VP_COMMANDS as e,resolveVpCommand as t,viteCommandName as n}from"./packages/vite/src/commands.js";import{describeVp as r,hasVp as i,resolveVp as a,runVp as o,vpVersion as s,which as c}from"./packages/vite/src/vp.js";import{runGuard as l,viteCommands as u}from"./packages/vite/src/cli/index.js";import{DBX_TASKS as d,dbx as f,
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;import{VP_COMMANDS as e,resolveVpCommand as t,viteCommandName as n}from"./packages/vite/src/commands.js";import{describeVp as r,hasVp as i,resolveVp as a,runVp as o,vpVersion as s,which as c}from"./packages/vite/src/vp.js";import{runGuard as l,viteCommands as u}from"./packages/vite/src/cli/index.js";import{DBX_TASKS as d,dbx as f,resolveDbx as p,runDbx as m}from"./packages/vite/src/plugin.js";import{viteProvider as h}from"./packages/vite/src/provider.js";import{VITE_CONFIG_SHIM as g,renderViteConfig as _,viteConfigObject as v,viteSyncTask as y}from"./packages/vite/src/sync.js";import{resolveVite as b}from"./packages/vite/src/resolve.js";import"./packages/vite/src/index.js";export{d as DBX_TASKS,g as VITE_CONFIG_SHIM,e as VP_COMMANDS,f as dbx,r as describeVp,i as hasVp,_ as renderViteConfig,p as resolveDbx,b as resolveVite,a as resolveVp,t as resolveVpCommand,m as runDbx,l as runGuard,o as runVp,n as viteCommandName,u as viteCommands,v as viteConfigObject,h as viteProvider,y as viteSyncTask,s as vpVersion,c as which};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deltabox/toolchain",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "All-in-one toolchain: scaffold projects, manage templates, configs, tsconfigs, changelogs and builds.",
|
|
5
5
|
"homepage": "https://toolchain.deltabox.studio",
|
|
6
6
|
"author": "Victor Sango <victor@deltabox.studio>",
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
"settings"
|
|
38
38
|
],
|
|
39
39
|
"scripts": {
|
|
40
|
-
"build": "vp run --filter \"./packages/*\" build && vp run build:root",
|
|
40
|
+
"build": "node scripts/bootstrap.mjs && vp run --filter \"./packages/*\" build && vp run build:root && yarn workspace toolchain-vscode package:vsix",
|
|
41
41
|
"docs": "vp run --filter \"./apps/docs\"",
|
|
42
42
|
"format": "vp fmt",
|
|
43
43
|
"format:check": "vp fmt --check",
|
|
44
44
|
"lint": "vp lint --fix",
|
|
45
45
|
"lint:check": "vp lint",
|
|
46
46
|
"check": "vp check",
|
|
47
|
-
"typecheck": "vp run --filter \"./packages/*\" build && vp run --filter \"./packages/*\" typecheck && vp run typecheck:root",
|
|
48
|
-
"test": "vp run --filter \"./packages/*\" build && vp run --filter \"./packages/*\" test && vp run test:root",
|
|
47
|
+
"typecheck": "node scripts/bootstrap.mjs && vp run --filter \"./packages/*\" build && vp run --filter \"./packages/*\" typecheck && vp run typecheck:root",
|
|
48
|
+
"test": "node scripts/bootstrap.mjs && vp run --filter \"./packages/*\" build && vp run --filter \"./packages/*\" test && vp run test:root",
|
|
49
49
|
"vp:test": "vp test --run --config vite.config.ts",
|
|
50
50
|
"vp:toolchain": "vp toolchain",
|
|
51
51
|
"config:generate": "tsx scripts/generate-config.ts",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"dev": "tsx src/cli/index.ts",
|
|
54
54
|
"dbx": "tsx src/cli/index.ts",
|
|
55
55
|
"commitlint": "commitlint",
|
|
56
|
-
"
|
|
56
|
+
"postinstall": "husky && node scripts/bootstrap.mjs"
|
|
57
57
|
},
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public",
|
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
"apps/*"
|
|
65
65
|
],
|
|
66
66
|
"dependencies": {
|
|
67
|
+
"@clack/prompts": "^1.8.1",
|
|
67
68
|
"commander": "^14.0.0",
|
|
68
69
|
"glob": "^13.0.6",
|
|
69
70
|
"lodash": "^4.18.1",
|
|
@@ -75,17 +76,17 @@
|
|
|
75
76
|
"devDependencies": {
|
|
76
77
|
"@commitlint/cli": "^21.2.2",
|
|
77
78
|
"@commitlint/config-conventional": "^21.2.2",
|
|
78
|
-
"@deltabox/toolchain-biome": "1.
|
|
79
|
-
"@deltabox/toolchain-changelog": "1.
|
|
80
|
-
"@deltabox/toolchain-config": "1.
|
|
81
|
-
"@deltabox/toolchain-core": "1.
|
|
82
|
-
"@deltabox/toolchain-migrate": "1.
|
|
83
|
-
"@deltabox/toolchain-project": "1.
|
|
84
|
-
"@deltabox/toolchain-shared": "1.
|
|
85
|
-
"@deltabox/toolchain-template": "1.
|
|
86
|
-
"@deltabox/toolchain-tsconfig": "1.
|
|
87
|
-
"@deltabox/toolchain-tsdown": "1.
|
|
88
|
-
"@deltabox/toolchain-vite": "1.
|
|
79
|
+
"@deltabox/toolchain-biome": "1.5.0",
|
|
80
|
+
"@deltabox/toolchain-changelog": "1.5.0",
|
|
81
|
+
"@deltabox/toolchain-config": "1.5.0",
|
|
82
|
+
"@deltabox/toolchain-core": "1.5.0",
|
|
83
|
+
"@deltabox/toolchain-migrate": "1.5.0",
|
|
84
|
+
"@deltabox/toolchain-project": "1.5.0",
|
|
85
|
+
"@deltabox/toolchain-shared": "1.5.0",
|
|
86
|
+
"@deltabox/toolchain-template": "1.5.0",
|
|
87
|
+
"@deltabox/toolchain-tsconfig": "1.5.0",
|
|
88
|
+
"@deltabox/toolchain-tsdown": "1.5.0",
|
|
89
|
+
"@deltabox/toolchain-vite": "1.5.0",
|
|
89
90
|
"@types/node": "^22.10.2",
|
|
90
91
|
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
91
92
|
"cross-env": "^10.1.0",
|
|
@@ -100,6 +101,14 @@
|
|
|
100
101
|
"vite-plus": "^1.2.0",
|
|
101
102
|
"vitest": "^5.0.0"
|
|
102
103
|
},
|
|
104
|
+
"peerDependencies": {
|
|
105
|
+
"vite-plus": ">=1"
|
|
106
|
+
},
|
|
107
|
+
"peerDependenciesMeta": {
|
|
108
|
+
"vite-plus": {
|
|
109
|
+
"optional": true
|
|
110
|
+
}
|
|
111
|
+
},
|
|
103
112
|
"packageManager": "yarn@4.17.1",
|
|
104
113
|
"engines": {
|
|
105
114
|
"node": ">=22.5.0"
|