@deltabox/toolchain 1.3.1 → 1.6.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 +117 -4
- package/README.md +32 -39
- package/dist/changelog.d.ts +3 -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 +11 -9
- 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/cli/index.js +1 -1
- package/dist/packages/changelog/src/index.d.ts +4 -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/run.d.ts +8 -2
- package/dist/packages/changelog/src/run.js +1 -1
- package/dist/packages/changelog/src/sync.d.ts +13 -5
- package/dist/packages/changelog/src/sync.js +1 -1
- package/dist/packages/changelog/src/utils/versioning.d.ts +78 -0
- package/dist/packages/changelog/src/utils/versioning.js +1 -0
- package/dist/packages/changelog/src/utils/write.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 +32 -0
- package/dist/packages/shared/src/bin.js +1 -0
- package/dist/packages/shared/src/config-schema.d.ts +131 -57
- package/dist/packages/shared/src/config-schema.js +1 -1
- package/dist/packages/shared/src/config-types.d.ts +42 -39
- package/dist/packages/shared/src/index.d.ts +9 -8
- 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/run.d.ts +22 -2
- package/dist/packages/shared/src/run.js +1 -1
- 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 +32 -19
- 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/packages/vite/src/vp.d.ts +5 -0
- package/dist/packages/vite/src/vp.js +1 -1
- 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 +8 -7
- 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,19 +1,20 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { TOOLCHAIN_PACKAGE, findOwnCliEntry, localToolchainVersion } from "./bin.js";
|
|
3
4
|
import { mergeJsonAt, readJsonAt, readJsonFile, toJson, writeJsonFile } from "./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 "./logger.js";
|
|
5
6
|
import { Sortable, deepMerge, isPlainObject, mapValues, resolveSort, sort } from "./object-utils.js";
|
|
6
|
-
import {
|
|
7
|
-
import { RunOptions, run, spawnCross } from "./run.js";
|
|
7
|
+
import { ToolchainProvider, ToolchainProviderAction, ToolchainProviderCommand, providerActions } from "./provider.js";
|
|
8
|
+
import { RunOptions, SpawnCrossOptions, killProcessTree, run, spawnCross } from "./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 "./string-utils.js";
|
|
9
10
|
import { ReplacementOptions, ReplacementValue, Replacements, Replacer, applyReplacements, applyReplacementsDeep, createReplacer, defineReplacements, extractTokens, hasUnresolvedTokens, tokenPattern } from "./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 { ChangelogVersioning, ChangelogVersioningConfig, ChangelogVersioningTarget, ChangelogWorkflowsConfig, DbxConfigSections, ProjectType, ToolchainBiomeConfig, ToolchainChangelogConfig, ToolchainConfigSections, ToolchainLoggerConfig, ToolchainProjectConfig, ToolchainProvidersConfig, ToolchainTemplateKind, ToolchainTemplateSource, ToolchainTemplateSourceType, ToolchainTemplatesConfig, ToolchainTsconfigConfig, ToolchainViteConfig, ToolchainWatchConfig, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig } from "./config-types.js";
|
|
12
|
+
import { Awaitable, GeneratedFile, JsonValue, PackageJson, ToolchainArgument, ToolchainCommand, ToolchainCommandContext, ToolchainOption } from "./types.js";
|
|
13
|
+
import { CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, biomeConfigSchema, changelogConfigSchema, changelogVersioningConfigSchema, changelogVersioningSchema, changelogVersioningTargetSchema, changelogWorkflowsConfigSchema, dbxConfigSchema, loggerConfigSchema, projectConfigSchema, projectTypeSchema, providersConfigSchema, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema } from "./config-schema.js";
|
|
14
|
+
import { CONFIG_FILE_NAMES, DbxConfig, ManagedFile, SyncContext, SyncSummary, SyncTask, ToolchainConfig, ToolchainHooks, ToolchainSection, defineConfig, repoSlugFromUrl, resolveTokens, sectionConfig, sectionEnabled } from "./toolchain.js";
|
|
14
15
|
import { YamlValue, toYaml } from "./yaml.js";
|
|
15
16
|
declare namespace index_d_exports {
|
|
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, ChangelogVersioning, ChangelogVersioningConfig, ChangelogVersioningTarget, ChangelogWorkflowsConfig, Colors, DbxConfig, DbxConfigSections, GeneratedFile, JsonValue, LOG_LEVELS, LogChannel, LogLevel, Logger, LoggerConfig, LoggerOptions, ManagedFile, PackageJson, ProjectType, ReplacementOptions, ReplacementValue, Replacements, Replacer, RunOptions, Sortable, SpawnCrossOptions, 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, YamlValue, applyReplacements, applyReplacementsDeep, asString, biomeConfigSchema, camelCase, camelCaseId, capitalize, changelogConfigSchema, changelogVersioningConfigSchema, changelogVersioningSchema, changelogVersioningTargetSchema, changelogWorkflowsConfigSchema, configureLogger, constantCase, createLogger, createReplacer, dbxConfigSchema, deepMerge, defineConfig, defineReplacements, ensureLeadingSlash, ensureSlashes, ensureTrailingSlash, extractTokens, findOwnCliEntry, formatCliFlag, getLogOverrides, getLogger, hasText, hasUnresolvedTokens, indent, isLocalhost, isLogLevel, isPlainObject, kebabCase, killProcessTree, localToolchainVersion, 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 };
|
|
17
18
|
}
|
|
18
19
|
//#endregion
|
|
19
|
-
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,
|
|
20
|
+
export { Awaitable, CONFIG_FILE_NAMES, CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, ChangelogVersioning, ChangelogVersioningConfig, ChangelogVersioningTarget, ChangelogWorkflowsConfig, Colors, DbxConfig, DbxConfigSections, GeneratedFile, JsonValue, LOG_LEVELS, LogChannel, LogLevel, Logger, LoggerConfig, LoggerOptions, ManagedFile, PackageJson, ProjectType, ReplacementOptions, ReplacementValue, Replacements, Replacer, RunOptions, Sortable, SpawnCrossOptions, 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, changelogVersioningConfigSchema, changelogVersioningSchema, changelogVersioningTargetSchema, changelogWorkflowsConfigSchema, configureLogger, constantCase, createLogger, createReplacer, dbxConfigSchema, deepMerge, defineConfig, defineReplacements, ensureLeadingSlash, ensureSlashes, ensureTrailingSlash, extractTokens, findOwnCliEntry, formatCliFlag, getLogOverrides, getLogger, hasText, hasUnresolvedTokens, indent, index_d_exports, isLocalhost, isLogLevel, isPlainObject, kebabCase, killProcessTree, localToolchainVersion, 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 };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node:path";import"node:url";import.meta.url;import{__exportAll as ee}from"../../../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;import{__exportAll as ee}from"../../../_virtual/_rolldown/runtime.js";import{TOOLCHAIN_PACKAGE as e,findOwnCliEntry as t,localToolchainVersion as n}from"./bin.js";import{deepMerge as r,isPlainObject as i,mapValues as a,resolveSort as o,sort as s}from"./object-utils.js";import{mergeJsonAt as c,readJsonAt as l,readJsonFile as u,toJson as d,writeJsonFile as f}from"./fs-utils.js";import{LOG_LEVELS as p,configureLogger as m,createLogger as h,getLogOverrides as g,getLogger as _,isLogLevel as v,logger as y,normalizeLogLevel as b,setLogConfig as x,setLogOverrides as S,stripAnsi as C}from"./logger.js";import{providerActions as w}from"./provider.js";import{killProcessTree as T,run as E,spawnCross as D}from"./run.js";import{asString as O,camelCase as k,camelCaseId as A,capitalize as j,constantCase as M,ensureLeadingSlash as N,ensureSlashes as P,ensureTrailingSlash as F,formatCliFlag as I,hasText as L,indent as R,isLocalhost as z,kebabCase as B,pascalCase as V,removeDoubleSlashes as H,removeLeadingSlash as U,removeTrailingSlash as W,sanitizeSlashes as G,snakeCase as K,str as q,titleCase as te}from"./string-utils.js";import{applyReplacements as J,applyReplacementsDeep as Y,createReplacer as X,defineReplacements as Z,extractTokens as Q,hasUnresolvedTokens as $,tokenPattern as ne}from"./template.js";import{CONFIG_SECTION_DESCRIPTIONS as re,CONFIG_SECTION_SCHEMAS as ie,CONFIG_TYPE_SCHEMAS as ae,biomeConfigSchema as oe,changelogConfigSchema as se,changelogVersioningConfigSchema as ce,changelogVersioningSchema as le,changelogVersioningTargetSchema as ue,changelogWorkflowsConfigSchema as de,dbxConfigSchema as fe,loggerConfigSchema as pe,projectConfigSchema as me,projectTypeSchema as he,providersConfigSchema as ge,templateKindSchema as _e,templateSourceSchema as ve,templateSourceTypeSchema as ye,templatesConfigSchema as be,toolchainConfigSchema as xe,tsconfigConfigSchema as Se,viteConfigSchema as Ce,watchConfigSchema as we,workflowConfigSchema as Te,workflowSettingSchema as Ee,workflowStepSchema as De,workflowStepsConfigSchema as Oe}from"./config-schema.js";import{CONFIG_FILE_NAMES as ke,defineConfig as Ae,repoSlugFromUrl as je,resolveTokens as Me,sectionConfig as Ne,sectionEnabled as Pe}from"./toolchain.js";import{toYaml as Fe}from"./yaml.js";var Ie=/* @__PURE__ */ ee({CONFIG_FILE_NAMES:()=>ke,CONFIG_SECTION_DESCRIPTIONS:()=>re,CONFIG_SECTION_SCHEMAS:()=>ie,CONFIG_TYPE_SCHEMAS:()=>ae,LOG_LEVELS:()=>p,TOOLCHAIN_PACKAGE:()=>e,applyReplacements:()=>J,applyReplacementsDeep:()=>Y,asString:()=>O,biomeConfigSchema:()=>oe,camelCase:()=>k,camelCaseId:()=>A,capitalize:()=>j,changelogConfigSchema:()=>se,changelogVersioningConfigSchema:()=>ce,changelogVersioningSchema:()=>le,changelogVersioningTargetSchema:()=>ue,changelogWorkflowsConfigSchema:()=>de,configureLogger:()=>m,constantCase:()=>M,createLogger:()=>h,createReplacer:()=>X,dbxConfigSchema:()=>fe,deepMerge:()=>r,defineConfig:()=>Ae,defineReplacements:()=>Z,ensureLeadingSlash:()=>N,ensureSlashes:()=>P,ensureTrailingSlash:()=>F,extractTokens:()=>Q,findOwnCliEntry:()=>t,formatCliFlag:()=>I,getLogOverrides:()=>g,getLogger:()=>_,hasText:()=>L,hasUnresolvedTokens:()=>$,indent:()=>R,isLocalhost:()=>z,isLogLevel:()=>v,isPlainObject:()=>i,kebabCase:()=>B,killProcessTree:()=>T,localToolchainVersion:()=>n,logger:()=>y,loggerConfigSchema:()=>pe,mapValues:()=>a,mergeJsonAt:()=>c,normalizeLogLevel:()=>b,pascalCase:()=>V,projectConfigSchema:()=>me,projectTypeSchema:()=>he,providerActions:()=>w,providersConfigSchema:()=>ge,readJsonAt:()=>l,readJsonFile:()=>u,removeDoubleSlashes:()=>H,removeLeadingSlash:()=>U,removeTrailingSlash:()=>W,repoSlugFromUrl:()=>je,resolveSort:()=>o,resolveTokens:()=>Me,run:()=>E,sanitizeSlashes:()=>G,sectionConfig:()=>Ne,sectionEnabled:()=>Pe,setLogConfig:()=>x,setLogOverrides:()=>S,snakeCase:()=>K,sort:()=>s,spawnCross:()=>D,str:()=>q,stripAnsi:()=>C,templateKindSchema:()=>_e,templateSourceSchema:()=>ve,templateSourceTypeSchema:()=>ye,templatesConfigSchema:()=>be,titleCase:()=>te,toJson:()=>d,toYaml:()=>Fe,tokenPattern:()=>ne,toolchainConfigSchema:()=>xe,tsconfigConfigSchema:()=>Se,viteConfigSchema:()=>Ce,watchConfigSchema:()=>we,workflowConfigSchema:()=>Te,workflowSettingSchema:()=>Ee,workflowStepSchema:()=>De,workflowStepsConfigSchema:()=>Oe,writeJsonFile:()=>f});export{ke as CONFIG_FILE_NAMES,re as CONFIG_SECTION_DESCRIPTIONS,ie as CONFIG_SECTION_SCHEMAS,ae as CONFIG_TYPE_SCHEMAS,p as LOG_LEVELS,e as TOOLCHAIN_PACKAGE,J as applyReplacements,Y as applyReplacementsDeep,O as asString,oe as biomeConfigSchema,k as camelCase,A as camelCaseId,j as capitalize,se as changelogConfigSchema,ce as changelogVersioningConfigSchema,le as changelogVersioningSchema,ue as changelogVersioningTargetSchema,de as changelogWorkflowsConfigSchema,m as configureLogger,M as constantCase,h as createLogger,X as createReplacer,fe as dbxConfigSchema,r as deepMerge,Ae as defineConfig,Z as defineReplacements,N as ensureLeadingSlash,P as ensureSlashes,F as ensureTrailingSlash,Q as extractTokens,t as findOwnCliEntry,I as formatCliFlag,g as getLogOverrides,_ as getLogger,L as hasText,$ as hasUnresolvedTokens,R as indent,z as isLocalhost,v as isLogLevel,i as isPlainObject,B as kebabCase,T as killProcessTree,n as localToolchainVersion,y as logger,pe as loggerConfigSchema,a as mapValues,c as mergeJsonAt,b as normalizeLogLevel,V as pascalCase,me as projectConfigSchema,he as projectTypeSchema,w as providerActions,ge as providersConfigSchema,l as readJsonAt,u as readJsonFile,H as removeDoubleSlashes,U as removeLeadingSlash,W as removeTrailingSlash,je as repoSlugFromUrl,o as resolveSort,Me as resolveTokens,E as run,G as sanitizeSlashes,Ne as sectionConfig,Pe as sectionEnabled,x as setLogConfig,S as setLogOverrides,K as snakeCase,s as sort,D as spawnCross,Ie as src_exports,q as str,C as stripAnsi,_e as templateKindSchema,ve as templateSourceSchema,ye as templateSourceTypeSchema,be as templatesConfigSchema,te as titleCase,d as toJson,Fe as toYaml,ne as tokenPattern,xe as toolchainConfigSchema,Se as tsconfigConfigSchema,Ce as viteConfigSchema,we as watchConfigSchema,Te as workflowConfigSchema,Ee as workflowSettingSchema,De as workflowStepSchema,Oe as workflowStepsConfigSchema,f as writeJsonFile};
|
|
@@ -13,7 +13,10 @@ export declare const LOG_LEVELS: readonly ['debug', 'info', 'warn', 'error', 'si
|
|
|
13
13
|
export interface LoggerOptions {
|
|
14
14
|
/** Minimum level to print (default `info`). */
|
|
15
15
|
level?: LogLevel;
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Force colors on/off (default: on). The toolchain colors its output by
|
|
18
|
+
* default; `--no-color` or `logger.color: false` turn it off.
|
|
19
|
+
*/
|
|
17
20
|
color?: boolean;
|
|
18
21
|
/** Prefix non-indented lines with `<name>:` (default `dbx`). */
|
|
19
22
|
name?: string;
|
|
@@ -23,11 +26,11 @@ export interface Logger {
|
|
|
23
26
|
readonly level: LogLevel;
|
|
24
27
|
/** A `picocolors` color set honoring the color setting. */
|
|
25
28
|
readonly colors: Colors;
|
|
26
|
-
/** Machine-readable output: raw to stdout, no prefix, no
|
|
29
|
+
/** Machine-readable output: raw to stdout, no prefix, no decoration. */
|
|
27
30
|
raw(message?: string): void;
|
|
28
|
-
/** Raw output to stderr, no prefix, no
|
|
31
|
+
/** Raw output to stderr, no prefix, no decoration. */
|
|
29
32
|
rawError(message?: string): void;
|
|
30
|
-
/** Write `text` verbatim to a channel (no prefix, no
|
|
33
|
+
/** Write `text` verbatim to a channel (no prefix, no decoration, no newline). */
|
|
31
34
|
write(channel: LogChannel, text: string): void;
|
|
32
35
|
debug(message?: string): void;
|
|
33
36
|
info(message?: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node:path";import"node:url";import.meta.url;import e from"picocolors";const
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;import{log as e}from"@clack/prompts";import t from"picocolors";const n=[`debug`,`info`,`warn`,`error`,`silent`],r={debug:0,info:1,warn:2,error:3,silent:4};function i(e){return typeof e==`string`&&n.includes(e)}function a(e,t=`info`){return i(e)?e:t}function o(e){return e.replace(/\x1b\[[0-9;]*m/g,``)}function s(n={}){let i=a(n.level),o=r[i],s=t.createColors(n.color??!0),c=n.name?`${n.name}: `:``;typeof n.color==`boolean`&&d(n.color);let l=e=>!c||e===``||/^\s/.test(e)?e:`${c}${e}`,u=(e,t,n)=>{e(l(t),{spacing:0,...n?{output:n}:{}})};return{level:i,colors:s,raw:(e=``)=>{process.stdout.write(`${e}\n`)},rawError:(e=``)=>{process.stderr.write(`${e}\n`)},write:(e,t)=>{e===`err`?process.stderr.write(t):process.stdout.write(t)},debug:(t=``)=>{o<=r.debug&&u(e.message,t)},info:(t=``)=>{o<=r.info&&u(e.info,t)},success:(t=``)=>{o<=r.info&&u(e.success,t)},warn:(t=``)=>{o<=r.warn&&u(e.warn,t,process.stderr)},error:(t=``)=>{o<=r.error&&u(e.error,t,process.stderr)}}}let c={},l={};function u(e){return!e||typeof e!=`object`?{}:{...i(e.level)?{level:e.level}:{},...typeof e.color==`boolean`?{color:e.color}:{},...typeof e.name==`string`?{name:e.name}:{}}}function d(e){e?(delete process.env.NO_COLOR,process.env.FORCE_COLOR=`1`):(delete process.env.FORCE_COLOR,process.env.NO_COLOR=`1`)}function f(e=!0){let t={name:`dbx`,...c,...l};return e&&t.color===void 0&&(t.color=!0),s(t)}let p=f(!1);function m(e){c=u(e),p=f()}function h(e){l=e,p=f()}function g(e){h(e)}function _(){return l}function v(){return p}const y={get level(){return p.level},get colors(){return p.colors},raw:(e=``)=>p.raw(e),rawError:(e=``)=>p.rawError(e),write:(e,t)=>p.write(e,t),debug:(e=``)=>p.debug(e),info:(e=``)=>p.info(e),success:(e=``)=>p.success(e),warn:(e=``)=>p.warn(e),error:(e=``)=>p.error(e)};export{n as LOG_LEVELS,g as configureLogger,s as createLogger,_ as getLogOverrides,v as getLogger,i as isLogLevel,y as logger,a as normalizeLogLevel,m as setLogConfig,h as setLogOverrides,o as stripAnsi};
|
|
@@ -15,7 +15,7 @@ import __tsdown_shims_url from 'node:url';
|
|
|
15
15
|
* this description (the extension over `dbx providers --json`).
|
|
16
16
|
*/
|
|
17
17
|
/** A CLI command a provider contributes (namespaced, eg. `vite:dev`). */
|
|
18
|
-
export interface
|
|
18
|
+
export interface ToolchainProviderCommand {
|
|
19
19
|
/** The namespaced `dbx` command name, eg. `vite:dev`. */
|
|
20
20
|
name: string;
|
|
21
21
|
/** The wrapped subcommand on the provider binary, eg. `dev`. */
|
|
@@ -28,7 +28,7 @@ export interface ToolingProviderCommand {
|
|
|
28
28
|
aliases?: string[];
|
|
29
29
|
}
|
|
30
30
|
/** A curated action the VS Code extension can surface for a provider. */
|
|
31
|
-
export interface
|
|
31
|
+
export interface ToolchainProviderAction {
|
|
32
32
|
/** Stable id, unique within the provider. */
|
|
33
33
|
id: string;
|
|
34
34
|
/** Menu label. */
|
|
@@ -41,7 +41,7 @@ export interface ToolingProviderAction {
|
|
|
41
41
|
group?: string;
|
|
42
42
|
}
|
|
43
43
|
/** A provider descriptor consumed by the CLI + the VS Code extension. */
|
|
44
|
-
export interface
|
|
44
|
+
export interface ToolchainProvider {
|
|
45
45
|
/** Stable id, eg. `vite-plus`. */
|
|
46
46
|
id: string;
|
|
47
47
|
/** Display name, eg. `Vite+`. */
|
|
@@ -53,14 +53,14 @@ export interface ToolingProvider {
|
|
|
53
53
|
/** The external binary the provider wraps, eg. `vp`. */
|
|
54
54
|
binary?: string;
|
|
55
55
|
/** The commands the provider contributes to the CLI. */
|
|
56
|
-
commands:
|
|
56
|
+
commands: ToolchainProviderCommand[];
|
|
57
57
|
/** Curated actions for the extension (defaults to one per command). */
|
|
58
|
-
actions?:
|
|
58
|
+
actions?: ToolchainProviderAction[];
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
61
|
* Derive the default actions (one per command) for a provider that does not
|
|
62
62
|
* declare its own. This keeps a provider descriptor minimal while still giving
|
|
63
63
|
* the extension something to render.
|
|
64
64
|
*/
|
|
65
|
-
export declare function providerActions(provider:
|
|
65
|
+
export declare function providerActions(provider: ToolchainProvider): ToolchainProviderAction[];
|
|
66
66
|
//#endregion
|
|
@@ -2,7 +2,24 @@ import __tsdown_shims_path from 'node:path';
|
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
3
|
import { ChildProcess, SpawnOptions } from "node:child_process";
|
|
4
4
|
//#region packages/shared/src/run.d.ts
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Kill a child process **and its descendants**. On Windows the child is a
|
|
7
|
+
* `cmd.exe` wrapper, so a plain `child.kill()` would orphan the real command;
|
|
8
|
+
* `taskkill /t` tears down the whole tree. On POSIX the child is killed directly.
|
|
9
|
+
*/
|
|
10
|
+
export declare function killProcessTree(child: ChildProcess, signal?: NodeJS.Signals): void;
|
|
11
|
+
/** {@link spawnCross} options: {@link SpawnOptions} plus an optional deadline. */
|
|
12
|
+
export interface SpawnCrossOptions extends SpawnOptions {
|
|
13
|
+
/**
|
|
14
|
+
* Kill the child (and its tree) after this many ms. Use it for one-shot
|
|
15
|
+
* commands so a hung child can never be left running; omit it for
|
|
16
|
+
* long-running processes (dev servers, watchers).
|
|
17
|
+
*/
|
|
18
|
+
timeoutMs?: number;
|
|
19
|
+
/** Called instead of the default warning when the deadline is hit. */
|
|
20
|
+
onTimeout?: (cmd: string, timeoutMs: number) => void;
|
|
21
|
+
}
|
|
22
|
+
export interface RunOptions extends SpawnCrossOptions {
|
|
6
23
|
/** Exit the main process with the child's exit code (default true). */
|
|
7
24
|
exitWithMainProc?: boolean;
|
|
8
25
|
/** Append a trailing `--` to the args (default true). */
|
|
@@ -15,8 +32,11 @@ export interface RunOptions extends SpawnOptions {
|
|
|
15
32
|
* child process. On Windows the command and every argument are escaped for
|
|
16
33
|
* `cmd.exe` (and a `.cmd`/`.bat` shim is re-escaped) so a caller-supplied argv
|
|
17
34
|
* value can never inject a command. `options.stdio` defaults to `inherit`.
|
|
35
|
+
*
|
|
36
|
+
* When `timeoutMs` is set the child's whole process tree is killed once the
|
|
37
|
+
* deadline passes (with a warning), so a stalled command can't hang forever.
|
|
18
38
|
*/
|
|
19
|
-
export declare function spawnCross(cmd: string, args: string[], options?:
|
|
39
|
+
export declare function spawnCross(cmd: string, args: string[], options?: SpawnCrossOptions): ChildProcess;
|
|
20
40
|
/**
|
|
21
41
|
* Spawn a command without a shell in a cross-platform safe way. On Windows the
|
|
22
42
|
* command and every argument are escaped for `cmd.exe` so a caller-supplied
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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,spawnSync as i}from"node:child_process";const a=process.platform===`win32`;let o=!1;const s=/([()\][%!^"`<>&|;, *?])/g;function c(e){return e.replace(s,`^$1`)}function l(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(s,`^$1`),t&&(n=n.replace(s,`^$1`)),n}function u(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 d(e){let t=u(e)??e;return/\.(cmd|bat)$/i.test(t)}function f(e,t=`SIGKILL`){let n=e.pid;if(n!==void 0){if(a)try{i(`taskkill`,[`/pid`,String(n),`/t`,`/f`],{stdio:`ignore`});return}catch{}try{e.kill(t)}catch{}}}function p(e,n,i={}){let{timeoutMs:s,onTimeout:u,...p}=i,m;if(a){let i=d(e),a=[c(e),...n.map(e=>l(e,i))].join(` `),s=process.env.ComSpec;!s&&!o&&(o=!0,t.warn(`ComSpec is not set — falling back to cmd.exe.`)),m=r(s??`cmd.exe`,[`/d`,`/s`,`/c`,`"${a}"`],{stdio:`inherit`,...p,shell:!1,windowsVerbatimArguments:!0})}else m=r(e,n,{stdio:`inherit`,...p,shell:!1});if(s!==void 0&&s>0){let n=setTimeout(()=>{u?u(e,s):t.warn(`\`${e}\` exceeded ${s}ms — terminating it.`),f(m)},s);n.unref?.(),m.once(`exit`,()=>clearTimeout(n))}return m}function m(e,n,r){let{exitWithMainProc:i=!0,argsEndingDashes:a=!0,verbose:o=!0,timeoutMs:s,...c}=r??{},l=[...n,...a?[`--`]:[]];o&&t.info(`$ ${e} ${l.join(` `)}`);let u=p(e,l,{...c,...s===void 0?{}:{timeoutMs:s}});return i&&u.on(`exit`,process.exit),u}export{f as killProcessTree,m as run,p as spawnCross};
|
|
@@ -1,11 +1,11 @@
|
|
|
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,
|
|
4
|
+
import { ChangelogVersioning, ChangelogVersioningConfig, ChangelogVersioningTarget, ChangelogWorkflowsConfig, DbxConfigSections, ProjectType, ToolchainBiomeConfig, ToolchainChangelogConfig, ToolchainConfigSections, ToolchainLoggerConfig, ToolchainProjectConfig, ToolchainProvidersConfig, ToolchainTemplateKind, ToolchainTemplateSource, ToolchainTemplateSourceType, ToolchainTemplatesConfig, ToolchainTsconfigConfig, ToolchainViteConfig, ToolchainWatchConfig, 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, loggerConfigSchema, projectConfigSchema, projectTypeSchema, providersConfigSchema, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema,
|
|
6
|
+
import { CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, biomeConfigSchema, changelogConfigSchema, changelogVersioningConfigSchema, changelogVersioningSchema, changelogVersioningTargetSchema, changelogWorkflowsConfigSchema, dbxConfigSchema, loggerConfigSchema, projectConfigSchema, projectTypeSchema, providersConfigSchema, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema } from "./config-schema.js";
|
|
7
7
|
//#region packages/shared/src/toolchain.d.ts
|
|
8
|
-
/** A summary of a sync run, handed to {@link
|
|
8
|
+
/** A summary of a sync run, handed to {@link ToolchainHooks.afterSync}. */
|
|
9
9
|
export interface SyncSummary {
|
|
10
10
|
written: string[];
|
|
11
11
|
changed: string[];
|
|
@@ -16,11 +16,11 @@ export interface SyncSummary {
|
|
|
16
16
|
* Lifecycle hooks, declared as functions in `dbx.config.ts` (so they only work
|
|
17
17
|
* from a `.ts`/`.js` config, not JSON). Return values are awaited.
|
|
18
18
|
*/
|
|
19
|
-
export interface
|
|
19
|
+
export interface ToolchainHooks {
|
|
20
20
|
/** Runs after the config is loaded + tokens resolved. */
|
|
21
21
|
afterLoad?: (info: {
|
|
22
22
|
cwd: string;
|
|
23
|
-
config:
|
|
23
|
+
config: ToolchainConfig;
|
|
24
24
|
tokens: Replacements;
|
|
25
25
|
path?: string;
|
|
26
26
|
}) => Awaitable<void>;
|
|
@@ -40,7 +40,7 @@ export interface ToolingHooks {
|
|
|
40
40
|
/** Runs once after the sync tasks with the result summary. */
|
|
41
41
|
afterSync?: (info: {
|
|
42
42
|
cwd: string;
|
|
43
|
-
config:
|
|
43
|
+
config: ToolchainConfig;
|
|
44
44
|
result: SyncSummary;
|
|
45
45
|
}) => Awaitable<void>;
|
|
46
46
|
/** Runs on every watch-triggered change. */
|
|
@@ -56,8 +56,8 @@ export interface ToolingHooks {
|
|
|
56
56
|
* section to enable it; omit it to leave that area untouched. Within a defined
|
|
57
57
|
* section, `enabled: false` disables it explicitly.
|
|
58
58
|
*/
|
|
59
|
-
export type
|
|
60
|
-
hooks?:
|
|
59
|
+
export type ToolchainConfig = ToolchainConfigSections & {
|
|
60
|
+
hooks?: ToolchainHooks;
|
|
61
61
|
};
|
|
62
62
|
/**
|
|
63
63
|
* The root shape of a `dbx.config.*` file. The `@deltabox/toolchain` settings
|
|
@@ -65,7 +65,7 @@ export type ToolingConfig = ToolingConfigSections & {
|
|
|
65
65
|
* alongside it.
|
|
66
66
|
*/
|
|
67
67
|
export interface DbxConfig {
|
|
68
|
-
toolchain?:
|
|
68
|
+
toolchain?: ToolchainConfig;
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
71
71
|
* Identity helper that gives a config file full type-checking + autocomplete.
|
|
@@ -76,7 +76,7 @@ export declare function defineConfig(config: DbxConfig): DbxConfig;
|
|
|
76
76
|
* A config section that is enabled with `true`, disabled with `false`, or
|
|
77
77
|
* configured with an options object.
|
|
78
78
|
*/
|
|
79
|
-
export type
|
|
79
|
+
export type ToolchainSection<T> = boolean | T;
|
|
80
80
|
/**
|
|
81
81
|
* Whether an optional top-level config section is enabled.
|
|
82
82
|
*
|
|
@@ -86,24 +86,22 @@ export type ToolingSection<T> = boolean | T;
|
|
|
86
86
|
* no options, or configure it with an object (`biome: { overrides: { ... } }`).
|
|
87
87
|
* Either way the tooling never touches an area the consumer did not ask for.
|
|
88
88
|
*/
|
|
89
|
-
export declare function sectionEnabled(section:
|
|
90
|
-
enabled?: boolean;
|
|
91
|
-
}> | undefined): boolean;
|
|
89
|
+
export declare function sectionEnabled(section: boolean | object | undefined): boolean;
|
|
92
90
|
/**
|
|
93
91
|
* The options object for a section (`undefined` when it is a boolean/absent).
|
|
94
92
|
* Not every section declares `enabled` (eg. `providers`), so the constraint is
|
|
95
93
|
* any object rather than `{ enabled?: boolean }`.
|
|
96
94
|
*/
|
|
97
|
-
export declare function sectionConfig<T extends object>(section:
|
|
95
|
+
export declare function sectionConfig<T extends object>(section: ToolchainSection<T> | undefined): T | undefined;
|
|
98
96
|
/** The file names a config loader looks for, in priority order. */
|
|
99
97
|
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'];
|
|
100
98
|
/** Derive the `owner/name` slug from a repository URL. */
|
|
101
99
|
export declare function repoSlugFromUrl(repo: string | undefined): string | undefined;
|
|
102
100
|
/**
|
|
103
|
-
* Flatten a {@link
|
|
101
|
+
* Flatten a {@link ToolchainConfig} into the `{{ token }}` replacements every
|
|
104
102
|
* template understands. Defaults are chosen so a bare config still renders.
|
|
105
103
|
*/
|
|
106
|
-
export declare function resolveTokens(config?:
|
|
104
|
+
export declare function resolveTokens(config?: ToolchainConfig): Replacements;
|
|
107
105
|
/** A file written by a sync task (its parent directory is created as needed). */
|
|
108
106
|
export interface ManagedFile {
|
|
109
107
|
/** Path relative to the project root. */
|
|
@@ -123,7 +121,7 @@ export interface SyncContext {
|
|
|
123
121
|
/** The detected/configured project kind. */
|
|
124
122
|
projectType: ProjectType;
|
|
125
123
|
/** The loaded config. */
|
|
126
|
-
config:
|
|
124
|
+
config: ToolchainConfig;
|
|
127
125
|
/** The resolved replacement tokens. */
|
|
128
126
|
tokens: Replacements;
|
|
129
127
|
/** Log a line (respects `--quiet`). */
|
|
@@ -146,7 +144,7 @@ export interface SyncTask {
|
|
|
146
144
|
*/
|
|
147
145
|
keep?: string[];
|
|
148
146
|
/** Whether the task runs for the given config (default: always). */
|
|
149
|
-
enabled?: (config:
|
|
147
|
+
enabled?: (config: ToolchainConfig) => boolean;
|
|
150
148
|
/**
|
|
151
149
|
* The project kinds the task applies to (default: all). A task is skipped
|
|
152
150
|
* when the resolved project type is not in this list.
|
|
@@ -159,4 +157,4 @@ export interface SyncTask {
|
|
|
159
157
|
run: (ctx: SyncContext) => Awaitable<ManagedFile[] | void>;
|
|
160
158
|
}
|
|
161
159
|
//#endregion
|
|
162
|
-
export { CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, ChangelogWorkflowsConfig, DbxConfigSections, ProjectType,
|
|
160
|
+
export { CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, ChangelogVersioning, ChangelogVersioningConfig, ChangelogVersioningTarget, ChangelogWorkflowsConfig, DbxConfigSections, ProjectType, ToolchainBiomeConfig, ToolchainChangelogConfig, ToolchainConfigSections, ToolchainLoggerConfig, ToolchainProjectConfig, ToolchainProvidersConfig, ToolchainTemplateKind, ToolchainTemplateSource, ToolchainTemplateSourceType, ToolchainTemplatesConfig, ToolchainTsconfigConfig, ToolchainViteConfig, ToolchainWatchConfig, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig, biomeConfigSchema, changelogConfigSchema, changelogVersioningConfigSchema, changelogVersioningSchema, changelogVersioningTargetSchema, changelogWorkflowsConfigSchema, dbxConfigSchema, loggerConfigSchema, projectConfigSchema, projectTypeSchema, providersConfigSchema, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, toolchainConfigSchema, 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,
|
|
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,changelogVersioningConfigSchema as a,changelogVersioningSchema as o,changelogVersioningTargetSchema as s,changelogWorkflowsConfigSchema as c,dbxConfigSchema as l,loggerConfigSchema as u,projectConfigSchema as d,projectTypeSchema as f,providersConfigSchema as p,templateKindSchema as m,templateSourceSchema as h,templateSourceTypeSchema as g,templatesConfigSchema as _,toolchainConfigSchema as v,tsconfigConfigSchema as y,viteConfigSchema as b,watchConfigSchema as x,workflowConfigSchema as S,workflowSettingSchema as C,workflowStepSchema as w,workflowStepsConfigSchema as T}from"./config-schema.js";function E(e){return e}function D(e){return e===void 0?!1:typeof e==`boolean`?e:e.enabled!==!1}function O(e){return e!==void 0&&typeof e==`object`?e:void 0}const k=[`dbx.config.ts`,`dbx.config.mts`,`dbx.config.js`,`dbx.config.mjs`,`dbx.config.cjs`,`dbx.config.json`];function A(e){if(!e)return;let t=e.match(/github\.com[/:]([^/]+)\/([^/.]+?)(?:\.git)?$/);return t?.[1]&&t[2]?`${t[1]}/${t[2]}`:void 0}function j(e={}){let t=e.project??{},n=O(e.changelog)??{};return{name:t.name??`app`,scope:t.scope??``,author:t.author??``,license:t.license??`MIT`,homepage:t.homepage??``,repo:t.repo??``,repoSlug:A(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{k 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 changelogVersioningConfigSchema,o as changelogVersioningSchema,s as changelogVersioningTargetSchema,c as changelogWorkflowsConfigSchema,l as dbxConfigSchema,E as defineConfig,u as loggerConfigSchema,d as projectConfigSchema,f as projectTypeSchema,p as providersConfigSchema,A as repoSlugFromUrl,j as resolveTokens,O as sectionConfig,D as sectionEnabled,m as templateKindSchema,h as templateSourceSchema,g as templateSourceTypeSchema,_ as templatesConfigSchema,v as toolchainConfigSchema,y as tsconfigConfigSchema,b as viteConfigSchema,x as watchConfigSchema,S as workflowConfigSchema,C as workflowSettingSchema,w as workflowStepSchema,T as workflowStepsConfigSchema};
|
|
@@ -2,7 +2,7 @@ import __tsdown_shims_path from 'node:path';
|
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
3
|
import { Replacements } from "./template.js";
|
|
4
4
|
import { ProjectType } from "./config-types.js";
|
|
5
|
-
import {
|
|
5
|
+
import { ToolchainConfig } from "./toolchain.js";
|
|
6
6
|
//#region packages/shared/src/types.d.ts
|
|
7
7
|
/** A value that may or may not be awaited. */
|
|
8
8
|
export type Awaitable<T> = T | Promise<T>;
|
|
@@ -16,7 +16,7 @@ export type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
|
16
16
|
[key: string]: JsonValue;
|
|
17
17
|
};
|
|
18
18
|
/** A CLI option a tooling command exposes (framework-agnostic). */
|
|
19
|
-
export interface
|
|
19
|
+
export interface ToolchainOption {
|
|
20
20
|
/** Commander-style flags, eg. `-o, --out <path>`. */
|
|
21
21
|
flags: string;
|
|
22
22
|
/** Human-readable description. */
|
|
@@ -29,20 +29,20 @@ export interface ToolingOption {
|
|
|
29
29
|
* `dbx.config.*` has been loaded, so a command can derive its defaults
|
|
30
30
|
* from the config; explicit CLI flags override those defaults.
|
|
31
31
|
*/
|
|
32
|
-
export interface
|
|
32
|
+
export interface ToolchainCommandContext {
|
|
33
33
|
/** The project root the config was loaded from. */
|
|
34
34
|
cwd: string;
|
|
35
35
|
/** The detected/configured project kind. */
|
|
36
36
|
projectType: ProjectType;
|
|
37
37
|
/** The loaded tooling config (empty object when none was found). */
|
|
38
|
-
config:
|
|
38
|
+
config: ToolchainConfig;
|
|
39
39
|
/** The resolved replacement tokens. */
|
|
40
40
|
tokens: Replacements;
|
|
41
41
|
/** The config file that was loaded, if any. */
|
|
42
42
|
configPath?: string;
|
|
43
43
|
}
|
|
44
44
|
/** A positional argument a command accepts. */
|
|
45
|
-
export interface
|
|
45
|
+
export interface ToolchainArgument {
|
|
46
46
|
/** The argument name (also its key in the run `args` object). */
|
|
47
47
|
name: string;
|
|
48
48
|
/** Human-readable description. */
|
|
@@ -59,15 +59,15 @@ export interface ToolingArgument {
|
|
|
59
59
|
* the flags explicitly passed on the command line (so config defaults apply
|
|
60
60
|
* otherwise); `context` carries the loaded config.
|
|
61
61
|
*/
|
|
62
|
-
export interface
|
|
62
|
+
export interface ToolchainCommand<Args extends Record<string, unknown> = Record<string, unknown>> {
|
|
63
63
|
/** The command name, eg. `config` or `generate`. */
|
|
64
64
|
name: string;
|
|
65
65
|
/** Human-readable description. */
|
|
66
66
|
description: string;
|
|
67
67
|
/** Positional arguments the command accepts. */
|
|
68
|
-
args?:
|
|
68
|
+
args?: ToolchainArgument[];
|
|
69
69
|
/** Options the command accepts. */
|
|
70
|
-
options?:
|
|
70
|
+
options?: ToolchainOption[];
|
|
71
71
|
/**
|
|
72
72
|
* Forward every operand (including unknown flags) to the command instead of
|
|
73
73
|
* parsing them. Used by provider passthrough commands (eg. `vite:dev`), which
|
|
@@ -76,7 +76,7 @@ export interface ToolingCommand<Args extends Record<string, unknown> = Record<st
|
|
|
76
76
|
*/
|
|
77
77
|
passthrough?: boolean;
|
|
78
78
|
/** Run the command with the CLI-provided options + the loaded config. */
|
|
79
|
-
run: (args: Args, context:
|
|
79
|
+
run: (args: Args, context: ToolchainCommandContext) => Awaitable<void>;
|
|
80
80
|
}
|
|
81
81
|
/** A package.json-shaped object (loose; only the fields the tooling touches). */
|
|
82
82
|
export interface PackageJson {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
import {
|
|
3
|
+
import { ToolchainCommand } from "../../../shared/src/types.js";
|
|
4
4
|
import "../../../shared/src/index.js";
|
|
5
5
|
//#region packages/template/src/cli/index.d.ts
|
|
6
6
|
/** The `template:*` commands plus the template-driven `create`. */
|
|
7
|
-
export declare function templateCommands():
|
|
7
|
+
export declare function templateCommands(): ToolchainCommand[];
|
|
8
8
|
//#endregion
|
|
@@ -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
|