@deltabox/toolchain 2.3.4 → 2.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 +141 -8
- package/dist/biome.d.ts +2 -2
- package/dist/biome.js +1 -1
- package/dist/cli/commands/sync.js +1 -1
- package/dist/cli/commands/watch.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/register.js +1 -1
- package/dist/cli/tooling-commands.js +1 -0
- package/dist/config.d.ts +2 -1
- package/dist/config.js +1 -1
- package/dist/core.d.ts +4 -3
- package/dist/core.js +1 -1
- package/dist/index.d.ts +14 -10
- package/dist/index.js +1 -1
- package/dist/migrate.d.ts +3 -3
- package/dist/migrate.js +1 -1
- package/dist/package.js +1 -1
- package/dist/packages/biome/src/index.d.ts +142 -7
- package/dist/packages/biome/src/index.js +1 -1
- package/dist/packages/changelog/src/workflows.d.ts +19 -5
- package/dist/packages/changelog/src/workflows.js +5 -4
- package/dist/packages/config/src/generators/commands.d.ts +22 -0
- package/dist/packages/config/src/generators/commands.js +2 -0
- package/dist/packages/config/src/generators/index.d.ts +2 -1
- package/dist/packages/config/src/generators/index.js +1 -1
- package/dist/packages/config/src/generators/types.js +1 -1
- package/dist/packages/config/src/index.d.ts +3 -2
- package/dist/packages/config/src/index.js +1 -1
- package/dist/packages/config/src/schema.js +1 -1
- package/dist/packages/core/src/editor-config.js +1 -1
- package/dist/packages/core/src/fmt-groups.d.ts +32 -0
- package/dist/packages/core/src/fmt-groups.js +1 -0
- 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.js +1 -1
- package/dist/packages/core/src/select.d.ts +3 -0
- package/dist/packages/core/src/select.js +1 -1
- package/dist/packages/core/src/sync.d.ts +6 -0
- package/dist/packages/core/src/sync.js +1 -1
- package/dist/packages/core/src/watch.d.ts +41 -0
- package/dist/packages/core/src/watch.js +1 -1
- package/dist/packages/migrate/src/cli/index.js +1 -1
- package/dist/packages/migrate/src/index.d.ts +3 -3
- package/dist/packages/migrate/src/index.js +1 -1
- package/dist/packages/migrate/src/oxc.js +1 -1
- package/dist/packages/migrate/src/oxlint-map.d.ts +34 -1
- package/dist/packages/migrate/src/oxlint-map.js +1 -1
- package/dist/packages/migrate/src/types.d.ts +3 -2
- package/dist/packages/migrate/src/vite-target.d.ts +7 -0
- package/dist/packages/migrate/src/vite-target.js +2 -2
- package/dist/packages/migrate/src/vite.d.ts +30 -1
- package/dist/packages/migrate/src/vite.js +10 -8
- package/dist/packages/project/src/cli/index.js +1 -1
- package/dist/packages/project/src/config.d.ts +20 -5
- 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/sync.js +1 -1
- package/dist/packages/project/src/typescript.d.ts +34 -0
- package/dist/packages/project/src/typescript.js +18 -10
- package/dist/packages/shared/src/config-schema/alias-rewrite.d.ts +32 -0
- package/dist/packages/shared/src/config-schema/biome.js +1 -1
- package/dist/packages/shared/src/config-schema/changelog.d.ts +623 -56
- package/dist/packages/shared/src/config-schema/ci.d.ts +1873 -163
- package/dist/packages/shared/src/config-schema/format.d.ts +4 -6
- package/dist/packages/shared/src/config-schema/format.js +1 -1
- package/dist/packages/shared/src/config-schema/generated/gitlab-ci.d.ts +1 -1
- package/dist/packages/shared/src/config-schema/generated/oxfmt-config.d.ts +1 -1
- package/dist/packages/shared/src/config-schema/index.d.ts +6057 -862
- package/dist/packages/shared/src/config-schema/index.js +1 -1
- package/dist/packages/shared/src/config-schema/json.d.ts +1 -1
- package/dist/packages/shared/src/config-schema/tsconfig.d.ts +21 -0
- package/dist/packages/shared/src/config-schema/tsconfig.js +1 -1
- package/dist/packages/shared/src/config-schema/vendor-types.d.ts +156 -0
- package/dist/packages/shared/src/config-schema/workflow.d.ts +3678 -297
- package/dist/packages/shared/src/config-schema/workflow.js +1 -1
- package/dist/packages/shared/src/config-types.d.ts +219 -37
- package/dist/packages/shared/src/ignore.d.ts +9 -1
- package/dist/packages/shared/src/ignore.js +1 -1
- package/dist/packages/shared/src/index.d.ts +11 -8
- package/dist/packages/shared/src/index.js +1 -1
- package/dist/packages/shared/src/string-utils.d.ts +9 -2
- package/dist/packages/shared/src/string-utils.js +2 -2
- package/dist/packages/shared/src/template.d.ts +1 -1
- package/dist/packages/shared/src/toolchain.d.ts +13 -4
- package/dist/packages/shared/src/toolchain.js +1 -1
- package/dist/packages/shared/src/tsconfig-files.d.ts +14 -0
- package/dist/packages/shared/src/tsconfig-files.js +1 -0
- package/dist/packages/shared/src/types.d.ts +4 -2
- package/dist/packages/shared/src/vite-defaults.d.ts +102 -10
- package/dist/packages/shared/src/vite-defaults.js +1 -1
- package/dist/packages/shared/src/yaml.d.ts +1 -1
- package/dist/packages/tsconfig/src/auto.d.ts +11 -0
- package/dist/packages/tsconfig/src/auto.js +1 -0
- package/dist/packages/tsconfig/src/cli/generate/index.d.ts +58 -0
- package/dist/packages/tsconfig/src/cli/generate/index.js +1 -1
- package/dist/packages/tsconfig/src/cli/generate/utils.d.ts +12 -0
- package/dist/packages/tsconfig/src/cli/generate/utils.js +1 -1
- package/dist/packages/tsconfig/src/cli/index.js +1 -1
- package/dist/packages/tsconfig/src/files.d.ts +5 -0
- package/dist/packages/tsconfig/src/files.js +1 -0
- package/dist/packages/tsconfig/src/index.d.ts +6 -5
- package/dist/packages/tsconfig/src/index.js +1 -1
- package/dist/packages/tsconfig/src/overrides.d.ts +3 -3
- package/dist/packages/tsconfig/src/resolve.d.ts +15 -3
- package/dist/packages/tsconfig/src/resolve.js +1 -1
- package/dist/packages/tsconfig/src/sync.d.ts +5 -11
- package/dist/packages/tsconfig/src/sync.js +1 -1
- package/dist/packages/tsconfig/src/templates.d.ts +38 -4
- package/dist/packages/tsconfig/src/workspaces.d.ts +36 -0
- package/dist/packages/tsconfig/src/workspaces.js +1 -0
- package/dist/packages/tsdown/src/config/node.js +1 -1
- package/dist/packages/vite/src/commands.js +1 -1
- package/dist/packages/vite/src/index.d.ts +3 -1
- package/dist/packages/vite/src/index.js +1 -1
- package/dist/packages/vite/src/resolve.js +1 -1
- package/dist/packages/vite/src/sync.js +3 -3
- package/dist/project.d.ts +2 -2
- package/dist/project.js +1 -1
- package/dist/shared.d.ts +10 -7
- package/dist/shared.js +1 -1
- package/dist/sync.d.ts +2 -0
- package/dist/sync.js +1 -1
- package/dist/tooling.d.ts +18 -1
- package/dist/tooling.js +1 -1
- package/dist/tsconfig.d.ts +5 -4
- package/dist/tsconfig.js +1 -1
- package/dist/vite.d.ts +2 -1
- package/dist/vite.js +1 -1
- package/package.json +15 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node:path";import"node:url";import.meta.url;import{__exportAll as ee}from"../../../_virtual/_rolldown/runtime.js";import{TOOLCHAIN_PACKAGE as te,findOwnCliEntry as e,localToolchainVersion as t}from"./bin.js";import{applyOverrides as n,deepMerge as r,isPlainObject as i,isUnsafeKey as a,mapValues as o,resolveSort as s,sort as c}from"./object-utils.js";import{insertMissingJsonc as l,mergeJsonAt as u,readJsonAt as d,readJsonFile as f,readJsoncAt as p,readJsoncFile as m,toJson as h,writeJsonFile as g}from"./fs-utils.js";import{DEFAULT_IGNORE_PATTERNS as _,collectGitignorePatterns as v,isIgnoredPath as y,resolveIgnorePatterns as b}from"./ignore.js";import{ERROR_MAP as x,WARNING_MAP as S,errorMessage as C,formatMessage as w,formatMessageId as T,warningMessage as E}from"./messages.js";import{LOG_LEVELS as D,configureLogger as O,createLogger as k,getLogOverrides as A,getLogger as j,isLogLevel as M,logger as N,normalizeLogLevel as P,setLogConfig as F,setLogOverrides as I,stripAnsi as L}from"./logger.js";import{projectFromPackageJson as R,projectToPackageJson as z,splitPackageName as B}from"./project.js";import{providerActions as V}from"./provider.js";import{registrySourceAllowed as H}from"./registry-policy.js";import{isCmdShim as U,killProcessTree as W,run as G,spawnCross as K}from"./run.js";import{asString as q,camelCase as J,camelCaseId as Y,capitalize as X,constantCase as Z,ensureLeadingSlash as Q,ensureSlashes as ne,ensureTrailingSlash as re,formatCliFlag as ie,hasEscapeArtifacts as ae,hasText as oe,indent as se,isLocalhost as ce,kebabCase as le,pascalCase as ue,removeDoubleSlashes as de,removeLeadingSlash as fe,removeTrailingSlash as pe,sanitizeSlashes as me,sanitizeText as he,snakeCase as ge,str as _e,stripControlChars as ve,stripEscapeArtifacts as ye,titleCase as be}from"./string-utils.js";import{applyReplacements as xe,applyReplacementsDeep as Se,createReplacer as Ce,defineReplacements as we,extractTokens as Te,hasUnresolvedTokens as Ee,tokenPattern as De}from"./template.js";import{configJsonValueSchema as Oe}from"./config-schema/json.js";import{ENABLED_DESCRIPTION as ke,section as Ae,withEnabled as je}from"./config-schema/meta.js";import{azureWorkflowSettingSchema as Me,customWorkflowSettingsSchema as Ne,githubWorkflowSettingSchema as Pe,gitlabWorkflowSettingSchema as $,isVendorWorkflowConfig as Fe,workflowConfigSchema as Ie,workflowJobSchema as Le,workflowOptionsSchema as Re,workflowSettingSchema as ze,workflowStepSchema as Be,workflowStepsConfigSchema as Ve}from"./config-schema/workflow.js";import{biomeConfigOptionsSchema as He,biomeConfigSchema as Ue}from"./config-schema/biome.js";import{catalogsConfigSchema as We}from"./config-schema/catalogs.js";import{changelogBranchesConfigSchema as Ge,changelogBreakingCallbackSchema as Ke,changelogBreakingSettingSchema as qe,changelogBumpRuleMatchSchema as Je,changelogBumpRuleSchema as Ye,changelogCommitFormatConfigSchema as Xe,changelogCommitlintConfigSchema as Ze,changelogConfigSchema as Qe,changelogGroupConfigSchema as $e,changelogGroupsSettingSchema as et,changelogProviderConfigSchema as tt,changelogProviderSettingSchema as nt,changelogVersioningConfigSchema as rt,changelogVersioningSchema as it,changelogVersioningTargetSchema as at,changelogWorkflowSettingSchema as ot,ciChangelogConfigSchema as st}from"./config-schema/changelog.js";import{ciConfigSchema as ct}from"./config-schema/ci.js";import{fmtConfigSchema as lt,lintConfigSchema as ut,vscodeSettingsSchema as dt}from"./config-schema/format.js";import{loggerConfigSchema as ft}from"./config-schema/logger.js";import{projectConfigSchema as pt,projectTypeSchema as mt}from"./config-schema/project.js";import{providersConfigSchema as ht}from"./config-schema/providers.js";import{registryConfigSchema as gt,registryPolicySchema as _t}from"./config-schema/registry.js";import{templateKindSchema as vt,templateSourceSchema as yt,templateSourceTypeSchema as bt,templatesConfigSchema as xt}from"./config-schema/templates.js";import{tsconfigConfigSchema as St}from"./config-schema/tsconfig.js";import{viteConfigSchema as Ct}from"./config-schema/vite.js";import{watchConfigSchema as wt}from"./config-schema/watch.js";import{configSchema as Tt,dbxConfigSchema as Et,toolchainConfigSchema as Dt}from"./config-schema/index.js";import{CONFIG_FILE_NAMES as Ot,DEFAULT_PACKAGE_MANAGER_VERSIONS as kt,FORMATTER_PRECEDENCE as At,LINTER_PRECEDENCE as jt,changelogSectionEnabled as Mt,defineConfig as Nt,repoSlugFromUrl as Pt,resolveChangelogBranches as Ft,resolveChangelogConfig as It,resolveCiConfig as Lt,resolveCommitlintEnabled as Rt,resolveFmtTool as zt,resolveFmtTools as Bt,resolveLintTool as Vt,resolveLintTools as Ht,resolveOxcFmtConfig as Ut,resolveOxcLintConfig as Wt,resolveTokens as Gt,sectionConfig as Kt,sectionEnabled as qt}from"./toolchain.js";import{DEFAULT_FMT_IGNORE_PATTERNS as Jt,DEFAULT_FMT_RULES as Yt,DEFAULT_LINT_IGNORE_PATTERNS as Xt,DEFAULT_LINT_RULES as Zt}from"./vite-defaults.js";import{toYaml as Qt}from"./yaml.js";var $t=/* @__PURE__ */ ee({CONFIG_FILE_NAMES:()=>Ot,DEFAULT_FMT_IGNORE_PATTERNS:()=>Jt,DEFAULT_FMT_RULES:()=>Yt,DEFAULT_IGNORE_PATTERNS:()=>_,DEFAULT_LINT_IGNORE_PATTERNS:()=>Xt,DEFAULT_LINT_RULES:()=>Zt,DEFAULT_PACKAGE_MANAGER_VERSIONS:()=>kt,ENABLED_DESCRIPTION:()=>ke,ERROR_MAP:()=>x,FORMATTER_PRECEDENCE:()=>At,LINTER_PRECEDENCE:()=>jt,LOG_LEVELS:()=>D,TOOLCHAIN_PACKAGE:()=>te,WARNING_MAP:()=>S,applyOverrides:()=>n,applyReplacements:()=>xe,applyReplacementsDeep:()=>Se,asString:()=>q,azureWorkflowSettingSchema:()=>Me,biomeConfigOptionsSchema:()=>He,biomeConfigSchema:()=>Ue,camelCase:()=>J,camelCaseId:()=>Y,capitalize:()=>X,catalogsConfigSchema:()=>We,changelogBranchesConfigSchema:()=>Ge,changelogBreakingCallbackSchema:()=>Ke,changelogBreakingSettingSchema:()=>qe,changelogBumpRuleMatchSchema:()=>Je,changelogBumpRuleSchema:()=>Ye,changelogCommitFormatConfigSchema:()=>Xe,changelogCommitlintConfigSchema:()=>Ze,changelogConfigSchema:()=>Qe,changelogGroupConfigSchema:()=>$e,changelogGroupsSettingSchema:()=>et,changelogProviderConfigSchema:()=>tt,changelogProviderSettingSchema:()=>nt,changelogSectionEnabled:()=>Mt,changelogVersioningConfigSchema:()=>rt,changelogVersioningSchema:()=>it,changelogVersioningTargetSchema:()=>at,changelogWorkflowSettingSchema:()=>ot,ciChangelogConfigSchema:()=>st,ciConfigSchema:()=>ct,collectGitignorePatterns:()=>v,configJsonValueSchema:()=>Oe,configSchema:()=>Tt,configureLogger:()=>O,constantCase:()=>Z,createLogger:()=>k,createReplacer:()=>Ce,customWorkflowSettingsSchema:()=>Ne,dbxConfigSchema:()=>Et,deepMerge:()=>r,defineConfig:()=>Nt,defineReplacements:()=>we,ensureLeadingSlash:()=>Q,ensureSlashes:()=>ne,ensureTrailingSlash:()=>re,errorMessage:()=>C,extractTokens:()=>Te,findOwnCliEntry:()=>e,fmtConfigSchema:()=>lt,formatCliFlag:()=>ie,formatMessage:()=>w,formatMessageId:()=>T,getLogOverrides:()=>A,getLogger:()=>j,githubWorkflowSettingSchema:()=>Pe,gitlabWorkflowSettingSchema:()=>$,hasEscapeArtifacts:()=>ae,hasText:()=>oe,hasUnresolvedTokens:()=>Ee,indent:()=>se,insertMissingJsonc:()=>l,isCmdShim:()=>U,isIgnoredPath:()=>y,isLocalhost:()=>ce,isLogLevel:()=>M,isPlainObject:()=>i,isUnsafeKey:()=>a,isVendorWorkflowConfig:()=>Fe,kebabCase:()=>le,killProcessTree:()=>W,lintConfigSchema:()=>ut,localToolchainVersion:()=>t,logger:()=>N,loggerConfigSchema:()=>ft,mapValues:()=>o,mergeJsonAt:()=>u,normalizeLogLevel:()=>P,pascalCase:()=>ue,projectConfigSchema:()=>pt,projectFromPackageJson:()=>R,projectToPackageJson:()=>z,projectTypeSchema:()=>mt,providerActions:()=>V,providersConfigSchema:()=>ht,readJsonAt:()=>d,readJsonFile:()=>f,readJsoncAt:()=>p,readJsoncFile:()=>m,registryConfigSchema:()=>gt,registryPolicySchema:()=>_t,registrySourceAllowed:()=>H,removeDoubleSlashes:()=>de,removeLeadingSlash:()=>fe,removeTrailingSlash:()=>pe,repoSlugFromUrl:()=>Pt,resolveChangelogBranches:()=>Ft,resolveChangelogConfig:()=>It,resolveCiConfig:()=>Lt,resolveCommitlintEnabled:()=>Rt,resolveFmtTool:()=>zt,resolveFmtTools:()=>Bt,resolveIgnorePatterns:()=>b,resolveLintTool:()=>Vt,resolveLintTools:()=>Ht,resolveOxcFmtConfig:()=>Ut,resolveOxcLintConfig:()=>Wt,resolveSort:()=>s,resolveTokens:()=>Gt,run:()=>G,sanitizeSlashes:()=>me,sanitizeText:()=>he,section:()=>Ae,sectionConfig:()=>Kt,sectionEnabled:()=>qt,setLogConfig:()=>F,setLogOverrides:()=>I,snakeCase:()=>ge,sort:()=>c,spawnCross:()=>K,splitPackageName:()=>B,str:()=>_e,stripAnsi:()=>L,stripControlChars:()=>ve,stripEscapeArtifacts:()=>ye,templateKindSchema:()=>vt,templateSourceSchema:()=>yt,templateSourceTypeSchema:()=>bt,templatesConfigSchema:()=>xt,titleCase:()=>be,toJson:()=>h,toYaml:()=>Qt,tokenPattern:()=>De,toolchainConfigSchema:()=>Dt,tsconfigConfigSchema:()=>St,viteConfigSchema:()=>Ct,vscodeSettingsSchema:()=>dt,warningMessage:()=>E,watchConfigSchema:()=>wt,withEnabled:()=>je,workflowConfigSchema:()=>Ie,workflowJobSchema:()=>Le,workflowOptionsSchema:()=>Re,workflowSettingSchema:()=>ze,workflowStepSchema:()=>Be,workflowStepsConfigSchema:()=>Ve,writeJsonFile:()=>g});export{Ot as CONFIG_FILE_NAMES,Jt as DEFAULT_FMT_IGNORE_PATTERNS,Yt as DEFAULT_FMT_RULES,_ as DEFAULT_IGNORE_PATTERNS,Xt as DEFAULT_LINT_IGNORE_PATTERNS,Zt as DEFAULT_LINT_RULES,kt as DEFAULT_PACKAGE_MANAGER_VERSIONS,ke as ENABLED_DESCRIPTION,x as ERROR_MAP,At as FORMATTER_PRECEDENCE,jt as LINTER_PRECEDENCE,D as LOG_LEVELS,te as TOOLCHAIN_PACKAGE,S as WARNING_MAP,n as applyOverrides,xe as applyReplacements,Se as applyReplacementsDeep,q as asString,Me as azureWorkflowSettingSchema,He as biomeConfigOptionsSchema,Ue as biomeConfigSchema,J as camelCase,Y as camelCaseId,X as capitalize,We as catalogsConfigSchema,Ge as changelogBranchesConfigSchema,Ke as changelogBreakingCallbackSchema,qe as changelogBreakingSettingSchema,Je as changelogBumpRuleMatchSchema,Ye as changelogBumpRuleSchema,Xe as changelogCommitFormatConfigSchema,Ze as changelogCommitlintConfigSchema,Qe as changelogConfigSchema,$e as changelogGroupConfigSchema,et as changelogGroupsSettingSchema,tt as changelogProviderConfigSchema,nt as changelogProviderSettingSchema,Mt as changelogSectionEnabled,rt as changelogVersioningConfigSchema,it as changelogVersioningSchema,at as changelogVersioningTargetSchema,ot as changelogWorkflowSettingSchema,st as ciChangelogConfigSchema,ct as ciConfigSchema,v as collectGitignorePatterns,Oe as configJsonValueSchema,Tt as configSchema,O as configureLogger,Z as constantCase,k as createLogger,Ce as createReplacer,Ne as customWorkflowSettingsSchema,Et as dbxConfigSchema,r as deepMerge,Nt as defineConfig,we as defineReplacements,Q as ensureLeadingSlash,ne as ensureSlashes,re as ensureTrailingSlash,C as errorMessage,Te as extractTokens,e as findOwnCliEntry,lt as fmtConfigSchema,ie as formatCliFlag,w as formatMessage,T as formatMessageId,A as getLogOverrides,j as getLogger,Pe as githubWorkflowSettingSchema,$ as gitlabWorkflowSettingSchema,ae as hasEscapeArtifacts,oe as hasText,Ee as hasUnresolvedTokens,se as indent,l as insertMissingJsonc,U as isCmdShim,y as isIgnoredPath,ce as isLocalhost,M as isLogLevel,i as isPlainObject,a as isUnsafeKey,Fe as isVendorWorkflowConfig,le as kebabCase,W as killProcessTree,ut as lintConfigSchema,t as localToolchainVersion,N as logger,ft as loggerConfigSchema,o as mapValues,u as mergeJsonAt,P as normalizeLogLevel,ue as pascalCase,pt as projectConfigSchema,R as projectFromPackageJson,z as projectToPackageJson,mt as projectTypeSchema,V as providerActions,ht as providersConfigSchema,d as readJsonAt,f as readJsonFile,p as readJsoncAt,m as readJsoncFile,gt as registryConfigSchema,_t as registryPolicySchema,H as registrySourceAllowed,de as removeDoubleSlashes,fe as removeLeadingSlash,pe as removeTrailingSlash,Pt as repoSlugFromUrl,Ft as resolveChangelogBranches,It as resolveChangelogConfig,Lt as resolveCiConfig,Rt as resolveCommitlintEnabled,zt as resolveFmtTool,Bt as resolveFmtTools,b as resolveIgnorePatterns,Vt as resolveLintTool,Ht as resolveLintTools,Ut as resolveOxcFmtConfig,Wt as resolveOxcLintConfig,s as resolveSort,Gt as resolveTokens,G as run,me as sanitizeSlashes,he as sanitizeText,Ae as section,Kt as sectionConfig,qt as sectionEnabled,F as setLogConfig,I as setLogOverrides,ge as snakeCase,c as sort,K as spawnCross,B as splitPackageName,$t as src_exports,_e as str,L as stripAnsi,ve as stripControlChars,ye as stripEscapeArtifacts,vt as templateKindSchema,yt as templateSourceSchema,bt as templateSourceTypeSchema,xt as templatesConfigSchema,be as titleCase,h as toJson,Qt as toYaml,De as tokenPattern,Dt as toolchainConfigSchema,St as tsconfigConfigSchema,Ct as viteConfigSchema,dt as vscodeSettingsSchema,E as warningMessage,wt as watchConfigSchema,je as withEnabled,Ie as workflowConfigSchema,Le as workflowJobSchema,Re as workflowOptionsSchema,ze as workflowSettingSchema,Be as workflowStepSchema,Ve as workflowStepsConfigSchema,g as writeJsonFile};
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;import{__exportAll as ee}from"../../../_virtual/_rolldown/runtime.js";import{TOOLCHAIN_PACKAGE as te,findOwnCliEntry as e,localToolchainVersion as t}from"./bin.js";import{applyOverrides as n,deepMerge as r,isPlainObject as i,isUnsafeKey as a,mapValues as o,resolveSort as s,sort as c}from"./object-utils.js";import{insertMissingJsonc as l,mergeJsonAt as u,readJsonAt as d,readJsonFile as f,readJsoncAt as p,readJsoncFile as m,toJson as h,writeJsonFile as g}from"./fs-utils.js";import{DEFAULT_FMT_IGNORE_PATTERNS as _,DEFAULT_IGNORE_PATTERNS as v,DEFAULT_LINT_IGNORE_PATTERNS as y,collectGitignorePatterns as b,isIgnoredPath as x,resolveIgnorePatterns as S}from"./ignore.js";import{ERROR_MAP as C,WARNING_MAP as w,errorMessage as T,formatMessage as E,formatMessageId as D,warningMessage as O}from"./messages.js";import{LOG_LEVELS as k,configureLogger as A,createLogger as j,getLogOverrides as M,getLogger as N,isLogLevel as P,logger as F,normalizeLogLevel as I,setLogConfig as L,setLogOverrides as R,stripAnsi as z}from"./logger.js";import{projectFromPackageJson as B,projectToPackageJson as V,splitPackageName as H}from"./project.js";import{providerActions as U}from"./provider.js";import{registrySourceAllowed as W}from"./registry-policy.js";import{isCmdShim as G,killProcessTree as K,run as q,spawnCross as J}from"./run.js";import{asString as Y,camelCase as X,camelCaseId as Z,capitalize as Q,constantCase as ne,ensureLeadingSlash as re,ensureSlashes as ie,ensureTrailingSlash as ae,formatCliFlag as oe,hasEscapeArtifacts as se,hasText as ce,indent as le,isLocalhost as ue,kebabCase as de,pascalCase as fe,removeDoubleSlashes as pe,removeLeadingSlash as me,removeTrailingSlash as he,repairBacktickArtifacts as ge,sanitizeSlashes as _e,sanitizeText as ve,snakeCase as ye,str as be,stripControlChars as xe,stripEscapeArtifacts as Se,titleCase as Ce}from"./string-utils.js";import{applyReplacements as we,applyReplacementsDeep as Te,createReplacer as Ee,defineReplacements as De,extractTokens as Oe,hasUnresolvedTokens as ke,tokenPattern as Ae}from"./template.js";import{configJsonValueSchema as je}from"./config-schema/json.js";import{ENABLED_DESCRIPTION as Me,section as Ne,withEnabled as Pe}from"./config-schema/meta.js";import{azureWorkflowSettingSchema as Fe,customWorkflowSettingsSchema as Ie,githubWorkflowSettingSchema as Le,gitlabWorkflowSettingSchema as Re,isVendorWorkflowConfig as $,workflowConfigSchema as ze,workflowExtraSchema as Be,workflowJobSchema as Ve,workflowOptionsSchema as He,workflowSettingSchema as Ue,workflowStepSchema as We,workflowStepsConfigSchema as Ge,workflowTokensSchema as Ke,workflowTriggersSchema as qe}from"./config-schema/workflow.js";import{biomeConfigOptionsSchema as Je,biomeConfigSchema as Ye}from"./config-schema/biome.js";import{catalogsConfigSchema as Xe}from"./config-schema/catalogs.js";import{changelogBranchesConfigSchema as Ze,changelogBreakingCallbackSchema as Qe,changelogBreakingSettingSchema as $e,changelogBumpRuleMatchSchema as et,changelogBumpRuleSchema as tt,changelogCommitFormatConfigSchema as nt,changelogCommitlintConfigSchema as rt,changelogConfigSchema as it,changelogGroupConfigSchema as at,changelogGroupsSettingSchema as ot,changelogProviderConfigSchema as st,changelogProviderSettingSchema as ct,changelogVersioningConfigSchema as lt,changelogVersioningSchema as ut,changelogVersioningTargetSchema as dt,changelogWorkflowSettingSchema as ft,ciChangelogConfigSchema as pt}from"./config-schema/changelog.js";import{ciConfigSchema as mt}from"./config-schema/ci.js";import{fmtConfigSchema as ht,lintConfigSchema as gt,vscodeSettingsSchema as _t}from"./config-schema/format.js";import{loggerConfigSchema as vt}from"./config-schema/logger.js";import{projectConfigSchema as yt,projectTypeSchema as bt}from"./config-schema/project.js";import{providersConfigSchema as xt}from"./config-schema/providers.js";import{registryConfigSchema as St,registryPolicySchema as Ct}from"./config-schema/registry.js";import{templateKindSchema as wt,templateSourceSchema as Tt,templateSourceTypeSchema as Et,templatesConfigSchema as Dt}from"./config-schema/templates.js";import{tsconfigConfigSchema as Ot}from"./config-schema/tsconfig.js";import{viteConfigSchema as kt}from"./config-schema/vite.js";import{watchConfigSchema as At}from"./config-schema/watch.js";import{configSchema as jt,dbxConfigSchema as Mt,toolchainConfigSchema as Nt}from"./config-schema/index.js";import{CONFIG_FILE_NAMES as Pt,DEFAULT_PACKAGE_MANAGER_VERSIONS as Ft,FORMATTER_PRECEDENCE as It,LINTER_PRECEDENCE as Lt,changelogSectionEnabled as Rt,defaultPackageManagerVersion as zt,defineConfig as Bt,repoSlugFromUrl as Vt,resolveChangelogBranches as Ht,resolveChangelogConfig as Ut,resolveCiConfig as Wt,resolveCommitlintEnabled as Gt,resolveFmtTool as Kt,resolveFmtTools as qt,resolveLintTool as Jt,resolveLintTools as Yt,resolveOxcFmtConfig as Xt,resolveOxcLintConfig as Zt,resolveTokens as Qt,sectionConfig as $t,sectionEnabled as en}from"./toolchain.js";import{tsconfigFileNames as tn}from"./tsconfig-files.js";import{DEFAULT_FMT_RULES as nn,DEFAULT_FMT_SORT_GROUP as rn,DEFAULT_FMT_SORT_GROUPS as an,DEFAULT_FMT_SORT_IMPORTS as on,DEFAULT_LINT_RULES as sn,applyFmtCustomGroups as cn,fmtCustomGroupsForProjects as ln}from"./vite-defaults.js";import{toYaml as un}from"./yaml.js";var dn=/* @__PURE__ */ ee({CONFIG_FILE_NAMES:()=>Pt,DEFAULT_FMT_IGNORE_PATTERNS:()=>_,DEFAULT_FMT_RULES:()=>nn,DEFAULT_FMT_SORT_GROUP:()=>rn,DEFAULT_FMT_SORT_GROUPS:()=>an,DEFAULT_FMT_SORT_IMPORTS:()=>on,DEFAULT_IGNORE_PATTERNS:()=>v,DEFAULT_LINT_IGNORE_PATTERNS:()=>y,DEFAULT_LINT_RULES:()=>sn,DEFAULT_PACKAGE_MANAGER_VERSIONS:()=>Ft,ENABLED_DESCRIPTION:()=>Me,ERROR_MAP:()=>C,FORMATTER_PRECEDENCE:()=>It,LINTER_PRECEDENCE:()=>Lt,LOG_LEVELS:()=>k,TOOLCHAIN_PACKAGE:()=>te,WARNING_MAP:()=>w,applyFmtCustomGroups:()=>cn,applyOverrides:()=>n,applyReplacements:()=>we,applyReplacementsDeep:()=>Te,asString:()=>Y,azureWorkflowSettingSchema:()=>Fe,biomeConfigOptionsSchema:()=>Je,biomeConfigSchema:()=>Ye,camelCase:()=>X,camelCaseId:()=>Z,capitalize:()=>Q,catalogsConfigSchema:()=>Xe,changelogBranchesConfigSchema:()=>Ze,changelogBreakingCallbackSchema:()=>Qe,changelogBreakingSettingSchema:()=>$e,changelogBumpRuleMatchSchema:()=>et,changelogBumpRuleSchema:()=>tt,changelogCommitFormatConfigSchema:()=>nt,changelogCommitlintConfigSchema:()=>rt,changelogConfigSchema:()=>it,changelogGroupConfigSchema:()=>at,changelogGroupsSettingSchema:()=>ot,changelogProviderConfigSchema:()=>st,changelogProviderSettingSchema:()=>ct,changelogSectionEnabled:()=>Rt,changelogVersioningConfigSchema:()=>lt,changelogVersioningSchema:()=>ut,changelogVersioningTargetSchema:()=>dt,changelogWorkflowSettingSchema:()=>ft,ciChangelogConfigSchema:()=>pt,ciConfigSchema:()=>mt,collectGitignorePatterns:()=>b,configJsonValueSchema:()=>je,configSchema:()=>jt,configureLogger:()=>A,constantCase:()=>ne,createLogger:()=>j,createReplacer:()=>Ee,customWorkflowSettingsSchema:()=>Ie,dbxConfigSchema:()=>Mt,deepMerge:()=>r,defaultPackageManagerVersion:()=>zt,defineConfig:()=>Bt,defineReplacements:()=>De,ensureLeadingSlash:()=>re,ensureSlashes:()=>ie,ensureTrailingSlash:()=>ae,errorMessage:()=>T,extractTokens:()=>Oe,findOwnCliEntry:()=>e,fmtConfigSchema:()=>ht,fmtCustomGroupsForProjects:()=>ln,formatCliFlag:()=>oe,formatMessage:()=>E,formatMessageId:()=>D,getLogOverrides:()=>M,getLogger:()=>N,githubWorkflowSettingSchema:()=>Le,gitlabWorkflowSettingSchema:()=>Re,hasEscapeArtifacts:()=>se,hasText:()=>ce,hasUnresolvedTokens:()=>ke,indent:()=>le,insertMissingJsonc:()=>l,isCmdShim:()=>G,isIgnoredPath:()=>x,isLocalhost:()=>ue,isLogLevel:()=>P,isPlainObject:()=>i,isUnsafeKey:()=>a,isVendorWorkflowConfig:()=>$,kebabCase:()=>de,killProcessTree:()=>K,lintConfigSchema:()=>gt,localToolchainVersion:()=>t,logger:()=>F,loggerConfigSchema:()=>vt,mapValues:()=>o,mergeJsonAt:()=>u,normalizeLogLevel:()=>I,pascalCase:()=>fe,projectConfigSchema:()=>yt,projectFromPackageJson:()=>B,projectToPackageJson:()=>V,projectTypeSchema:()=>bt,providerActions:()=>U,providersConfigSchema:()=>xt,readJsonAt:()=>d,readJsonFile:()=>f,readJsoncAt:()=>p,readJsoncFile:()=>m,registryConfigSchema:()=>St,registryPolicySchema:()=>Ct,registrySourceAllowed:()=>W,removeDoubleSlashes:()=>pe,removeLeadingSlash:()=>me,removeTrailingSlash:()=>he,repairBacktickArtifacts:()=>ge,repoSlugFromUrl:()=>Vt,resolveChangelogBranches:()=>Ht,resolveChangelogConfig:()=>Ut,resolveCiConfig:()=>Wt,resolveCommitlintEnabled:()=>Gt,resolveFmtTool:()=>Kt,resolveFmtTools:()=>qt,resolveIgnorePatterns:()=>S,resolveLintTool:()=>Jt,resolveLintTools:()=>Yt,resolveOxcFmtConfig:()=>Xt,resolveOxcLintConfig:()=>Zt,resolveSort:()=>s,resolveTokens:()=>Qt,run:()=>q,sanitizeSlashes:()=>_e,sanitizeText:()=>ve,section:()=>Ne,sectionConfig:()=>$t,sectionEnabled:()=>en,setLogConfig:()=>L,setLogOverrides:()=>R,snakeCase:()=>ye,sort:()=>c,spawnCross:()=>J,splitPackageName:()=>H,str:()=>be,stripAnsi:()=>z,stripControlChars:()=>xe,stripEscapeArtifacts:()=>Se,templateKindSchema:()=>wt,templateSourceSchema:()=>Tt,templateSourceTypeSchema:()=>Et,templatesConfigSchema:()=>Dt,titleCase:()=>Ce,toJson:()=>h,toYaml:()=>un,tokenPattern:()=>Ae,toolchainConfigSchema:()=>Nt,tsconfigConfigSchema:()=>Ot,tsconfigFileNames:()=>tn,viteConfigSchema:()=>kt,vscodeSettingsSchema:()=>_t,warningMessage:()=>O,watchConfigSchema:()=>At,withEnabled:()=>Pe,workflowConfigSchema:()=>ze,workflowExtraSchema:()=>Be,workflowJobSchema:()=>Ve,workflowOptionsSchema:()=>He,workflowSettingSchema:()=>Ue,workflowStepSchema:()=>We,workflowStepsConfigSchema:()=>Ge,workflowTokensSchema:()=>Ke,workflowTriggersSchema:()=>qe,writeJsonFile:()=>g});export{Pt as CONFIG_FILE_NAMES,_ as DEFAULT_FMT_IGNORE_PATTERNS,nn as DEFAULT_FMT_RULES,rn as DEFAULT_FMT_SORT_GROUP,an as DEFAULT_FMT_SORT_GROUPS,on as DEFAULT_FMT_SORT_IMPORTS,v as DEFAULT_IGNORE_PATTERNS,y as DEFAULT_LINT_IGNORE_PATTERNS,sn as DEFAULT_LINT_RULES,Ft as DEFAULT_PACKAGE_MANAGER_VERSIONS,Me as ENABLED_DESCRIPTION,C as ERROR_MAP,It as FORMATTER_PRECEDENCE,Lt as LINTER_PRECEDENCE,k as LOG_LEVELS,te as TOOLCHAIN_PACKAGE,w as WARNING_MAP,cn as applyFmtCustomGroups,n as applyOverrides,we as applyReplacements,Te as applyReplacementsDeep,Y as asString,Fe as azureWorkflowSettingSchema,Je as biomeConfigOptionsSchema,Ye as biomeConfigSchema,X as camelCase,Z as camelCaseId,Q as capitalize,Xe as catalogsConfigSchema,Ze as changelogBranchesConfigSchema,Qe as changelogBreakingCallbackSchema,$e as changelogBreakingSettingSchema,et as changelogBumpRuleMatchSchema,tt as changelogBumpRuleSchema,nt as changelogCommitFormatConfigSchema,rt as changelogCommitlintConfigSchema,it as changelogConfigSchema,at as changelogGroupConfigSchema,ot as changelogGroupsSettingSchema,st as changelogProviderConfigSchema,ct as changelogProviderSettingSchema,Rt as changelogSectionEnabled,lt as changelogVersioningConfigSchema,ut as changelogVersioningSchema,dt as changelogVersioningTargetSchema,ft as changelogWorkflowSettingSchema,pt as ciChangelogConfigSchema,mt as ciConfigSchema,b as collectGitignorePatterns,je as configJsonValueSchema,jt as configSchema,A as configureLogger,ne as constantCase,j as createLogger,Ee as createReplacer,Ie as customWorkflowSettingsSchema,Mt as dbxConfigSchema,r as deepMerge,zt as defaultPackageManagerVersion,Bt as defineConfig,De as defineReplacements,re as ensureLeadingSlash,ie as ensureSlashes,ae as ensureTrailingSlash,T as errorMessage,Oe as extractTokens,e as findOwnCliEntry,ht as fmtConfigSchema,ln as fmtCustomGroupsForProjects,oe as formatCliFlag,E as formatMessage,D as formatMessageId,M as getLogOverrides,N as getLogger,Le as githubWorkflowSettingSchema,Re as gitlabWorkflowSettingSchema,se as hasEscapeArtifacts,ce as hasText,ke as hasUnresolvedTokens,le as indent,l as insertMissingJsonc,G as isCmdShim,x as isIgnoredPath,ue as isLocalhost,P as isLogLevel,i as isPlainObject,a as isUnsafeKey,$ as isVendorWorkflowConfig,de as kebabCase,K as killProcessTree,gt as lintConfigSchema,t as localToolchainVersion,F as logger,vt as loggerConfigSchema,o as mapValues,u as mergeJsonAt,I as normalizeLogLevel,fe as pascalCase,yt as projectConfigSchema,B as projectFromPackageJson,V as projectToPackageJson,bt as projectTypeSchema,U as providerActions,xt as providersConfigSchema,d as readJsonAt,f as readJsonFile,p as readJsoncAt,m as readJsoncFile,St as registryConfigSchema,Ct as registryPolicySchema,W as registrySourceAllowed,pe as removeDoubleSlashes,me as removeLeadingSlash,he as removeTrailingSlash,ge as repairBacktickArtifacts,Vt as repoSlugFromUrl,Ht as resolveChangelogBranches,Ut as resolveChangelogConfig,Wt as resolveCiConfig,Gt as resolveCommitlintEnabled,Kt as resolveFmtTool,qt as resolveFmtTools,S as resolveIgnorePatterns,Jt as resolveLintTool,Yt as resolveLintTools,Xt as resolveOxcFmtConfig,Zt as resolveOxcLintConfig,s as resolveSort,Qt as resolveTokens,q as run,_e as sanitizeSlashes,ve as sanitizeText,Ne as section,$t as sectionConfig,en as sectionEnabled,L as setLogConfig,R as setLogOverrides,ye as snakeCase,c as sort,J as spawnCross,H as splitPackageName,dn as src_exports,be as str,z as stripAnsi,xe as stripControlChars,Se as stripEscapeArtifacts,wt as templateKindSchema,Tt as templateSourceSchema,Et as templateSourceTypeSchema,Dt as templatesConfigSchema,Ce as titleCase,h as toJson,un as toYaml,Ae as tokenPattern,Nt as toolchainConfigSchema,Ot as tsconfigConfigSchema,tn as tsconfigFileNames,kt as viteConfigSchema,_t as vscodeSettingsSchema,O as warningMessage,At as watchConfigSchema,Pe as withEnabled,ze as workflowConfigSchema,Be as workflowExtraSchema,Ve as workflowJobSchema,He as workflowOptionsSchema,Ue as workflowSettingSchema,We as workflowStepSchema,Ge as workflowStepsConfigSchema,Ke as workflowTokensSchema,qe as workflowTriggersSchema,g as writeJsonFile};
|
|
@@ -60,11 +60,18 @@ export declare function stripControlChars(text: string): string;
|
|
|
60
60
|
export declare function stripEscapeArtifacts(text: string): string;
|
|
61
61
|
/** Whether text contains shell-escape artifacts that {@link sanitizeText} repairs. */
|
|
62
62
|
export declare function hasEscapeArtifacts(text: string): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Repair the common backtick-to-backslash artifacts left by a shell. This is a
|
|
65
|
+
* heuristic: it only rewrites paired `\code\` spans and lone trailing `\` after
|
|
66
|
+
* an identifier, and never touches a backslash that is part of a path or regex.
|
|
67
|
+
*/
|
|
68
|
+
export declare function repairBacktickArtifacts(text: string): string;
|
|
63
69
|
/**
|
|
64
70
|
* Sanitize text that may have passed through a shell (commit bodies, generated
|
|
65
71
|
* descriptions) before it is rendered to markdown: restore shell-escape
|
|
66
|
-
* artifacts, strip any remaining bare
|
|
67
|
-
* to LF. Conservative by design — it
|
|
72
|
+
* artifacts, repair backtick-to-backslash artifacts, strip any remaining bare
|
|
73
|
+
* control characters, then normalize CRLF to LF. Conservative by design — it
|
|
74
|
+
* never removes an ordinary backslash.
|
|
68
75
|
*/
|
|
69
76
|
export declare function sanitizeText(text: string): string;
|
|
70
77
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import"node:path";import"node:url";import.meta.url;function e(e){return typeof e==`string`?e.trim():``}function t(e){return typeof e==`string`?e:``}function n(e){return typeof e==`string`&&e.trim().length>0}function r(e){return e.length>0?e.charAt(0).toUpperCase()+e.slice(1):e}function i(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).split(/[^a-zA-Z0-9]+/).filter(Boolean)}function a(e){return i(e).map((e,t)=>t===0?e.toLowerCase():r(e.toLowerCase())).join(``)}function o(e){return i(e).map(e=>r(e.toLowerCase())).join(``)}function s(e){return i(e).map(e=>e.toLowerCase()).join(`-`)}function c(e){return i(e).map(e=>e.toLowerCase()).join(`_`)}function l(e){return i(e).map(e=>e.toUpperCase()).join(`_`)}function u(e){return i(e).map(e=>r(e.toLowerCase())).join(` `)}function d(e){return a(e)}function f(e,t=``){return s(t&&e.startsWith(t)?e.slice(t.length):e)}function p(e,t=2){let n=` `.repeat(t);return e.split(`
|
|
2
2
|
`).map(e=>e.trim()?n+e:e).join(`
|
|
3
|
-
`)}function m(e){return/localhost|127\.0\.0\.1|0\.0\.0\.0|::/.test(e)}function h(e,t=`/`){return e.startsWith(t)?e:`${t}${e}`}function g(e,t=`/`){return e.endsWith(t)?e:`${e}${t}`}function _(e,t=`/`){return e.replace(RegExp(`^${S(t)}+`),``)}function v(e,t=`/`){return e.replace(RegExp(`${S(t)}+$`),``)}function y(e,t=`/`){return e.replace(RegExp(`${S(t)}+`,`g`),t)}function b(e,t=[`leading`,`trailing`,`double`],n=`/`){let r=e;for(let e of t)e===`leading`&&(r=_(r,n)),e===`trailing`&&(r=v(r,n)),e===`double`&&(r=y(r,n));return r}function x(e,t,n=`/`){if(!t.length)throw Error(`ensureSlashes: operations array cannot be empty.`);let r=e;for(let e of t)if(e===`leading`)r=h(r,n);else if(e===`trailing`)r=g(r,n);else throw Error(`ensureSlashes: invalid operation: ${e}`);return r}function S(e){return e===`/`?`\\/`:e}const C={0:`0`,7:`a`,8:`b`,9:`t`,10:`n`,11:`v`,12:`f`,13:`r`,27:`e`},w=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g,T=/\\([\u0000-\u001f])/g;function E(e){return C[e.charCodeAt(0)]??``}function D(e){return e.replace(w,E)}function O(e){return e.replace(T,(e,t)=>E(t))}function k(e){return/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]|\\[\u0000-\u001f]/.test(e)}function A(e){return D(O(e)).replace(/\r\n?/g,`
|
|
4
|
-
`)}export{t as asString,a as camelCase,d as camelCaseId,r as capitalize,l as constantCase,h as ensureLeadingSlash,x as ensureSlashes,g as ensureTrailingSlash,f as formatCliFlag,k as hasEscapeArtifacts,n as hasText,p as indent,m as isLocalhost,s as kebabCase,o as pascalCase,y as removeDoubleSlashes,_ as removeLeadingSlash,v as removeTrailingSlash,b as sanitizeSlashes,
|
|
3
|
+
`)}function m(e){return/localhost|127\.0\.0\.1|0\.0\.0\.0|::/.test(e)}function h(e,t=`/`){return e.startsWith(t)?e:`${t}${e}`}function g(e,t=`/`){return e.endsWith(t)?e:`${e}${t}`}function _(e,t=`/`){return e.replace(RegExp(`^${S(t)}+`),``)}function v(e,t=`/`){return e.replace(RegExp(`${S(t)}+$`),``)}function y(e,t=`/`){return e.replace(RegExp(`${S(t)}+`,`g`),t)}function b(e,t=[`leading`,`trailing`,`double`],n=`/`){let r=e;for(let e of t)e===`leading`&&(r=_(r,n)),e===`trailing`&&(r=v(r,n)),e===`double`&&(r=y(r,n));return r}function x(e,t,n=`/`){if(!t.length)throw Error(`ensureSlashes: operations array cannot be empty.`);let r=e;for(let e of t)if(e===`leading`)r=h(r,n);else if(e===`trailing`)r=g(r,n);else throw Error(`ensureSlashes: invalid operation: ${e}`);return r}function S(e){return e===`/`?`\\/`:e}const C={0:`0`,7:`a`,8:`b`,9:`t`,10:`n`,11:`v`,12:`f`,13:`r`,27:`e`},w=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g,T=/\\([\u0000-\u001f])/g;function E(e){return C[e.charCodeAt(0)]??``}function D(e){return e.replace(w,E)}function O(e){return e.replace(T,(e,t)=>E(t))}function k(e){return/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]|\\[\u0000-\u001f]/.test(e)||new RegExp(A.source).test(e)||new RegExp(j.source).test(e)}const A=/(^|[\s([{>"'])\\([^\s\\](?:[^\\\n:]*[^\s\\])?)\\(?=[\s)\]}>.,;:!?"'`]|$)/g,j=/(^|[\s([{>"'])([A-Za-z_$][\w$]*(?:[./@-][\w$./@-]*)*)\\(?=[\s)\]}>.,;:!?"'`]|$)/g;function M(e){return/[./@_$-]/.test(e)||!/[A-Z]/.test(e)||e===e.toUpperCase()}function N(e){return/[a-z][A-Z]|[./@_$-]/.test(e)||e===e.toUpperCase()}function P(e){return e.replace(A,(e,t,n)=>M(n)?`${t}\`${n}\``:e).replace(j,(e,t,n)=>N(n)?`${t}\`${n}\``:e)}function F(e){return D(P(O(e))).replace(/\r\n?/g,`
|
|
4
|
+
`)}export{t as asString,a as camelCase,d as camelCaseId,r as capitalize,l as constantCase,h as ensureLeadingSlash,x as ensureSlashes,g as ensureTrailingSlash,f as formatCliFlag,k as hasEscapeArtifacts,n as hasText,p as indent,m as isLocalhost,s as kebabCase,o as pascalCase,y as removeDoubleSlashes,_ as removeLeadingSlash,v as removeTrailingSlash,P as repairBacktickArtifacts,b as sanitizeSlashes,F as sanitizeText,c as snakeCase,e as str,D as stripControlChars,O as stripEscapeArtifacts,u as titleCase};
|
|
@@ -13,7 +13,7 @@ import __tsdown_shims_url from 'node:url';
|
|
|
13
13
|
export type ReplacementValue = string | number | boolean | null | undefined;
|
|
14
14
|
/** A map of token name to replacement value. */
|
|
15
15
|
export interface Replacements {
|
|
16
|
-
[key: string]: ReplacementValue;
|
|
16
|
+
[key: string & {}]: ReplacementValue;
|
|
17
17
|
}
|
|
18
18
|
export interface ReplacementOptions {
|
|
19
19
|
/** Opening token delimiter (default `{{`). */
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { ToolchainTsconfigAliasRewrite, ToolchainTsconfigAliasRewriteKey, ToolchainTsconfigAliasRewriteRule } from "./config-schema/alias-rewrite.js";
|
|
3
4
|
import { AzurePipelines } from "./config-schema/generated/azure-pipelines.js";
|
|
4
5
|
import { BiomeConfig } from "./config-schema/generated/biome-config.js";
|
|
5
6
|
import { GitHubWorkflow } from "./config-schema/generated/github-workflow.js";
|
|
6
7
|
import { GitLabCi } from "./config-schema/generated/gitlab-ci.js";
|
|
7
8
|
import { OxfmtConfig } from "./config-schema/generated/oxfmt-config.js";
|
|
8
9
|
import { OxlintConfig } from "./config-schema/generated/oxlint-config.js";
|
|
9
|
-
import {
|
|
10
|
+
import { DprintConfig, EslintConfig, EslintLanguageOptions, EslintLinterOptions, PrettierConfig } from "./config-schema/vendor-types.js";
|
|
11
|
+
import { AzureWorkflowSetting, ChangelogBranchesConfig, ChangelogBumpRule, ChangelogBumpRuleMatch, ChangelogCommitFormatConfig, ChangelogCommitlintConfig, ChangelogConfig, ChangelogProviderConfig, ChangelogVersioning, ChangelogVersioningConfig, ChangelogVersioningTarget, ChangelogWorkflowSetting, CiChangelogConfig, ConfigJsonValue, CustomWorkflowSettings, DbxConfigSections, GitHubWorkflowSetting, GitLabWorkflowSetting, ProjectType, ToolchainBiomeConfig, ToolchainCatalogsConfig, ToolchainCiConfig, ToolchainConfigSections, ToolchainFmtConfig, ToolchainLintConfig, ToolchainLoggerConfig, ToolchainProjectConfig, ToolchainProvidersConfig, ToolchainRegistryConfig, ToolchainRegistryPolicy, ToolchainTemplateKind, ToolchainTemplateSource, ToolchainTemplateSourceType, ToolchainTemplatesConfig, ToolchainTsconfigAliasAutoSetting, ToolchainTsconfigAutoSetting, ToolchainTsconfigConfig, ToolchainTsconfigOverrides, ToolchainViteConfig, ToolchainVscodeSettings, ToolchainWatchConfig, WorkflowExtra, WorkflowJob, WorkflowOptions, WorkflowSetting, WorkflowStep, WorkflowStepsConfig, WorkflowTokens, WorkflowTriggers } from "./config-types.js";
|
|
10
12
|
import { Replacements } from "./template.js";
|
|
11
13
|
import { biomeConfigOptionsSchema, biomeConfigSchema } from "./config-schema/biome.js";
|
|
12
14
|
import { catalogsConfigSchema } from "./config-schema/catalogs.js";
|
|
@@ -23,7 +25,7 @@ import { templateKindSchema, templateSourceSchema, templateSourceTypeSchema, tem
|
|
|
23
25
|
import { tsconfigConfigSchema } from "./config-schema/tsconfig.js";
|
|
24
26
|
import { viteConfigSchema } from "./config-schema/vite.js";
|
|
25
27
|
import { watchConfigSchema } from "./config-schema/watch.js";
|
|
26
|
-
import { VendorWorkflowConfig, azureWorkflowSettingSchema, customWorkflowSettingsSchema, githubWorkflowSettingSchema, gitlabWorkflowSettingSchema, isVendorWorkflowConfig, workflowConfigSchema, workflowJobSchema, workflowOptionsSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema } from "./config-schema/workflow.js";
|
|
28
|
+
import { VendorWorkflowConfig, azureWorkflowSettingSchema, customWorkflowSettingsSchema, githubWorkflowSettingSchema, gitlabWorkflowSettingSchema, isVendorWorkflowConfig, workflowConfigSchema, workflowExtraSchema, workflowJobSchema, workflowOptionsSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema, workflowTokensSchema, workflowTriggersSchema } from "./config-schema/workflow.js";
|
|
27
29
|
import { configSchema, dbxConfigSchema, toolchainConfigSchema } from "./config-schema/index.js";
|
|
28
30
|
import { Awaitable } from "./types.js";
|
|
29
31
|
//#region packages/shared/src/toolchain.d.ts
|
|
@@ -140,7 +142,14 @@ export declare function resolveCiConfig(config?: ToolchainConfig): ToolchainCiCo
|
|
|
140
142
|
*/
|
|
141
143
|
export declare function resolveChangelogConfig(config?: ToolchainConfig): CiChangelogConfig | undefined;
|
|
142
144
|
/** Default package-manager versions used when a config omits `packageManagerVersion`. */
|
|
143
|
-
export declare const DEFAULT_PACKAGE_MANAGER_VERSIONS:
|
|
145
|
+
export declare const DEFAULT_PACKAGE_MANAGER_VERSIONS: {
|
|
146
|
+
readonly yarn: '4.17.1';
|
|
147
|
+
readonly pnpm: '10.11.1';
|
|
148
|
+
readonly npm: '11.19.0';
|
|
149
|
+
readonly bun: '1.3.0';
|
|
150
|
+
};
|
|
151
|
+
/** The default version for a package manager, when known. */
|
|
152
|
+
export declare function defaultPackageManagerVersion(packageManager: string): string | undefined;
|
|
144
153
|
/** Formatter tools, highest priority first. */
|
|
145
154
|
export declare const FORMATTER_PRECEDENCE: readonly ['oxc', 'biome', 'prettier', 'dprint'];
|
|
146
155
|
/** Linter tools, highest priority first. */
|
|
@@ -254,4 +263,4 @@ export interface SyncTask {
|
|
|
254
263
|
run: (ctx: SyncContext) => Awaitable<ManagedFile[] | void>;
|
|
255
264
|
}
|
|
256
265
|
//#endregion
|
|
257
|
-
export { type AzurePipelines, AzureWorkflowSetting, type BiomeConfig, ChangelogBranchesConfig, ChangelogBumpRule, ChangelogBumpRuleMatch, ChangelogCommitFormatConfig, ChangelogCommitlintConfig, ChangelogConfig, ChangelogProviderConfig, ChangelogVersioning, ChangelogVersioningConfig, ChangelogVersioningTarget, ChangelogWorkflowSetting, CiChangelogConfig, ConfigJsonValue, CustomWorkflowSettings, DbxConfigSections, ENABLED_DESCRIPTION, type GitHubWorkflow, GitHubWorkflowSetting, type GitLabCi, GitLabWorkflowSetting, type OxfmtConfig, type OxlintConfig, ProjectType, ToolchainBiomeConfig, ToolchainCatalogsConfig, ToolchainCiConfig, ToolchainConfigSections, ToolchainFmtConfig, ToolchainLintConfig, ToolchainLoggerConfig, ToolchainProjectConfig, ToolchainProvidersConfig, ToolchainRegistryConfig, ToolchainRegistryPolicy, ToolchainTemplateKind, ToolchainTemplateSource, ToolchainTemplateSourceType, ToolchainTemplatesConfig, ToolchainTsconfigConfig, ToolchainTsconfigOverrides, ToolchainViteConfig, ToolchainVscodeSettings, ToolchainWatchConfig, VendorWorkflowConfig, WorkflowJob, WorkflowOptions, WorkflowSetting, WorkflowStep, WorkflowStepsConfig, azureWorkflowSettingSchema, biomeConfigOptionsSchema, biomeConfigSchema, catalogsConfigSchema, changelogBranchesConfigSchema, changelogBreakingCallbackSchema, changelogBreakingSettingSchema, changelogBumpRuleMatchSchema, changelogBumpRuleSchema, changelogCommitFormatConfigSchema, changelogCommitlintConfigSchema, changelogConfigSchema, changelogGroupConfigSchema, changelogGroupsSettingSchema, changelogProviderConfigSchema, changelogProviderSettingSchema, changelogVersioningConfigSchema, changelogVersioningSchema, changelogVersioningTargetSchema, changelogWorkflowSettingSchema, ciChangelogConfigSchema, ciConfigSchema, configJsonValueSchema, configSchema, customWorkflowSettingsSchema, dbxConfigSchema, fmtConfigSchema, githubWorkflowSettingSchema, gitlabWorkflowSettingSchema, isVendorWorkflowConfig, lintConfigSchema, loggerConfigSchema, projectConfigSchema, projectTypeSchema, providersConfigSchema, registryConfigSchema, registryPolicySchema, section, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, vscodeSettingsSchema, watchConfigSchema, withEnabled, workflowConfigSchema, workflowJobSchema, workflowOptionsSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema };
|
|
266
|
+
export { type AzurePipelines, AzureWorkflowSetting, type BiomeConfig, ChangelogBranchesConfig, ChangelogBumpRule, ChangelogBumpRuleMatch, ChangelogCommitFormatConfig, ChangelogCommitlintConfig, ChangelogConfig, ChangelogProviderConfig, ChangelogVersioning, ChangelogVersioningConfig, ChangelogVersioningTarget, ChangelogWorkflowSetting, CiChangelogConfig, ConfigJsonValue, CustomWorkflowSettings, DbxConfigSections, DprintConfig, ENABLED_DESCRIPTION, EslintConfig, EslintLanguageOptions, EslintLinterOptions, type GitHubWorkflow, GitHubWorkflowSetting, type GitLabCi, GitLabWorkflowSetting, type OxfmtConfig, type OxlintConfig, PrettierConfig, ProjectType, ToolchainBiomeConfig, ToolchainCatalogsConfig, ToolchainCiConfig, ToolchainConfigSections, ToolchainFmtConfig, ToolchainLintConfig, ToolchainLoggerConfig, ToolchainProjectConfig, ToolchainProvidersConfig, ToolchainRegistryConfig, ToolchainRegistryPolicy, ToolchainTemplateKind, ToolchainTemplateSource, ToolchainTemplateSourceType, ToolchainTemplatesConfig, ToolchainTsconfigAliasAutoSetting, ToolchainTsconfigAliasRewrite, ToolchainTsconfigAliasRewriteKey, ToolchainTsconfigAliasRewriteRule, ToolchainTsconfigAutoSetting, ToolchainTsconfigConfig, ToolchainTsconfigOverrides, ToolchainViteConfig, ToolchainVscodeSettings, ToolchainWatchConfig, VendorWorkflowConfig, WorkflowExtra, WorkflowJob, WorkflowOptions, WorkflowSetting, WorkflowStep, WorkflowStepsConfig, WorkflowTokens, WorkflowTriggers, azureWorkflowSettingSchema, biomeConfigOptionsSchema, biomeConfigSchema, catalogsConfigSchema, changelogBranchesConfigSchema, changelogBreakingCallbackSchema, changelogBreakingSettingSchema, changelogBumpRuleMatchSchema, changelogBumpRuleSchema, changelogCommitFormatConfigSchema, changelogCommitlintConfigSchema, changelogConfigSchema, changelogGroupConfigSchema, changelogGroupsSettingSchema, changelogProviderConfigSchema, changelogProviderSettingSchema, changelogVersioningConfigSchema, changelogVersioningSchema, changelogVersioningTargetSchema, changelogWorkflowSettingSchema, ciChangelogConfigSchema, ciConfigSchema, configJsonValueSchema, configSchema, customWorkflowSettingsSchema, dbxConfigSchema, fmtConfigSchema, githubWorkflowSettingSchema, gitlabWorkflowSettingSchema, isVendorWorkflowConfig, lintConfigSchema, loggerConfigSchema, projectConfigSchema, projectTypeSchema, providersConfigSchema, registryConfigSchema, registryPolicySchema, section, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, vscodeSettingsSchema, watchConfigSchema, withEnabled, workflowConfigSchema, workflowExtraSchema, workflowJobSchema, workflowOptionsSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema, workflowTokensSchema, workflowTriggersSchema };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node:path";import"node:url";import.meta.url;import{deepMerge as e,isPlainObject as t}from"./object-utils.js";import{configJsonValueSchema as n}from"./config-schema/json.js";import{ENABLED_DESCRIPTION as r,section as i,withEnabled as a}from"./config-schema/meta.js";import{azureWorkflowSettingSchema as ee,customWorkflowSettingsSchema as te,githubWorkflowSettingSchema as ne,gitlabWorkflowSettingSchema as re,isVendorWorkflowConfig as o,workflowConfigSchema as s,
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;import{deepMerge as e,isPlainObject as t}from"./object-utils.js";import{configJsonValueSchema as n}from"./config-schema/json.js";import{ENABLED_DESCRIPTION as r,section as i,withEnabled as a}from"./config-schema/meta.js";import{azureWorkflowSettingSchema as ee,customWorkflowSettingsSchema as te,githubWorkflowSettingSchema as ne,gitlabWorkflowSettingSchema as re,isVendorWorkflowConfig as o,workflowConfigSchema as s,workflowExtraSchema as c,workflowJobSchema as ie,workflowOptionsSchema as ae,workflowSettingSchema as oe,workflowStepSchema as se,workflowStepsConfigSchema as ce,workflowTokensSchema as le,workflowTriggersSchema as ue}from"./config-schema/workflow.js";import{biomeConfigOptionsSchema as de,biomeConfigSchema as fe}from"./config-schema/biome.js";import{catalogsConfigSchema as pe}from"./config-schema/catalogs.js";import{changelogBranchesConfigSchema as l,changelogBreakingCallbackSchema as u,changelogBreakingSettingSchema as d,changelogBumpRuleMatchSchema as f,changelogBumpRuleSchema as p,changelogCommitFormatConfigSchema as m,changelogCommitlintConfigSchema as h,changelogConfigSchema as g,changelogGroupConfigSchema as _,changelogGroupsSettingSchema as v,changelogProviderConfigSchema as y,changelogProviderSettingSchema as b,changelogVersioningConfigSchema as x,changelogVersioningSchema as S,changelogVersioningTargetSchema as C,changelogWorkflowSettingSchema as w,ciChangelogConfigSchema as T}from"./config-schema/changelog.js";import{ciConfigSchema as E}from"./config-schema/ci.js";import{fmtConfigSchema as D,lintConfigSchema as O,vscodeSettingsSchema as k}from"./config-schema/format.js";import{loggerConfigSchema as A}from"./config-schema/logger.js";import{projectConfigSchema as j,projectTypeSchema as M}from"./config-schema/project.js";import{providersConfigSchema as N}from"./config-schema/providers.js";import{registryConfigSchema as P,registryPolicySchema as F}from"./config-schema/registry.js";import{templateKindSchema as me,templateSourceSchema as I,templateSourceTypeSchema as L,templatesConfigSchema as R}from"./config-schema/templates.js";import{tsconfigConfigSchema as z}from"./config-schema/tsconfig.js";import{viteConfigSchema as he}from"./config-schema/vite.js";import{watchConfigSchema as ge}from"./config-schema/watch.js";import{configSchema as _e,dbxConfigSchema as ve,toolchainConfigSchema as ye}from"./config-schema/index.js";function be(e){return e}function B(e){return e===void 0?!1:typeof e==`boolean`?e:e.enabled!==!1}function V(e){return e!==void 0&&typeof e==`object`?e:void 0}const xe=[`dbx.config.ts`,`dbx.config.mts`,`dbx.config.js`,`dbx.config.mjs`,`dbx.config.cjs`,`dbx.config.json`];function H(e){if(!e)return;let t=e.match(/github\.com[/:]([^/]+)\/([^/.]+?)(?:\.git)?$/);return t?.[1]&&t[2]?`${t[1]}/${t[2]}`:void 0}function U(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function W(e={}){return B(e.ci)?V(e.ci):void 0}function G(t={}){let n=V(t.changelog),r=n&&B(n)?n:void 0,i=W(t)?.changelog;if(i===!1)return;if(i===void 0||i===!0||typeof i==`string`||o(i))return r;let a=i;if(B(a))return r?e(r,a):a}const K={yarn:`4.17.1`,pnpm:`10.11.1`,npm:`11.19.0`,bun:`1.3.0`};function q(e){return K[e]}const J=[`oxc`,`biome`,`prettier`,`dprint`],Y=[`oxc`,`biome`,`eslint`];function X(e){return B(e)?V(e):void 0}function Z(e={}){let t=X(e.fmt)??{},n=X(e.vite),r=/* @__PURE__ */ new Set;return n?.fmt!==void 0&&n.fmt!==!1&&r.add(`oxc`),t.oxc!==void 0&&t.oxc!==!1&&r.add(`oxc`),t.biome!==void 0&&t.biome!==!1&&r.add(`biome`),t.prettier!==void 0&&t.prettier!==!1&&r.add(`prettier`),t.dprint!==void 0&&t.dprint!==!1&&r.add(`dprint`),J.filter(e=>r.has(e))}function Q(e={}){let t=X(e.lint)??{},n=X(e.vite),r=/* @__PURE__ */ new Set;return n?.lint!==void 0&&n.lint!==!1&&r.add(`oxc`),t.oxc!==void 0&&t.oxc!==!1&&r.add(`oxc`),t.biome!==void 0&&t.biome!==!1&&r.add(`biome`),t.eslint!==void 0&&t.eslint!==!1&&r.add(`eslint`),Y.filter(e=>r.has(e))}function Se(e={}){return Z(e)[0]}function Ce(e={}){return Q(e)[0]}function we(n={}){let r=X(n.fmt)?.oxc,i=X(n.vite)?.fmt;return i===void 0?r:i===!1?!1:i===!0?r??!0:r===void 0?i:t(r)&&t(i)?e(r,i):i}function Te(n={}){let r=X(n.lint)?.oxc,i=X(n.vite)?.lint;return i===void 0?r:i===!1?!1:i===!0?r??!0:r===void 0?i:t(r)&&t(i)?e(r,i):i}function Ee(e={}){let t=W(e)?.changelog;return t===void 0?!1:typeof t==`boolean`?t:typeof t==`string`?t.trim().length>0:B(t)}function De(e){let t=e?.commitlint;return t===void 0?!0:typeof t==`boolean`?t:t.enabled!==!1}function $(e){let t=e?.branches??{},n=U(t.main);n.length===0&&n.push(`main`);let r=U(t.dev);return{main:n,dev:r.length>0?r:n}}function Oe(e={}){let t=e.project??{},n=$(G(e)??{}),r=t.name??`app`,i=t.packageManager??`yarn`,a=t.packageManagerVersion??q(i)??`4.17.1`;return{name:r,scope:t.scope??``,author:t.author??``,license:t.license??`MIT`,homepage:t.homepage??``,repo:t.repo??``,repoSlug:H(t.repo)??``,description:t.description??``,nodeVersion:t.nodeVersion??`22`,packageManager:i,yarnVersion:a,packageManagerVersion:a,mainBranch:n.main[0]??`main`,devBranch:n.dev[0]??`main`}}export{xe as CONFIG_FILE_NAMES,K as DEFAULT_PACKAGE_MANAGER_VERSIONS,r as ENABLED_DESCRIPTION,J as FORMATTER_PRECEDENCE,Y as LINTER_PRECEDENCE,ee as azureWorkflowSettingSchema,de as biomeConfigOptionsSchema,fe as biomeConfigSchema,pe as catalogsConfigSchema,l as changelogBranchesConfigSchema,u as changelogBreakingCallbackSchema,d as changelogBreakingSettingSchema,f as changelogBumpRuleMatchSchema,p as changelogBumpRuleSchema,m as changelogCommitFormatConfigSchema,h as changelogCommitlintConfigSchema,g as changelogConfigSchema,_ as changelogGroupConfigSchema,v as changelogGroupsSettingSchema,y as changelogProviderConfigSchema,b as changelogProviderSettingSchema,Ee as changelogSectionEnabled,x as changelogVersioningConfigSchema,S as changelogVersioningSchema,C as changelogVersioningTargetSchema,w as changelogWorkflowSettingSchema,T as ciChangelogConfigSchema,E as ciConfigSchema,n as configJsonValueSchema,_e as configSchema,te as customWorkflowSettingsSchema,ve as dbxConfigSchema,q as defaultPackageManagerVersion,be as defineConfig,D as fmtConfigSchema,ne as githubWorkflowSettingSchema,re as gitlabWorkflowSettingSchema,o as isVendorWorkflowConfig,O as lintConfigSchema,A as loggerConfigSchema,j as projectConfigSchema,M as projectTypeSchema,N as providersConfigSchema,P as registryConfigSchema,F as registryPolicySchema,H as repoSlugFromUrl,$ as resolveChangelogBranches,G as resolveChangelogConfig,W as resolveCiConfig,De as resolveCommitlintEnabled,Se as resolveFmtTool,Z as resolveFmtTools,Ce as resolveLintTool,Q as resolveLintTools,we as resolveOxcFmtConfig,Te as resolveOxcLintConfig,Oe as resolveTokens,i as section,V as sectionConfig,B as sectionEnabled,me as templateKindSchema,I as templateSourceSchema,L as templateSourceTypeSchema,R as templatesConfigSchema,ye as toolchainConfigSchema,z as tsconfigConfigSchema,he as viteConfigSchema,k as vscodeSettingsSchema,ge as watchConfigSchema,a as withEnabled,s as workflowConfigSchema,c as workflowExtraSchema,ie as workflowJobSchema,ae as workflowOptionsSchema,oe as workflowSettingSchema,se as workflowStepSchema,ce as workflowStepsConfigSchema,le as workflowTokensSchema,ue as workflowTriggersSchema};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { ToolchainConfig } from "./toolchain.js";
|
|
4
|
+
//#region packages/shared/src/tsconfig-files.d.ts
|
|
5
|
+
/** The tsconfig file names a project reads and patches (custom names honoured). */
|
|
6
|
+
export interface TsconfigFileNameSet {
|
|
7
|
+
baseFile: string;
|
|
8
|
+
rootFile: string;
|
|
9
|
+
defaultFile: string;
|
|
10
|
+
buildFile: string;
|
|
11
|
+
}
|
|
12
|
+
/** Resolve the configured tsconfig file names (defaults for the unset ones). */
|
|
13
|
+
export declare function tsconfigFileNames(config: ToolchainConfig): TsconfigFileNameSet;
|
|
14
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;import{sectionConfig as e}from"./toolchain.js";function t(t){let n=e(t.tsconfig)??{};return{baseFile:n.baseFile??`tsconfig.base.json`,rootFile:n.rootFile??`tsconfig.workspaces.json`,defaultFile:n.defaultFile??`tsconfig.default.json`,buildFile:n.buildFile??`tsconfig.build.json`}}export{t as tsconfigFileNames};
|
|
@@ -13,7 +13,7 @@ export interface GeneratedFile {
|
|
|
13
13
|
}
|
|
14
14
|
/** Any JSON-serializable value. */
|
|
15
15
|
export type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
16
|
-
[key: string]: JsonValue;
|
|
16
|
+
[key: string & {}]: JsonValue;
|
|
17
17
|
};
|
|
18
18
|
/** A CLI option a tooling command exposes (framework-agnostic). */
|
|
19
19
|
export interface ToolchainOption {
|
|
@@ -44,6 +44,8 @@ export interface ToolchainCommandContext {
|
|
|
44
44
|
tokens: Replacements;
|
|
45
45
|
/** The config file that was loaded, if any. */
|
|
46
46
|
configPath?: string;
|
|
47
|
+
/** The inherited ancestor config file, when this project has no config of its own. */
|
|
48
|
+
parentPath?: string;
|
|
47
49
|
/** Whether config discovery was disabled (`dbx --no-config`). */
|
|
48
50
|
noConfig?: boolean;
|
|
49
51
|
/**
|
|
@@ -119,6 +121,6 @@ export interface PackageJson {
|
|
|
119
121
|
};
|
|
120
122
|
exports?: Record<string, unknown> | string;
|
|
121
123
|
files?: string[];
|
|
122
|
-
[key: string]: unknown;
|
|
124
|
+
[key: string & {}]: unknown;
|
|
123
125
|
}
|
|
124
126
|
//#endregion
|
|
@@ -3,28 +3,120 @@ import __tsdown_shims_url from 'node:url';
|
|
|
3
3
|
import { OxfmtConfig } from "./config-schema/generated/oxfmt-config.js";
|
|
4
4
|
import { OxlintConfig } from "./config-schema/generated/oxlint-config.js";
|
|
5
5
|
//#region packages/shared/src/vite-defaults.d.ts
|
|
6
|
+
/** A deeply readonly view of a config object (for the literal default values). */
|
|
7
|
+
export type DeepReadonly<T> = T extends readonly (infer U)[] ? readonly DeepReadonly<U>[] : T extends object ? { readonly [K in keyof T]: DeepReadonly<T[K]>; } : T;
|
|
6
8
|
/** The Oxfmt options accepted by Vite+ (`toolchain.vite.fmt`). */
|
|
7
9
|
export type ToolchainOxfmtConfig = OxfmtConfig;
|
|
8
10
|
/** The Oxlint options accepted by Vite+ (`toolchain.vite.lint`). */
|
|
9
11
|
export type ToolchainOxlintConfig = OxlintConfig;
|
|
12
|
+
/** The object form of Oxfmt's `sortImports` option. */
|
|
13
|
+
export type FmtSortImports = Exclude<NonNullable<OxfmtConfig['sortImports']>, boolean>;
|
|
14
|
+
/** One custom `sortImports` group. */
|
|
15
|
+
export type FmtCustomGroup = NonNullable<FmtSortImports['customGroups']>[number];
|
|
16
|
+
/** One entry in `sortImports.groups`. */
|
|
17
|
+
export type FmtSortGroup = NonNullable<FmtSortImports['groups']>[number];
|
|
18
|
+
/** The group name used for a project's own workspace packages. */
|
|
19
|
+
export declare const DEFAULT_FMT_SORT_GROUP = "workspace";
|
|
10
20
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* `
|
|
21
|
+
* The default import groups: builtins, external packages, source-internal
|
|
22
|
+
* aliases, relatives, styles and unknowns. The `workspace` group is inserted
|
|
23
|
+
* after `external` by {@link applyFmtCustomGroups}.
|
|
14
24
|
*/
|
|
15
|
-
export declare const
|
|
25
|
+
export declare const DEFAULT_FMT_SORT_GROUPS: readonly ['builtin', 'external', readonly ['internal', 'subpath'], readonly ['parent', 'sibling', 'index'], 'style', 'unknown'];
|
|
26
|
+
/** The default Oxfmt `sortImports` options (without resolved custom groups). */
|
|
27
|
+
export declare const DEFAULT_FMT_SORT_IMPORTS: FmtSortImports;
|
|
16
28
|
/**
|
|
17
29
|
* The Oxfmt options used when `vite.fmt` is `true`, and the base an options
|
|
18
|
-
* object is merged over.
|
|
19
|
-
* is
|
|
30
|
+
* object is merged over. Import sorting is enabled by default; the workspace
|
|
31
|
+
* custom group is filled in from the project graph by `resolveFmtCustomGroups`.
|
|
20
32
|
*/
|
|
21
|
-
export declare const DEFAULT_FMT_RULES:
|
|
22
|
-
|
|
23
|
-
|
|
33
|
+
export declare const DEFAULT_FMT_RULES: {
|
|
34
|
+
readonly useTabs: false;
|
|
35
|
+
readonly tabWidth: 4;
|
|
36
|
+
readonly printWidth: 100;
|
|
37
|
+
readonly endOfLine: 'lf';
|
|
38
|
+
readonly insertFinalNewline: true;
|
|
39
|
+
readonly singleQuote: true;
|
|
40
|
+
readonly jsxSingleQuote: false;
|
|
41
|
+
readonly quoteProps: 'as-needed';
|
|
42
|
+
readonly trailingComma: 'es5';
|
|
43
|
+
readonly semi: true;
|
|
44
|
+
readonly arrowParens: 'avoid';
|
|
45
|
+
readonly bracketSpacing: true;
|
|
46
|
+
readonly bracketSameLine: false;
|
|
47
|
+
readonly singleAttributePerLine: false;
|
|
48
|
+
readonly objectWrap: 'preserve';
|
|
49
|
+
readonly proseWrap: 'preserve';
|
|
50
|
+
readonly embeddedLanguageFormatting: 'auto';
|
|
51
|
+
readonly htmlWhitespaceSensitivity: 'css';
|
|
52
|
+
readonly vueIndentScriptAndStyle: false;
|
|
53
|
+
readonly sortPackageJson: false;
|
|
54
|
+
readonly sortImports: {
|
|
55
|
+
readonly ignoreCase?: boolean;
|
|
56
|
+
readonly internalPattern?: Array<string>;
|
|
57
|
+
readonly newlinesBetween?: boolean;
|
|
58
|
+
readonly order?: 'asc' | 'desc';
|
|
59
|
+
readonly partitionByComment?: boolean;
|
|
60
|
+
readonly partitionByNewline?: boolean;
|
|
61
|
+
readonly sortSideEffects?: boolean;
|
|
62
|
+
readonly groups: (string | string[] | {
|
|
63
|
+
newlinesBetween: boolean;
|
|
64
|
+
})[];
|
|
65
|
+
readonly customGroups: readonly [];
|
|
66
|
+
};
|
|
67
|
+
readonly ignorePatterns: readonly ["**/node_modules/**", "**/.git/**", "**/.dbx/**", "**/dist/**", "**/build/**", "**/out/**", "**/coverage/**", "**/.turbo/**", "**/.yarn/**", "**/.next/**", "**/.cache/**", "**/.output/**", "**/.vite/**", "**/.vscode/**", "**/.nyc_output/**", "**/*.tsbuildinfo", "**/.nuxt/**", "**/.svelte-kit/**", "**/.generated/**", "**/generated/**", "**/*.json", "**/*.yml", "**/*.yaml", "**/*.lock", "**/*.min.*", "**/*.gen.*", "**/CHANGELOG.md", "CHANGELOG.proposed.md", "**/vite.config.ts"];
|
|
68
|
+
};
|
|
69
|
+
/** The `name`/`scope` fields needed to build a workspace custom group. */
|
|
70
|
+
export interface FmtProjectIdentity {
|
|
71
|
+
name?: string;
|
|
72
|
+
scope?: string;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Build the custom `sortImports` group for a set of projects. Scopes become
|
|
76
|
+
* `@scope/**` patterns; unscoped and scoped project names also match the bare
|
|
77
|
+
* name and its subpaths, so workspace imports sort together.
|
|
78
|
+
*/
|
|
79
|
+
export declare function fmtCustomGroupsForProjects(projects: Iterable<FmtProjectIdentity | undefined | null>): FmtCustomGroup[];
|
|
80
|
+
/**
|
|
81
|
+
* Add the resolved workspace custom groups to an Oxfmt config, preserving any
|
|
82
|
+
* groups the consumer already defined. `sortImports: false` is respected; when
|
|
83
|
+
* `sortImports` is absent the config is left alone.
|
|
84
|
+
*/
|
|
85
|
+
export declare function applyFmtCustomGroups(fmt: ToolchainOxfmtConfig | DeepReadonly<ToolchainOxfmtConfig>, customGroups: FmtCustomGroup[]): ToolchainOxfmtConfig;
|
|
24
86
|
/**
|
|
25
87
|
* The Oxlint options used when `vite.lint` is `true`, and the base an options
|
|
26
88
|
* object is merged over. Framework/a11y rules are disabled by default (opt in
|
|
27
89
|
* per project); the remaining rules are non-blocking warnings.
|
|
28
90
|
*/
|
|
29
|
-
export declare const DEFAULT_LINT_RULES:
|
|
91
|
+
export declare const DEFAULT_LINT_RULES: {
|
|
92
|
+
readonly ignorePatterns: readonly ["**/node_modules/**", "**/.git/**", "**/.dbx/**", "**/dist/**", "**/build/**", "**/out/**", "**/coverage/**", "**/.turbo/**", "**/.yarn/**", "**/.next/**", "**/.cache/**", "**/.output/**", "**/.vite/**", "**/.vscode/**", "**/.nyc_output/**", "**/*.tsbuildinfo", "**/.nuxt/**", "**/.svelte-kit/**", "**/.generated/**", "**/generated/**", "**/*.gen.*", "**/*.min.*", "**/vendor/**"];
|
|
93
|
+
readonly rules: {
|
|
94
|
+
readonly 'jsx-a11y/alt-text': 'off';
|
|
95
|
+
readonly 'jsx-a11y/aria-props': 'off';
|
|
96
|
+
readonly 'jsx-a11y/click-events-have-key-events': 'off';
|
|
97
|
+
readonly 'react/button-has-type': 'off';
|
|
98
|
+
readonly 'react/react-in-jsx-scope': 'off';
|
|
99
|
+
readonly 'react/exhaustive-deps': 'off';
|
|
100
|
+
readonly 'typescript/no-empty-object-type': 'off';
|
|
101
|
+
readonly 'typescript/no-explicit-any': 'off';
|
|
102
|
+
readonly 'typescript/no-non-null-assertion': 'off';
|
|
103
|
+
readonly 'typescript/no-useless-empty-export': 'off';
|
|
104
|
+
readonly eqeqeq: 'warn';
|
|
105
|
+
readonly 'import/no-duplicates': 'warn';
|
|
106
|
+
readonly 'no-alert': 'warn';
|
|
107
|
+
readonly 'no-case-declarations': 'off';
|
|
108
|
+
readonly 'no-console': 'off';
|
|
109
|
+
readonly 'no-constant-condition': 'off';
|
|
110
|
+
readonly 'no-control-regex': 'off';
|
|
111
|
+
readonly 'no-debugger': 'warn';
|
|
112
|
+
readonly 'no-inner-declarations': 'off';
|
|
113
|
+
readonly 'no-return-assign': 'off';
|
|
114
|
+
readonly 'no-unused-vars': 'warn';
|
|
115
|
+
readonly 'no-useless-escape': 'off';
|
|
116
|
+
readonly 'no-var': 'warn';
|
|
117
|
+
readonly 'prefer-const': 'warn';
|
|
118
|
+
readonly 'prefer-exponentiation-operator': 'off';
|
|
119
|
+
readonly 'prefer-template': 'off';
|
|
120
|
+
};
|
|
121
|
+
};
|
|
30
122
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node:path";import"node:url";import.meta.url;import{
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;import{isPlainObject as e}from"./object-utils.js";import{DEFAULT_FMT_IGNORE_PATTERNS as t,DEFAULT_LINT_IGNORE_PATTERNS as n}from"./ignore.js";const r=`workspace`,i=[`builtin`,`external`,[`internal`,`subpath`],[`parent`,`sibling`,`index`],`style`,`unknown`];function a(){return i.map(e=>Array.isArray(e)?[...e]:e)}const o={groups:a(),customGroups:[],internalPattern:[`~/`,`@/`],newlinesBetween:!0},s={useTabs:!1,tabWidth:4,printWidth:100,endOfLine:`lf`,insertFinalNewline:!0,singleQuote:!0,jsxSingleQuote:!1,quoteProps:`as-needed`,trailingComma:`es5`,semi:!0,arrowParens:`avoid`,bracketSpacing:!0,bracketSameLine:!1,singleAttributePerLine:!1,objectWrap:`preserve`,proseWrap:`preserve`,embeddedLanguageFormatting:`auto`,htmlWhitespaceSensitivity:`css`,vueIndentScriptAndStyle:!1,sortPackageJson:!1,sortImports:{...o,groups:a(),customGroups:[]},ignorePatterns:[...t]};function c(e){let t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Set;for(let r of e)r&&(r.scope&&t.add(r.scope),r.name&&n.add(r.name));let i=[...[...t].sort().map(e=>`${e}/**`),...[...n].sort().flatMap(e=>[e,`${e}/**`])],a=[...new Set(i)];return a.length>0?[{groupName:r,elementNamePattern:a}]:[]}function l(e){return typeof e==`string`?[e]:Array.isArray(e)?e:[]}function u(e,t){if(e.some(e=>l(e).includes(t)))return;let n=e.findIndex(e=>l(e).includes(`external`));e.splice(n===-1?e.length:n+1,0,t)}function d(t,n){let r=t;if(n.length===0||r.sortImports===void 0||r.sortImports===!1)return r;let i=r.sortImports===!0||!e(r.sortImports)?{...o,groups:a(),customGroups:[]}:{...r.sortImports},s=Array.isArray(i.groups)?[...i.groups]:a(),c=Array.isArray(i.customGroups)?i.customGroups.map(e=>({...e})):[];for(let e of n){let t=c.findIndex(t=>t.groupName===e.groupName);if(t===-1)c.push({...e});else{let n=c[t];c[t]={...n,elementNamePattern:[.../* @__PURE__ */ new Set([...n?.elementNamePattern??[],...e.elementNamePattern??[]])]}}e.groupName&&u(s,e.groupName)}return{...r,sortImports:{...i,groups:s,customGroups:c}}}const f={ignorePatterns:[...n],rules:{"jsx-a11y/alt-text":`off`,"jsx-a11y/aria-props":`off`,"jsx-a11y/click-events-have-key-events":`off`,"react/button-has-type":`off`,"react/react-in-jsx-scope":`off`,"react/exhaustive-deps":`off`,"typescript/no-empty-object-type":`off`,"typescript/no-explicit-any":`off`,"typescript/no-non-null-assertion":`off`,"typescript/no-useless-empty-export":`off`,eqeqeq:`warn`,"import/no-duplicates":`warn`,"no-alert":`warn`,"no-case-declarations":`off`,"no-console":`off`,"no-constant-condition":`off`,"no-control-regex":`off`,"no-debugger":`warn`,"no-inner-declarations":`off`,"no-return-assign":`off`,"no-unused-vars":`warn`,"no-useless-escape":`off`,"no-var":`warn`,"prefer-const":`warn`,"prefer-exponentiation-operator":`off`,"prefer-template":`off`}};export{s as DEFAULT_FMT_RULES,r as DEFAULT_FMT_SORT_GROUP,i as DEFAULT_FMT_SORT_GROUPS,o as DEFAULT_FMT_SORT_IMPORTS,f as DEFAULT_LINT_RULES,d as applyFmtCustomGroups,c as fmtCustomGroupsForProjects};
|
|
@@ -9,7 +9,7 @@ import __tsdown_shims_url from 'node:url';
|
|
|
9
9
|
* double-quoted.
|
|
10
10
|
*/
|
|
11
11
|
type YamlValue = string | number | boolean | null | YamlValue[] | {
|
|
12
|
-
[key: string]: YamlValue;
|
|
12
|
+
[key: string & {}]: YamlValue;
|
|
13
13
|
};
|
|
14
14
|
/** Serialize a value (expected to be a map) to a YAML document. */
|
|
15
15
|
export declare function toYaml(value: Record<string, YamlValue>): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import "./workspaces.js";
|
|
4
|
+
import { TsConfigJson } from "type-fest";
|
|
5
|
+
//#region packages/tsconfig/src/auto.d.ts
|
|
6
|
+
/** The keys auto-wiring owns in the root workspaces tsconfig. */
|
|
7
|
+
export interface TsconfigAutoState {
|
|
8
|
+
paths: string[];
|
|
9
|
+
references: string[];
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{default as e}from"node:path";import"node:url";import.meta.url;import{resolveTsconfigCompilerOption as t}from"./resolve.js";import{matchesAutoFilter as n,resolveAutoSwitches as r}from"./workspaces.js";import i from"node:fs";import{globSync as a}from"glob";const o=[`ts`,`tsx`,`js`,`jsx`];function s(e){return e.replace(/\\/g,`/`)}function c(t,n){let r=s(e.relative(t,n));return r.startsWith(`.`)?r:`./${r}`}function l(e){let t=s(e).replace(/^\.\//,``).replace(/\/+$/,``);return t===``?`.`:t}function u(e,n=`src`){let r=e.options.autoSrcDir;if(typeof r==`string`&&r.trim())return l(r);let i=t(e.defaultTsconfigPath,`rootDir`);if(i)return l(c(e.dir,i));let a=t(e.defaultTsconfigPath,`baseUrl`);return l(a?c(e.dir,a):n)}function d(e){if(typeof e==`string`)return e;if(Array.isArray(e)){for(let t of e){let e=d(t);if(e)return e}return}if(!e||typeof e!=`object`)return;let t=e;for(let e of[`types`,`import`,`default`,`require`,`node`,`browser`]){let n=d(t[e]);if(n)return n}for(let e of Object.values(t)){let t=d(e);if(t)return t}}function f(e){if(typeof e==`string`)return[{key:``,target:e}];if(!e||typeof e!=`object`||Array.isArray(e))return[];let t=e;if(Object.keys(t).every(e=>!e.startsWith(`.`))){let e=d(t);return e?[{key:``,target:e}]:[]}let n=[];for(let[e,r]of Object.entries(t)){let t=d(r);t&&(e===`.`?n.push({key:``,target:t}):e.startsWith(`./`)&&n.push({key:e.slice(2),target:t}))}return n}function p(t,n,r){return c(t,e.resolve(n,r))}function m(e,t,n,r){let i={};for(let a of e){let e=a.key?`${t}/${a.key}`:t;i[e]=[p(n,r,a.target)]}return i}function h(e){let t=e.replace(/\\/g,`/`);return!(/(^|\/)(dist|build|out|lib|coverage)\//.test(t)||/\.d\.[cm]?ts$/.test(t))}function g(e){if(!e)return[];let t=Array.isArray(e)?e.flatMap(e=>(Array.isArray(e.pattern)?e.pattern:[e.pattern]).map(t=>({pattern:t,replacement:e.replacement}))):Object.entries(e).map(([e,t])=>({pattern:e,replacement:t})),n=[];for(let e of t)try{let t=e.pattern instanceof RegExp?new RegExp(e.pattern.source,e.pattern.flags.replace(/[gy]/g,``)):new RegExp(e.pattern);n.push({regex:t,replacement:e.replacement})}catch{}return n}function _(e,t){let n=g(t);if(n.length===0)return e;let r={};for(let[t,i]of Object.entries(e)){let e=n.find(e=>e.regex.test(t)),a=e?t.replace(e.regex,e.replacement):t;r[a]=i}return r}function v(t,n,r,a){let s=n.types,l=typeof s==`string`?s:n.main;if(typeof l==`string`&&h(l))return p(a,t.dir,l);let u=e.resolve(t.dir,r),d=o.map(t=>e.join(u,`index.${t}`)).find(e=>i.existsSync(e));return d?c(a,d):void 0}function y(t,n){let r=t.packageName;if(!r)return{};let l=t.packageJson??{},d=u(t),p={},g=f(l.exports).filter(e=>h(e.target));if(g.length>0){if(Object.assign(p,m(g,r,n,t.dir)),!p[r]){let e=v(t,l,d,n);e&&(p[r]=[e])}return!p[`${r}/*`]&&d&&(p[`${r}/*`]=[c(n,e.resolve(t.dir,d,`*`))]),p}let _=v(t,l,d,n);if(_)return p[r]=[_],d&&(p[`${r}/*`]=[c(n,e.resolve(t.dir,d,`*`))]),p;let y=e.resolve(t.dir,d),b=o.map(t=>e.join(y,`index.${t}`)).find(e=>i.existsSync(e));b&&(p[r]=[c(n,b)]);let x=i.existsSync(y)?a(`**/index.{${o.join(`,`)}}`,{cwd:y,nodir:!0,ignore:[`**/node_modules/**`]}):[];for(let t of x){let i=s(t),a=e.posix.dirname(i);a!==`.`&&(p[`${r}/${a}`]=[c(n,e.join(y,i))])}return d===`.`?p[`${r}/*`]=[c(n,e.resolve(t.dir,`*`))]:p[`${r}/*`]=[c(n,e.resolve(y,`*`))],p}function b(e,t){let a=structuredClone(t.existing??{}),o={...a.compilerOptions},s={...o.paths},l=[...a.references??[]],u=t.previous??{paths:[],references:[]},d=/* @__PURE__ */ new Set,f=/* @__PURE__ */ new Set,p=new Map(e.map(e=>[c(t.cwd,e.targetTsconfigPath),e]));l=l.filter(e=>{let t=e.path.replace(/\\/g,`/`).replace(/^\.\//,`./`),a=p.get(t);if(!a)return!0;let o=r(a.options);return!o.refsAuto.enabled||!n(t,o.refsAuto)?!0:!i.existsSync(a.defaultTsconfigPath)||!(a.enabled&&a.options.refs!==!1&&a.options.composite===!0)?!1:(f.add(t),!0)});for(let a of e){if(!a.enabled)continue;let e=r(a.options);if(!n(a.relativeDir,e.auto))continue;if(a.options.aliases!==!1&&e.aliasAuto.enabled&&a.packageName){let r=e.aliasAuto.rewriteAlias??e.auto.rewriteAlias,i=_(y(a,t.cwd),r);for(let[t,r]of Object.entries(i))n(t,e.aliasAuto)&&(t in s&&!u.paths.includes(t)||(s[t]=r,d.add(t)))}let o=a.options.refs!==!1&&e.refsAuto.enabled,p=a.options.composite===!0,m={path:c(t.cwd,a.targetTsconfigPath)};if(o&&p&&!a.isRoot&&i.existsSync(a.defaultTsconfigPath)&&n(m.path,e.refsAuto)){let e=l.find(e=>e.path===m.path);(!e||u.references.includes(m.path))&&(l=l.filter(e=>e.path!==m.path),l.push(e?{...e,...m}:m),f.add(m.path))}}for(let e of u.paths)d.has(e)||delete s[e];for(let e of u.references)f.has(e)||(l=l.filter(t=>t.path!==e));Object.keys(s).length>0?o.paths=s:delete o.paths;let m={...a,compilerOptions:o};return l.length>0?m.references=l:delete m.references,{config:m,state:{paths:[...d].sort(),references:[...f].sort()}}}function x(e){try{let t=JSON.parse(i.readFileSync(e,`utf-8`));return{paths:Array.isArray(t.paths)?t.paths:[],references:Array.isArray(t.references)?t.references:[]}}catch{return}}function S(t){return e.join(t,`.dbx`,`toolchain`,`tsconfig-auto.json`)}export{S as autoStatePath,b as buildAutoTsconfig,x as readAutoState,y as resolveWorkspaceAliases,u as resolveWorkspaceSrcDir};
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { ToolchainTsconfigConfig } from "../../../../shared/src/config-types.js";
|
|
4
|
+
import { TsconfigWorkspace } from "../../workspaces.js";
|
|
5
|
+
import { TsconfigAutoState } from "../../auto.js";
|
|
3
6
|
import { TsconfigOverrides } from "../../overrides.js";
|
|
4
7
|
import { GeneratedTsconfigResult } from "./utils.js";
|
|
8
|
+
import { ToolchainConfig } from "../../../../shared/src/toolchain.js";
|
|
9
|
+
import "../../../../shared/src/index.js";
|
|
10
|
+
import { TsConfigJson } from "type-fest";
|
|
5
11
|
//#region packages/tsconfig/src/cli/generate/index.d.ts
|
|
6
12
|
export interface GenerateTsconfigsOptions {
|
|
7
13
|
/** The repo root to scan (default `process.cwd()`). */
|
|
@@ -32,6 +38,10 @@ export interface GenerateTsconfigsOptions {
|
|
|
32
38
|
write?: boolean;
|
|
33
39
|
/** Managed file overrides applied before generating each workspace. */
|
|
34
40
|
overrides?: TsconfigOverrides;
|
|
41
|
+
/** Pre-resolved workspaces (project-graph + nested config aware). */
|
|
42
|
+
workspaces?: TsconfigWorkspace[];
|
|
43
|
+
/** In-memory root workspaces tsconfig (auto-wired before generation). */
|
|
44
|
+
monorepoConfig?: TsConfigJson;
|
|
35
45
|
}
|
|
36
46
|
/**
|
|
37
47
|
* Extend every workspace default tsconfig (`tsconfig.default.json`) into a
|
|
@@ -40,6 +50,54 @@ export interface GenerateTsconfigsOptions {
|
|
|
40
50
|
* tsconfig and each workspace's `tsconfig.build.json` are optional.
|
|
41
51
|
*/
|
|
42
52
|
export declare function generateTsconfigs(options?: GenerateTsconfigsOptions): GeneratedTsconfigResult[];
|
|
53
|
+
export interface GenerateWorkspaceTsconfigsOptions {
|
|
54
|
+
/** Repo root (default `process.cwd()`). */
|
|
55
|
+
cwd?: string;
|
|
56
|
+
/** The merged root config. */
|
|
57
|
+
config: ToolchainConfig;
|
|
58
|
+
/** CLI overrides for the `tsconfig` section. */
|
|
59
|
+
overrides?: Partial<ToolchainTsconfigConfig>;
|
|
60
|
+
/** Write the outputs to disk (default true). */
|
|
61
|
+
write?: boolean;
|
|
62
|
+
/** Previous auto state (from the sync manifest); otherwise the sidecar is read. */
|
|
63
|
+
previousAuto?: TsconfigAutoState;
|
|
64
|
+
/** Override the auto sidecar path. */
|
|
65
|
+
autoStateFile?: string;
|
|
66
|
+
/** Write the auto-state sidecar (default true; sync stores it in the manifest instead). */
|
|
67
|
+
writeSidecar?: boolean;
|
|
68
|
+
}
|
|
69
|
+
export interface GenerateWorkspaceTsconfigsResult {
|
|
70
|
+
results: GeneratedTsconfigResult[];
|
|
71
|
+
workspaces: TsconfigWorkspace[];
|
|
72
|
+
/** The resolved root workspaces tsconfig (auto-wired + root overrides). */
|
|
73
|
+
autoConfig: TsConfigJson;
|
|
74
|
+
/** The auto-wired config before root overrides (the sync base). */
|
|
75
|
+
baseAutoConfig: TsConfigJson;
|
|
76
|
+
/** The keys auto-wiring owns, persisted in the sidecar. */
|
|
77
|
+
autoState: TsconfigAutoState;
|
|
78
|
+
/** Absolute root workspaces tsconfig path. */
|
|
79
|
+
rootTsconfigPath: string;
|
|
80
|
+
/** JSON text for the root workspaces tsconfig. */
|
|
81
|
+
rootContent: string;
|
|
82
|
+
/** JSON text before root overrides. */
|
|
83
|
+
baseRootContent: string;
|
|
84
|
+
/** Absolute auto-state sidecar path. */
|
|
85
|
+
autoStatePath: string;
|
|
86
|
+
/** JSON text for the auto-state sidecar. */
|
|
87
|
+
autoStateContent: string;
|
|
88
|
+
/** Whether the root workspaces tsconfig should be written. */
|
|
89
|
+
writeRoot: boolean;
|
|
90
|
+
/** Whether the auto-state sidecar should be written. */
|
|
91
|
+
writeState: boolean;
|
|
92
|
+
/** True when the `tsconfig` section is disabled/undefined. */
|
|
93
|
+
skipped?: boolean;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The high-level generator used by `dbx sync` and `dbx tsconfig`: resolves the
|
|
97
|
+
* project graph + nested configs, auto-wires the root workspaces tsconfig, then
|
|
98
|
+
* generates every enabled workspace tsconfig with its own effective switches.
|
|
99
|
+
*/
|
|
100
|
+
export declare function generateWorkspaceTsconfigs(options: GenerateWorkspaceTsconfigsOptions): Promise<GenerateWorkspaceTsconfigsResult>;
|
|
43
101
|
/** CLI entry (used by the `tsconfig` command). */
|
|
44
102
|
export declare function runTsconfigCli(argv?: string[]): void;
|
|
45
103
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as e}from"node:path";import{fileURLToPath as t,pathToFileURL as n}from"node:url";import.meta.url;import{
|
|
1
|
+
import{default as e}from"node:path";import{fileURLToPath as t,pathToFileURL as n}from"node:url";import.meta.url;import{deepMerge as r}from"../../../../shared/src/object-utils.js";import{resolveIgnorePatterns as i}from"../../../../shared/src/ignore.js";import{logger as a}from"../../../../shared/src/logger.js";import{sectionConfig as o,sectionEnabled as s}from"../../../../shared/src/toolchain.js";import{tsconfigFileNames as c}from"../../../../shared/src/tsconfig-files.js";import"../../../../shared/src/index.js";import{mergeOverride as l}from"../../overrides.js";import{readTsconfig as u}from"../../resolve.js";import"../../files.js";import{resolveTsconfigWorkspaces as d}from"../../workspaces.js";import{autoStatePath as f,buildAutoTsconfig as p,readAutoState as m}from"../../auto.js";import{generateTsconfig as h}from"./utils.js";import g from"node:fs";import{isDeepStrictEqual as _,parseArgs as v}from"node:util";import{Glob as y}from"glob";function b(t={}){let{aliases:n=!0,composite:r=!1,refs:o=!1,indent:s=4,gitignore:c=!0,defaultFile:l=`tsconfig.default.json`,buildFile:d=`tsconfig.build.json`,monorepoTsconfigFilename:f=`tsconfig.workspaces.json`,log:p=!0,write:m=!0}=t,_=t.glob??`**/${l}`,v=t.cwd??process.cwd(),b=e=>{p&&a.info(e)};n||b(`Ignoring path aliases for all tsconfigs...`),r||b(`Disabling compilerOptions.composite for all tsconfigs...`),o||b(`Ignoring project references for all tsconfigs...`);let x=e.resolve(v,f),S=e.relative(v,x),C=t.monorepoConfig!==void 0||g.existsSync(x),w=[];if(t.workspaces){let e=t.workspaces.filter(e=>e.enabled&&g.existsSync(e.defaultTsconfigPath));b(C?`Extending ${e.length} tsconfigs with ${S}...`:`Extending ${e.length} tsconfigs (no ${S})...`);for(let n of e){let e=n.options;w.push(h({cwd:v,dirname:n.dir,tsconfigPath:n.defaultTsconfigPath,monorepoTsconfigPath:x,tsconfigBuildPath:n.buildTsconfigPath,targetTsconfigPath:n.targetTsconfigPath,targetTsconfigBuildPath:n.buildTsconfigPath,indent:s,aliases:e.aliases!==!1,refs:e.refs===!0,composite:e.composite===!0,...t.monorepoConfig?{monorepoConfig:t.monorepoConfig}:{},write:m,log:b,...t.overrides?{overrides:t.overrides}:{}}))}}else{let a=Array.isArray(_)?_:[_],u=a.filter(e=>!e.startsWith(`!`)),f=[...a.filter(e=>e.startsWith(`!`)).map(e=>e.slice(1)),...i(v,{...t.exclude===void 0?{}:{exclude:t.exclude},gitignore:c})],p=new y(u.length?u:[`**/${l}`],{cwd:v,withFileTypes:!0,ignore:f}).walkSync();b(C?`Extending ${p.length} tsconfigs with ${S}...`:`Extending ${p.length} tsconfigs (no ${S})...`);for(let i of p){let a=i.fullpath(),c=e.dirname(a);w.push(h({cwd:v,dirname:c,tsconfigPath:a,monorepoTsconfigPath:x,tsconfigBuildPath:e.resolve(c,d),targetTsconfigPath:e.resolve(c,`tsconfig.json`),targetTsconfigBuildPath:e.resolve(c,d),indent:s,disableComposite:!r,ignoreAliases:!n,ignoreReferences:!o,...t.monorepoConfig?{monorepoConfig:t.monorepoConfig}:{},write:m,log:b,...t.overrides?{overrides:t.overrides}:{}}))}}if(!o&&!w.some(e=>e.config.references!==void 0))return w;b(`Checking for additional tsconfig changes...`);let T=new Map(w.map(t=>[e.resolve(t.targetTsconfigPath),t]));for(let t of w){let{dirname:n,dirnameRelative:r,targetTsconfigPath:i,config:a}=t;b(` - ${r}`),a.references?.length&&(a.references=a.references.filter(t=>{let r=e.resolve(n,t.path),i=T.get(r),a;if(i)a=i.config.compilerOptions?.composite;else if(g.existsSync(r))a=u(r).compilerOptions?.composite;else return b(` tsconfig not found for ${t.path}, skipping.`),!1;return a!=null&&a!==!1})),m&&g.writeFileSync(i,`${JSON.stringify(a,null,s)}\n`)}return w}async function x(t){let n=e.resolve(t.cwd??process.cwd()),i=r(o(t.config.tsconfig)??{},t.overrides??{}),a={...t.config,tsconfig:i},h=c(a),v=e.resolve(n,h.rootFile),y=t.autoStateFile??f(n);if(!s(t.config.tsconfig))return{results:[],workspaces:[],autoConfig:{},baseAutoConfig:{},autoState:{paths:[],references:[]},rootTsconfigPath:v,rootContent:``,baseRootContent:``,autoStatePath:y,autoStateContent:`{}`,writeRoot:!1,writeState:!1,skipped:!0};let x=await d({cwd:n,rootConfig:a,...i.glob===void 0?{}:{glob:i.glob},...i.exclude===void 0?{}:{exclude:i.exclude},...i.gitignore===void 0?{}:{gitignore:i.gitignore}}),S=g.existsSync(v)?u(v):void 0,C=t.previousAuto??m(y),w=p(x,{cwd:n,existing:S,previous:C}),T=w.config,E=i.overrides?.root?l(T,i.overrides.root):T,D=i.indent??4,O=`${JSON.stringify(T,null,D)}\n`,k=`${JSON.stringify(E,null,D)}\n`,A=`${JSON.stringify(w.state,null,D)}\n`,j=w.state.paths.length>0||w.state.references.length>0||g.existsSync(v)||!!i.overrides?.root,M=!_(S??{},T),N=t.writeSidecar!==!1&&(g.existsSync(y)||w.state.paths.length>0||w.state.references.length>0),P=b({cwd:n,workspaces:x.filter(e=>e.isRoot||!e.ownTsconfig),monorepoConfig:E,monorepoTsconfigFilename:h.rootFile,indent:D,write:t.write??!0,log:!1,...i.overrides?{overrides:{...i.overrides,root:void 0}}:{}});return t.write!==!1&&(j&&M&&(g.mkdirSync(e.dirname(v),{recursive:!0}),g.writeFileSync(v,k,`utf-8`)),N&&(g.mkdirSync(e.dirname(y),{recursive:!0}),g.writeFileSync(y,A,`utf-8`))),{results:P,workspaces:x,autoConfig:E,baseAutoConfig:T,autoState:w.state,rootTsconfigPath:v,rootContent:k,baseRootContent:O,autoStatePath:y,autoStateContent:A,writeRoot:j&&M,writeState:N}}function S(e=process.argv.slice(2)){let{values:t}=v({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`},glob:{type:`string`,multiple:!0},exclude:{type:`string`,multiple:!0},gitignore:{type:`boolean`,default:!0},"default-file":{type:`string`},"build-file":{type:`string`},"root-file":{type:`string`}}});b({aliases:t.aliases,composite:t.composite,refs:t.refs,indent:Number.parseInt(t.indent,10),...t.glob?{glob:t.glob}:{},...t.exclude?{exclude:t.exclude}:{},gitignore:t.gitignore,...t[`default-file`]?{defaultFile:t[`default-file`]}:{},...t[`build-file`]?{buildFile:t[`build-file`]}:{},...t[`root-file`]?{monorepoTsconfigFilename:t[`root-file`]}:{}})}if(/[\\/]generate[\\/]index\.[cm]?[jt]s$/.test(t(import.meta.url))&&import.meta.url===n(process.argv[1]??``).href)try{S()}catch(e){a.error(`Failed to generate tsconfigs due to: ${e}`),process.exit(1)}export{b as generateTsconfigs,x as generateWorkspaceTsconfigs,S as runTsconfigCli};
|
|
@@ -16,6 +16,12 @@ export declare function generateTsconfig(options: {
|
|
|
16
16
|
ignoreAliases?: boolean;
|
|
17
17
|
ignoreReferences?: boolean;
|
|
18
18
|
disableComposite?: boolean;
|
|
19
|
+
/** Effective per-workspace switches (they override the legacy ignore flags). */
|
|
20
|
+
aliases?: boolean;
|
|
21
|
+
refs?: boolean;
|
|
22
|
+
composite?: boolean;
|
|
23
|
+
/** In-memory workspaces tsconfig (the auto-generated object). */
|
|
24
|
+
monorepoConfig?: TsConfigJson;
|
|
19
25
|
/** Write the generated files to disk (default true). */
|
|
20
26
|
write?: boolean;
|
|
21
27
|
/** Log sink (default: the shared info logger). Pass a no-op to stay quiet. */
|
|
@@ -34,6 +40,12 @@ export declare function generateTsconfig(options: {
|
|
|
34
40
|
ignoreAliases?: boolean;
|
|
35
41
|
ignoreReferences?: boolean;
|
|
36
42
|
disableComposite?: boolean;
|
|
43
|
+
/** Effective per-workspace switches (they override the legacy ignore flags). */
|
|
44
|
+
aliases?: boolean;
|
|
45
|
+
refs?: boolean;
|
|
46
|
+
composite?: boolean;
|
|
47
|
+
/** In-memory workspaces tsconfig (the auto-generated object). */
|
|
48
|
+
monorepoConfig?: TsConfigJson;
|
|
37
49
|
/** Write the generated files to disk (default true). */
|
|
38
50
|
write?: boolean;
|
|
39
51
|
/** Log sink (default: the shared info logger). Pass a no-op to stay quiet. */
|