@deltabox/toolchain 2.1.1 → 2.3.2

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.
Files changed (140) hide show
  1. package/CHANGELOG.md +398 -628
  2. package/README.md +6 -0
  3. package/dist/changelog.d.ts +6 -5
  4. package/dist/changelog.js +1 -1
  5. package/dist/cli/commands/providers.js +1 -1
  6. package/dist/cli/commands/reset.js +1 -1
  7. package/dist/cli/config-selection.js +1 -1
  8. package/dist/cli/index.d.ts +2 -2
  9. package/dist/cli/index.js +1 -1
  10. package/dist/cli/update-check.js +1 -1
  11. package/dist/config.d.ts +2 -2
  12. package/dist/config.js +1 -1
  13. package/dist/index.d.ts +38 -30
  14. package/dist/index.js +1 -1
  15. package/dist/migrate.d.ts +2 -2
  16. package/dist/migrate.js +1 -1
  17. package/dist/package.js +1 -1
  18. package/dist/packages/changelog/src/cli/index.js +1 -1
  19. package/dist/packages/changelog/src/index.d.ts +7 -6
  20. package/dist/packages/changelog/src/index.js +1 -1
  21. package/dist/packages/changelog/src/run-workflows.d.ts +39 -2
  22. package/dist/packages/changelog/src/run-workflows.js +1 -1
  23. package/dist/packages/changelog/src/run.d.ts +1 -1
  24. package/dist/packages/changelog/src/run.js +1 -1
  25. package/dist/packages/changelog/src/sync.js +1 -1
  26. package/dist/packages/changelog/src/templates.js +1 -1
  27. package/dist/packages/changelog/src/utils/format.d.ts +5 -3
  28. package/dist/packages/changelog/src/utils/format.js +5 -5
  29. package/dist/packages/changelog/src/utils/git.d.ts +1 -1
  30. package/dist/packages/changelog/src/utils/git.js +1 -1
  31. package/dist/packages/changelog/src/utils/reformat.d.ts +7 -2
  32. package/dist/packages/changelog/src/utils/reformat.js +5 -4
  33. package/dist/packages/changelog/src/utils/release-notes.js +1 -1
  34. package/dist/packages/changelog/src/utils/repo.js +1 -1
  35. package/dist/packages/changelog/src/utils/summary.d.ts +1 -1
  36. package/dist/packages/changelog/src/utils/types.d.ts +9 -46
  37. package/dist/packages/changelog/src/utils/versioning.d.ts +11 -14
  38. package/dist/packages/changelog/src/utils/write.js +1 -1
  39. package/dist/packages/changelog/src/workflows.d.ts +11 -3
  40. package/dist/packages/changelog/src/workflows.js +5 -5
  41. package/dist/packages/config/src/cli/index.d.ts +1 -1
  42. package/dist/packages/config/src/collect.js +1 -1
  43. package/dist/packages/config/src/config-json.js +1 -1
  44. package/dist/packages/config/src/generators/env.js +2 -2
  45. package/dist/packages/config/src/generators/markdown.js +8 -8
  46. package/dist/packages/config/src/generators/output.js +1 -0
  47. package/dist/packages/config/src/generators/types.js +3 -3
  48. package/dist/packages/config/src/index.d.ts +3 -3
  49. package/dist/packages/config/src/index.js +1 -1
  50. package/dist/packages/config/src/schema.d.ts +16 -0
  51. package/dist/packages/config/src/schema.js +1 -1
  52. package/dist/packages/config/src/types.d.ts +5 -0
  53. package/dist/packages/core/src/editor-config.js +1 -1
  54. package/dist/packages/core/src/loader.js +1 -1
  55. package/dist/packages/core/src/manifest.js +1 -1
  56. package/dist/packages/core/src/paths.js +1 -0
  57. package/dist/packages/core/src/provider-registry.js +1 -1
  58. package/dist/packages/core/src/reset.d.ts +3 -0
  59. package/dist/packages/core/src/reset.js +1 -1
  60. package/dist/packages/core/src/sync.js +1 -1
  61. package/dist/packages/core/src/vscode.js +1 -1
  62. package/dist/packages/core/src/watch.d.ts +1 -1
  63. package/dist/packages/core/src/watch.js +1 -1
  64. package/dist/packages/migrate/src/cli/index.js +1 -1
  65. package/dist/packages/migrate/src/eslint.js +1 -1
  66. package/dist/packages/migrate/src/index.d.ts +2 -2
  67. package/dist/packages/migrate/src/index.js +1 -1
  68. package/dist/packages/migrate/src/prettier.d.ts +2 -0
  69. package/dist/packages/migrate/src/prettier.js +2 -2
  70. package/dist/packages/migrate/src/vite-target.js +1 -1
  71. package/dist/packages/project/src/cli/index.js +1 -1
  72. package/dist/packages/project/src/index.d.ts +4 -4
  73. package/dist/packages/project/src/index.js +1 -1
  74. package/dist/packages/project/src/typescript.d.ts +4 -2
  75. package/dist/packages/project/src/typescript.js +2 -2
  76. package/dist/packages/shared/src/changelog-callbacks.d.ts +72 -0
  77. package/dist/packages/shared/src/config-schema/biome.d.ts +8 -1
  78. package/dist/packages/shared/src/config-schema/biome.js +1 -1
  79. package/dist/packages/shared/src/config-schema/changelog.d.ts +3049 -30
  80. package/dist/packages/shared/src/config-schema/changelog.js +1 -1
  81. package/dist/packages/shared/src/config-schema/ci.d.ts +1163 -23
  82. package/dist/packages/shared/src/config-schema/external.js +1 -0
  83. package/dist/packages/shared/src/config-schema/format.d.ts +16 -10
  84. package/dist/packages/shared/src/config-schema/format.js +1 -1
  85. package/dist/packages/shared/src/config-schema/generated/azure-pipelines.d.ts +10501 -0
  86. package/dist/packages/shared/src/config-schema/generated/biome-config.d.ts +5962 -0
  87. package/dist/packages/shared/src/config-schema/generated/github-workflow.d.ts +179 -0
  88. package/dist/packages/shared/src/config-schema/generated/gitlab-ci.d.ts +296 -0
  89. package/dist/packages/shared/src/config-schema/generated/oxfmt-config.d.ts +411 -0
  90. package/dist/packages/shared/src/config-schema/generated/oxlint-config.d.ts +2218 -0
  91. package/dist/packages/shared/src/config-schema/index.d.ts +5355 -142
  92. package/dist/packages/shared/src/config-schema/index.js +1 -1
  93. package/dist/packages/shared/src/config-schema/json.d.ts +18 -0
  94. package/dist/packages/shared/src/config-schema/json.js +1 -0
  95. package/dist/packages/shared/src/config-schema/logger.d.ts +10 -1
  96. package/dist/packages/shared/src/config-schema/logger.js +1 -1
  97. package/dist/packages/shared/src/config-schema/tsconfig.d.ts +5 -4
  98. package/dist/packages/shared/src/config-schema/tsconfig.js +1 -1
  99. package/dist/packages/shared/src/config-schema/vite.d.ts +5 -3
  100. package/dist/packages/shared/src/config-schema/vite.js +1 -1
  101. package/dist/packages/shared/src/config-schema/workflow.d.ts +946 -31
  102. package/dist/packages/shared/src/config-schema/workflow.js +1 -1
  103. package/dist/packages/shared/src/config-types.d.ts +257 -33
  104. package/dist/packages/shared/src/fs-utils.d.ts +12 -0
  105. package/dist/packages/shared/src/fs-utils.js +8 -1
  106. package/dist/packages/shared/src/index.d.ts +19 -11
  107. package/dist/packages/shared/src/index.js +1 -1
  108. package/dist/packages/shared/src/object-utils.d.ts +2 -0
  109. package/dist/packages/shared/src/object-utils.js +1 -1
  110. package/dist/packages/shared/src/registry-policy.d.ts +3 -2
  111. package/dist/packages/shared/src/registry-policy.js +1 -1
  112. package/dist/packages/shared/src/run.d.ts +2 -0
  113. package/dist/packages/shared/src/run.js +1 -1
  114. package/dist/packages/shared/src/string-utils.d.ts +7 -5
  115. package/dist/packages/shared/src/string-utils.js +2 -2
  116. package/dist/packages/shared/src/template.d.ts +2 -1
  117. package/dist/packages/shared/src/template.js +1 -1
  118. package/dist/packages/shared/src/toolchain.d.ts +14 -7
  119. package/dist/packages/shared/src/toolchain.js +1 -1
  120. package/dist/packages/shared/src/types.d.ts +5 -0
  121. package/dist/packages/shared/src/vite-defaults.d.ts +4 -3
  122. package/dist/packages/shared/src/vite-defaults.js +1 -1
  123. package/dist/packages/shared/src/yaml.js +5 -5
  124. package/dist/packages/template/src/scaffold.js +1 -1
  125. package/dist/packages/tsconfig/src/cli/generate/index.js +1 -1
  126. package/dist/packages/tsconfig/src/overrides.d.ts +5 -5
  127. package/dist/packages/tsdown/src/config/node.d.ts +5 -0
  128. package/dist/packages/tsdown/src/config/node.js +2 -2
  129. package/dist/packages/tsdown/src/index.d.ts +3 -3
  130. package/dist/packages/tsdown/src/index.js +1 -1
  131. package/dist/packages/vite/src/plugin.js +1 -1
  132. package/dist/packages/vite/src/vp.js +1 -1
  133. package/dist/project.d.ts +3 -3
  134. package/dist/project.js +1 -1
  135. package/dist/shared.d.ts +18 -10
  136. package/dist/shared.js +1 -1
  137. package/dist/tooling.js +1 -1
  138. package/dist/tsdown.d.ts +2 -2
  139. package/dist/tsdown.js +1 -1
  140. package/package.json +25 -13
