@deltabox/toolchain 1.2.1 → 1.3.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 +149 -4
- package/README.md +21 -14
- package/dist/changelog.d.ts +2 -2
- package/dist/changelog.js +1 -1
- package/dist/cli/commands/projects.js +1 -1
- package/dist/cli/commands/providers.js +1 -1
- package/dist/cli/commands/reset.js +1 -1
- package/dist/cli/commands/sync.js +1 -1
- package/dist/cli/commands/watch.js +1 -1
- package/dist/cli/index.d.ts +33 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/register.js +1 -1
- package/dist/cli/update-check.js +1 -0
- package/dist/config.d.ts +2 -1
- package/dist/config.js +1 -1
- package/dist/core.d.ts +2 -1
- package/dist/core.js +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +1 -1
- package/dist/package.js +1 -1
- package/dist/packages/changelog/src/cli/index.js +1 -1
- 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.js +1 -1
- package/dist/packages/changelog/src/templates.d.ts +1 -1
- package/dist/packages/changelog/src/templates.js +3 -3
- package/dist/packages/changelog/src/utils/format.js +5 -5
- package/dist/packages/changelog/src/utils/git.js +1 -1
- package/dist/packages/changelog/src/utils/reformat.js +4 -4
- package/dist/packages/changelog/src/utils/repo.js +1 -1
- package/dist/packages/changelog/src/utils/summary.d.ts +7 -0
- package/dist/packages/changelog/src/utils/summary.js +1 -1
- package/dist/packages/changelog/src/utils/version.js +5 -5
- package/dist/packages/changelog/src/utils/write.js +1 -1
- package/dist/packages/config/src/cli/index.js +1 -1
- package/dist/packages/config/src/generated-format.d.ts +42 -0
- package/dist/packages/config/src/generated-format.js +3 -0
- package/dist/packages/config/src/generators/types.js +3 -1
- package/dist/packages/config/src/index.d.ts +3 -2
- package/dist/packages/config/src/index.js +1 -1
- package/dist/packages/core/src/gitignore.d.ts +19 -0
- package/dist/packages/core/src/gitignore.js +7 -0
- package/dist/packages/core/src/index.d.ts +3 -2
- package/dist/packages/core/src/index.js +1 -1
- package/dist/packages/core/src/loader.js +1 -1
- package/dist/packages/core/src/sync.d.ts +1 -1
- package/dist/packages/core/src/sync.js +1 -1
- package/dist/packages/core/src/watch.js +1 -1
- package/dist/packages/migrate/src/cli/index.js +1 -1
- package/dist/packages/migrate/src/oxfmt-map.js +1 -1
- package/dist/packages/project/src/cli/index.js +1 -1
- package/dist/packages/shared/src/config-schema.d.ts +100 -0
- package/dist/packages/shared/src/config-schema.js +1 -1
- package/dist/packages/shared/src/config-types.d.ts +68 -217
- package/dist/packages/shared/src/index.d.ts +5 -4
- package/dist/packages/shared/src/index.js +1 -1
- package/dist/packages/shared/src/logger.d.ts +68 -0
- package/dist/packages/shared/src/logger.js +1 -0
- package/dist/packages/shared/src/run.js +1 -1
- package/dist/packages/shared/src/toolchain.d.ts +9 -7
- package/dist/packages/shared/src/toolchain.js +1 -1
- package/dist/packages/template/src/cli/index.js +1 -1
- package/dist/packages/template/src/scaffold.js +1 -1
- package/dist/packages/tsconfig/src/cli/generate/index.js +1 -1
- package/dist/packages/tsconfig/src/cli/generate/utils.js +1 -1
- package/dist/packages/tsdown/src/cleanup.js +1 -1
- package/dist/packages/vite/src/cli/index.d.ts +5 -1
- package/dist/packages/vite/src/cli/index.js +1 -1
- package/dist/packages/vite/src/commands.d.ts +6 -0
- package/dist/packages/vite/src/commands.js +1 -1
- package/dist/packages/vite/src/index.d.ts +3 -3
- package/dist/packages/vite/src/index.js +1 -1
- package/dist/packages/vite/src/vp.d.ts +6 -0
- package/dist/packages/vite/src/vp.js +1 -1
- package/dist/shared.d.ts +4 -3
- package/dist/shared.js +1 -1
- package/dist/sync.js +1 -1
- package/dist/vite.d.ts +3 -3
- package/dist/vite.js +1 -1
- package/package.json +13 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node:path";import"node:url";import.meta.url;import{__exportAll as ee}from"../../../_virtual/_rolldown/runtime.js";import{deepMerge as e,isPlainObject as t,mapValues as n,resolveSort as r,sort as i}from"./object-utils.js";import{mergeJsonAt as a,readJsonAt as o,readJsonFile as s,toJson as c,writeJsonFile as l}from"./fs-utils.js";import{
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;import{__exportAll as ee}from"../../../_virtual/_rolldown/runtime.js";import{deepMerge as e,isPlainObject as t,mapValues as n,resolveSort as r,sort as i}from"./object-utils.js";import{mergeJsonAt as a,readJsonAt as o,readJsonFile as s,toJson as c,writeJsonFile as l}from"./fs-utils.js";import{LOG_LEVELS as u,configureLogger as d,createLogger as f,getLogOverrides as p,getLogger as m,isLogLevel as h,logger as g,normalizeLogLevel as _,setLogConfig as v,setLogOverrides as y,stripAnsi as b}from"./logger.js";import{providerActions as x}from"./provider.js";import{run as S,spawnCross as C}from"./run.js";import{asString as w,camelCase as T,camelCaseId as E,capitalize as D,constantCase as O,ensureLeadingSlash as k,ensureSlashes as A,ensureTrailingSlash as j,formatCliFlag as M,hasText as N,indent as P,isLocalhost as F,kebabCase as I,pascalCase as L,removeDoubleSlashes as R,removeLeadingSlash as z,removeTrailingSlash as B,sanitizeSlashes as V,snakeCase as H,str as U,titleCase as te}from"./string-utils.js";import{applyReplacements as W,applyReplacementsDeep as G,createReplacer as K,defineReplacements as q,extractTokens as J,hasUnresolvedTokens as Y,tokenPattern as X}from"./template.js";import{CONFIG_SECTION_DESCRIPTIONS as Z,CONFIG_SECTION_SCHEMAS as Q,CONFIG_TYPE_SCHEMAS as $,biomeConfigSchema as ne,changelogConfigSchema as re,changelogWorkflowsConfigSchema as ie,dbxConfigSchema as ae,loggerConfigSchema as oe,projectConfigSchema as se,projectTypeSchema as ce,providersConfigSchema as le,templateKindSchema as ue,templateSourceSchema as de,templateSourceTypeSchema as fe,templatesConfigSchema as pe,toolingConfigSchema as me,tsconfigConfigSchema as he,viteConfigSchema as ge,watchConfigSchema as _e,workflowConfigSchema as ve,workflowSettingSchema as ye,workflowStepSchema as be,workflowStepsConfigSchema as xe}from"./config-schema.js";import{CONFIG_FILE_NAMES as Se,defineConfig as Ce,repoSlugFromUrl as we,resolveTokens as Te,sectionConfig as Ee,sectionEnabled as De}from"./toolchain.js";import{toYaml as Oe}from"./yaml.js";var ke=/* @__PURE__ */ ee({CONFIG_FILE_NAMES:()=>Se,CONFIG_SECTION_DESCRIPTIONS:()=>Z,CONFIG_SECTION_SCHEMAS:()=>Q,CONFIG_TYPE_SCHEMAS:()=>$,LOG_LEVELS:()=>u,applyReplacements:()=>W,applyReplacementsDeep:()=>G,asString:()=>w,biomeConfigSchema:()=>ne,camelCase:()=>T,camelCaseId:()=>E,capitalize:()=>D,changelogConfigSchema:()=>re,changelogWorkflowsConfigSchema:()=>ie,configureLogger:()=>d,constantCase:()=>O,createLogger:()=>f,createReplacer:()=>K,dbxConfigSchema:()=>ae,deepMerge:()=>e,defineConfig:()=>Ce,defineReplacements:()=>q,ensureLeadingSlash:()=>k,ensureSlashes:()=>A,ensureTrailingSlash:()=>j,extractTokens:()=>J,formatCliFlag:()=>M,getLogOverrides:()=>p,getLogger:()=>m,hasText:()=>N,hasUnresolvedTokens:()=>Y,indent:()=>P,isLocalhost:()=>F,isLogLevel:()=>h,isPlainObject:()=>t,kebabCase:()=>I,logger:()=>g,loggerConfigSchema:()=>oe,mapValues:()=>n,mergeJsonAt:()=>a,normalizeLogLevel:()=>_,pascalCase:()=>L,projectConfigSchema:()=>se,projectTypeSchema:()=>ce,providerActions:()=>x,providersConfigSchema:()=>le,readJsonAt:()=>o,readJsonFile:()=>s,removeDoubleSlashes:()=>R,removeLeadingSlash:()=>z,removeTrailingSlash:()=>B,repoSlugFromUrl:()=>we,resolveSort:()=>r,resolveTokens:()=>Te,run:()=>S,sanitizeSlashes:()=>V,sectionConfig:()=>Ee,sectionEnabled:()=>De,setLogConfig:()=>v,setLogOverrides:()=>y,snakeCase:()=>H,sort:()=>i,spawnCross:()=>C,str:()=>U,stripAnsi:()=>b,templateKindSchema:()=>ue,templateSourceSchema:()=>de,templateSourceTypeSchema:()=>fe,templatesConfigSchema:()=>pe,titleCase:()=>te,toJson:()=>c,toYaml:()=>Oe,tokenPattern:()=>X,toolingConfigSchema:()=>me,tsconfigConfigSchema:()=>he,viteConfigSchema:()=>ge,watchConfigSchema:()=>_e,workflowConfigSchema:()=>ve,workflowSettingSchema:()=>ye,workflowStepSchema:()=>be,workflowStepsConfigSchema:()=>xe,writeJsonFile:()=>l});export{Se as CONFIG_FILE_NAMES,Z as CONFIG_SECTION_DESCRIPTIONS,Q as CONFIG_SECTION_SCHEMAS,$ as CONFIG_TYPE_SCHEMAS,u as LOG_LEVELS,W as applyReplacements,G as applyReplacementsDeep,w as asString,ne as biomeConfigSchema,T as camelCase,E as camelCaseId,D as capitalize,re as changelogConfigSchema,ie as changelogWorkflowsConfigSchema,d as configureLogger,O as constantCase,f as createLogger,K as createReplacer,ae as dbxConfigSchema,e as deepMerge,Ce as defineConfig,q as defineReplacements,k as ensureLeadingSlash,A as ensureSlashes,j as ensureTrailingSlash,J as extractTokens,M as formatCliFlag,p as getLogOverrides,m as getLogger,N as hasText,Y as hasUnresolvedTokens,P as indent,F as isLocalhost,h as isLogLevel,t as isPlainObject,I as kebabCase,g as logger,oe as loggerConfigSchema,n as mapValues,a as mergeJsonAt,_ as normalizeLogLevel,L as pascalCase,se as projectConfigSchema,ce as projectTypeSchema,x as providerActions,le as providersConfigSchema,o as readJsonAt,s as readJsonFile,R as removeDoubleSlashes,z as removeLeadingSlash,B as removeTrailingSlash,we as repoSlugFromUrl,r as resolveSort,Te as resolveTokens,S as run,V as sanitizeSlashes,Ee as sectionConfig,De as sectionEnabled,v as setLogConfig,y as setLogOverrides,H as snakeCase,i as sort,C as spawnCross,ke as src_exports,U as str,b as stripAnsi,ue as templateKindSchema,de as templateSourceSchema,fe as templateSourceTypeSchema,pe as templatesConfigSchema,te as titleCase,c as toJson,Oe as toYaml,X as tokenPattern,me as toolingConfigSchema,he as tsconfigConfigSchema,ge as viteConfigSchema,_e as watchConfigSchema,ve as workflowConfigSchema,ye as workflowSettingSchema,be as workflowStepSchema,xe as workflowStepsConfigSchema,l as writeJsonFile};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import pc from "picocolors";
|
|
4
|
+
//#region packages/shared/src/logger.d.ts
|
|
5
|
+
/** Ordered from most to least verbose. */
|
|
6
|
+
export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent';
|
|
7
|
+
/** A raw output channel: `out` is stdout, `err` is stderr. */
|
|
8
|
+
export type LogChannel = 'out' | 'err';
|
|
9
|
+
/** A `picocolors` color set (color-aware). */
|
|
10
|
+
export type Colors = ReturnType<typeof pc.createColors>;
|
|
11
|
+
/** Every valid level, most verbose first. */
|
|
12
|
+
export declare const LOG_LEVELS: readonly ['debug', 'info', 'warn', 'error', 'silent'];
|
|
13
|
+
export interface LoggerOptions {
|
|
14
|
+
/** Minimum level to print (default `info`). */
|
|
15
|
+
level?: LogLevel;
|
|
16
|
+
/** Force colors on/off (default: `picocolors` autodetection). */
|
|
17
|
+
color?: boolean;
|
|
18
|
+
/** Prefix non-indented lines with `<name>:` (default `dbx`). */
|
|
19
|
+
name?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface Logger {
|
|
22
|
+
/** The configured level. */
|
|
23
|
+
readonly level: LogLevel;
|
|
24
|
+
/** A `picocolors` color set honoring the color setting. */
|
|
25
|
+
readonly colors: Colors;
|
|
26
|
+
/** Machine-readable output: raw to stdout, no prefix, no color. */
|
|
27
|
+
raw(message?: string): void;
|
|
28
|
+
/** Raw output to stderr, no prefix, no color. */
|
|
29
|
+
rawError(message?: string): void;
|
|
30
|
+
/** Write `text` verbatim to a channel (no prefix, no color, no added newline). */
|
|
31
|
+
write(channel: LogChannel, text: string): void;
|
|
32
|
+
debug(message?: string): void;
|
|
33
|
+
info(message?: string): void;
|
|
34
|
+
success(message?: string): void;
|
|
35
|
+
warn(message?: string): void;
|
|
36
|
+
error(message?: string): void;
|
|
37
|
+
}
|
|
38
|
+
/** Whether a value is a valid {@link LogLevel}. */
|
|
39
|
+
export declare function isLogLevel(value: unknown): value is LogLevel;
|
|
40
|
+
/** Coerce a possibly-invalid level to a known one (default `info`). */
|
|
41
|
+
export declare function normalizeLogLevel(value: unknown, fallback?: LogLevel): LogLevel;
|
|
42
|
+
/**
|
|
43
|
+
* Strip ANSI SGR escape codes from `text`. Used to keep commander's help/error
|
|
44
|
+
* output plain when the logger's colours are disabled (`--no-color` or
|
|
45
|
+
* `logger.color: false`).
|
|
46
|
+
*/
|
|
47
|
+
export declare function stripAnsi(text: string): string;
|
|
48
|
+
/** Create a logger with the given options. */
|
|
49
|
+
export declare function createLogger(options?: LoggerOptions): Logger;
|
|
50
|
+
/** A `dbx.config.*` `logger` section value. */
|
|
51
|
+
export interface LoggerConfig {
|
|
52
|
+
level?: LogLevel;
|
|
53
|
+
color?: boolean;
|
|
54
|
+
name?: string;
|
|
55
|
+
}
|
|
56
|
+
/** Apply the `logger` section from the loaded `dbx.config.*`. */
|
|
57
|
+
export declare function setLogConfig(options: LoggerConfig | boolean | undefined): void;
|
|
58
|
+
/** Apply logger overrides from the CLI (they win over the config). */
|
|
59
|
+
export declare function setLogOverrides(options: LoggerOptions): void;
|
|
60
|
+
/** Configure the active logger directly (same as the CLI overrides). */
|
|
61
|
+
export declare function configureLogger(options: LoggerOptions): void;
|
|
62
|
+
/** The current CLI overrides (a command merges, rather than replaces, these). */
|
|
63
|
+
export declare function getLogOverrides(): LoggerOptions;
|
|
64
|
+
/** The active logger instance. */
|
|
65
|
+
export declare function getLogger(): Logger;
|
|
66
|
+
/** The active logger; every call delegates to the current instance. */
|
|
67
|
+
export declare const logger: Logger;
|
|
68
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;import e from"picocolors";const t=[`debug`,`info`,`warn`,`error`,`silent`],n={debug:0,info:1,warn:2,error:3,silent:4};function r(e){return typeof e==`string`&&t.includes(e)}function i(e,t=`info`){return r(e)?e:t}function a(e){return e.replace(/\x1b\[[0-9;]*m/g,``)}function o(t={}){let r=i(t.level),a=n[r],o=t.color===void 0?e:e.createColors(t.color),s=t.name?`${t.name}: `:``,c=(e,t)=>{let n=e===``?``:t(e);return!s||e===``||/^\s/.test(e)?n:`${o.dim(s)}${n}`},l=e=>{process.stdout.write(`${e}\n`)},u=e=>{process.stderr.write(`${e}\n`)};return{level:r,colors:o,raw:(e=``)=>l(e),rawError:(e=``)=>u(e),write:(e,t)=>{e===`err`?process.stderr.write(t):process.stdout.write(t)},debug:(e=``)=>{a<=n.debug&&l(c(e,o.dim))},info:(e=``)=>{a<=n.info&&l(c(e,e=>e))},success:(e=``)=>{a<=n.info&&l(c(e,o.green))},warn:(e=``)=>{a<=n.warn&&u(c(e,o.yellow))},error:(e=``)=>{a<=n.error&&u(c(e,o.red))}}}let s={},c={};function l(e){return!e||typeof e!=`object`?{}:{...r(e.level)?{level:e.level}:{},...typeof e.color==`boolean`?{color:e.color}:{},...typeof e.name==`string`?{name:e.name}:{}}}function u(){return o({name:`dbx`,...s,...c})}let d=u();function f(e){s=l(e),d=u()}function p(e){c=e,d=u()}function m(e){p(e)}function h(){return c}function g(){return d}const _={get level(){return d.level},get colors(){return d.colors},raw:(e=``)=>d.raw(e),rawError:(e=``)=>d.rawError(e),write:(e,t)=>d.write(e,t),debug:(e=``)=>d.debug(e),info:(e=``)=>d.info(e),success:(e=``)=>d.success(e),warn:(e=``)=>d.warn(e),error:(e=``)=>d.error(e)};export{t as LOG_LEVELS,m as configureLogger,o as createLogger,h as getLogOverrides,g as getLogger,r as isLogLevel,_ as logger,i as normalizeLogLevel,f as setLogConfig,p as setLogOverrides,a as stripAnsi};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as e}from"node:path";import"node:url";import.meta.url;import t from"node:fs";import{spawn as
|
|
1
|
+
import{default as e}from"node:path";import"node:url";import.meta.url;import{logger as t}from"./logger.js";import n from"node:fs";import{spawn as r}from"node:child_process";const i=process.platform===`win32`,a=/([()\][%!^"`<>&|;, *?])/g;function o(e){return e.replace(a,`^$1`)}function s(e,t){let n=String(e);return n=n.replace(/(?=(\\+?)?)\1"/g,`$1$1\\"`),n=n.replace(/(?=(\\+?)?)\1$/,`$1$1`),n=`"${n}"`,n=n.replace(a,`^$1`),t&&(n=n.replace(a,`^$1`)),n}function c(t){if(e.extname(t))return n.existsSync(t)?t:void 0;let r=(process.env.PATHEXT??`.COM;.EXE;.BAT;.CMD`).split(`;`),i=(process.env.PATH??``).split(e.delimiter);for(let a of r)for(let r of i){let i=e.join(r,`${t}${a.toLowerCase()}`);if(n.existsSync(i))return i}}function l(e){let t=c(e)??e;return/\.(cmd|bat)$/i.test(t)}function u(e,t,n={}){if(i){let i=l(e),a=[o(e),...t.map(e=>s(e,i))].join(` `);return r(process.env.ComSpec??`cmd.exe`,[`/d`,`/s`,`/c`,`"${a}"`],{stdio:`inherit`,...n,shell:!1,windowsVerbatimArguments:!0})}return r(e,t,{stdio:`inherit`,...n,shell:!1})}function d(e,n,r){let{exitWithMainProc:i=!0,argsEndingDashes:a=!0,verbose:o=!0,...s}=r??{},c=[...n,...a?[`--`]:[]];o&&t.info(`$ ${e} ${c.join(` `)}`);let l=u(e,c,s);return i&&l.on(`exit`,process.exit),l}export{d as run,u as spawnCross};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
3
|
import { Replacements } from "./template.js";
|
|
4
|
-
import { ChangelogWorkflowsConfig, DbxConfigSections, ProjectType, ToolingBiomeConfig, ToolingChangelogConfig, ToolingConfigSections, ToolingProjectConfig, ToolingTemplateKind, ToolingTemplateSource, ToolingTemplateSourceType, ToolingTemplatesConfig, ToolingTsconfigConfig, ToolingViteConfig, ToolingWatchConfig, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig } from "./config-types.js";
|
|
4
|
+
import { ChangelogWorkflowsConfig, DbxConfigSections, ProjectType, ToolingBiomeConfig, ToolingChangelogConfig, ToolingConfigSections, ToolingLoggerConfig, ToolingProjectConfig, ToolingProvidersConfig, ToolingTemplateKind, ToolingTemplateSource, ToolingTemplateSourceType, ToolingTemplatesConfig, ToolingTsconfigConfig, ToolingViteConfig, ToolingWatchConfig, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig } from "./config-types.js";
|
|
5
5
|
import { Awaitable } from "./types.js";
|
|
6
|
-
import { CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, biomeConfigSchema, changelogConfigSchema, changelogWorkflowsConfigSchema, dbxConfigSchema, projectConfigSchema, projectTypeSchema, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, toolingConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema } from "./config-schema.js";
|
|
6
|
+
import { CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, biomeConfigSchema, changelogConfigSchema, changelogWorkflowsConfigSchema, dbxConfigSchema, loggerConfigSchema, projectConfigSchema, projectTypeSchema, providersConfigSchema, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, toolingConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema } from "./config-schema.js";
|
|
7
7
|
//#region packages/shared/src/toolchain.d.ts
|
|
8
8
|
/** A summary of a sync run, handed to {@link ToolingHooks.afterSync}. */
|
|
9
9
|
export interface SyncSummary {
|
|
@@ -89,10 +89,12 @@ export type ToolingSection<T> = boolean | T;
|
|
|
89
89
|
export declare function sectionEnabled(section: ToolingSection<{
|
|
90
90
|
enabled?: boolean;
|
|
91
91
|
}> | undefined): boolean;
|
|
92
|
-
/**
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
/**
|
|
93
|
+
* The options object for a section (`undefined` when it is a boolean/absent).
|
|
94
|
+
* Not every section declares `enabled` (eg. `providers`), so the constraint is
|
|
95
|
+
* any object rather than `{ enabled?: boolean }`.
|
|
96
|
+
*/
|
|
97
|
+
export declare function sectionConfig<T extends object>(section: ToolingSection<T> | undefined): T | undefined;
|
|
96
98
|
/** The file names a config loader looks for, in priority order. */
|
|
97
99
|
export declare const CONFIG_FILE_NAMES: readonly ['dbx.config.ts', 'dbx.config.mts', 'dbx.config.js', 'dbx.config.mjs', 'dbx.config.cjs', 'dbx.config.json'];
|
|
98
100
|
/** Derive the `owner/name` slug from a repository URL. */
|
|
@@ -157,4 +159,4 @@ export interface SyncTask {
|
|
|
157
159
|
run: (ctx: SyncContext) => Awaitable<ManagedFile[] | void>;
|
|
158
160
|
}
|
|
159
161
|
//#endregion
|
|
160
|
-
export { CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, ChangelogWorkflowsConfig, DbxConfigSections, ProjectType, ToolingBiomeConfig, ToolingChangelogConfig, ToolingConfigSections, ToolingProjectConfig, ToolingTemplateKind, ToolingTemplateSource, ToolingTemplateSourceType, ToolingTemplatesConfig, ToolingTsconfigConfig, ToolingViteConfig, ToolingWatchConfig, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig, biomeConfigSchema, changelogConfigSchema, changelogWorkflowsConfigSchema, dbxConfigSchema, projectConfigSchema, projectTypeSchema, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, toolingConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema };
|
|
162
|
+
export { CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, ChangelogWorkflowsConfig, DbxConfigSections, ProjectType, ToolingBiomeConfig, ToolingChangelogConfig, ToolingConfigSections, ToolingLoggerConfig, ToolingProjectConfig, ToolingProvidersConfig, ToolingTemplateKind, ToolingTemplateSource, ToolingTemplateSourceType, ToolingTemplatesConfig, ToolingTsconfigConfig, ToolingViteConfig, ToolingWatchConfig, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig, biomeConfigSchema, changelogConfigSchema, changelogWorkflowsConfigSchema, dbxConfigSchema, loggerConfigSchema, projectConfigSchema, projectTypeSchema, providersConfigSchema, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, toolingConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node:path";import"node:url";import.meta.url;import{CONFIG_SECTION_DESCRIPTIONS as e,CONFIG_SECTION_SCHEMAS as t,CONFIG_TYPE_SCHEMAS as n,biomeConfigSchema as r,changelogConfigSchema as i,changelogWorkflowsConfigSchema as a,dbxConfigSchema as o,
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;import{CONFIG_SECTION_DESCRIPTIONS as e,CONFIG_SECTION_SCHEMAS as t,CONFIG_TYPE_SCHEMAS as n,biomeConfigSchema as r,changelogConfigSchema as i,changelogWorkflowsConfigSchema as a,dbxConfigSchema as o,loggerConfigSchema as s,projectConfigSchema as c,projectTypeSchema as l,providersConfigSchema as u,templateKindSchema as d,templateSourceSchema as f,templateSourceTypeSchema as p,templatesConfigSchema as m,toolingConfigSchema as h,tsconfigConfigSchema as g,viteConfigSchema as _,watchConfigSchema as v,workflowConfigSchema as y,workflowSettingSchema as b,workflowStepSchema as x,workflowStepsConfigSchema as S}from"./config-schema.js";function C(e){return e}function w(e){return e===void 0?!1:typeof e==`boolean`?e:e.enabled!==!1}function T(e){return e!==void 0&&typeof e==`object`?e:void 0}const E=[`dbx.config.ts`,`dbx.config.mts`,`dbx.config.js`,`dbx.config.mjs`,`dbx.config.cjs`,`dbx.config.json`];function D(e){if(!e)return;let t=e.match(/github\.com[/:]([^/]+)\/([^/.]+?)(?:\.git)?$/);return t?.[1]&&t[2]?`${t[1]}/${t[2]}`:void 0}function O(e={}){let t=e.project??{},n=T(e.changelog)??{};return{name:t.name??`app`,scope:t.scope??``,author:t.author??``,license:t.license??`MIT`,homepage:t.homepage??``,repo:t.repo??``,repoSlug:D(t.repo)??``,description:t.description??``,nodeVersion:t.nodeVersion??`22`,packageManager:t.packageManager??`yarn`,yarnVersion:t.packageManagerVersion??`4.17.1`,packageManagerVersion:t.packageManagerVersion??`4.17.1`,mainBranch:n.branches?.main??`main`,devBranch:n.branches?.dev??`dev`}}export{E as CONFIG_FILE_NAMES,e as CONFIG_SECTION_DESCRIPTIONS,t as CONFIG_SECTION_SCHEMAS,n as CONFIG_TYPE_SCHEMAS,r as biomeConfigSchema,i as changelogConfigSchema,a as changelogWorkflowsConfigSchema,o as dbxConfigSchema,C as defineConfig,s as loggerConfigSchema,c as projectConfigSchema,l as projectTypeSchema,u as providersConfigSchema,D as repoSlugFromUrl,O as resolveTokens,T as sectionConfig,w as sectionEnabled,d as templateKindSchema,f as templateSourceSchema,p as templateSourceTypeSchema,m as templatesConfigSchema,h as toolingConfigSchema,g as tsconfigConfigSchema,_ as viteConfigSchema,v as watchConfigSchema,y as workflowConfigSchema,b as workflowSettingSchema,x as workflowStepSchema,S as workflowStepsConfigSchema};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as e}from"node:path";import"node:url";import.meta.url;import{TEMPLATE_MANIFEST as
|
|
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 d={flags:`--cwd <dir>`,description:`Project root (default: cwd).`},f={flags:`--kind <kind>`,description:`project | workspace | application | folder | tooling | pipeline.`};function p(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 m(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 h(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 g(){return[{name:`template:list`,description:`List templates (builtin + local + opted-in online sources).`,options:[d,{flags:`--online`,description:`Resolve online sources (npm/git).`},{flags:`--offline`,description:`Force offline (skip npm/git).`},f,{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(p),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:[d,f,{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=h(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:[d,{flags:`--type <type>`,description:`Force: builtin | local | npm | git | vite-plus.`},{flags:`--name <name>`,description:`Display name.`},f,{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:[d,{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:[d,{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(p(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).`},f,{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).`},d,{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=String(e.template??``),a=e.kind,s=await o({cwd:n.cwd,config:n.config,online:!0}),c=s.find(e=>e.id===i);if(!c&&!i&&a&&(c=s.find(e=>e.kind===a)),!c&&i&&(c={id:i,name:i,kind:a??`project`,source:{type:`vite-plus`,locate:i},online:!0}),!c)throw Error("No template selected. Pass --template <id> or --kind <kind> (see `dbx template:list`).");let u={...n.config.project,name:e.name??n.config.project?.name??`app`,...e.scope?{scope:e.scope}:{}},d=m(e.var),f=await l(c,{cwd:r,tokens:u,variables:d});if(e.json)t.raw(JSON.stringify({template:c.id,out:r,...f},null,4));else if(c.source.type===`vite-plus`||c.source.type===`npm`||c.source.type===`git`)f.code&&(process.exitCode=f.code);else for(let e of f.written)t.info(`Created ${e}`)}}]}export{g as templateCommands};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as e}from"node:path";import"node:url";import.meta.url;import{applyReplacements as t}from"../../shared/src/template.js";import"../../shared/src/index.js";import{createMonorepoRootFiles as n,createRootProjectFiles as r,createWorkspaceFiles as i,writeGeneratedFiles as a}from"../../project/src/typescript.js";import"../../project/src/index.js";import{
|
|
1
|
+
import{default as e}from"node:path";import"node:url";import.meta.url;import{applyReplacements as t}from"../../shared/src/template.js";import"../../shared/src/index.js";import{createMonorepoRootFiles as n,createRootProjectFiles as r,createWorkspaceFiles as i,writeGeneratedFiles as a}from"../../project/src/typescript.js";import"../../project/src/index.js";import{runVp as o}from"../../vite/src/vp.js";import"../../vite/src/index.js";import{readTemplateManifest as s}from"./local.js";import c from"node:fs";const l=/* @__PURE__ */ new Set([`node_modules`,`.git`,`dist`,`.turbo`,`.dbx`,`.DS_Store`,`template.json`]);function u(e){return{...e.tokens,...e.variables}}function d(e,t){let o=u(t),s=String(o.name??`app`),c=o.scope?String(o.scope):void 0,l=[];switch(e.builtin){case`monorepo-root`:{let e=c??`@${s}`;l.push(...n({name:s,scope:e,type:`monorepo-root`,workspaces:[{alias:`core`,dir:`packages/core`}]})),l.push(...i({name:s,scope:e,wsName:`core`,wsDir:`packages/core`,type:`monorepo-workspace`}).map(e=>({...e,path:`packages/core/${e.path}`})));break}case`monorepo-workspace`:{let e=`packages/${s}`;l.push(...i({name:s,...c?{scope:c}:{},wsName:s,wsDir:e,type:`monorepo-workspace`}).map(t=>({...t,path:`${e}/${t.path}`})));break}case`folder`:l.push({path:`README.md`,content:`# ${s}\n`});break;default:l.push(...r({name:s,...c?{scope:c}:{},type:`project`}))}return{written:a(l,t.cwd)}}function f(n,r){let i=n.dir;if(!i)throw Error(`Local template "${n.id}" has no directory.`);let a=s(i),o=/* @__PURE__ */ new Set([...l,...a?.ignore??[]]),d=n.tokens?.open??`{{`,f=n.tokens?.close??`}}`,p=u(r),m=r.overwrite!==!1,h=[],g=n=>{let a=e.join(i,n);for(let s of c.readdirSync(a,{withFileTypes:!0})){if(o.has(s.name))continue;let a=n?`${n}/${s.name}`:s.name;if(s.isDirectory()){g(a);continue}let l=e.join(r.cwd,t(a,p,{open:d,close:f}));if(!m&&c.existsSync(l))continue;c.mkdirSync(e.dirname(l),{recursive:!0});let u=c.readFileSync(e.join(i,a),`utf-8`);c.writeFileSync(l,t(u,p,{open:d,close:f}),`utf-8`),h.push(l)}};return g(``),{written:h}}async function p(e,t){let n=e.source.subdir?`${e.source.locate}/${e.source.subdir}`:e.source.locate,r=[`create`];n&&r.push(n);let i=t.tokens?.name;return i&&r.push(String(i)),{written:[],code:(await o(r,{cwd:t.cwd})).code}}async function m(e,t){if(e.builtin)return d(e,t);switch(e.source.type){case`local`:return f(e,t);case`vite-plus`:case`npm`:case`git`:return p(e,t);default:throw Error(`Template "${e.id}" has no scaffold handler.`)}}export{m as scaffoldTemplate};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as e}from"node:path";import{pathToFileURL as
|
|
1
|
+
import{default as e}from"node:path";import{fileURLToPath as t,pathToFileURL as n}from"node:url";import.meta.url;import{logger as r}from"../../../../shared/src/logger.js";import"../../../../shared/src/index.js";import{generateTsconfig as i}from"./utils.js";import a from"node:fs";import{parseArgs as o}from"node:util";import{Glob as s}from"glob";function c(t={}){let{aliases:n=!0,composite:o=!1,refs:c=!1,indent:l=4,glob:u=`**/tsconfig.default.json`,appGlob:d=`apps/**/tsconfig.default.json`,monorepoTsconfigFilename:f=`tsconfig.monorepo.json`,log:p=!0,write:m=!0}=t,h=t.cwd??process.cwd(),g=e=>{p&&r.info(e)};n||g(`Ignoring path aliases for all tsconfigs...`),o||g(`Disabling compilerOptions.composite for all tsconfigs...`),c||g(`Ignoring project references for all tsconfigs...`);let _=e.resolve(h,f),v=e.relative(h,_),y=new s(u,{cwd:h,withFileTypes:!0}).walkSync(),b=new s(d,{cwd:h,withFileTypes:!0}).walkSync().map(e=>e.fullpath());g(`Extending ${y.length} tsconfigs with ${v}...`);let x=[];for(let t of y){let r=t.fullpath(),a=e.dirname(r),s=c&&b.some(e=>e===r);x.push(i({cwd:h,dirname:a,tsconfigPath:r,monorepoTsconfigPath:_,tsconfigBuildPath:e.resolve(a,`tsconfig.build.json`),targetTsconfigPath:e.resolve(a,`tsconfig.json`),targetTsconfigBuildPath:e.resolve(a,`tsconfig.build.json`),indent:l,disableComposite:!o||s,ignoreAliases:!n,ignoreReferences:!c,write:m}))}if(!c)return x;g(`Checking for additional tsconfig changes...`);for(let t of x){let{dirname:n,dirnameRelative:r,tsconfigPath:i,targetTsconfigPath:o,config:s}=t;g(` - ${r}`),!b.some(e=>e===i)&&(s.references?.length&&(s.references=s.references.filter(t=>{let r=e.resolve(n,t.path);if(!a.existsSync(r))return g(` tsconfig not found for ${t.path}, skipping.`),!1;let i=JSON.parse(a.readFileSync(r,`utf-8`));return i.compilerOptions?.composite!=null&&i.compilerOptions?.composite!==!1})),m&&a.writeFileSync(o,`${JSON.stringify(s,null,l)}\n`))}return x}function l(e=process.argv.slice(2)){let{values:t}=o({args:e,options:{aliases:{type:`boolean`,short:`a`,default:!0},composite:{type:`boolean`,short:`c`,default:!1},refs:{type:`boolean`,short:`r`,default:!1},indent:{type:`string`,short:`i`,default:`4`}}});c({aliases:t.aliases,composite:t.composite,refs:t.refs,indent:Number.parseInt(t.indent,10)})}if(/[\\/]generate[\\/]index\.[cm]?[jt]s$/.test(t(import.meta.url))&&import.meta.url===n(process.argv[1]??``).href)try{l()}catch(e){r.error(`Failed to generate tsconfigs due to: ${e}`),process.exit(1)}export{c as generateTsconfigs,l as runTsconfigCli};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as e}from"node:path";import"node:url";import.meta.url;import t from"node:fs";function
|
|
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 n from"node:fs";function r(r){let{cwd:a,dirname:o,tsconfigPath:s,monorepoTsconfigPath:c,tsconfigBuildPath:l,targetTsconfigPath:u,targetTsconfigBuildPath:d,indent:f=4,disableComposite:p,ignoreAliases:m,ignoreReferences:h,write:g=!0}=r,_=e.relative(a,o).replace(/\\/g,`/`)||`.`;try{if(!n.existsSync(s))throw Error(`Source tsconfig not found: ${s}`);if(!c)throw Error(`options.monorepoTsconfigPath not set for ${s}`);if(!n.existsSync(c))throw Error(`Root 'tsconfig.monorepo.json' not found: ${c}`);t.info(` - ${_}`);let d=e.basename(s),v=n.existsSync(l),y=JSON.parse(n.readFileSync(c,`utf-8`)),b=JSON.parse(n.readFileSync(s,`utf-8`)),x=v?JSON.parse(n.readFileSync(l,`utf-8`)):void 0,S=p?[]:[.../* @__PURE__ */ new Set([...b.compilerOptions?.types??[],...p?[]:y.compilerOptions?.types??[]])],C={...p?{}:y,extends:`./${d}`,compilerOptions:{...p?{composite:!1}:y.compilerOptions,...S.length?{types:S}:{},...m?{}:{paths:{...b.compilerOptions?.paths,...y.compilerOptions?.paths?Object.fromEntries(Object.entries(y.compilerOptions.paths).reduce((e,t)=>{let[n,r]=t,s=!0,c=r.map(e=>i(e,o,a)),l=[];for(let{newPath:e,isRoot:t,inRootDir:n}of c)(!t&&!n||/^.$/.test(_))&&(s=!1,l.push(e));return s?e:e.concat([[n,l]])},[])):{}}}},...h?{}:{references:(b.references??[]).concat(y.references??[]).reduce((e,t)=>{if(e.find(e=>e.path===t.path))return e;let{newPath:n,isRoot:r,inRootDir:s}=i(t.path,o,a);return(r||s)&&!/^.$/.test(_)?e:e.concat([{...t,path:n}])},[])}},w=v?{...x,extends:`./${d}`}:void 0;return g&&n.writeFileSync(u,`${JSON.stringify(C,null,f)}\n`),{...r,dirnameRelative:_,tsconfigFilename:d,config:C,newTsconfig:C,newTsconfigBuild:w,originalConfig:b,tsconfigMonorepo:y,tsconfigBuild:x}}catch(e){t.error(` Failed to extend tsconfig for ${_} due to: ${e}`),process.exit(1)}}function i(t,n,r){let i=e.resolve(r,t),a=e.basename(i),o=e.dirname(i),s=e.join(e.relative(n,o),a).replace(/\\/g,`/`);s=s.startsWith(`.`)?s:`./${s}`;let c=e.dirname(e.resolve(n,s));return{isRoot:n===c,inRootDir:c.startsWith(n),newPath:s,newPathDirname:c}}export{r as generateTsconfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as e}from"node:path";import"node:url";import.meta.url;import t from"node:fs";import{Glob as
|
|
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 n from"node:fs";import{Glob as r}from"glob";function i(i,a,o={}){let s=Array.isArray(a)?a:[a];if(!s.length)return o.silent||t.info(`Search pattern not provided. Skipping ${i} cleanup.`),[];let c=o.cwd??process.cwd(),l=new r(s,{cwd:c,dot:!0,ignore:o.ignore??[`**/node_modules/**`]}).walkSync();if(!l.length)return o.silent||t.info(`No ${i} artifacts found. Skipping cleanup.`),[];o.silent||t.info(`Cleaning up ${i} artifacts:`);let u=[];for(let r of l)n.rmSync(e.resolve(c,r),{recursive:!0,force:!0}),u.push(r),o.silent||t.info(` - ${r}`);return u}export{i as cleanup};
|
|
@@ -2,7 +2,11 @@ import __tsdown_shims_path from 'node:path';
|
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
3
|
import { ToolingCommand } from "../../../shared/src/types.js";
|
|
4
4
|
import "../../../shared/src/index.js";
|
|
5
|
+
import { resolveVpCommand } from "../commands.js";
|
|
5
6
|
//#region packages/vite/src/cli/index.d.ts
|
|
7
|
+
/** The guard key for a `run` invocation, or `undefined` for other commands. */
|
|
8
|
+
export declare function runGuard(args: string[], cwd: string): string | undefined;
|
|
6
9
|
/** Every Vite+ passthrough command (the generic `vite` + one per subcommand). */
|
|
7
10
|
export declare function viteCommands(): ToolingCommand[];
|
|
8
|
-
//#endregion
|
|
11
|
+
//#endregion
|
|
12
|
+
export { resolveVpCommand };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node:path";import"node:url";import.meta.url;import{VP_COMMANDS as
|
|
1
|
+
import{default as e}from"node:path";import"node:url";import.meta.url;import{logger as t}from"../../../shared/src/logger.js";import{sectionConfig as n}from"../../../shared/src/toolchain.js";import"../../../shared/src/index.js";import{VP_COMMANDS as r,resolveVpCommand as i,viteCommandName as a}from"../commands.js";import{runVp as o}from"../vp.js";const s={flags:`--cwd <dir>`,description:"Project root to run `vp` in (default: cwd)."},c=`DBX_RUN_GUARD`;function l(t,n){if(t[0]===`run`)return`${e.resolve(n)}|${t.slice(1).join(` `)}`}function u(e,r,i){return{name:e,description:r,passthrough:!0,options:[s],run:async(e,r)=>{let a=e.args??[],s=e.cwd??r.cwd,u=[...i,...a],d=l(u,s);if(d&&process.env[c]===d){t.debug(`pruned a self-referential \`${u.join(` `)}\``);return}let f=t.colors.isColorSupported&&n(r.config.providers)?.color!==!1,p=await o(u,{cwd:s,color:f,...d?{env:{[c]:d}}:{}});p.code!==0&&(process.exitCode=p.code)}}}function d(){return[u(`vite`,"Run any Vite+ command through `vp` (eg. `dbx vite dev`).",[]),...r.map(e=>u(a(e.name),`Vite+: ${e.description}`,[e.name]))]}export{i as resolveVpCommand,l as runGuard,d as viteCommands};
|
|
@@ -26,4 +26,10 @@ export interface VpCommandInfo {
|
|
|
26
26
|
export declare const VP_COMMANDS: VpCommandInfo[];
|
|
27
27
|
/** The `dbx` command name for a vp subcommand (`dev` -> `vite:dev`). */
|
|
28
28
|
export declare function viteCommandName(subcommand: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Resolve a vp subcommand **or alias** to its canonical name (`i` -> `install`),
|
|
31
|
+
* or `undefined` when it is not a Vite+ command. Used to let a bare
|
|
32
|
+
* `dbx <command>` fall through to the `vite` passthrough.
|
|
33
|
+
*/
|
|
34
|
+
export declare function resolveVpCommand(name: string): string | undefined;
|
|
29
35
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node:path";import"node:url";import.meta.url;const e=[{name:`create`,group:`start`,description:`Create a new project from a template.`},{name:`migrate`,group:`start`,description:`Migrate an existing project to Vite+.`},{name:`config`,group:`start`,description:`Configure hooks and agent integration.`},{name:`hooks`,group:`start`,description:`Manage the Git hook dispatcher.`},{name:`staged`,group:`start`,description:`Run linters on staged files.`},{name:`install`,group:`start`,aliases:[`i`],description:`Install dependencies with the detected package manager.`},{name:`env`,group:`start`,description:`Manage Node.js and package managers.`},{name:`dev`,group:`develop`,description:`Run the Vite development server.`},{name:`check`,group:`develop`,description:`Run format, lint and type checks.`},{name:`lint`,group:`develop`,description:`Lint code with Oxlint.`},{name:`fmt`,group:`develop`,description:`Format code with Oxfmt.`},{name:`test`,group:`develop`,description:`Run tests through bundled Vitest.`},{name:`run`,group:`execute`,description:`Run package scripts and monorepo tasks.`},{name:`exec`,group:`execute`,description:`Execute a binary from local node_modules.`},{name:`node`,group:`execute`,description:`Run a Node.js script in the Vite+ env.`},{name:`dlx`,group:`execute`,description:`Run a package binary without installing it.`},{name:`cache`,group:`execute`,description:`Manage the task cache.`},{name:`build`,group:`build`,description:`Build for production.`},{name:`pack`,group:`build`,description:`Build libraries for npm or standalone binaries.`},{name:`preview`,group:`build`,description:`Preview the production build.`},{name:`add`,group:`deps`,description:`Add packages to dependencies.`},{name:`remove`,group:`deps`,aliases:[`rm`,`un`,`uninstall`],description:`Remove packages from dependencies.`},{name:`update`,group:`deps`,aliases:[`up`],description:`Update packages.`},{name:`dedupe`,group:`deps`,description:`Deduplicate dependencies.`},{name:`outdated`,group:`deps`,description:`Check for outdated packages.`},{name:`list`,group:`deps`,aliases:[`ls`],description:`List installed packages.`},{name:`why`,group:`deps`,aliases:[`explain`],description:`Explain why a package is installed.`},{name:`info`,group:`deps`,aliases:[`view`,`show`],description:`View package metadata.`},{name:`link`,group:`deps`,aliases:[`ln`],description:`Link local packages.`},{name:`unlink`,group:`deps`,description:`Unlink local packages.`},{name:`rebuild`,group:`deps`,description:`Rebuild native modules.`},{name:`pm`,group:`deps`,description:`Forward a command to the package manager.`},{name:`toolchain`,group:`maintain`,description:`Show Vite+ tool versions.`},{name:`upgrade`,group:`maintain`,description:"Update `vp` itself."},{name:`implode`,group:`maintain`,description:"Remove `vp` and all related data."}];function t(e){return`vite:${e}`}export{e as VP_COMMANDS,t as viteCommandName};
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;const e=[{name:`create`,group:`start`,description:`Create a new project from a template.`},{name:`migrate`,group:`start`,description:`Migrate an existing project to Vite+.`},{name:`config`,group:`start`,description:`Configure hooks and agent integration.`},{name:`hooks`,group:`start`,description:`Manage the Git hook dispatcher.`},{name:`staged`,group:`start`,description:`Run linters on staged files.`},{name:`install`,group:`start`,aliases:[`i`],description:`Install dependencies with the detected package manager.`},{name:`env`,group:`start`,description:`Manage Node.js and package managers.`},{name:`dev`,group:`develop`,description:`Run the Vite development server.`},{name:`check`,group:`develop`,description:`Run format, lint and type checks.`},{name:`lint`,group:`develop`,description:`Lint code with Oxlint.`},{name:`fmt`,group:`develop`,description:`Format code with Oxfmt.`},{name:`test`,group:`develop`,description:`Run tests through bundled Vitest.`},{name:`run`,group:`execute`,description:`Run package scripts and monorepo tasks.`},{name:`exec`,group:`execute`,description:`Execute a binary from local node_modules.`},{name:`node`,group:`execute`,description:`Run a Node.js script in the Vite+ env.`},{name:`dlx`,group:`execute`,description:`Run a package binary without installing it.`},{name:`cache`,group:`execute`,description:`Manage the task cache.`},{name:`build`,group:`build`,description:`Build for production.`},{name:`pack`,group:`build`,description:`Build libraries for npm or standalone binaries.`},{name:`preview`,group:`build`,description:`Preview the production build.`},{name:`add`,group:`deps`,description:`Add packages to dependencies.`},{name:`remove`,group:`deps`,aliases:[`rm`,`un`,`uninstall`],description:`Remove packages from dependencies.`},{name:`update`,group:`deps`,aliases:[`up`],description:`Update packages.`},{name:`dedupe`,group:`deps`,description:`Deduplicate dependencies.`},{name:`outdated`,group:`deps`,description:`Check for outdated packages.`},{name:`list`,group:`deps`,aliases:[`ls`],description:`List installed packages.`},{name:`why`,group:`deps`,aliases:[`explain`],description:`Explain why a package is installed.`},{name:`info`,group:`deps`,aliases:[`view`,`show`],description:`View package metadata.`},{name:`link`,group:`deps`,aliases:[`ln`],description:`Link local packages.`},{name:`unlink`,group:`deps`,description:`Unlink local packages.`},{name:`rebuild`,group:`deps`,description:`Rebuild native modules.`},{name:`pm`,group:`deps`,description:`Forward a command to the package manager.`},{name:`toolchain`,group:`maintain`,description:`Show Vite+ tool versions.`},{name:`upgrade`,group:`maintain`,description:"Update `vp` itself."},{name:`implode`,group:`maintain`,description:"Remove `vp` and all related data."}];function t(e){return`vite:${e}`}function n(t){return e.find(e=>e.name===t||e.aliases?.includes(t)===!0)?.name}export{e as VP_COMMANDS,n as resolveVpCommand,t as viteCommandName};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { VP_COMMANDS, VpCommandInfo, VpGroup, resolveVpCommand, viteCommandName } from "./commands.js";
|
|
4
|
+
import { runGuard, viteCommands } from "./cli/index.js";
|
|
5
5
|
import { DBX_TASKS, DbxPluginOptions, DbxSource, DbxViteConfig, ResolvedDbx, dbx, defineDbxConfig, resolveDbx, runDbx } from "./plugin.js";
|
|
6
6
|
import { viteProvider } from "./provider.js";
|
|
7
7
|
import { DEFAULT_LINT_IGNORE, DEFAULT_TEST_INCLUDE, renderViteConfig, viteConfigObject, viteSyncTask } from "./sync.js";
|
|
8
8
|
import { ResolvedVp, RunVpOptions, VpResult, VpSource, describeVp, hasVp, resolveVp, runVp, vpVersion, which } from "./vp.js";
|
|
9
|
-
export { DBX_TASKS, DEFAULT_LINT_IGNORE, DEFAULT_TEST_INCLUDE, DbxPluginOptions, DbxSource, DbxViteConfig, ResolvedDbx, ResolvedVp, RunVpOptions, VP_COMMANDS, VpCommandInfo, VpGroup, VpResult, VpSource, dbx, defineDbxConfig, describeVp, hasVp, renderViteConfig, resolveDbx, resolveVp, runDbx, runVp, viteCommandName, viteCommands, viteConfigObject, viteProvider, viteSyncTask, vpVersion, which };
|
|
9
|
+
export { DBX_TASKS, DEFAULT_LINT_IGNORE, DEFAULT_TEST_INCLUDE, DbxPluginOptions, DbxSource, DbxViteConfig, ResolvedDbx, ResolvedVp, RunVpOptions, VP_COMMANDS, VpCommandInfo, VpGroup, VpResult, VpSource, dbx, defineDbxConfig, describeVp, hasVp, renderViteConfig, resolveDbx, 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,viteCommandName as
|
|
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,defineDbxConfig as p,resolveDbx as m,runDbx as h}from"./plugin.js";import{viteProvider as g}from"./provider.js";import{DEFAULT_LINT_IGNORE as _,DEFAULT_TEST_INCLUDE as v,renderViteConfig as y,viteConfigObject as b,viteSyncTask as x}from"./sync.js";export{d as DBX_TASKS,_ as DEFAULT_LINT_IGNORE,v as DEFAULT_TEST_INCLUDE,e as VP_COMMANDS,f as dbx,p as defineDbxConfig,r as describeVp,i as hasVp,y as renderViteConfig,m as resolveDbx,a as resolveVp,t as resolveVpCommand,h as runDbx,l as runGuard,o as runVp,n as viteCommandName,u as viteCommands,b as viteConfigObject,g as viteProvider,x as viteSyncTask,s as vpVersion,c as which};
|
|
@@ -38,6 +38,12 @@ export interface RunVpOptions {
|
|
|
38
38
|
mode?: 'inherit' | 'capture';
|
|
39
39
|
/** Extra environment variables. */
|
|
40
40
|
env?: NodeJS.ProcessEnv;
|
|
41
|
+
/**
|
|
42
|
+
* Whether the child may colour its output. `false` sets `NO_COLOR=1` and
|
|
43
|
+
* `FORCE_COLOR=0` in the child env so Vite+ emits no colour; `true`/
|
|
44
|
+
* `undefined` leaves detection to the child.
|
|
45
|
+
*/
|
|
46
|
+
color?: boolean;
|
|
41
47
|
}
|
|
42
48
|
export interface VpResult {
|
|
43
49
|
code: number;
|
|
@@ -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 n from"node:fs";const r=process.platform===`win32`;function i(t){let n=e.join(t,`node_modules`,`.bin`,`vp`);return r?[`${n}.cmd`,`${n}.exe`,`${n}.ps1`,n]:[n]}function a(t){let i=r?(process.env.PATHEXT??`.COM;.EXE;.BAT;.CMD`).split(`;`).filter(Boolean):[``],a=(process.env.PATH??``).split(e.delimiter).filter(Boolean);for(let r of a)for(let a of i){let i=e.join(r,`${t}${a.toLowerCase()}`);try{return n.accessSync(i,n.constants.X_OK),i}catch{}}}function o(e=process.cwd()){for(let t of i(e))if(n.existsSync(t))return{exe:t,args:[],source:`local`};let t=a(`vp`);return t?{exe:t,args:[],source:`global`}:{exe:r?`npx.cmd`:`npx`,args:[`--yes`,`vite-plus`],source:`npx`}}function s(e=process.cwd()){return o(e).source!==`npx`}function c(e,n={}){let r=n.cwd??process.cwd(),i=o(r),a=n.mode===`capture
|
|
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 n from"node:fs";const r=process.platform===`win32`;function i(t){let n=e.join(t,`node_modules`,`.bin`,`vp`);return r?[`${n}.cmd`,`${n}.exe`,`${n}.ps1`,n]:[n]}function a(t){let i=r?(process.env.PATHEXT??`.COM;.EXE;.BAT;.CMD`).split(`;`).filter(Boolean):[``],a=(process.env.PATH??``).split(e.delimiter).filter(Boolean);for(let r of a)for(let a of i){let i=e.join(r,`${t}${a.toLowerCase()}`);try{return n.accessSync(i,n.constants.X_OK),i}catch{}}}function o(e=process.cwd()){for(let t of i(e))if(n.existsSync(t))return{exe:t,args:[],source:`local`};let t=a(`vp`);return t?{exe:t,args:[],source:`global`}:{exe:r?`npx.cmd`:`npx`,args:[`--yes`,`vite-plus`],source:`npx`}}function s(e=process.cwd()){return o(e).source!==`npx`}function c(e,n={}){let r=n.cwd??process.cwd(),i=o(r),a=n.mode===`capture`,s={...process.env,...n.env};return n.color===!1&&(s.NO_COLOR=`1`,s.FORCE_COLOR=`0`),new Promise(n=>{let o=``,c=``,l=t(i.exe,[...i.args,...e],{cwd:r,env:s,stdio:a?`pipe`:`inherit`});l.stdout?.on(`data`,e=>{o+=e}),l.stderr?.on(`data`,e=>{c+=e}),l.on(`error`,e=>{n({code:1,stdout:o,stderr:`${c}${String(e)}`,resolved:i})}),l.on(`exit`,e=>{n({code:e??0,stdout:o,stderr:c,resolved:i})})})}async function l(e=process.cwd()){let t=await c([`--version`],{cwd:e,mode:`capture`});if(t.code===0)return t.stdout.trim()||t.stderr.trim()||void 0}function u(e=process.cwd()){let t=o(e);return t.source===`local`?`local (node_modules/.bin/vp)`:t.source===`global`?`global (PATH)`:`npx --yes vite-plus`}export{u as describeVp,s as hasVp,o as resolveVp,c as runVp,l as vpVersion,a as which};
|
package/dist/shared.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
3
|
import { mergeJsonAt, readJsonAt, readJsonFile, toJson, writeJsonFile } from "./packages/shared/src/fs-utils.js";
|
|
4
|
+
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";
|
|
4
5
|
import { Sortable, deepMerge, isPlainObject, mapValues, resolveSort, sort } from "./packages/shared/src/object-utils.js";
|
|
5
6
|
import { ToolingProvider, ToolingProviderAction, ToolingProviderCommand, providerActions } from "./packages/shared/src/provider.js";
|
|
6
7
|
import { RunOptions, run, spawnCross } from "./packages/shared/src/run.js";
|
|
7
8
|
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";
|
|
8
9
|
import { ReplacementOptions, ReplacementValue, Replacements, Replacer, applyReplacements, applyReplacementsDeep, createReplacer, defineReplacements, extractTokens, hasUnresolvedTokens, tokenPattern } from "./packages/shared/src/template.js";
|
|
9
|
-
import { ChangelogWorkflowsConfig, DbxConfigSections, ProjectType, ToolingBiomeConfig, ToolingChangelogConfig, ToolingConfigSections, ToolingProjectConfig, ToolingTemplateKind, ToolingTemplateSource, ToolingTemplateSourceType, ToolingTemplatesConfig, ToolingTsconfigConfig, ToolingViteConfig, ToolingWatchConfig, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig } from "./packages/shared/src/config-types.js";
|
|
10
|
+
import { ChangelogWorkflowsConfig, DbxConfigSections, ProjectType, ToolingBiomeConfig, ToolingChangelogConfig, ToolingConfigSections, ToolingLoggerConfig, ToolingProjectConfig, ToolingProvidersConfig, ToolingTemplateKind, ToolingTemplateSource, ToolingTemplateSourceType, ToolingTemplatesConfig, ToolingTsconfigConfig, ToolingViteConfig, ToolingWatchConfig, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig } from "./packages/shared/src/config-types.js";
|
|
10
11
|
import { Awaitable, GeneratedFile, JsonValue, PackageJson, ToolingArgument, ToolingCommand, ToolingCommandContext, ToolingOption } from "./packages/shared/src/types.js";
|
|
11
|
-
import { CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, biomeConfigSchema, changelogConfigSchema, changelogWorkflowsConfigSchema, dbxConfigSchema, projectConfigSchema, projectTypeSchema, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, toolingConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema } from "./packages/shared/src/config-schema.js";
|
|
12
|
+
import { CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, biomeConfigSchema, changelogConfigSchema, changelogWorkflowsConfigSchema, dbxConfigSchema, loggerConfigSchema, projectConfigSchema, projectTypeSchema, providersConfigSchema, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, toolingConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema } from "./packages/shared/src/config-schema.js";
|
|
12
13
|
import { CONFIG_FILE_NAMES, DbxConfig, ManagedFile, SyncContext, SyncSummary, SyncTask, ToolingConfig, ToolingHooks, ToolingSection, defineConfig, repoSlugFromUrl, resolveTokens, sectionConfig, sectionEnabled } from "./packages/shared/src/toolchain.js";
|
|
13
14
|
import { YamlValue, toYaml } from "./packages/shared/src/yaml.js";
|
|
14
15
|
import "./packages/shared/src/index.js";
|
|
15
|
-
export { Awaitable, CONFIG_FILE_NAMES, CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, ChangelogWorkflowsConfig, DbxConfig, DbxConfigSections, GeneratedFile, JsonValue, ManagedFile, PackageJson, ProjectType, ReplacementOptions, ReplacementValue, Replacements, Replacer, RunOptions, Sortable, SyncContext, SyncSummary, SyncTask, ToolingArgument, ToolingBiomeConfig, ToolingChangelogConfig, ToolingCommand, ToolingCommandContext, ToolingConfig, ToolingConfigSections, ToolingHooks, ToolingOption, ToolingProjectConfig, ToolingProvider, ToolingProviderAction, ToolingProviderCommand, ToolingSection, ToolingTemplateKind, ToolingTemplateSource, ToolingTemplateSourceType, ToolingTemplatesConfig, ToolingTsconfigConfig, ToolingViteConfig, ToolingWatchConfig, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig, type YamlValue, applyReplacements, applyReplacementsDeep, asString, biomeConfigSchema, camelCase, camelCaseId, capitalize, changelogConfigSchema, changelogWorkflowsConfigSchema, constantCase, createReplacer, dbxConfigSchema, deepMerge, defineConfig, defineReplacements, ensureLeadingSlash, ensureSlashes, ensureTrailingSlash, extractTokens, formatCliFlag, hasText, hasUnresolvedTokens, indent, isLocalhost, isPlainObject, kebabCase, mapValues, mergeJsonAt, pascalCase, projectConfigSchema, projectTypeSchema, providerActions, readJsonAt, readJsonFile, removeDoubleSlashes, removeLeadingSlash, removeTrailingSlash, repoSlugFromUrl, resolveSort, resolveTokens, run, sanitizeSlashes, sectionConfig, sectionEnabled, snakeCase, sort, spawnCross, str, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, titleCase, toJson, toYaml, tokenPattern, toolingConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema, writeJsonFile };
|
|
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, ToolingArgument, ToolingBiomeConfig, ToolingChangelogConfig, ToolingCommand, ToolingCommandContext, ToolingConfig, ToolingConfigSections, ToolingHooks, ToolingLoggerConfig, ToolingOption, ToolingProjectConfig, ToolingProvider, ToolingProviderAction, ToolingProviderCommand, ToolingProvidersConfig, ToolingSection, ToolingTemplateKind, ToolingTemplateSource, ToolingTemplateSourceType, ToolingTemplatesConfig, ToolingTsconfigConfig, ToolingViteConfig, ToolingWatchConfig, 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, 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, toolingConfigSchema, 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{deepMerge as e,isPlainObject as t,mapValues as n,resolveSort as r,sort as i}from"./packages/shared/src/object-utils.js";import{mergeJsonAt as a,readJsonAt as o,readJsonFile as s,toJson as c,writeJsonFile as l}from"./packages/shared/src/fs-utils.js";import{
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;import{deepMerge as e,isPlainObject as t,mapValues as n,resolveSort as r,sort as i}from"./packages/shared/src/object-utils.js";import{mergeJsonAt as a,readJsonAt as o,readJsonFile as s,toJson as c,writeJsonFile as l}from"./packages/shared/src/fs-utils.js";import{LOG_LEVELS as u,configureLogger as d,createLogger as f,getLogOverrides as p,getLogger as m,isLogLevel as h,logger as g,normalizeLogLevel as _,setLogConfig as v,setLogOverrides as y,stripAnsi as b}from"./packages/shared/src/logger.js";import{providerActions as x}from"./packages/shared/src/provider.js";import{run as S,spawnCross as C}from"./packages/shared/src/run.js";import{asString as w,camelCase as T,camelCaseId as E,capitalize as D,constantCase as O,ensureLeadingSlash as k,ensureSlashes as A,ensureTrailingSlash as j,formatCliFlag as M,hasText as N,indent as P,isLocalhost as F,kebabCase as I,pascalCase as L,removeDoubleSlashes as R,removeLeadingSlash as z,removeTrailingSlash as B,sanitizeSlashes as V,snakeCase as H,str as U,titleCase as W}from"./packages/shared/src/string-utils.js";import{applyReplacements as G,applyReplacementsDeep as K,createReplacer as q,defineReplacements as J,extractTokens as Y,hasUnresolvedTokens as X,tokenPattern as Z}from"./packages/shared/src/template.js";import{CONFIG_SECTION_DESCRIPTIONS as Q,CONFIG_SECTION_SCHEMAS as $,CONFIG_TYPE_SCHEMAS as ee,biomeConfigSchema as te,changelogConfigSchema as ne,changelogWorkflowsConfigSchema as re,dbxConfigSchema as ie,loggerConfigSchema as ae,projectConfigSchema as oe,projectTypeSchema as se,providersConfigSchema as ce,templateKindSchema as le,templateSourceSchema as ue,templateSourceTypeSchema as de,templatesConfigSchema as fe,toolingConfigSchema as pe,tsconfigConfigSchema as me,viteConfigSchema as he,watchConfigSchema as ge,workflowConfigSchema as _e,workflowSettingSchema as ve,workflowStepSchema as ye,workflowStepsConfigSchema as be}from"./packages/shared/src/config-schema.js";import{CONFIG_FILE_NAMES as xe,defineConfig as Se,repoSlugFromUrl as Ce,resolveTokens as we,sectionConfig as Te,sectionEnabled as Ee}from"./packages/shared/src/toolchain.js";import{toYaml as De}from"./packages/shared/src/yaml.js";import"./packages/shared/src/index.js";export{xe as CONFIG_FILE_NAMES,Q as CONFIG_SECTION_DESCRIPTIONS,$ as CONFIG_SECTION_SCHEMAS,ee as CONFIG_TYPE_SCHEMAS,u as LOG_LEVELS,G as applyReplacements,K as applyReplacementsDeep,w as asString,te as biomeConfigSchema,T as camelCase,E as camelCaseId,D as capitalize,ne as changelogConfigSchema,re as changelogWorkflowsConfigSchema,d as configureLogger,O as constantCase,f as createLogger,q as createReplacer,ie as dbxConfigSchema,e as deepMerge,Se as defineConfig,J as defineReplacements,k as ensureLeadingSlash,A as ensureSlashes,j as ensureTrailingSlash,Y as extractTokens,M as formatCliFlag,p as getLogOverrides,m as getLogger,N as hasText,X as hasUnresolvedTokens,P as indent,F as isLocalhost,h as isLogLevel,t as isPlainObject,I as kebabCase,g as logger,ae as loggerConfigSchema,n as mapValues,a as mergeJsonAt,_ as normalizeLogLevel,L as pascalCase,oe as projectConfigSchema,se as projectTypeSchema,x as providerActions,ce as providersConfigSchema,o as readJsonAt,s as readJsonFile,R as removeDoubleSlashes,z as removeLeadingSlash,B as removeTrailingSlash,Ce as repoSlugFromUrl,r as resolveSort,we as resolveTokens,S as run,V as sanitizeSlashes,Te as sectionConfig,Ee as sectionEnabled,v as setLogConfig,y as setLogOverrides,H as snakeCase,i as sort,C as spawnCross,U as str,b as stripAnsi,le as templateKindSchema,ue as templateSourceSchema,de as templateSourceTypeSchema,fe as templatesConfigSchema,W as titleCase,c as toJson,De as toYaml,Z as tokenPattern,pe as toolingConfigSchema,me as tsconfigConfigSchema,he as viteConfigSchema,ge as watchConfigSchema,_e as workflowConfigSchema,ve as workflowSettingSchema,ye as workflowStepSchema,be as workflowStepsConfigSchema,l as writeJsonFile};
|
package/dist/sync.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node:path";import"node:url";import.meta.url;import{sectionConfig as e,sectionEnabled as t}from"./packages/shared/src/toolchain.js";import"./packages/shared/src/index.js";import{biomeSyncTask as n,biomeVscodeSettings as r}from"./packages/biome/src/index.js";import{conventionalCommitsVscodeExtensions as i,conventionalCommitsVscodeSettings as a}from"./packages/changelog/src/templates.js";import{changelogSyncTask as o}from"./packages/changelog/src/sync.js";import"./packages/changelog/src/index.js";import{vscodeSyncTask as s}from"./packages/core/src/vscode.js";import"./packages/core/src/index.js";import{tsconfigSyncTask as c}from"./packages/tsconfig/src/sync.js";import"./packages/tsconfig/src/index.js";function
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;import{sectionConfig as e,sectionEnabled as t}from"./packages/shared/src/toolchain.js";import"./packages/shared/src/index.js";import{biomeSyncTask as n,biomeVscodeSettings as r}from"./packages/biome/src/index.js";import{conventionalCommitsVscodeExtensions as i,conventionalCommitsVscodeSettings as a}from"./packages/changelog/src/templates.js";import{changelogSyncTask as o}from"./packages/changelog/src/sync.js";import"./packages/changelog/src/index.js";import{vscodeSyncTask as s}from"./packages/core/src/vscode.js";import"./packages/core/src/index.js";import{tsconfigSyncTask as c}from"./packages/tsconfig/src/sync.js";import"./packages/tsconfig/src/index.js";import{viteSyncTask as l}from"./packages/vite/src/sync.js";import"./packages/vite/src/index.js";function u(){return[o(),n(),c(),l(),s({settings:e=>[...t(e.biome)?[r]:[],a],extensions:[...i.recommendations],enabled:n=>t(n.changelog)&&e(n.changelog)?.vscode!==!1||t(n.biome)&&e(n.biome)?.vscode!==!1})]}export{u as defaultSyncTasks};
|
package/dist/vite.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { VP_COMMANDS, VpCommandInfo, VpGroup, resolveVpCommand, viteCommandName } from "./packages/vite/src/commands.js";
|
|
4
|
+
import { runGuard, viteCommands } from "./packages/vite/src/cli/index.js";
|
|
5
5
|
import { DBX_TASKS, DbxPluginOptions, DbxSource, DbxViteConfig, ResolvedDbx, dbx, defineDbxConfig, resolveDbx, runDbx } from "./packages/vite/src/plugin.js";
|
|
6
6
|
import { viteProvider } from "./packages/vite/src/provider.js";
|
|
7
7
|
import { DEFAULT_LINT_IGNORE, DEFAULT_TEST_INCLUDE, renderViteConfig, viteConfigObject, viteSyncTask } from "./packages/vite/src/sync.js";
|
|
8
8
|
import { ResolvedVp, RunVpOptions, VpResult, VpSource, describeVp, hasVp, resolveVp, runVp, vpVersion, which } from "./packages/vite/src/vp.js";
|
|
9
9
|
import "./packages/vite/src/index.js";
|
|
10
|
-
export { DBX_TASKS, DEFAULT_LINT_IGNORE, DEFAULT_TEST_INCLUDE, DbxPluginOptions, DbxSource, DbxViteConfig, ResolvedDbx, ResolvedVp, RunVpOptions, VP_COMMANDS, VpCommandInfo, VpGroup, VpResult, VpSource, dbx, defineDbxConfig, describeVp, hasVp, renderViteConfig, resolveDbx, resolveVp, runDbx, runVp, viteCommandName, viteCommands, viteConfigObject, viteProvider, viteSyncTask, vpVersion, which };
|
|
10
|
+
export { DBX_TASKS, DEFAULT_LINT_IGNORE, DEFAULT_TEST_INCLUDE, DbxPluginOptions, DbxSource, DbxViteConfig, ResolvedDbx, ResolvedVp, RunVpOptions, VP_COMMANDS, VpCommandInfo, VpGroup, VpResult, VpSource, dbx, defineDbxConfig, describeVp, hasVp, renderViteConfig, resolveDbx, 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,viteCommandName as
|
|
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,defineDbxConfig as p,resolveDbx as m,runDbx as h}from"./packages/vite/src/plugin.js";import{viteProvider as g}from"./packages/vite/src/provider.js";import{DEFAULT_LINT_IGNORE as _,DEFAULT_TEST_INCLUDE as v,renderViteConfig as y,viteConfigObject as b,viteSyncTask as x}from"./packages/vite/src/sync.js";import"./packages/vite/src/index.js";export{d as DBX_TASKS,_ as DEFAULT_LINT_IGNORE,v as DEFAULT_TEST_INCLUDE,e as VP_COMMANDS,f as dbx,p as defineDbxConfig,r as describeVp,i as hasVp,y as renderViteConfig,m as resolveDbx,a as resolveVp,t as resolveVpCommand,h as runDbx,l as runGuard,o as runVp,n as viteCommandName,u as viteCommands,b as viteConfigObject,g as viteProvider,x 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.3.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>",
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
"commander": "^14.0.0",
|
|
68
68
|
"glob": "^13.0.6",
|
|
69
69
|
"lodash": "^4.18.1",
|
|
70
|
+
"picocolors": "^1.1.1",
|
|
70
71
|
"tsdown": "^0.23.0",
|
|
71
72
|
"untyped": "^2.0.0",
|
|
72
73
|
"zod": "^4.3.0"
|
|
@@ -74,17 +75,17 @@
|
|
|
74
75
|
"devDependencies": {
|
|
75
76
|
"@commitlint/cli": "^21.2.2",
|
|
76
77
|
"@commitlint/config-conventional": "^21.2.2",
|
|
77
|
-
"@deltabox/toolchain-biome": "1.
|
|
78
|
-
"@deltabox/toolchain-changelog": "1.
|
|
79
|
-
"@deltabox/toolchain-config": "1.
|
|
80
|
-
"@deltabox/toolchain-core": "1.
|
|
81
|
-
"@deltabox/toolchain-migrate": "1.
|
|
82
|
-
"@deltabox/toolchain-project": "1.
|
|
83
|
-
"@deltabox/toolchain-shared": "1.
|
|
84
|
-
"@deltabox/toolchain-template": "1.
|
|
85
|
-
"@deltabox/toolchain-tsconfig": "1.
|
|
86
|
-
"@deltabox/toolchain-tsdown": "1.
|
|
87
|
-
"@deltabox/toolchain-vite": "1.
|
|
78
|
+
"@deltabox/toolchain-biome": "1.3.0",
|
|
79
|
+
"@deltabox/toolchain-changelog": "1.3.0",
|
|
80
|
+
"@deltabox/toolchain-config": "1.3.0",
|
|
81
|
+
"@deltabox/toolchain-core": "1.3.0",
|
|
82
|
+
"@deltabox/toolchain-migrate": "1.3.0",
|
|
83
|
+
"@deltabox/toolchain-project": "1.3.0",
|
|
84
|
+
"@deltabox/toolchain-shared": "1.3.0",
|
|
85
|
+
"@deltabox/toolchain-template": "1.3.0",
|
|
86
|
+
"@deltabox/toolchain-tsconfig": "1.3.0",
|
|
87
|
+
"@deltabox/toolchain-tsdown": "1.3.0",
|
|
88
|
+
"@deltabox/toolchain-vite": "1.3.0",
|
|
88
89
|
"@types/node": "^22.10.2",
|
|
89
90
|
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
90
91
|
"cross-env": "^10.1.0",
|