@@ -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,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{DEFAULT_IGNORE_PATTERNS as p,collectGitignorePatterns as m,isIgnoredPath as h,resolveIgnorePatterns as g}from"./ignore.js";import{ERROR_MAP as _,WARNING_MAP as v,errorMessage as y,formatMessage as b,formatMessageId as x,warningMessage as S}from"./messages.js";import{LOG_LEVELS as C,configureLogger as w,createLogger as T,getLogOverrides as E,getLogger as D,isLogLevel as O,logger as k,normalizeLogLevel as A,setLogConfig as j,setLogOverrides as M,stripAnsi as N}from"./logger.js";import{projectFromPackageJson as P,projectToPackageJson as F,splitPackageName as I}from"./project.js";import{providerActions as L}from"./provider.js";import{registrySourceAllowed as R}from"./registry-policy.js";import{killProcessTree as z,run as B,spawnCross as V}from"./run.js";import{asString as H,camelCase as U,camelCaseId as W,capitalize as G,constantCase as K,ensureLeadingSlash as q,ensureSlashes as J,ensureTrailingSlash as Y,formatCliFlag as X,hasText as Z,indent as Q,isLocalhost as ne,kebabCase as re,pascalCase as ie,removeDoubleSlashes as ae,removeLeadingSlash as oe,removeTrailingSlash as se,sanitizeSlashes as ce,sanitizeText as le,snakeCase as ue,str as de,stripControlChars as fe,stripEscapeArtifacts as pe,titleCase as me}from"./string-utils.js";import{applyReplacements as he,applyReplacementsDeep as ge,createReplacer as _e,defineReplacements as ve,extractTokens as ye,hasUnresolvedTokens as be,tokenPattern as xe}from"./template.js";import{ENABLED_DESCRIPTION as Se,section as $,withEnabled as Ce}from"./config-schema/meta.js";import{biomeConfigSchema as we}from"./config-schema/biome.js";import{catalogsConfigSchema as Te}from"./config-schema/catalogs.js";import{customWorkflowSettingsSchema as Ee,workflowConfigSchema as De,workflowOptionsSchema as Oe,workflowSettingSchema as ke,workflowStepSchema as Ae,workflowStepsConfigSchema as je}from"./config-schema/workflow.js";import{changelogBranchesConfigSchema as Me,changelogCommitlintConfigSchema as Ne,changelogConfigSchema as Pe,changelogVersioningConfigSchema as Fe,changelogVersioningSchema as Ie,changelogVersioningTargetSchema as Le,changelogWorkflowSettingSchema as Re,legacyChangelogConfigSchema as ze}from"./config-schema/changelog.js";import{ciConfigSchema as Be}from"./config-schema/ci.js";import{fmtConfigSchema as Ve,lintConfigSchema as He,vscodeSettingsSchema as Ue}from"./config-schema/format.js";import{loggerConfigSchema as We}from"./config-schema/logger.js";import{projectConfigSchema as Ge,projectTypeSchema as Ke}from"./config-schema/project.js";import{providersConfigSchema as qe}from"./config-schema/providers.js";import{registryConfigSchema as Je,registryPolicySchema as Ye}from"./config-schema/registry.js";import{templateKindSchema as Xe,templateSourceSchema as Ze,templateSourceTypeSchema as Qe,templatesConfigSchema as $e}from"./config-schema/templates.js";import{tsconfigConfigSchema as et}from"./config-schema/tsconfig.js";import{viteConfigSchema as tt}from"./config-schema/vite.js";import{watchConfigSchema as nt}from"./config-schema/watch.js";import{configSchema as rt,dbxConfigSchema as it,toolchainConfigSchema as at}from"./config-schema/index.js";import{CONFIG_FILE_NAMES as ot,DEFAULT_PACKAGE_MANAGER_VERSIONS as st,FORMATTER_PRECEDENCE as ct,LINTER_PRECEDENCE as lt,changelogSectionEnabled as ut,defineConfig as dt,repoSlugFromUrl as ft,resolveChangelogBranches as pt,resolveChangelogConfig as mt,resolveCiConfig as ht,resolveCommitlintEnabled as gt,resolveFmtTool as _t,resolveFmtTools as vt,resolveLintTool as yt,resolveLintTools as bt,resolveOxcFmtConfig as xt,resolveOxcLintConfig as St,resolveTokens as Ct,sectionConfig as wt,sectionEnabled as Tt}from"./toolchain.js";import{DEFAULT_FMT_IGNORE_PATTERNS as Et,DEFAULT_FMT_RULES as Dt,DEFAULT_LINT_IGNORE_PATTERNS as Ot,DEFAULT_LINT_RULES as kt}from"./vite-defaults.js";import{toYaml as At}from"./yaml.js";var jt=/* @__PURE__ */ ee({CONFIG_FILE_NAMES:()=>ot,DEFAULT_FMT_IGNORE_PATTERNS:()=>Et,DEFAULT_FMT_RULES:()=>Dt,DEFAULT_IGNORE_PATTERNS:()=>p,DEFAULT_LINT_IGNORE_PATTERNS:()=>Ot,DEFAULT_LINT_RULES:()=>kt,DEFAULT_PACKAGE_MANAGER_VERSIONS:()=>st,ENABLED_DESCRIPTION:()=>Se,ERROR_MAP:()=>_,FORMATTER_PRECEDENCE:()=>ct,LINTER_PRECEDENCE:()=>lt,LOG_LEVELS:()=>C,TOOLCHAIN_PACKAGE:()=>te,WARNING_MAP:()=>v,applyOverrides:()=>n,applyReplacements:()=>he,applyReplacementsDeep:()=>ge,asString:()=>H,biomeConfigSchema:()=>we,camelCase:()=>U,camelCaseId:()=>W,capitalize:()=>G,catalogsConfigSchema:()=>Te,changelogBranchesConfigSchema:()=>Me,changelogCommitlintConfigSchema:()=>Ne,changelogConfigSchema:()=>Pe,changelogSectionEnabled:()=>ut,changelogVersioningConfigSchema:()=>Fe,changelogVersioningSchema:()=>Ie,changelogVersioningTargetSchema:()=>Le,changelogWorkflowSettingSchema:()=>Re,ciConfigSchema:()=>Be,collectGitignorePatterns:()=>m,configSchema:()=>rt,configureLogger:()=>w,constantCase:()=>K,createLogger:()=>T,createReplacer:()=>_e,customWorkflowSettingsSchema:()=>Ee,dbxConfigSchema:()=>it,deepMerge:()=>r,defineConfig:()=>dt,defineReplacements:()=>ve,ensureLeadingSlash:()=>q,ensureSlashes:()=>J,ensureTrailingSlash:()=>Y,errorMessage:()=>y,extractTokens:()=>ye,findOwnCliEntry:()=>e,fmtConfigSchema:()=>Ve,formatCliFlag:()=>X,formatMessage:()=>b,formatMessageId:()=>x,getLogOverrides:()=>E,getLogger:()=>D,hasText:()=>Z,hasUnresolvedTokens:()=>be,indent:()=>Q,isIgnoredPath:()=>h,isLocalhost:()=>ne,isLogLevel:()=>O,isPlainObject:()=>i,kebabCase:()=>re,killProcessTree:()=>z,legacyChangelogConfigSchema:()=>ze,lintConfigSchema:()=>He,localToolchainVersion:()=>t,logger:()=>k,loggerConfigSchema:()=>We,mapValues:()=>a,mergeJsonAt:()=>c,normalizeLogLevel:()=>A,pascalCase:()=>ie,projectConfigSchema:()=>Ge,projectFromPackageJson:()=>P,projectToPackageJson:()=>F,projectTypeSchema:()=>Ke,providerActions:()=>L,providersConfigSchema:()=>qe,readJsonAt:()=>l,readJsonFile:()=>u,registryConfigSchema:()=>Je,registryPolicySchema:()=>Ye,registrySourceAllowed:()=>R,removeDoubleSlashes:()=>ae,removeLeadingSlash:()=>oe,removeTrailingSlash:()=>se,repoSlugFromUrl:()=>ft,resolveChangelogBranches:()=>pt,resolveChangelogConfig:()=>mt,resolveCiConfig:()=>ht,resolveCommitlintEnabled:()=>gt,resolveFmtTool:()=>_t,resolveFmtTools:()=>vt,resolveIgnorePatterns:()=>g,resolveLintTool:()=>yt,resolveLintTools:()=>bt,resolveOxcFmtConfig:()=>xt,resolveOxcLintConfig:()=>St,resolveSort:()=>o,resolveTokens:()=>Ct,run:()=>B,sanitizeSlashes:()=>ce,sanitizeText:()=>le,section:()=>$,sectionConfig:()=>wt,sectionEnabled:()=>Tt,setLogConfig:()=>j,setLogOverrides:()=>M,snakeCase:()=>ue,sort:()=>s,spawnCross:()=>V,splitPackageName:()=>I,str:()=>de,stripAnsi:()=>N,stripControlChars:()=>fe,stripEscapeArtifacts:()=>pe,templateKindSchema:()=>Xe,templateSourceSchema:()=>Ze,templateSourceTypeSchema:()=>Qe,templatesConfigSchema:()=>$e,titleCase:()=>me,toJson:()=>d,toYaml:()=>At,tokenPattern:()=>xe,toolchainConfigSchema:()=>at,tsconfigConfigSchema:()=>et,viteConfigSchema:()=>tt,vscodeSettingsSchema:()=>Ue,warningMessage:()=>S,watchConfigSchema:()=>nt,withEnabled:()=>Ce,workflowConfigSchema:()=>De,workflowOptionsSchema:()=>Oe,workflowSettingSchema:()=>ke,workflowStepSchema:()=>Ae,workflowStepsConfigSchema:()=>je,writeJsonFile:()=>f});export{ot as CONFIG_FILE_NAMES,Et as DEFAULT_FMT_IGNORE_PATTERNS,Dt as DEFAULT_FMT_RULES,p as DEFAULT_IGNORE_PATTERNS,Ot as DEFAULT_LINT_IGNORE_PATTERNS,kt as DEFAULT_LINT_RULES,st as DEFAULT_PACKAGE_MANAGER_VERSIONS,Se as ENABLED_DESCRIPTION,_ as ERROR_MAP,ct as FORMATTER_PRECEDENCE,lt as LINTER_PRECEDENCE,C as LOG_LEVELS,te as TOOLCHAIN_PACKAGE,v as WARNING_MAP,n as applyOverrides,he as applyReplacements,ge as applyReplacementsDeep,H as asString,we as biomeConfigSchema,U as camelCase,W as camelCaseId,G as capitalize,Te as catalogsConfigSchema,Me as changelogBranchesConfigSchema,Ne as changelogCommitlintConfigSchema,Pe as changelogConfigSchema,ut as changelogSectionEnabled,Fe as changelogVersioningConfigSchema,Ie as changelogVersioningSchema,Le as changelogVersioningTargetSchema,Re as changelogWorkflowSettingSchema,Be as ciConfigSchema,m as collectGitignorePatterns,rt as configSchema,w as configureLogger,K as constantCase,T as createLogger,_e as createReplacer,Ee as customWorkflowSettingsSchema,it as dbxConfigSchema,r as deepMerge,dt as defineConfig,ve as defineReplacements,q as ensureLeadingSlash,J as ensureSlashes,Y as ensureTrailingSlash,y as errorMessage,ye as extractTokens,e as findOwnCliEntry,Ve as fmtConfigSchema,X as formatCliFlag,b as formatMessage,x as formatMessageId,E as getLogOverrides,D as getLogger,Z as hasText,be as hasUnresolvedTokens,Q as indent,h as isIgnoredPath,ne as isLocalhost,O as isLogLevel,i as isPlainObject,re as kebabCase,z as killProcessTree,ze as legacyChangelogConfigSchema,He as lintConfigSchema,t as localToolchainVersion,k as logger,We as loggerConfigSchema,a as mapValues,c as mergeJsonAt,A as normalizeLogLevel,ie as pascalCase,Ge as projectConfigSchema,P as projectFromPackageJson,F as projectToPackageJson,Ke as projectTypeSchema,L as providerActions,qe as providersConfigSchema,l as readJsonAt,u as readJsonFile,Je as registryConfigSchema,Ye as registryPolicySchema,R as registrySourceAllowed,ae as removeDoubleSlashes,oe as removeLeadingSlash,se as removeTrailingSlash,ft as repoSlugFromUrl,pt as resolveChangelogBranches,mt as resolveChangelogConfig,ht as resolveCiConfig,gt as resolveCommitlintEnabled,_t as resolveFmtTool,vt as resolveFmtTools,g as resolveIgnorePatterns,yt as resolveLintTool,bt as resolveLintTools,xt as resolveOxcFmtConfig,St as resolveOxcLintConfig,o as resolveSort,Ct as resolveTokens,B as run,ce as sanitizeSlashes,le as sanitizeText,$ as section,wt as sectionConfig,Tt as sectionEnabled,j as setLogConfig,M as setLogOverrides,ue as snakeCase,s as sort,V as spawnCross,I as splitPackageName,jt as src_exports,de as str,N as stripAnsi,fe as stripControlChars,pe as stripEscapeArtifacts,Xe as templateKindSchema,Ze as templateSourceSchema,Qe as templateSourceTypeSchema,$e as templatesConfigSchema,me as titleCase,d as toJson,At as toYaml,xe as tokenPattern,at as toolchainConfigSchema,et as tsconfigConfigSchema,tt as viteConfigSchema,Ue as vscodeSettingsSchema,S as warningMessage,nt as watchConfigSchema,Ce as withEnabled,De as workflowConfigSchema,Oe as workflowOptionsSchema,ke as workflowSettingSchema,Ae as workflowStepSchema,je as workflowStepsConfigSchema,f 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_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};
@@ -8,6 +8,8 @@ export declare function sort<T extends Sortable>(value: T): T;
8
8
  export declare function resolveSort(a: string, b: string): number;
9
9
  /** Whether a value is a non-null, non-array object. */
10
10
  export declare function isPlainObject(value: unknown): value is Record<string, unknown>;
11
+ /** Whether a key could mutate an object's prototype when assigned. */
12
+ export declare function isUnsafeKey(key: string): boolean;
11
13
  /** Recursively merge `sources` over `target` (arrays and scalars are replaced). */
12
14
  export declare function deepMerge<T extends Record<string, any>>(target: T, ...sources: (Partial<T> | undefined)[]): T;
13
15
  /** Map an object's values, keeping the keys. */
@@ -1 +1 @@
1
- import"node:path";import"node:url";import.meta.url;function e(e){if(!e)return e;let n=(Array.isArray(e)?e:Object.entries(e||{})).sort(([e],[n])=>t(e,n));return Array.isArray(e)?n:Object.fromEntries(n)}function t(e,t){return e.localeCompare(t)}function n(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function r(e,...t){let i={...e};for(let e of t)if(e)for(let[t,a]of Object.entries(e)){let e=i[t];n(e)&&n(a)?i[t]=r(e,a):a!==void 0&&(i[t]=a)}return i}function i(e,t){return Object.fromEntries(Object.entries(e).map(([e,n])=>[e,t(n,e)]))}function a(e,...t){if(t.length===0)return e;let r={...e};for(let e of t)if(e)for(let[t,i]of Object.entries(e)){if(i===void 0)continue;let e=r[t];r[t]=n(e)&&n(i)?a(e,i):i}return r}export{a as applyOverrides,r as deepMerge,n as isPlainObject,i as mapValues,t as resolveSort,e as sort};
1
+ import"node:path";import"node:url";import.meta.url;function e(e){if(!e)return e;let n=(Array.isArray(e)?e:Object.entries(e||{})).sort(([e],[n])=>t(e,n));return Array.isArray(e)?n:Object.fromEntries(n)}function t(e,t){return e.localeCompare(t)}function n(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function r(e){return e===`__proto__`||e===`constructor`||e===`prototype`}function i(e,...t){let a={...e};for(let e of t)if(e)for(let[t,o]of Object.entries(e)){if(r(t))continue;let e=a[t];n(e)&&n(o)?a[t]=i(e,o):o!==void 0&&(a[t]=o)}return a}function a(e,t){return Object.fromEntries(Object.entries(e).map(([e,n])=>[e,t(n,e)]))}function o(e,...t){if(t.length===0)return e;let i={...e};for(let e of t)if(e)for(let[t,a]of Object.entries(e)){if(a===void 0||r(t))continue;let e=i[t];i[t]=n(e)&&n(a)?o(e,a):a}return i}export{o as applyOverrides,i as deepMerge,n as isPlainObject,r as isUnsafeKey,a as mapValues,t as resolveSort,e as sort};
@@ -10,8 +10,9 @@ export interface RegistryPolicy {
10
10
  }
11
11
  /**
12
12
  * Whether a registry source is allowed by a policy. URLs are matched against
13
- * the full URL, the host and `host/path`; local sources should be passed as an
14
- * absolute path. A missing policy (or an empty deny + allow) allows everything.
13
+ * the full URL, the host (with and without a port) and `host/path`; local
14
+ * sources should be passed as an absolute path. A missing policy (or an empty
15
+ * deny + allow) allows everything.
15
16
  */
16
17
  export declare function registrySourceAllowed(source: string, policy: RegistryPolicy | undefined): boolean;
17
18
  //#endregion
@@ -1 +1 @@
1
- import"node:path";import"node:url";import.meta.url;function e(e){let t=e.replace(/[.+^${}()|[\]\\]/g,`\\$&`).replace(/\*\*/g,`\0`).replace(/\*/g,`[^/]*`).replace(/\?/g,`.`).replace(/\u0000/g,`.*`);return RegExp(`^${t}$`,`i`)}function t(t,n){return!n||n.length===0?!1:n.some(n=>e(n.replace(/\\/g,`/`)).test(t))}function n(e,n){if(!n)return!0;let r=e.replace(/\\/g,`/`).replace(/\/+$/,``),i=[r];try{let e=new URL(r);i.push(e.host.toLowerCase(),`${e.host}${e.pathname}`.toLowerCase())}catch{}return i.some(e=>t(e,n.deny))?!1:!n.allow||n.allow.length===0||i.some(e=>t(e,n.allow))}export{n as registrySourceAllowed};
1
+ import"node:path";import"node:url";import.meta.url;function e(e){let t=e.replace(/[.+^${}()|[\]\\]/g,`\\$&`).replace(/\*\*/g,`\0`).replace(/\*/g,`[^/]*`).replace(/\?/g,`.`).replace(/\u0000/g,`.*`);return RegExp(`^${t}$`,`i`)}function t(t,n){return!n||n.length===0?!1:n.some(n=>e(n.replace(/\\/g,`/`)).test(t))}function n(e){let t=[e],n=/^[^@\s]+@([^:\s]+):(.+)$/.exec(e);if(n){let e=(n[1]??``).toLowerCase(),r=(n[2]??``).toLowerCase();t.push(e,`${e}/${r.replace(/^\/+/,``)}`)}try{let n=new URL(e.startsWith(`//`)?`https:${e}`:e),r=n.hostname.toLowerCase(),i=`${r}${n.pathname}`.toLowerCase();t.push(n.host.toLowerCase(),r,i,`${n.host}${n.pathname}`.toLowerCase())}catch{}return t}function r(e,r){if(!r)return!0;let i=n(e.replace(/\\/g,`/`).replace(/\/+$/,``));return i.some(e=>t(e,r.deny))?!1:!r.allow||r.allow.length===0||i.some(e=>t(e,r.allow))}export{r as registrySourceAllowed};
@@ -2,6 +2,8 @@ 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
+ /** Whether running `cmd` on Windows goes through a `.cmd`/`.bat` shim. */
6
+ export declare function isCmdShim(cmd: string): boolean;
5
7
  /**
6
8
  * Kill a child process **and its descendants**. On Windows the child is a
7
9
  * `cmd.exe` wrapper, so a plain `child.kill()` would orphan the real command;
@@ -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,spawnSync as i}from"node:child_process";const a=process.platform===`win32`;let o=!1;const s=/([()\][%!^"`<>&|;, *?])/g;function c(e){return/\s/.test(e)?`"${e.replace(/(?=(\\+?)?)\1"/g,`$1$1\\"`).replace(/(?=(\\+?)?)\1$/,`$1$1`)}"`: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
+ 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/\s/.test(e)?`"${e.replace(/(?=(\\+?)?)\1"/g,`$1$1\\"`).replace(/(?=(\\+?)?)\1$/,`$1$1`)}"`: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){let r=(process.env.PATHEXT??`.COM;.EXE;.BAT;.CMD`).split(`;`).filter(Boolean),i=!!e.extname(t);if(t.includes(`/`)||t.includes(`\\`)||e.isAbsolute(t)){if(i)return n.existsSync(t)?t:void 0;for(let e of r){let r=`${t}${e.toLowerCase()}`;if(n.existsSync(r))return r}return}let a=(process.env.PATH??``).split(e.delimiter).filter(Boolean);for(let o of a)if(i){let r=e.join(o,t);if(n.existsSync(r))return r}else for(let i of r){let r=e.join(o,`${t}${i.toLowerCase()}`);if(n.existsSync(r))return r}}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`,(e,t)=>process.exit(e??+!!t)),u}export{d as isCmdShim,f as killProcessTree,m as run,p as spawnCross};
@@ -49,20 +49,22 @@ export declare function removeDoubleSlashes(value: string, slash?: string): stri
49
49
  export declare function sanitizeSlashes(value: string, operations?: ('leading' | 'trailing' | 'double')[], slash?: string): string;
50
50
  /** Ensure slashes at the requested positions. */
51
51
  export declare function ensureSlashes(value: string, operations: ('leading' | 'trailing')[], slash?: string): string;
52
- /** Strip bare control characters, keeping `\t`, `\n` and `\r`. */
52
+ /** Restore/strip bare control characters, keeping `\t`, `\n` and `\r`. */
53
53
  export declare function stripControlChars(text: string): string;
54
54
  /**
55
55
  * Strip the predictable shell-escape artifacts: a backslash that precedes a
56
56
  * control character. Ordinary backslashes (Windows paths, regular expressions,
57
57
  * Markdown hard breaks that use two trailing spaces) are left untouched — only
58
- * a backslash directly before a control character is removed.
58
+ * a backslash directly before a control character is handled.
59
59
  */
60
60
  export declare function stripEscapeArtifacts(text: string): string;
61
+ /** Whether text contains shell-escape artifacts that {@link sanitizeText} repairs. */
62
+ export declare function hasEscapeArtifacts(text: string): boolean;
61
63
  /**
62
64
  * Sanitize text that may have passed through a shell (commit bodies, generated
63
- * descriptions) before it is rendered to markdown: normalize CRLF to LF, then
64
- * strip shell-escape artifacts followed by any remaining bare control
65
- * characters. Conservative by design — it never removes an ordinary backslash.
65
+ * descriptions) before it is rendered to markdown: restore shell-escape
66
+ * artifacts, strip any remaining bare control characters, then normalize CRLF
67
+ * to LF. Conservative by design — it never removes an ordinary backslash.
66
68
  */
67
69
  export declare function sanitizeText(text: string): string;
68
70
  //#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=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g,w=/\\[\u0000-\u001f]/g;function T(e){return e.replace(C,``)}function E(e){return e.replace(w,``)}function D(e){return T(E(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,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,D as sanitizeText,c as snakeCase,e as str,T as stripControlChars,E as stripEscapeArtifacts,u as titleCase};
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,A as sanitizeText,c as snakeCase,e as str,D as stripControlChars,O as stripEscapeArtifacts,u as titleCase};
@@ -41,7 +41,8 @@ export declare function applyReplacements(input: string, replacements?: Replacem
41
41
  export declare function createReplacer(replacements?: Replacements, options?: ReplacementOptions): Replacer;
42
42
  /**
43
43
  * Recursively apply replacements to an arbitrary value. Strings are rendered;
44
- * arrays and plain objects are walked; everything else is returned as-is.
44
+ * arrays and plain objects are walked; everything else (RegExp, Date, URL, ...)
45
+ * is returned as-is.
45
46
  */
46
47
  export declare function applyReplacementsDeep<T>(value: T, replacements?: Replacements, options?: ReplacementOptions): T;
47
48
  /** Every distinct token name referenced by `input`. */
@@ -1 +1 @@
1
- import"node:path";import"node:url";import.meta.url;function e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function t(t=`{{`,n=`}}`){return RegExp(`${e(t)}\\s*([\\w.@/-]+)\\s*(?::\\s*([^]*?))?\\s*${e(n)}`,`g`)}function n(e){return e==null?``:String(e)}function r(e,r={},i={}){let{open:a=`{{`,close:o=`}}`,keepUnresolved:s=!0,strict:c=!1,transform:l}=i,u=t(a,o);return e.replace(u,(e,t,i)=>{if(Object.hasOwn(r,t)){let e=n(r[t]);return l?l(e,t):e}if(i!==void 0)return i.trim();if(c)throw Error(`Missing replacement for token "{{${t}}}"`);return s?e:``})}function i(e={},t={}){return n=>r(n,e,t)}function a(e,t={},n={}){if(typeof e==`string`)return r(e,t,n);if(Array.isArray(e))return e.map(e=>a(e,t,n));if(e&&typeof e==`object`){let r={};for(let[i,o]of Object.entries(e))r[i]=a(o,t,n);return r}return e}function o(e,n={}){let r=t(n.open,n.close),i=/* @__PURE__ */ new Set;for(let t of e.matchAll(r))t[1]&&i.add(t[1]);return[...i]}function s(e){let n=t();return n.lastIndex=0,n.test(e)}function c(e){return e}export{r as applyReplacements,a as applyReplacementsDeep,i as createReplacer,c as defineReplacements,o as extractTokens,s as hasUnresolvedTokens,t as tokenPattern};
1
+ import"node:path";import"node:url";import.meta.url;function e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function t(t=`{{`,n=`}}`){return RegExp(`${e(t)}\\s*([\\w.@/-]+)\\s*(?::\\s*([^]*?))?\\s*${e(n)}`,`g`)}function n(e){return e==null?``:String(e)}function r(e,r={},i={}){let{open:a=`{{`,close:o=`}}`,keepUnresolved:s=!0,strict:c=!1,transform:l}=i,u=t(a,o);return e.replace(u,(e,t,i)=>{if(Object.hasOwn(r,t)){let e=n(r[t]);return l?l(e,t):e}if(i!==void 0)return i.trim();if(c)throw Error(`Missing replacement for token "{{${t}}}"`);return s?e:``})}function i(e={},t={}){return n=>r(n,e,t)}function a(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function o(e,t={},n={}){if(typeof e==`string`)return r(e,t,n);if(Array.isArray(e))return e.map(e=>o(e,t,n));if(e&&typeof e==`object`&&a(e)){let r={};for(let[i,a]of Object.entries(e))r[i]=o(a,t,n);return r}return e}function s(e,n={}){let r=t(n.open,n.close),i=/* @__PURE__ */ new Set;for(let t of e.matchAll(r))t[1]&&i.add(t[1]);return[...i]}function c(e){let n=t();return n.lastIndex=0,n.test(e)}function l(e){return e}export{r as applyReplacements,o as applyReplacementsDeep,i as createReplacer,l as defineReplacements,s as extractTokens,c as hasUnresolvedTokens,t as tokenPattern};
@@ -1,12 +1,19 @@
1
1
  import __tsdown_shims_path from 'node:path';
2
2
  import __tsdown_shims_url from 'node:url';
3
- import { ChangelogBranchesConfig, ChangelogCommitlintConfig, ChangelogConfig, ChangelogVersioning, ChangelogVersioningConfig, ChangelogVersioningTarget, ChangelogWorkflowSetting, CustomWorkflowSettings, DbxConfigSections, ProjectType, ToolchainBiomeConfig, ToolchainCatalogsConfig, ToolchainChangelogConfig, ToolchainCiConfig, ToolchainConfigSections, ToolchainFmtConfig, ToolchainLintConfig, ToolchainLoggerConfig, ToolchainProjectConfig, ToolchainProvidersConfig, ToolchainRegistryConfig, ToolchainRegistryPolicy, ToolchainTemplateKind, ToolchainTemplateSource, ToolchainTemplateSourceType, ToolchainTemplatesConfig, ToolchainTsconfigConfig, ToolchainTsconfigOverrides, ToolchainViteConfig, ToolchainVscodeSettings, ToolchainWatchConfig, WorkflowOptions, WorkflowSetting, WorkflowStep, WorkflowStepsConfig } from "./config-types.js";
3
+ import { AzurePipelines } from "./config-schema/generated/azure-pipelines.js";
4
+ import { BiomeConfig } from "./config-schema/generated/biome-config.js";
5
+ import { GitHubWorkflow } from "./config-schema/generated/github-workflow.js";
6
+ import { GitLabCi } from "./config-schema/generated/gitlab-ci.js";
7
+ import { OxfmtConfig } from "./config-schema/generated/oxfmt-config.js";
8
+ import { OxlintConfig } from "./config-schema/generated/oxlint-config.js";
9
+ 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, ToolchainTsconfigConfig, ToolchainTsconfigOverrides, ToolchainViteConfig, ToolchainVscodeSettings, ToolchainWatchConfig, WorkflowJob, WorkflowOptions, WorkflowSetting, WorkflowStep, WorkflowStepsConfig } from "./config-types.js";
4
10
  import { Replacements } from "./template.js";
5
- import { biomeConfigSchema } from "./config-schema/biome.js";
11
+ import { biomeConfigOptionsSchema, biomeConfigSchema } from "./config-schema/biome.js";
6
12
  import { catalogsConfigSchema } from "./config-schema/catalogs.js";
7
- import { changelogBranchesConfigSchema, changelogCommitlintConfigSchema, changelogConfigSchema, changelogVersioningConfigSchema, changelogVersioningSchema, changelogVersioningTargetSchema, changelogWorkflowSettingSchema, legacyChangelogConfigSchema } from "./config-schema/changelog.js";
13
+ import { changelogBranchesConfigSchema, changelogBreakingCallbackSchema, changelogBreakingSettingSchema, changelogBumpRuleMatchSchema, changelogBumpRuleSchema, changelogCommitFormatConfigSchema, changelogCommitlintConfigSchema, changelogConfigSchema, changelogGroupConfigSchema, changelogGroupsSettingSchema, changelogProviderConfigSchema, changelogProviderSettingSchema, changelogVersioningConfigSchema, changelogVersioningSchema, changelogVersioningTargetSchema, changelogWorkflowSettingSchema, ciChangelogConfigSchema } from "./config-schema/changelog.js";
8
14
  import { ciConfigSchema } from "./config-schema/ci.js";
9
15
  import { fmtConfigSchema, lintConfigSchema, vscodeSettingsSchema } from "./config-schema/format.js";
16
+ import { configJsonValueSchema } from "./config-schema/json.js";
10
17
  import { loggerConfigSchema } from "./config-schema/logger.js";
11
18
  import { ENABLED_DESCRIPTION, section, withEnabled } from "./config-schema/meta.js";
12
19
  import { projectConfigSchema, projectTypeSchema } from "./config-schema/project.js";
@@ -16,7 +23,7 @@ import { templateKindSchema, templateSourceSchema, templateSourceTypeSchema, tem
16
23
  import { tsconfigConfigSchema } from "./config-schema/tsconfig.js";
17
24
  import { viteConfigSchema } from "./config-schema/vite.js";
18
25
  import { watchConfigSchema } from "./config-schema/watch.js";
19
- import { customWorkflowSettingsSchema, workflowConfigSchema, workflowOptionsSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema } from "./config-schema/workflow.js";
26
+ import { VendorWorkflowConfig, azureWorkflowSettingSchema, customWorkflowSettingsSchema, githubWorkflowSettingSchema, gitlabWorkflowSettingSchema, isVendorWorkflowConfig, workflowConfigSchema, workflowJobSchema, workflowOptionsSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema } from "./config-schema/workflow.js";
20
27
  import { configSchema, dbxConfigSchema, toolchainConfigSchema } from "./config-schema/index.js";
21
28
  import { Awaitable } from "./types.js";
22
29
  //#region packages/shared/src/toolchain.d.ts
@@ -131,7 +138,7 @@ export declare function resolveCiConfig(config?: ToolchainConfig): ToolchainCiCo
131
138
  * option; when it is enabled but not configured (`true`, a raw workflow string,
132
139
  * or workflow-only options) the manual section's options still apply.
133
140
  */
134
- export declare function resolveChangelogConfig(config?: ToolchainConfig): ChangelogConfig | undefined;
141
+ export declare function resolveChangelogConfig(config?: ToolchainConfig): CiChangelogConfig | undefined;
135
142
  /** Default package-manager versions used when a config omits `packageManagerVersion`. */
136
143
  export declare const DEFAULT_PACKAGE_MANAGER_VERSIONS: Record<string, string>;
137
144
  /** Formatter tools, highest priority first. */
@@ -165,7 +172,7 @@ export declare function resolveCommitlintEnabled(changelog?: ChangelogConfig): b
165
172
  * default** and reuses `main` when omitted, so a single-branch repo needs no
166
173
  * `dev`. Each side accepts a glob or an array of globs.
167
174
  */
168
- export declare function resolveChangelogBranches(changelog?: ChangelogConfig): {
175
+ export declare function resolveChangelogBranches(changelog?: CiChangelogConfig): {
169
176
  main: string[];
170
177
  dev: string[];
171
178
  };
@@ -247,4 +254,4 @@ export interface SyncTask {
247
254
  run: (ctx: SyncContext) => Awaitable<ManagedFile[] | void>;
248
255
  }
249
256
  //#endregion
250
- export { ChangelogBranchesConfig, ChangelogCommitlintConfig, ChangelogConfig, ChangelogVersioning, ChangelogVersioningConfig, ChangelogVersioningTarget, ChangelogWorkflowSetting, CustomWorkflowSettings, DbxConfigSections, ENABLED_DESCRIPTION, ProjectType, ToolchainBiomeConfig, ToolchainCatalogsConfig, ToolchainChangelogConfig, ToolchainCiConfig, ToolchainConfigSections, ToolchainFmtConfig, ToolchainLintConfig, ToolchainLoggerConfig, ToolchainProjectConfig, ToolchainProvidersConfig, ToolchainRegistryConfig, ToolchainRegistryPolicy, ToolchainTemplateKind, ToolchainTemplateSource, ToolchainTemplateSourceType, ToolchainTemplatesConfig, ToolchainTsconfigConfig, ToolchainTsconfigOverrides, ToolchainViteConfig, ToolchainVscodeSettings, ToolchainWatchConfig, WorkflowOptions, WorkflowSetting, WorkflowStep, WorkflowStepsConfig, biomeConfigSchema, catalogsConfigSchema, changelogBranchesConfigSchema, changelogCommitlintConfigSchema, changelogConfigSchema, changelogVersioningConfigSchema, changelogVersioningSchema, changelogVersioningTargetSchema, changelogWorkflowSettingSchema, ciConfigSchema, configSchema, customWorkflowSettingsSchema, dbxConfigSchema, fmtConfigSchema, legacyChangelogConfigSchema, lintConfigSchema, loggerConfigSchema, projectConfigSchema, projectTypeSchema, providersConfigSchema, registryConfigSchema, registryPolicySchema, section, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, vscodeSettingsSchema, watchConfigSchema, withEnabled, workflowConfigSchema, workflowOptionsSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema };
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 };
@@ -1 +1 @@
1
- import"node:path";import"node:url";import.meta.url;import{deepMerge as e,isPlainObject as t}from"./object-utils.js";import{ENABLED_DESCRIPTION as n,section as r,withEnabled as i}from"./config-schema/meta.js";import{biomeConfigSchema as a}from"./config-schema/biome.js";import{catalogsConfigSchema as o}from"./config-schema/catalogs.js";import{customWorkflowSettingsSchema as s,workflowConfigSchema as c,workflowOptionsSchema as l,workflowSettingSchema as u,workflowStepSchema as d,workflowStepsConfigSchema as f}from"./config-schema/workflow.js";import{changelogBranchesConfigSchema as p,changelogCommitlintConfigSchema as m,changelogConfigSchema as h,changelogVersioningConfigSchema as g,changelogVersioningSchema as _,changelogVersioningTargetSchema as v,changelogWorkflowSettingSchema as y,legacyChangelogConfigSchema as ee}from"./config-schema/changelog.js";import{ciConfigSchema as b}from"./config-schema/ci.js";import{fmtConfigSchema as x,lintConfigSchema as S,vscodeSettingsSchema as C}from"./config-schema/format.js";import{loggerConfigSchema as w}from"./config-schema/logger.js";import{projectConfigSchema as T,projectTypeSchema as E}from"./config-schema/project.js";import{providersConfigSchema as D}from"./config-schema/providers.js";import{registryConfigSchema as O,registryPolicySchema as k}from"./config-schema/registry.js";import{templateKindSchema as A,templateSourceSchema as j,templateSourceTypeSchema as M,templatesConfigSchema as N}from"./config-schema/templates.js";import{tsconfigConfigSchema as P}from"./config-schema/tsconfig.js";import{viteConfigSchema as F}from"./config-schema/vite.js";import{watchConfigSchema as I}from"./config-schema/watch.js";import{configSchema as L,dbxConfigSchema as R,toolchainConfigSchema as te}from"./config-schema/index.js";function z(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 H=[`dbx.config.ts`,`dbx.config.mts`,`dbx.config.js`,`dbx.config.mjs`,`dbx.config.cjs`,`dbx.config.json`];function U(e){if(!e)return;let t=e.match(/github\.com[/:]([^/]+)\/([^/.]+?)(?:\.git)?$/);return t?.[1]&&t[2]?`${t[1]}/${t[2]}`:void 0}function W(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function G(e={}){return B(e.ci)?V(e.ci):void 0}function K(t={}){let n=V(t.changelog),r=n&&B(n)?n:void 0,i=G(t)?.changelog;return i===void 0||i===!1||i===!0||typeof i==`string`||!B(i)?r:r?e(r,i):i}const q={yarn:`4.17.1`,pnpm:`10.11.1`,npm:`11.19.0`,bun:`1.3.0`},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 ne(e={}){return Z(e)[0]}function re(e={}){return Q(e)[0]}function ie(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 ae(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 oe(e={}){let t=G(e)?.changelog;return t===void 0?!1:typeof t==`boolean`?t:typeof t==`string`?t.trim().length>0:B(t)}function se(e){let t=e?.commitlint;return t===void 0?!0:typeof t==`boolean`?t:t.enabled!==!1}function $(e){let t=e?.branches??{},n=W(t.main);n.length===0&&n.push(`main`);let r=W(t.dev);return{main:n,dev:r.length>0?r:n}}function ce(e={}){let t=e.project??{},n=$(K(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:U(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{H as CONFIG_FILE_NAMES,q as DEFAULT_PACKAGE_MANAGER_VERSIONS,n as ENABLED_DESCRIPTION,J as FORMATTER_PRECEDENCE,Y as LINTER_PRECEDENCE,a as biomeConfigSchema,o as catalogsConfigSchema,p as changelogBranchesConfigSchema,m as changelogCommitlintConfigSchema,h as changelogConfigSchema,oe as changelogSectionEnabled,g as changelogVersioningConfigSchema,_ as changelogVersioningSchema,v as changelogVersioningTargetSchema,y as changelogWorkflowSettingSchema,b as ciConfigSchema,L as configSchema,s as customWorkflowSettingsSchema,R as dbxConfigSchema,z as defineConfig,x as fmtConfigSchema,ee as legacyChangelogConfigSchema,S as lintConfigSchema,w as loggerConfigSchema,T as projectConfigSchema,E as projectTypeSchema,D as providersConfigSchema,O as registryConfigSchema,k as registryPolicySchema,U as repoSlugFromUrl,$ as resolveChangelogBranches,K as resolveChangelogConfig,G as resolveCiConfig,se as resolveCommitlintEnabled,ne as resolveFmtTool,Z as resolveFmtTools,re as resolveLintTool,Q as resolveLintTools,ie as resolveOxcFmtConfig,ae as resolveOxcLintConfig,ce as resolveTokens,r as section,V as sectionConfig,B as sectionEnabled,A as templateKindSchema,j as templateSourceSchema,M as templateSourceTypeSchema,N as templatesConfigSchema,te as toolchainConfigSchema,P as tsconfigConfigSchema,F as viteConfigSchema,C as vscodeSettingsSchema,I as watchConfigSchema,i as withEnabled,c as workflowConfigSchema,l as workflowOptionsSchema,u as workflowSettingSchema,d as workflowStepSchema,f as workflowStepsConfigSchema};
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,workflowJobSchema as c,workflowOptionsSchema as ie,workflowSettingSchema as ae,workflowStepSchema as oe,workflowStepsConfigSchema as se}from"./config-schema/workflow.js";import{biomeConfigOptionsSchema as ce,biomeConfigSchema as le}from"./config-schema/biome.js";import{catalogsConfigSchema as ue}from"./config-schema/catalogs.js";import{changelogBranchesConfigSchema as de,changelogBreakingCallbackSchema as fe,changelogBreakingSettingSchema as l,changelogBumpRuleMatchSchema as u,changelogBumpRuleSchema as d,changelogCommitFormatConfigSchema as f,changelogCommitlintConfigSchema as p,changelogConfigSchema as m,changelogGroupConfigSchema as h,changelogGroupsSettingSchema as g,changelogProviderConfigSchema as _,changelogProviderSettingSchema as v,changelogVersioningConfigSchema as y,changelogVersioningSchema as b,changelogVersioningTargetSchema as x,changelogWorkflowSettingSchema as S,ciChangelogConfigSchema as C}from"./config-schema/changelog.js";import{ciConfigSchema as w}from"./config-schema/ci.js";import{fmtConfigSchema as T,lintConfigSchema as E,vscodeSettingsSchema as D}from"./config-schema/format.js";import{loggerConfigSchema as O}from"./config-schema/logger.js";import{projectConfigSchema as k,projectTypeSchema as A}from"./config-schema/project.js";import{providersConfigSchema as j}from"./config-schema/providers.js";import{registryConfigSchema as M,registryPolicySchema as N}from"./config-schema/registry.js";import{templateKindSchema as P,templateSourceSchema as F,templateSourceTypeSchema as pe,templatesConfigSchema as I}from"./config-schema/templates.js";import{tsconfigConfigSchema as L}from"./config-schema/tsconfig.js";import{viteConfigSchema as R}from"./config-schema/vite.js";import{watchConfigSchema as z}from"./config-schema/watch.js";import{configSchema as B,dbxConfigSchema as me,toolchainConfigSchema as he}from"./config-schema/index.js";function ge(e){return e}function V(e){return e===void 0?!1:typeof e==`boolean`?e:e.enabled!==!1}function H(e){return e!==void 0&&typeof e==`object`?e:void 0}const _e=[`dbx.config.ts`,`dbx.config.mts`,`dbx.config.js`,`dbx.config.mjs`,`dbx.config.cjs`,`dbx.config.json`];function U(e){if(!e)return;let t=e.match(/github\.com[/:]([^/]+)\/([^/.]+?)(?:\.git)?$/);return t?.[1]&&t[2]?`${t[1]}/${t[2]}`:void 0}function W(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function G(e={}){return V(e.ci)?H(e.ci):void 0}function K(t={}){let n=H(t.changelog),r=n&&V(n)?n:void 0,i=G(t)?.changelog;if(i===!1)return;if(i===void 0||i===!0||typeof i==`string`||o(i))return r;let a=i;if(V(a))return r?e(r,a):a}const q={yarn:`4.17.1`,pnpm:`10.11.1`,npm:`11.19.0`,bun:`1.3.0`},J=[`oxc`,`biome`,`prettier`,`dprint`],Y=[`oxc`,`biome`,`eslint`];function X(e){return V(e)?H(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 ve(e={}){return Z(e)[0]}function ye(e={}){return Q(e)[0]}function be(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 xe(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 Se(e={}){let t=G(e)?.changelog;return t===void 0?!1:typeof t==`boolean`?t:typeof t==`string`?t.trim().length>0:V(t)}function Ce(e){let t=e?.commitlint;return t===void 0?!0:typeof t==`boolean`?t:t.enabled!==!1}function $(e){let t=e?.branches??{},n=W(t.main);n.length===0&&n.push(`main`);let r=W(t.dev);return{main:n,dev:r.length>0?r:n}}function we(e={}){let t=e.project??{},n=$(K(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:U(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{_e as CONFIG_FILE_NAMES,q as DEFAULT_PACKAGE_MANAGER_VERSIONS,r as ENABLED_DESCRIPTION,J as FORMATTER_PRECEDENCE,Y as LINTER_PRECEDENCE,ee as azureWorkflowSettingSchema,ce as biomeConfigOptionsSchema,le as biomeConfigSchema,ue as catalogsConfigSchema,de as changelogBranchesConfigSchema,fe as changelogBreakingCallbackSchema,l as changelogBreakingSettingSchema,u as changelogBumpRuleMatchSchema,d as changelogBumpRuleSchema,f as changelogCommitFormatConfigSchema,p as changelogCommitlintConfigSchema,m as changelogConfigSchema,h as changelogGroupConfigSchema,g as changelogGroupsSettingSchema,_ as changelogProviderConfigSchema,v as changelogProviderSettingSchema,Se as changelogSectionEnabled,y as changelogVersioningConfigSchema,b as changelogVersioningSchema,x as changelogVersioningTargetSchema,S as changelogWorkflowSettingSchema,C as ciChangelogConfigSchema,w as ciConfigSchema,n as configJsonValueSchema,B as configSchema,te as customWorkflowSettingsSchema,me as dbxConfigSchema,ge as defineConfig,T as fmtConfigSchema,ne as githubWorkflowSettingSchema,re as gitlabWorkflowSettingSchema,o as isVendorWorkflowConfig,E as lintConfigSchema,O as loggerConfigSchema,k as projectConfigSchema,A as projectTypeSchema,j as providersConfigSchema,M as registryConfigSchema,N as registryPolicySchema,U as repoSlugFromUrl,$ as resolveChangelogBranches,K as resolveChangelogConfig,G as resolveCiConfig,Ce as resolveCommitlintEnabled,ve as resolveFmtTool,Z as resolveFmtTools,ye as resolveLintTool,Q as resolveLintTools,be as resolveOxcFmtConfig,xe as resolveOxcLintConfig,we as resolveTokens,i as section,H as sectionConfig,V as sectionEnabled,P as templateKindSchema,F as templateSourceSchema,pe as templateSourceTypeSchema,I as templatesConfigSchema,he as toolchainConfigSchema,L as tsconfigConfigSchema,R as viteConfigSchema,D as vscodeSettingsSchema,z as watchConfigSchema,a as withEnabled,s as workflowConfigSchema,c as workflowJobSchema,ie as workflowOptionsSchema,ae as workflowSettingSchema,oe as workflowStepSchema,se as workflowStepsConfigSchema};
@@ -94,6 +94,11 @@ export interface ToolchainCommand<Args extends Record<string, unknown> = Record<
94
94
  * the `args` key of the run argument (typed `string[]`).
95
95
  */
96
96
  passthrough?: boolean;
97
+ /**
98
+ * Omit the command from generated documentation. Used by provider
99
+ * passthroughs, whose names depend on the consumer's registry.
100
+ */
101
+ hidden?: boolean;
97
102
  /** Run the command with the CLI-provided options + the loaded config. */
98
103
  run: (args: Args, context: ToolchainCommandContext) => Awaitable<void>;
99
104
  }
@@ -1,11 +1,12 @@
1
1
  import __tsdown_shims_path from 'node:path';
2
2
  import __tsdown_shims_url from 'node:url';
3
- import { ViteUserConfig } from "vite-plus";
3
+ import { OxfmtConfig } from "./config-schema/generated/oxfmt-config.js";
4
+ import { OxlintConfig } from "./config-schema/generated/oxlint-config.js";
4
5
  //#region packages/shared/src/vite-defaults.d.ts
5
6
  /** The Oxfmt options accepted by Vite+ (`toolchain.vite.fmt`). */
6
- export type ToolchainOxfmtConfig = NonNullable<ViteUserConfig['fmt']>;
7
+ export type ToolchainOxfmtConfig = OxfmtConfig;
7
8
  /** The Oxlint options accepted by Vite+ (`toolchain.vite.lint`). */
8
- export type ToolchainOxlintConfig = NonNullable<ViteUserConfig['lint']>;
9
+ export type ToolchainOxlintConfig = OxlintConfig;
9
10
  /**
10
11
  * Common paths Oxfmt should leave alone. Starts from the shared build/cache
11
12
  * ignores and adds generated JSON/YAML, lockfiles, changelogs and the managed
@@ -1 +1 @@
1
- import"node:path";import"node:url";import.meta.url;import{DEFAULT_IGNORE_PATTERNS as e}from"./ignore.js";const t=[...e,`**/.nuxt/**`,`**/.svelte-kit/**`,`**/.generated/**`,`**/generated/**`,`**/*.json`,`**/*.yml`,`**/*.yaml`,`**/*.lock`,`**/*.min.*`,`**/CHANGELOG.md`,`CHANGELOG.proposed.md`,`**/vite.config.ts`],n={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,ignorePatterns:t},r=[...e,`**/.nuxt/**`,`**/.svelte-kit/**`,`**/.generated/**`,`**/generated/**`,`**/*.min.*`,`**/vendor/**`],i={ignorePatterns:r,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-hooks/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{t as DEFAULT_FMT_IGNORE_PATTERNS,n as DEFAULT_FMT_RULES,r as DEFAULT_LINT_IGNORE_PATTERNS,i as DEFAULT_LINT_RULES};
1
+ import"node:path";import"node:url";import.meta.url;import{DEFAULT_IGNORE_PATTERNS as e}from"./ignore.js";const t=[...e,`**/.nuxt/**`,`**/.svelte-kit/**`,`**/.generated/**`,`**/generated/**`,`**/*.json`,`**/*.yml`,`**/*.yaml`,`**/*.lock`,`**/*.min.*`,`**/CHANGELOG.md`,`CHANGELOG.proposed.md`,`**/vite.config.ts`],n={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,ignorePatterns:t},r=[...e,`**/.nuxt/**`,`**/.svelte-kit/**`,`**/.generated/**`,`**/generated/**`,`**/*.min.*`,`**/vendor/**`],i={ignorePatterns:r,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{t as DEFAULT_FMT_IGNORE_PATTERNS,n as DEFAULT_FMT_RULES,r as DEFAULT_LINT_IGNORE_PATTERNS,i as DEFAULT_LINT_RULES};
@@ -1,5 +1,5 @@
1
- import"node:path";import"node:url";import.meta.url;const e=/^(?:true|false|yes|no|on|off|null|~)$/i,t=/^[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?$/;function n(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function r(n){return!!(n===``||e.test(n)||t.test(n)||/^[\s\-?:,[\]{}#&*!|>%@`"']/.test(n)||/\s$/.test(n)||n.includes(`: `)||n.includes(` #`)||n.includes(` `)||n.includes("${{")||/["\\]/.test(n))}function i(e){return e===null?`null`:typeof e==`boolean`?e?`true`:`false`:typeof e==`number`?String(e):r(e)?`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`:e}function a(t){return r(t)&&!e.test(t)?`"${t}"`:t}function o(e){return e.reduce((e,t)=>e+String(s(t)).length+2,0)}function s(e){return e}function c(e){return e===null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`}function l(e,t){let r=` `.repeat(t),a=[];for(let o of e)if(c(o))a.push(`${r}- ${i(o)}`);else if(Array.isArray(o))a.push(`${r}-`),a.push(...l(o,t+2));else if(n(o)){let e=d(o,t+2),n=e[0];if(n===void 0)a.push(`${r}- {}`);else{a.push(`${r}- ${n.slice(t+2)}`);for(let t=1;t<e.length;t+=1)a.push(e[t])}}return a}function u(e,t,n,r){let i=e.endsWith(`
2
- `)?e.slice(0,-1):e,a=[`${n}${r}: |`];for(let e of i.split(`
3
- `))a.push(e===``?``:`${` `.repeat(t+2)}${e}`);return a}function d(e,t){let r=` `.repeat(t),f=[];for(let[p,m]of Object.entries(e)){if(m===void 0)continue;let e=a(p);typeof m==`string`&&m.includes(`
4
- `)?f.push(...u(m,t,r,e)):c(m)?f.push(`${r}${e}: ${i(m)}`):Array.isArray(m)?m.length===0?f.push(`${r}${e}: []`):m.every(c)&&o(m)<=60?f.push(`${r}${e}: [${m.map(e=>i(s(e))).join(`, `)}]`):(f.push(`${r}${e}:`),f.push(...l(m,t+2))):n(m)&&(Object.keys(m).length===0?f.push(`${r}${e}: {}`):(f.push(`${r}${e}:`),f.push(...d(m,t+2))))}return f}function f(e){return`${d(e,0).join(`
5
- `)}\n`}export{f as toYaml};
1
+ import"node:path";import"node:url";import.meta.url;const e=/^(?:true|false|yes|no|on|off|null|~)$/i,t=/^[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?$/;function n(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function r(n){return!!(n===``||e.test(n)||t.test(n)||/^[\s\-?:,[\]{}#&*!|>%@`"']/.test(n)||/\s$/.test(n)||n.includes(`: `)||n.includes(` #`)||n.includes(` `)||n.includes("${{")||/["\\\r\n]/.test(n))}function i(e){return e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`).replace(/\r/g,`\\r`).replace(/\n/g,`\\n`)}function a(e){return e===null?`null`:typeof e==`boolean`?e?`true`:`false`:typeof e==`number`?String(e):r(e)?`"${i(e)}"`:e}function o(e){return e===`on`?e:r(e)?`"${i(e)}"`:e}function s(e){return e.reduce((e,t)=>e+String(c(t)).length+2,0)}function c(e){return e}function l(e){return e===null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`}function u(e,t){let r=` `.repeat(t),i=[];for(let o of e)if(l(o))i.push(`${r}- ${a(o)}`);else if(Array.isArray(o))i.push(`${r}-`),i.push(...u(o,t+2));else if(n(o)){let e=f(o,t+2),n=e[0];if(n===void 0)i.push(`${r}- {}`);else{i.push(`${r}- ${n.slice(t+2)}`);for(let t=1;t<e.length;t+=1)i.push(e[t])}}return i}function d(e,t,n,r){let i=e.endsWith(`
2
+ `),a=i?e.slice(0,-1):e,o=[`${n}${r}: ${i?`|`:`|-`}`];for(let e of a.split(`
3
+ `))o.push(e===``?``:`${` `.repeat(t+2)}${e}`);return o}function f(e,t){let r=` `.repeat(t),i=[];for(let[p,m]of Object.entries(e)){if(m===void 0)continue;let e=o(p);typeof m==`string`&&m.includes(`
4
+ `)?i.push(...d(m,t,r,e)):l(m)?i.push(`${r}${e}: ${a(m)}`):Array.isArray(m)?m.length===0?i.push(`${r}${e}: []`):m.every(l)&&s(m)<=60?i.push(`${r}${e}: [${m.map(e=>a(c(e))).join(`, `)}]`):(i.push(`${r}${e}:`),i.push(...u(m,t+2))):n(m)&&(Object.keys(m).length===0?i.push(`${r}${e}: {}`):(i.push(`${r}${e}:`),i.push(...f(m,t+2))))}return i}function p(e){return`${f(e,0).join(`
5
+ `)}\n`}export{p as toYaml};
@@ -1 +1 @@
1
- import{default as e}from"node:path";import{pathToFileURL as t}from"node:url";import.meta.url;import{spawnCross as n}from"../../shared/src/run.js";import{applyReplacements as r}from"../../shared/src/template.js";import"../../shared/src/index.js";import{hasCatalog as i}from"../../project/src/catalogs.js";import{SCAFFOLD_CATALOG as a,createMonorepoRootFiles as o,createRootProjectFiles as s,createWorkspaceFiles as c,findRootOxcFiles as l,upsertWorkspaceTsconfig as u,writeGeneratedFiles as d}from"../../project/src/typescript.js";import"../../project/src/index.js";import{runVp as f}from"../../vite/src/vp.js";import"../../vite/src/index.js";import{readTemplateManifest as p}from"./local.js";import m from"node:fs";import{spawn as h}from"node:child_process";const g=/* @__PURE__ */ new Set([`node_modules`,`.git`,`dist`,`.turbo`,`.dbx`,`.DS_Store`,`template.json`]);function _(e){return{...e.tokens,...e.variables}}function v(e,t=!0){return e==null||e===``?t:typeof e==`boolean`?e:![`no`,`false`,`0`,`off`].includes(String(e).toLowerCase())}function y(e){let t=e=>e==null||e===``?void 0:String(e),n=t(e.repo)??t(e.repoUrl);return{...t(e.description)?{description:t(e.description)}:{},...t(e.author)?{author:t(e.author)}:{},...t(e.license)?{license:t(e.license)}:{},...t(e.homepage)?{homepage:t(e.homepage)}:{},...n?{repo:n}:{},...t(e.nodeVersion)?{nodeVersion:t(e.nodeVersion)}:{}}}function b(e,t){let n=_(t),r=e=>e==null||e===``?void 0:String(e),f=String(n.name??`app`),p=n.scope?String(n.scope):void 0,m=v(n.includeConfig),h=r(n.packageManager),g=r(t.tokens?.packageManager),b=r(t.tokens?.packageManagerVersion)??r(t.tokens?.yarnVersion),x=r(t.variables?.packageManagerVersion)??(h&&h===g?b:void 0),S={...y(n),...x?{packageManagerVersion:x}:{}},{description:C,...w}=S,T=[];switch(e.builtin){case`monorepo-root`:{let e=p??`@${f}`;T.push(...o({...S,name:f,scope:e,type:`monorepo-root`,includeConfig:m,...h?{packageManager:h}:{},workspaces:[]}));break}case`monorepo-example`:{let e=p??`@${f}`;T.push(...o({...S,name:f,scope:e,type:`monorepo-root`,includeConfig:m,...h?{packageManager:h}:{},workspaces:[{alias:`core`,dir:`packages/core`}]})),T.push(...c({...w,name:f,scope:e,wsName:`core`,wsDir:`packages/core`,type:`monorepo-workspace`,includeConfig:m,useCatalog:!0,...h?{packageManager:h}:{}}).map(e=>({...e,path:`packages/core/${e.path}`})));break}case`monorepo-workspace`:{let e=`packages/${f}`;T.push(...c({...w,name:f,...p?{scope:p}:{},wsName:f,wsDir:e,type:`monorepo-workspace`,includeConfig:m,useCatalog:i(t.cwd,h,Object.keys(a)),...h?{packageManager:h}:{}}).map(t=>({...t,path:`${e}/${t.path}`})));break}case`folder`:T.push({path:`README.md`,content:`# ${f}\n`});break;default:T.push(...s({...S,name:f,...p?{scope:p}:{},type:`project`,kind:e.builtin===`application`?`application`:`project`,includeConfig:m,rootOxc:l(t.cwd),...h?{packageManager:h}:{}}))}let E=d(T,t.cwd,{force:t.force===!0});return e.builtin===`monorepo-workspace`&&u(t.cwd,{alias:f,dir:`packages/${f}`},p,t.tsconfigRootFile),{written:E}}function x(t,n){let i=t.dir;if(!i)throw Error(`Local template "${t.id}" has no directory.`);let a=p(i),o=/* @__PURE__ */ new Set([...g,...a?.ignore??[]]);for(let e of t.actions??[])e.module&&o.add(e.module.replace(/\\/g,`/`));let s=t.tokens?.open??`{{`,c=t.tokens?.close??`}}`,l=_(n),u=n.force===!0||n.overwrite===!0,d=[],f=e.resolve(n.cwd),h=t=>{let n=e.join(i,t);for(let a of m.readdirSync(n,{withFileTypes:!0})){if(o.has(a.name))continue;let n=t?`${t}/${a.name}`:a.name;if(a.isDirectory()){h(n);continue}let p=e.resolve(f,r(n,l,{open:s,close:c})),g=process.platform===`win32`?f.toLowerCase():f,_=process.platform===`win32`?p.toLowerCase():p;if(_!==g&&!_.startsWith(`${g}${e.sep}`))throw Error(`refusing to write outside ${f}: ${p}`);if(!u&&m.existsSync(p))continue;let v=m.readFileSync(e.join(i,n),`utf-8`);d.push({target:p,content:r(v,l,{open:s,close:c})})}};h(``);let v=[];for(let t of d)m.mkdirSync(e.dirname(t.target),{recursive:!0}),m.writeFileSync(t.target,t.content,`utf-8`),v.push(t.target);return{written:v}}async function S(e,t){let n=e.source.subdir?`${e.source.locate}/${e.source.subdir}`:e.source.locate,r=[`create`];n&&r.push(n);let i=t.tokens?.name;return i&&r.push(String(i)),{written:[],code:(await f(r,{cwd:t.cwd})).code}}function C(e,t,r){return new Promise(i=>{let a;try{a=n(e,t,{cwd:r,stdio:`inherit`})}catch{i(1);return}a.on(`error`,()=>i(1)),a.on(`exit`,e=>i(e??0))})}function w(e,t){return new Promise(n=>{let r=h(e,{cwd:t,stdio:`inherit`,shell:!0});r.on(`error`,()=>n(1)),r.on(`exit`,e=>n(e??0))})}function T(e,t){let n=_(t),r={};for(let[e,n]of Object.entries(t.variables??{}))r[e]=n==null?``:String(n);return{cwd:t.cwd,...e.dir?{templateDir:e.dir}:{},tokens:n,variables:r,packageManager:String(n.packageManager??`yarn`),log:e=>console.log(e)}}async function E(n,r,i,a){if(r.builtin===`install`){a.log(`Installing dependencies with ${a.packageManager}…`);let e=await C(a.packageManager,[`install`],i.cwd);if(e!==0)throw Error(`\`${a.packageManager} install\` failed with exit code ${e}.`)}else if(r.module){let o=n.dir??i.cwd,s=e.resolve(o,r.module);if(!m.existsSync(s))throw Error(`template action module not found: ${r.module}`);let c=await import(t(s).href),l=c.default??c.run;if(typeof l!=`function`)throw Error(`template action module "${r.module}" does not export a function.`);await l(a)}else if(r.command){let e=await w(r.command,i.cwd);if(e!==0)throw Error(`template command failed with exit code ${e}: ${r.command}`)}else throw Error(`template action "${r.id}" declares no builtin, module or command.`)}async function D(e,t){let n=new Set(t.actions??[]),r=[];for(let i of e.actions??[])n.has(i.id)&&(await E(e,i,t,T(e,t)),r.push(i.id));return r}async function O(e,t){if(e.builtin){let n=b(e,t),r=await D(e,t);return r.length>0?{...n,ranActions:r}:n}switch(e.source.type){case`local`:{let n=x(e,t),r=await D(e,t);return r.length>0?{...n,ranActions:r}:n}case`vite-plus`:case`npm`:case`git`:return S(e,t);default:throw Error(`Template "${e.id}" has no scaffold handler.`)}}export{O as scaffoldTemplate};
1
+ import{default as e}from"node:path";import{pathToFileURL as t}from"node:url";import.meta.url;import{spawnCross as n}from"../../shared/src/run.js";import{applyReplacements as r}from"../../shared/src/template.js";import"../../shared/src/index.js";import{hasCatalog as i}from"../../project/src/catalogs.js";import{SCAFFOLD_CATALOG as a,createMonorepoRootFiles as o,createRootProjectFiles as s,createWorkspaceFiles as c,findRootOxcFiles as l,upsertWorkspaceTsconfig as u,workspaceDirForTsconfig as d,writeGeneratedFiles as f}from"../../project/src/typescript.js";import"../../project/src/index.js";import{runVp as p}from"../../vite/src/vp.js";import"../../vite/src/index.js";import{readTemplateManifest as m}from"./local.js";import h from"node:fs";import{spawn as g}from"node:child_process";const _=/* @__PURE__ */ new Set([`node_modules`,`.git`,`dist`,`.turbo`,`.dbx`,`.DS_Store`,`template.json`]);function v(e){return{...e.tokens,...e.variables}}function y(e,t=!0){return e==null||e===``?t:typeof e==`boolean`?e:![`no`,`false`,`0`,`off`].includes(String(e).toLowerCase())}function b(e){let t=e=>e==null||e===``?void 0:String(e),n=t(e.repo)??t(e.repoUrl);return{...t(e.description)?{description:t(e.description)}:{},...t(e.author)?{author:t(e.author)}:{},...t(e.license)?{license:t(e.license)}:{},...t(e.homepage)?{homepage:t(e.homepage)}:{},...n?{repo:n}:{},...t(e.nodeVersion)?{nodeVersion:t(e.nodeVersion)}:{}}}function x(e,t){let n=v(t),r=e=>e==null||e===``?void 0:String(e),p=String(n.name??`app`),m=n.scope?String(n.scope):void 0,h=y(n.includeConfig),g=r(n.packageManager),_=r(t.tokens?.packageManager),x=r(t.tokens?.packageManagerVersion)??r(t.tokens?.yarnVersion),S=r(t.variables?.packageManagerVersion)??(g&&g===_?x:void 0),C={...b(n),...S?{packageManagerVersion:S}:{}},{description:w,...T}=C,E=[];switch(e.builtin){case`monorepo-root`:{let e=m??`@${p}`;E.push(...o({...C,name:p,scope:e,type:`monorepo-root`,includeConfig:h,...g?{packageManager:g}:{},workspaces:[]}));break}case`monorepo-example`:{let e=m??`@${p}`;E.push(...o({...C,name:p,scope:e,type:`monorepo-root`,includeConfig:h,...g?{packageManager:g}:{},workspaces:[{alias:`core`,dir:`packages/core`}]})),E.push(...c({...T,name:p,scope:e,wsName:`core`,wsDir:`packages/core`,type:`monorepo-workspace`,includeConfig:h,useCatalog:!0,...g?{packageManager:g}:{}}).map(e=>({...e,path:`packages/core/${e.path}`})));break}case`monorepo-workspace`:{let e=d(`packages/${p}`);E.push(...c({...T,name:p,...m?{scope:m}:{},wsName:p,wsDir:e,type:`monorepo-workspace`,includeConfig:h,useCatalog:i(t.cwd,g,Object.keys(a)),...g?{packageManager:g}:{}}).map(t=>({...t,path:`${e}/${t.path}`})));break}case`folder`:E.push({path:`README.md`,content:`# ${p}\n`});break;default:E.push(...s({...C,name:p,...m?{scope:m}:{},type:`project`,kind:e.builtin===`application`?`application`:`project`,includeConfig:h,rootOxc:l(t.cwd),...g?{packageManager:g}:{}}))}let D=f(E,t.cwd,{force:t.force===!0});return e.builtin===`monorepo-workspace`&&u(t.cwd,{alias:p,dir:d(`packages/${p}`)},m,t.tsconfigRootFile),{written:D}}function S(t,n){let i=t.dir;if(!i)throw Error(`Local template "${t.id}" has no directory.`);let a=m(i),o=/* @__PURE__ */ new Set([..._,...a?.ignore??[]]);for(let e of t.actions??[])e.module&&o.add(e.module.replace(/\\/g,`/`));let s=t.tokens?.open??`{{`,c=t.tokens?.close??`}}`,l=v(n),u=n.force===!0||n.overwrite===!0,d=[],f=e.resolve(n.cwd),p=t=>{let n=e.join(i,t);for(let a of h.readdirSync(n,{withFileTypes:!0})){if(o.has(a.name))continue;let n=t?`${t}/${a.name}`:a.name;if(a.isDirectory()){p(n);continue}let m=e.resolve(f,r(n,l,{open:s,close:c})),g=process.platform===`win32`?f.toLowerCase():f,_=process.platform===`win32`?m.toLowerCase():m;if(_!==g&&!_.startsWith(`${g}${e.sep}`))throw Error(`refusing to write outside ${f}: ${m}`);if(!u&&h.existsSync(m))continue;let v=h.readFileSync(e.join(i,n),`utf-8`);d.push({target:m,content:r(v,l,{open:s,close:c})})}};p(``);let g=[];for(let t of d)h.mkdirSync(e.dirname(t.target),{recursive:!0}),h.writeFileSync(t.target,t.content,`utf-8`),g.push(t.target);return{written:g}}async function C(e,t){let n=e.source.subdir?`${e.source.locate}/${e.source.subdir}`:e.source.locate,r=[`create`];n&&r.push(n);let i=t.tokens?.name;return i&&r.push(String(i)),{written:[],code:(await p(r,{cwd:t.cwd})).code}}function w(e,t,r){return new Promise(i=>{let a;try{a=n(e,t,{cwd:r,stdio:`inherit`})}catch{i(1);return}a.on(`error`,()=>i(1)),a.on(`exit`,e=>i(e??0))})}function T(e,t){return new Promise(n=>{let r=g(e,{cwd:t,stdio:`inherit`,shell:!0});r.on(`error`,()=>n(1)),r.on(`exit`,e=>n(e??0))})}function E(e,t){let n=v(t),r={};for(let[e,n]of Object.entries(t.variables??{}))r[e]=n==null?``:String(n);return{cwd:t.cwd,...e.dir?{templateDir:e.dir}:{},tokens:n,variables:r,packageManager:String(n.packageManager??`yarn`),log:e=>console.log(e)}}async function D(n,r,i,a){if(r.builtin===`install`){a.log(`Installing dependencies with ${a.packageManager}…`);let e=await w(a.packageManager,[`install`],i.cwd);if(e!==0)throw Error(`\`${a.packageManager} install\` failed with exit code ${e}.`)}else if(r.module){let o=n.dir??i.cwd,s=e.resolve(o,r.module);if(!h.existsSync(s))throw Error(`template action module not found: ${r.module}`);let c=await import(t(s).href),l=c.default??c.run;if(typeof l!=`function`)throw Error(`template action module "${r.module}" does not export a function.`);await l(a)}else if(r.command){let e=await T(r.command,i.cwd);if(e!==0)throw Error(`template command failed with exit code ${e}: ${r.command}`)}else throw Error(`template action "${r.id}" declares no builtin, module or command.`)}async function O(e,t){let n=new Set(t.actions??[]),r=[];for(let i of e.actions??[])n.has(i.id)&&(await D(e,i,t,E(e,t)),r.push(i.id));return r}async function k(e,t){if(e.builtin){let n=x(e,t),r=await O(e,t);return r.length>0?{...n,ranActions:r}:n}switch(e.source.type){case`local`:{let n=S(e,t),r=await O(e,t);return r.length>0?{...n,ranActions:r}:n}case`vite-plus`:case`npm`:case`git`:return C(e,t);default:throw Error(`Template "${e.id}" has no scaffold handler.`)}}export{k as scaffoldTemplate};
@@ -1 +1 @@
1
- import{default as e}from"node:path";import{fileURLToPath as t,pathToFileURL as n}from"node:url";import.meta.url;import{resolveIgnorePatterns as r}from"../../../../shared/src/ignore.js";import{logger as i}from"../../../../shared/src/logger.js";import"../../../../shared/src/index.js";import{generateTsconfig as a}from"./utils.js";import o from"node:fs";import{parseArgs as s}from"node:util";import{Glob as c}from"glob";function l(t={}){let{aliases:n=!0,composite:s=!1,refs:l=!1,indent:u=4,gitignore:d=!0,defaultFile:f=`tsconfig.default.json`,buildFile:p=`tsconfig.build.json`,monorepoTsconfigFilename:m=`tsconfig.workspaces.json`,log:h=!0,write:g=!0}=t,_=t.glob??`**/${f}`,v=t.cwd??process.cwd(),y=e=>{h&&i.info(e)};n||y(`Ignoring path aliases for all tsconfigs...`),s||y(`Disabling compilerOptions.composite for all tsconfigs...`),l||y(`Ignoring project references for all tsconfigs...`);let b=e.resolve(v,m),x=e.relative(v,b),S=o.existsSync(b),C=Array.isArray(_)?_:[_],w=C.filter(e=>!e.startsWith(`!`)),T=[...C.filter(e=>e.startsWith(`!`)).map(e=>e.slice(1)),...r(v,{...t.exclude===void 0?{}:{exclude:t.exclude},gitignore:d})],E=new c(w.length?w:[`**/${f}`],{cwd:v,withFileTypes:!0,ignore:T}).walkSync();y(S?`Extending ${E.length} tsconfigs with ${x}...`:`Extending ${E.length} tsconfigs (no ${x})...`);let D=[];for(let r of E){let i=r.fullpath(),o=e.dirname(i);D.push(a({cwd:v,dirname:o,tsconfigPath:i,monorepoTsconfigPath:b,tsconfigBuildPath:e.resolve(o,p),targetTsconfigPath:e.resolve(o,`tsconfig.json`),targetTsconfigBuildPath:e.resolve(o,p),indent:u,disableComposite:!s,ignoreAliases:!n,ignoreReferences:!l,write:g,log:y,...t.overrides?{overrides:t.overrides}:{}}))}if(!l)return D;y(`Checking for additional tsconfig changes...`);let O=new Map(D.map(t=>[e.resolve(t.targetTsconfigPath),t]));for(let t of D){let{dirname:n,dirnameRelative:r,targetTsconfigPath:i,config:a}=t;y(` - ${r}`),a.references?.length&&(a.references=a.references.filter(t=>{let r=e.resolve(n,t.path),i=O.get(r),a;if(i)a=i.config.compilerOptions?.composite;else if(o.existsSync(r))a=JSON.parse(o.readFileSync(r,`utf-8`)).compilerOptions?.composite;else return y(` tsconfig not found for ${t.path}, skipping.`),!1;return a!=null&&a!==!1})),g&&o.writeFileSync(i,`${JSON.stringify(a,null,u)}\n`)}return D}function u(e=process.argv.slice(2)){let{values:t}=s({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`}}});l({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{u()}catch(e){i.error(`Failed to generate tsconfigs due to: ${e}`),process.exit(1)}export{l as generateTsconfigs,u as runTsconfigCli};
1
+ import{default as e}from"node:path";import{fileURLToPath as t,pathToFileURL as n}from"node:url";import.meta.url;import{resolveIgnorePatterns as r}from"../../../../shared/src/ignore.js";import{logger as i}from"../../../../shared/src/logger.js";import"../../../../shared/src/index.js";import{readTsconfig as a}from"../../resolve.js";import{generateTsconfig as o}from"./utils.js";import s from"node:fs";import{parseArgs as c}from"node:util";import{Glob as l}from"glob";function u(t={}){let{aliases:n=!0,composite:c=!1,refs:u=!1,indent:d=4,gitignore:f=!0,defaultFile:p=`tsconfig.default.json`,buildFile:m=`tsconfig.build.json`,monorepoTsconfigFilename:h=`tsconfig.workspaces.json`,log:g=!0,write:_=!0}=t,v=t.glob??`**/${p}`,y=t.cwd??process.cwd(),b=e=>{g&&i.info(e)};n||b(`Ignoring path aliases for all tsconfigs...`),c||b(`Disabling compilerOptions.composite for all tsconfigs...`),u||b(`Ignoring project references for all tsconfigs...`);let x=e.resolve(y,h),S=e.relative(y,x),C=s.existsSync(x),w=Array.isArray(v)?v:[v],T=w.filter(e=>!e.startsWith(`!`)),E=[...w.filter(e=>e.startsWith(`!`)).map(e=>e.slice(1)),...r(y,{...t.exclude===void 0?{}:{exclude:t.exclude},gitignore:f})],D=new l(T.length?T:[`**/${p}`],{cwd:y,withFileTypes:!0,ignore:E}).walkSync();b(C?`Extending ${D.length} tsconfigs with ${S}...`:`Extending ${D.length} tsconfigs (no ${S})...`);let O=[];for(let r of D){let i=r.fullpath(),a=e.dirname(i);O.push(o({cwd:y,dirname:a,tsconfigPath:i,monorepoTsconfigPath:x,tsconfigBuildPath:e.resolve(a,m),targetTsconfigPath:e.resolve(a,`tsconfig.json`),targetTsconfigBuildPath:e.resolve(a,m),indent:d,disableComposite:!c,ignoreAliases:!n,ignoreReferences:!u,write:_,log:b,...t.overrides?{overrides:t.overrides}:{}}))}if(!u)return O;b(`Checking for additional tsconfig changes...`);let k=new Map(O.map(t=>[e.resolve(t.targetTsconfigPath),t]));for(let t of O){let{dirname:n,dirnameRelative:r,targetTsconfigPath:i,config:o}=t;b(` - ${r}`),o.references?.length&&(o.references=o.references.filter(t=>{let r=e.resolve(n,t.path),i=k.get(r),o;if(i)o=i.config.compilerOptions?.composite;else if(s.existsSync(r))o=a(r).compilerOptions?.composite;else return b(` tsconfig not found for ${t.path}, skipping.`),!1;return o!=null&&o!==!1})),_&&s.writeFileSync(i,`${JSON.stringify(o,null,d)}\n`)}return O}function d(e=process.argv.slice(2)){let{values:t}=c({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`}}});u({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{d()}catch(e){i.error(`Failed to generate tsconfigs due to: ${e}`),process.exit(1)}export{u as generateTsconfigs,d as runTsconfigCli};
@@ -29,9 +29,9 @@ export interface RevertOverrideResult {
29
29
  /** Dotted keys left alone because they changed after the override applied them. */
30
30
  kept: string[];
31
31
  }
32
- type JsonObject = Record<string, unknown>;
32
+ type JsonObject$1 = Record<string, unknown>;
33
33
  /** Whether `value` is a plain object with at least one key. */
34
- export declare function hasOverrideKeys(value: unknown): value is JsonObject;
34
+ export declare function hasOverrideKeys(value: unknown): value is JsonObject$1;
35
35
  /** Whether `path` exists in `target` (walking plain objects only). */
36
36
  export declare function hasPath(target: unknown, path: string[]): boolean;
37
37
  /** The value at `path`, or `undefined`. */
@@ -46,7 +46,7 @@ export declare function removedOverrideLeaves(previous: object | undefined, next
46
46
  /** The leaves of `next` that `previous` did not set yet. */
47
47
  export declare function addedOverrideLeaves(previous: object | undefined, next: object | undefined): OverrideLeaf[];
48
48
  /** Deep-merge `override` into `target` in place (objects merge, the rest replaces). */
49
- export declare function applyOverride(target: JsonObject, override: object): void;
49
+ export declare function applyOverride(target: JsonObject$1, override: object): void;
50
50
  /** Deep-merge an override into a copy of `target` (for in-memory use). */
51
51
  export declare function mergeOverride<T extends object>(target: T, override?: object): T;
52
52
  /**
@@ -61,13 +61,13 @@ export declare function mergeOverride<T extends object>(target: T, override?: ob
61
61
  * - the key holds another value: it was edited after the override applied it,
62
62
  * so it is kept.
63
63
  */
64
- export declare function revertOverride(target: JsonObject, leaves: OverrideLeaf[], snapshot: unknown): RevertOverrideResult;
64
+ export declare function revertOverride(target: JsonObject$1, leaves: OverrideLeaf[], snapshot: unknown): RevertOverrideResult;
65
65
  /**
66
66
  * Record the current values of newly overridden keys in `snapshot`, so a key
67
67
  * the user added after the snapshot was taken is restored (not removed) when the
68
68
  * override is dropped again.
69
69
  */
70
- export declare function recordOverrideSnapshot(snapshot: JsonObject, current: unknown, leaves: OverrideLeaf[]): void;
70
+ export declare function recordOverrideSnapshot(snapshot: JsonObject$1, current: unknown, leaves: OverrideLeaf[]): void;
71
71
  /** Whether a manifest value is a well-formed {@link AppliedOverride}. */
72
72
  export declare function isAppliedOverride(value: unknown): value is AppliedOverride;
73
73
  //#endregion
@@ -2,6 +2,11 @@ import __tsdown_shims_path from 'node:path';
2
2
  import __tsdown_shims_url from 'node:url';
3
3
  import { UserConfig } from "tsdown";
4
4
  //#region packages/tsdown/src/config/node.d.ts
5
+ /**
6
+ * Sort a package.json's `exports` keys in place (`./types` after the root,
7
+ * `./package.json` last). Returns whether the file was rewritten.
8
+ */
9
+ export declare function sortPackageExports(packageJsonPath: string): boolean;
5
10
  /**
6
11
  * The shared tsdown base configuration. Kept project-agnostic: the ASCII/banner
7
12
  * branding is opt-in via {@link createPostBanner} and consumer metadata.
@@ -1,3 +1,3 @@
1
- import"node:path";import"node:url";import.meta.url;import{sort as e}from"../../../shared/src/object-utils.js";import"../../../shared/src/index.js";import{globalLogger as t}from"tsdown";const n={format:[`esm`],platform:`node`,fixedExtension:!1,deps:{neverBundle:[/(^node:)|\/tests\/|node_modules/]},dts:{generator:`tsgo`},minify:!0,tsconfig:`tsconfig.build.json`,publint:!0,sourcemap:!1,clean:!0,shims:!0,exports:!0,outputOptions:{assetFileNames:`_assets/[name][extname]`,chunkFileNames:`_chunks/[name]-[hash].js`},hooks:{"build:done":n=>{try{if(process.env.NODE_ENV===`development`||!n.options.pkg?.exports||typeof n.options.pkg.exports!=`object`)return;let{packageJsonPath:r,...i}=n.options.pkg,{".":a,"./":o=a,"./types":s,"./package.json":c,...l}=e(i.exports);i.exports={...o?{".":o}:{},...s?{"./types":s}:{},...l,...c?{"./package.json":c}:{}},t.success(`package.json exports keys sorted!`)}catch(e){t.error(`Failed to sort package.json exports keys:`,e)}}}};function r(e={}){let{name:t,version:n,license:r,homepage:i,banner:a,copyright:o}=e;return e=>{let s=[];return a&&s.push(...a.split(`
1
+ import"node:path";import"node:url";import.meta.url;import{sort as e}from"../../../shared/src/object-utils.js";import"../../../shared/src/index.js";import t from"node:fs";import{globalLogger as n}from"tsdown";function r(n){let r=JSON.parse(t.readFileSync(n,`utf-8`));if(!r.exports||typeof r.exports!=`object`)return!1;let{".":i,"./":a=i,"./types":o,"./package.json":s,...c}=e(r.exports);return r.exports={...a?{".":a}:{},...o?{"./types":o}:{},...c,...s?{"./package.json":s}:{}},t.writeFileSync(n,`${JSON.stringify(r,null,4)}\n`,`utf-8`),!0}const i={format:[`esm`],platform:`node`,fixedExtension:!1,deps:{neverBundle:[/(^node:)|\/tests\/|node_modules/]},dts:{generator:`tsgo`},minify:!0,tsconfig:`tsconfig.build.json`,publint:!0,sourcemap:!1,clean:!0,shims:!0,exports:!0,outputOptions:{assetFileNames:`_assets/[name][extname]`,chunkFileNames:`_chunks/[name]-[hash].js`},hooks:{"build:done":e=>{try{if(process.env.NODE_ENV===`development`)return;let t=e.options.pkg?.packageJsonPath;if(!t)return;r(t)&&n.success(`package.json exports keys sorted!`)}catch(e){n.error(`Failed to sort package.json exports keys:`,e)}}}};function a(e={}){let{name:t,version:n,license:r,homepage:i,banner:a,copyright:o}=e;return e=>{let s=[];return a&&s.push(...a.split(`
2
2
  `)),s.push(e.fileName),t&&s.push(`Source code for ${t}${n?` v${n}`:``}.`),r&&s.push(`Released under the ${r} License.`),i&&s.push(i),s.push(``,`© ${o??`deltabox`}. All rights reserved.`,``),`/*\n${s.map(e=>` * ${e}`).join(`
3
- `)} */\n`}}function i(e={},t){let i={...n,...e};return t&&(i.outputOptions={...n.outputOptions,...e.outputOptions,postBanner:r(t)}),i}export{n as baseTsdownConfig,r as createPostBanner,i as createTsdownConfig};
3
+ `)} */\n`}}function o(e={},t){let n={...i,...e};return t&&(n.outputOptions={...i.outputOptions,...e.outputOptions,postBanner:a(t)}),n}export{i as baseTsdownConfig,a as createPostBanner,o as createTsdownConfig,r as sortPackageExports};
@@ -1,9 +1,9 @@
1
1
  import __tsdown_shims_path from 'node:path';
2
2
  import __tsdown_shims_url from 'node:url';
3
3
  import { CleanupOptions, cleanup } from "./cleanup.js";
4
- import { PostBannerOptions, baseTsdownConfig, createPostBanner, createTsdownConfig } from "./config/node.js";
4
+ import { PostBannerOptions, baseTsdownConfig, createPostBanner, createTsdownConfig, sortPackageExports } from "./config/node.js";
5
5
  declare namespace index_d_exports {
6
- export { CleanupOptions, PostBannerOptions, baseTsdownConfig, cleanup, createPostBanner, createTsdownConfig };
6
+ export { CleanupOptions, PostBannerOptions, baseTsdownConfig, cleanup, createPostBanner, createTsdownConfig, sortPackageExports };
7
7
  }
8
8
  //#endregion
9
- export { CleanupOptions, PostBannerOptions, baseTsdownConfig, cleanup, createPostBanner, createTsdownConfig, index_d_exports };
9
+ export { CleanupOptions, PostBannerOptions, baseTsdownConfig, cleanup, createPostBanner, createTsdownConfig, index_d_exports, sortPackageExports };
@@ -1 +1 @@
1
- import"node:path";import"node:url";import.meta.url;import{__exportAll as e}from"../../../_virtual/_rolldown/runtime.js";import{cleanup as t}from"./cleanup.js";import{baseTsdownConfig as n,createPostBanner as r,createTsdownConfig as i}from"./config/node.js";var a=/* @__PURE__ */ e({baseTsdownConfig:()=>n,cleanup:()=>t,createPostBanner:()=>r,createTsdownConfig:()=>i});export{n as baseTsdownConfig,t as cleanup,r as createPostBanner,i as createTsdownConfig,a as src_exports};
1
+ import"node:path";import"node:url";import.meta.url;import{__exportAll as e}from"../../../_virtual/_rolldown/runtime.js";import{cleanup as t}from"./cleanup.js";import{baseTsdownConfig as n,createPostBanner as r,createTsdownConfig as i,sortPackageExports as a}from"./config/node.js";var o=/* @__PURE__ */ e({baseTsdownConfig:()=>n,cleanup:()=>t,createPostBanner:()=>r,createTsdownConfig:()=>i,sortPackageExports:()=>a});export{n as baseTsdownConfig,t as cleanup,r as createPostBanner,i as createTsdownConfig,a as sortPackageExports,o as src_exports};
@@ -1 +1 @@
1
- import{default as e}from"node:path";import"node:url";import.meta.url;import{TOOLCHAIN_PACKAGE as t,findOwnCliEntry as n,localToolchainVersion as r}from"../../shared/src/bin.js";import{logger as i}from"../../shared/src/logger.js";import{spawnCross as a}from"../../shared/src/run.js";import"../../shared/src/index.js";import{which as o}from"./vp.js";import s from"node:fs";const c=process.platform===`win32`;let l=!1,u=!1;function d(t){let n=e.join(t,`node_modules`,`.bin`,`dbx`);return c?[`${n}.cmd`,`${n}.exe`,`${n}.ps1`,n]:[n]}function f(e=process.cwd()){let a=process.env.DBX_BIN;if(a){if(s.existsSync(a))return{exe:a,args:[],source:`local`};u||(u=!0,i.warn(`DBX_BIN points at ${a}, which does not exist; ignoring it.`))}for(let t of d(e))if(s.existsSync(t))return{exe:t,args:[],source:`local`};let f=n(e);if(f)return{exe:process.execPath,args:[f],source:`local`};let p=r(e),m=o(`dbx`);if(m){if(p===void 0)return{exe:m,args:[],source:`global`};i.warn(`ignoring the global \`dbx\` at ${m} — this project pins ${t}@${p}.`)}let h=p?`${t}@${p}`:t;return l||(l=!0,i.warn(`no project-local ${t} found — running \`npx --yes ${h}\` (needs network).`)),{exe:c?`npx.cmd`:`npx`,args:[`--yes`,h],source:`npx`}}const p=3e5;function m(e,t=process.cwd(),n=p){let r=f(t);return new Promise(i=>{let o=a(r.exe,[...r.args,...e],{cwd:t,env:process.env,stdio:`inherit`,...n>0?{timeoutMs:n}:{}});o.on(`error`,()=>i(1)),o.on(`exit`,e=>i(e??0))})}function h(e){return/[\s"'&|<>^()]/.test(e)?`"${e.replace(/"/g,`\\"`)}"`:e}function g(e,t=process.cwd()){let n=f(t);return[...[n.exe,...n.args].map(h),e].join(` `)}const _={get"dbx:sync"(){return{command:g(`sync`)}},get"dbx:check"(){return{command:g(`sync --check`)}}},v=[/dbx\.config\.[cm]?[jt]s$/,/tsconfig\.(?:default|monorepo)\.json$/];function y(e={}){let t=e.check??!!process.env.CI,n=e.sync??!0,r=e.watch??!0,i=e.debounce??150,a=e.cwd??process.cwd(),o,s=!1,c=async()=>{if(!s){s=!0;try{await m([`sync`],a)}finally{s=!1}}},l=()=>{o&&clearTimeout(o),o=setTimeout(()=>{c()},i)};return{name:`deltabox-toolchain`,enforce:`pre`,configResolved(t){a=e.cwd??t.root},async buildStart(){t?await m([`sync`,`--check`],a)!==0&&this.error("deltabox-toolchain: generated files are out of date — run `dbx sync`."):n&&await c()},watchChange(e){r&&n&&v.some(t=>t.test(e))&&l()}}}export{_ as DBX_TASKS,p as DBX_TIMEOUT_MS,y as dbx,g as dbxTaskCommand,f as resolveDbx,m as runDbx};
1
+ import{default as e}from"node:path";import"node:url";import.meta.url;import{TOOLCHAIN_PACKAGE as t,findOwnCliEntry as n,localToolchainVersion as r}from"../../shared/src/bin.js";import{logger as i}from"../../shared/src/logger.js";import{spawnCross as a}from"../../shared/src/run.js";import"../../shared/src/index.js";import{which as o}from"./vp.js";import s from"node:fs";const c=process.platform===`win32`;let l=!1,u=!1;function d(t){let n=e.join(t,`node_modules`,`.bin`,`dbx`);return c?[`${n}.cmd`,`${n}.exe`,`${n}.ps1`,n]:[n]}function f(e=process.cwd()){let a=process.env.DBX_BIN;if(a){if(s.existsSync(a))return{exe:a,args:[],source:`local`};u||(u=!0,i.warn(`DBX_BIN points at ${a}, which does not exist; ignoring it.`))}for(let t of d(e))if(s.existsSync(t))return{exe:t,args:[],source:`local`};let f=n(e);if(f)return{exe:process.execPath,args:[f],source:`local`};let p=r(e),m=o(`dbx`);if(m){if(p===void 0)return{exe:m,args:[],source:`global`};i.warn(`ignoring the global \`dbx\` at ${m} — this project pins ${t}@${p}.`)}let h=p?`${t}@${p}`:t;return l||(l=!0,i.warn(`no project-local ${t} found — running \`npx --yes ${h}\` (needs network).`)),{exe:c?`npx.cmd`:`npx`,args:[`--yes`,h],source:`npx`}}const p=3e5;function m(e,t=process.cwd(),n=p){let r=f(t);return new Promise(i=>{let o=a(r.exe,[...r.args,...e],{cwd:t,env:process.env,stdio:`inherit`,...n>0?{timeoutMs:n}:{}});o.on(`error`,()=>i(1)),o.on(`exit`,e=>i(e??0))})}function h(e){return/[\s"'&|<>^()]/.test(e)?`"${e.replace(/"/g,`\\"`)}"`:e}function g(e,t=process.cwd()){let n=f(t);return[...[n.exe,...n.args].map(h),e].join(` `)}const _={get"dbx:sync"(){return{command:g(`sync`)}},get"dbx:check"(){return{command:g(`sync --check`)}}},v=[/dbx\.config\.[cm]?[jt]s$/,/tsconfig\.(?:default|monorepo)\.json$/];function y(e={}){let t=e.check??!!process.env.CI,n=e.sync??!0,r=e.watch??!0,a=e.debounce??150,o=e.cwd??process.cwd(),s,c=!1,l=async()=>{if(c)return 0;c=!0;try{return await m([`sync`],o)}finally{c=!1}},u=()=>{s&&clearTimeout(s),s=setTimeout(()=>{l().then(e=>{e!==0&&i.warn(`dbx sync failed; continuing with stale files.`)})},a)};return{name:`deltabox-toolchain`,enforce:`pre`,configResolved(t){o=e.cwd??t.root},async buildStart(){t?await m([`sync`,`--check`],o)!==0&&this.error("deltabox-toolchain: generated files are out of date — run `dbx sync`."):n&&await l()!==0&&this.error("deltabox-toolchain: `dbx sync` failed; generated files are stale.")},watchChange(e){r&&n&&v.some(t=>t.test(e))&&u()}}}export{_ as DBX_TASKS,p as DBX_TIMEOUT_MS,y as dbx,g as dbxTaskCommand,f as resolveDbx,m as runDbx};
@@ -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{spawnCross as n}from"../../shared/src/run.js";import"../../shared/src/index.js";import r from"node:fs";const i=process.platform===`win32`;function a(t){let n=e.join(t,`node_modules`,`.bin`,`vp`);return i?[`${n}.cmd`,`${n}.exe`,`${n}.ps1`,n]:[n]}let o=!1;function s(n){let a=i?(process.env.PATHEXT??`.COM;.EXE;.BAT;.CMD`).split(`;`).filter(Boolean):[``],s=(process.env.PATH??``).split(e.delimiter).filter(Boolean);s.length===0&&!o&&(o=!0,t.warn(`PATH is empty — cannot look up binaries on PATH; falling back.`));for(let t of s)for(let i of a){let a=e.join(t,`${n}${i.toLowerCase()}`);try{return r.accessSync(a,r.constants.X_OK),a}catch{}}}function c(e=process.cwd()){for(let t of a(e))if(r.existsSync(t))return{exe:t,args:[],source:`local`};let t=s(`vp`);return t?{exe:t,args:[],source:`global`}:{exe:i?`npx.cmd`:`npx`,args:[`--yes`,`--package`,`vite-plus`,`vp`],source:`npx`}}function l(e=process.cwd()){return c(e).source!==`npx`}function u(e,t={}){let r=t.cwd??process.cwd(),i=c(r),a=t.mode===`capture`,o={...process.env,...t.env};return t.color===!1&&(o.NO_COLOR=`1`,o.FORCE_COLOR=`0`),new Promise(s=>{let c=``,l=``,u=n(i.exe,[...i.args,...e],{cwd:r,env:o,stdio:a?`pipe`:`inherit`,...t.timeoutMs===void 0?{}:{timeoutMs:t.timeoutMs}});u.stdout?.on(`data`,e=>{c+=e}),u.stderr?.on(`data`,e=>{l+=e}),u.on(`error`,e=>{s({code:1,stdout:c,stderr:`${l}${String(e)}`,resolved:i})}),u.on(`exit`,e=>{s({code:e??0,stdout:c,stderr:l,resolved:i})})})}async function d(e=process.cwd()){let t=await u([`--version`],{cwd:e,mode:`capture`});if(t.code===0)return t.stdout.trim()||t.stderr.trim()||void 0}function f(e=process.cwd()){let t=c(e);return t.source===`local`?`local (node_modules/.bin/vp)`:t.source===`global`?`global (PATH)`:`npx --yes --package vite-plus vp`}export{f as describeVp,l as hasVp,c as resolveVp,u as runVp,d as vpVersion,s as which};
1
+ import{default as e}from"node:path";import"node:url";import.meta.url;import{logger as t}from"../../shared/src/logger.js";import{spawnCross as n}from"../../shared/src/run.js";import"../../shared/src/index.js";import r from"node:fs";const i=process.platform===`win32`;function a(t){let n=[],r=e.resolve(t);for(;;){let t=e.join(r,`node_modules`,`.bin`,`vp`);n.push(...i?[`${t}.cmd`,`${t}.exe`,`${t}.ps1`,t]:[t]);let a=e.dirname(r);if(a===r)break;r=a}return n}let o=!1;function s(n){let a=i?(process.env.PATHEXT??`.COM;.EXE;.BAT;.CMD`).split(`;`).filter(Boolean):[``],s=(process.env.PATH??``).split(e.delimiter).filter(Boolean);s.length===0&&!o&&(o=!0,t.warn(`PATH is empty — cannot look up binaries on PATH; falling back.`));for(let t of s)for(let i of a){let a=e.join(t,`${n}${i.toLowerCase()}`);try{return r.accessSync(a,r.constants.X_OK),a}catch{}}}function c(e=process.cwd()){for(let t of a(e))if(r.existsSync(t))return{exe:t,args:[],source:`local`};let t=s(`vp`);return t?{exe:t,args:[],source:`global`}:{exe:i?`npx.cmd`:`npx`,args:[`--yes`,`--package`,`vite-plus`,`vp`],source:`npx`}}function l(e=process.cwd()){return c(e).source!==`npx`}function u(e,t={}){let r=t.cwd??process.cwd(),i=c(r),a=t.mode===`capture`,o={...process.env,...t.env};return t.color===!1&&(o.NO_COLOR=`1`,o.FORCE_COLOR=`0`),new Promise(s=>{let c=``,l=``,u=n(i.exe,[...i.args,...e],{cwd:r,env:o,stdio:a?`pipe`:`inherit`,...t.timeoutMs===void 0?{}:{timeoutMs:t.timeoutMs}});u.stdout?.on(`data`,e=>{c+=e}),u.stderr?.on(`data`,e=>{l+=e}),u.on(`error`,e=>{s({code:1,stdout:c,stderr:`${l}${String(e)}`,resolved:i})}),u.on(`exit`,e=>{s({code:e??0,stdout:c,stderr:l,resolved:i})})})}async function d(e=process.cwd()){let t=await u([`--version`],{cwd:e,mode:`capture`});if(t.code===0)return t.stdout.trim()||t.stderr.trim()||void 0}function f(e=process.cwd()){let t=c(e);return t.source===`local`?`local (node_modules/.bin/vp)`:t.source===`global`?`global (PATH)`:`npx --yes --package vite-plus vp`}export{f as describeVp,l as hasVp,c as resolveVp,u as runVp,d as vpVersion,s as which};
package/dist/project.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import __tsdown_shims_path from 'node:path';
2
2
  import __tsdown_shims_url from 'node:url';
3
- import { DEFAULT_PACKAGE_MANAGER_VERSIONS } from "./packages/shared/src/toolchain.js";
4
3
  import { CATALOG_MARKER, CATALOG_PACKAGE_MANAGERS, Catalog, catalogFileFor, catalogsSyncTask, hasCatalog, renderPnpmWorkspace, renderYarnrc, supportsCatalogs } from "./packages/project/src/catalogs.js";
5
4
  import { projectCommands } from "./packages/project/src/cli/index.js";
6
5
  import { GENERATED_CONFIG_FILENAME, GenerateProjectConfigsOptions, GenerateProjectConfigsResult, GeneratedProjectConfig, generateProjectConfigs } from "./packages/project/src/config.js";
7
6
  import { projectSyncTask } from "./packages/project/src/sync.js";
8
- import { MonorepoRootContext, ProjectContext, RootOxcFiles, SCAFFOLD_CATALOG, WorkspaceContext, WriteGeneratedFilesOptions, createMonorepoRootFiles, createRootProjectFiles, createWorkspaceFiles, findRootOxcFiles, renderApplicationEntry, renderApplicationHtml, renderGitignore, renderSourceEntry, renderSourceTest, renderToolchainConfig, renderWorkspaceTsconfig, upsertWorkspaceTsconfig, writeGeneratedFiles } from "./packages/project/src/typescript.js";
7
+ import { MonorepoRootContext, ProjectContext, RootOxcFiles, SCAFFOLD_CATALOG, WorkspaceContext, WriteGeneratedFilesOptions, createMonorepoRootFiles, createRootProjectFiles, createWorkspaceFiles, findRootOxcFiles, renderApplicationEntry, renderApplicationHtml, renderGitignore, renderSourceEntry, renderSourceTest, renderToolchainConfig, renderWorkspaceTsconfig, upsertWorkspaceTsconfig, workspaceDirForTsconfig, writeGeneratedFiles } from "./packages/project/src/typescript.js";
9
8
  import "./packages/project/src/index.js";
10
- export { CATALOG_MARKER, CATALOG_PACKAGE_MANAGERS, Catalog, DEFAULT_PACKAGE_MANAGER_VERSIONS, GENERATED_CONFIG_FILENAME, GenerateProjectConfigsOptions, GenerateProjectConfigsResult, GeneratedProjectConfig, MonorepoRootContext, ProjectContext, RootOxcFiles, SCAFFOLD_CATALOG, WorkspaceContext, WriteGeneratedFilesOptions, catalogFileFor, catalogsSyncTask, createMonorepoRootFiles, createRootProjectFiles, createWorkspaceFiles, findRootOxcFiles, generateProjectConfigs, hasCatalog, projectCommands, projectSyncTask, renderApplicationEntry, renderApplicationHtml, renderGitignore, renderPnpmWorkspace, renderSourceEntry, renderSourceTest, renderToolchainConfig, renderWorkspaceTsconfig, renderYarnrc, supportsCatalogs, upsertWorkspaceTsconfig, writeGeneratedFiles };
9
+ import { DEFAULT_PACKAGE_MANAGER_VERSIONS } from "./packages/shared/src/toolchain.js";
10
+ export { CATALOG_MARKER, CATALOG_PACKAGE_MANAGERS, Catalog, DEFAULT_PACKAGE_MANAGER_VERSIONS, GENERATED_CONFIG_FILENAME, GenerateProjectConfigsOptions, GenerateProjectConfigsResult, GeneratedProjectConfig, MonorepoRootContext, ProjectContext, RootOxcFiles, SCAFFOLD_CATALOG, WorkspaceContext, WriteGeneratedFilesOptions, catalogFileFor, catalogsSyncTask, createMonorepoRootFiles, createRootProjectFiles, createWorkspaceFiles, findRootOxcFiles, generateProjectConfigs, hasCatalog, projectCommands, projectSyncTask, renderApplicationEntry, renderApplicationHtml, renderGitignore, renderPnpmWorkspace, renderSourceEntry, renderSourceTest, renderToolchainConfig, renderWorkspaceTsconfig, renderYarnrc, supportsCatalogs, upsertWorkspaceTsconfig, workspaceDirForTsconfig, writeGeneratedFiles };