@deltabox/toolchain 1.11.4 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/CHANGELOG.md +308 -4
  2. package/README.md +21 -14
  3. package/dist/_virtual/_rolldown/runtime.js +1 -1
  4. package/dist/changelog.d.ts +7 -6
  5. package/dist/changelog.js +1 -1
  6. package/dist/cli/commands/index.js +1 -1
  7. package/dist/cli/commands/providers.js +1 -1
  8. package/dist/cli/commands/reset.js +1 -1
  9. package/dist/cli/commands/shared.js +1 -1
  10. package/dist/cli/commands/sync.js +1 -1
  11. package/dist/cli/commands/watch.js +1 -1
  12. package/dist/cli/config-selection.d.ts +23 -0
  13. package/dist/cli/config-selection.js +1 -0
  14. package/dist/cli/context.js +1 -1
  15. package/dist/cli/index.d.ts +5 -3
  16. package/dist/cli/index.js +1 -1
  17. package/dist/cli/register.js +1 -1
  18. package/dist/config.d.ts +8 -8
  19. package/dist/config.js +1 -1
  20. package/dist/core.d.ts +7 -6
  21. package/dist/core.js +1 -1
  22. package/dist/globals.d.ts +31 -0
  23. package/dist/globals.js +1 -0
  24. package/dist/index.d.ts +32 -11
  25. package/dist/index.js +1 -1
  26. package/dist/migrate.d.ts +3 -2
  27. package/dist/migrate.js +1 -1
  28. package/dist/package.js +1 -1
  29. package/dist/packages/biome/src/index.d.ts +2 -1
  30. package/dist/packages/biome/src/index.js +1 -1
  31. package/dist/packages/changelog/src/cli/index.js +1 -1
  32. package/dist/packages/changelog/src/index.d.ts +8 -7
  33. package/dist/packages/changelog/src/index.js +1 -1
  34. package/dist/packages/changelog/src/run-workflows.d.ts +19 -4
  35. package/dist/packages/changelog/src/run-workflows.js +1 -1
  36. package/dist/packages/changelog/src/run.d.ts +3 -3
  37. package/dist/packages/changelog/src/run.js +1 -1
  38. package/dist/packages/changelog/src/sync.d.ts +7 -4
  39. package/dist/packages/changelog/src/sync.js +1 -1
  40. package/dist/packages/changelog/src/utils/format.d.ts +2 -1
  41. package/dist/packages/changelog/src/utils/format.js +5 -5
  42. package/dist/packages/changelog/src/utils/git.js +1 -1
  43. package/dist/packages/changelog/src/utils/reformat.d.ts +2 -1
  44. package/dist/packages/changelog/src/utils/reformat.js +3 -3
  45. package/dist/packages/changelog/src/utils/summary.d.ts +25 -2
  46. package/dist/packages/changelog/src/utils/summary.js +3 -1
  47. package/dist/packages/changelog/src/utils/types.d.ts +34 -2
  48. package/dist/packages/changelog/src/utils/version.d.ts +1 -0
  49. package/dist/packages/changelog/src/utils/versioning.d.ts +25 -4
  50. package/dist/packages/changelog/src/utils/versioning.js +1 -1
  51. package/dist/packages/changelog/src/utils/write.js +1 -1
  52. package/dist/packages/changelog/src/workflows.d.ts +27 -7
  53. package/dist/packages/changelog/src/workflows.js +5 -5
  54. package/dist/packages/config/src/cli/index.js +1 -1
  55. package/dist/packages/config/src/collect.d.ts +10 -8
  56. package/dist/packages/config/src/collect.js +1 -1
  57. package/dist/packages/config/src/config-json.d.ts +4 -4
  58. package/dist/packages/config/src/config-json.js +1 -1
  59. package/dist/packages/config/src/engine.d.ts +14 -25
  60. package/dist/packages/config/src/engine.js +1 -1
  61. package/dist/packages/config/src/env-file.d.ts +4 -4
  62. package/dist/packages/config/src/env-file.js +2 -2
  63. package/dist/packages/config/src/env.d.ts +4 -6
  64. package/dist/packages/config/src/env.js +1 -1
  65. package/dist/packages/config/src/generators/cli.d.ts +6 -6
  66. package/dist/packages/config/src/generators/cli.js +1 -1
  67. package/dist/packages/config/src/generators/env.d.ts +9 -9
  68. package/dist/packages/config/src/generators/env.js +2 -2
  69. package/dist/packages/config/src/generators/index.d.ts +4 -4
  70. package/dist/packages/config/src/generators/index.js +1 -1
  71. package/dist/packages/config/src/generators/json.d.ts +5 -7
  72. package/dist/packages/config/src/generators/json.js +1 -1
  73. package/dist/packages/config/src/generators/markdown.d.ts +57 -35
  74. package/dist/packages/config/src/generators/markdown.js +18 -19
  75. package/dist/packages/config/src/generators/types.d.ts +28 -23
  76. package/dist/packages/config/src/generators/types.js +3 -3
  77. package/dist/packages/config/src/index.d.ts +9 -9
  78. package/dist/packages/config/src/index.js +1 -1
  79. package/dist/packages/config/src/schema.d.ts +31 -3
  80. package/dist/packages/config/src/schema.js +1 -1
  81. package/dist/packages/config/src/types.d.ts +134 -28
  82. package/dist/packages/core/src/editor-config.d.ts +14 -0
  83. package/dist/packages/core/src/editor-config.js +1 -0
  84. package/dist/packages/core/src/graph.js +1 -1
  85. package/dist/packages/core/src/index.d.ts +8 -7
  86. package/dist/packages/core/src/index.js +1 -1
  87. package/dist/packages/core/src/loader.d.ts +20 -2
  88. package/dist/packages/core/src/loader.js +1 -1
  89. package/dist/packages/core/src/manifest.d.ts +20 -1
  90. package/dist/packages/core/src/manifest.js +1 -1
  91. package/dist/packages/core/src/provider-registry.d.ts +48 -3
  92. package/dist/packages/core/src/provider-registry.js +1 -1
  93. package/dist/packages/core/src/reset.d.ts +15 -0
  94. package/dist/packages/core/src/reset.js +1 -1
  95. package/dist/packages/core/src/sync.d.ts +10 -0
  96. package/dist/packages/core/src/sync.js +1 -1
  97. package/dist/packages/core/src/watch.d.ts +9 -0
  98. package/dist/packages/core/src/watch.js +1 -1
  99. package/dist/packages/migrate/src/cli/index.js +1 -1
  100. package/dist/packages/migrate/src/index.d.ts +3 -2
  101. package/dist/packages/migrate/src/index.js +1 -1
  102. package/dist/packages/migrate/src/oxc.d.ts +13 -0
  103. package/dist/packages/migrate/src/oxc.js +1 -0
  104. package/dist/packages/migrate/src/registry.js +1 -1
  105. package/dist/packages/migrate/src/vite-target.js +1 -1
  106. package/dist/packages/migrate/src/vite.d.ts +25 -3
  107. package/dist/packages/migrate/src/vite.js +7 -2
  108. package/dist/packages/project/src/catalogs.d.ts +7 -0
  109. package/dist/packages/project/src/catalogs.js +1 -1
  110. package/dist/packages/project/src/cli/index.js +1 -1
  111. package/dist/packages/project/src/config.d.ts +6 -0
  112. package/dist/packages/project/src/config.js +1 -1
  113. package/dist/packages/project/src/index.d.ts +5 -4
  114. package/dist/packages/project/src/index.js +1 -1
  115. package/dist/packages/project/src/sync.js +1 -1
  116. package/dist/packages/project/src/typescript.d.ts +64 -12
  117. package/dist/packages/project/src/typescript.js +12 -7
  118. package/dist/packages/shared/src/changelog-groups.d.ts +59 -0
  119. package/dist/packages/shared/src/config-schema/biome.d.ts +10 -0
  120. package/dist/packages/shared/src/config-schema/biome.js +1 -0
  121. package/dist/packages/shared/src/config-schema/catalogs.d.ts +14 -0
  122. package/dist/packages/shared/src/config-schema/catalogs.js +1 -0
  123. package/dist/packages/shared/src/config-schema/changelog.d.ts +245 -0
  124. package/dist/packages/shared/src/config-schema/changelog.js +1 -0
  125. package/dist/packages/shared/src/config-schema/ci.d.ts +389 -0
  126. package/dist/packages/shared/src/config-schema/ci.js +1 -0
  127. package/dist/packages/shared/src/config-schema/format.d.ts +38 -0
  128. package/dist/packages/shared/src/config-schema/format.js +1 -0
  129. package/dist/packages/shared/src/config-schema/index.d.ts +1648 -0
  130. package/dist/packages/shared/src/config-schema/index.js +1 -0
  131. package/dist/packages/shared/src/config-schema/logger.d.ts +19 -0
  132. package/dist/packages/shared/src/config-schema/logger.js +1 -0
  133. package/dist/packages/shared/src/config-schema/meta.d.ts +16 -0
  134. package/dist/packages/shared/src/config-schema/meta.js +1 -0
  135. package/dist/packages/shared/src/config-schema/project.d.ts +35 -0
  136. package/dist/packages/shared/src/config-schema/project.js +1 -0
  137. package/dist/packages/shared/src/config-schema/providers.d.ts +9 -0
  138. package/dist/packages/shared/src/config-schema/providers.js +1 -0
  139. package/dist/packages/shared/src/config-schema/registry.d.ts +21 -0
  140. package/dist/packages/shared/src/config-schema/registry.js +1 -0
  141. package/dist/packages/shared/src/config-schema/templates.d.ts +81 -0
  142. package/dist/packages/shared/src/config-schema/templates.js +1 -0
  143. package/dist/packages/shared/src/config-schema/tsconfig.d.ts +30 -0
  144. package/dist/packages/shared/src/config-schema/tsconfig.js +1 -0
  145. package/dist/packages/shared/src/config-schema/vite.d.ts +26 -0
  146. package/dist/packages/shared/src/config-schema/vite.js +1 -0
  147. package/dist/packages/shared/src/config-schema/watch.d.ts +11 -0
  148. package/dist/packages/shared/src/config-schema/watch.js +1 -0
  149. package/dist/packages/shared/src/config-schema/workflow.d.ts +590 -0
  150. package/dist/packages/shared/src/config-schema/workflow.js +1 -0
  151. package/dist/packages/shared/src/config-types.d.ts +290 -90
  152. package/dist/packages/shared/src/fs-utils.js +1 -1
  153. package/dist/packages/shared/src/index.d.ts +26 -7
  154. package/dist/packages/shared/src/index.js +1 -1
  155. package/dist/packages/shared/src/logger.d.ts +26 -3
  156. package/dist/packages/shared/src/logger.js +1 -1
  157. package/dist/packages/shared/src/messages.d.ts +36 -0
  158. package/dist/packages/shared/src/messages.js +1 -0
  159. package/dist/packages/shared/src/object-utils.d.ts +5 -0
  160. package/dist/packages/shared/src/object-utils.js +1 -1
  161. package/dist/packages/shared/src/registry-policy.d.ts +17 -0
  162. package/dist/packages/shared/src/registry-policy.js +1 -0
  163. package/dist/packages/shared/src/toolchain.d.ts +90 -11
  164. package/dist/packages/shared/src/toolchain.js +1 -1
  165. package/dist/packages/shared/src/types.d.ts +6 -0
  166. package/dist/packages/shared/src/vite-defaults.d.ts +29 -0
  167. package/dist/packages/shared/src/vite-defaults.js +1 -0
  168. package/dist/packages/template/src/builtin.js +1 -1
  169. package/dist/packages/template/src/cli/index.js +1 -1
  170. package/dist/packages/template/src/global.d.ts +130 -0
  171. package/dist/packages/template/src/global.js +3 -0
  172. package/dist/packages/template/src/index.d.ts +3 -2
  173. package/dist/packages/template/src/index.js +1 -1
  174. package/dist/packages/template/src/online.d.ts +13 -4
  175. package/dist/packages/template/src/online.js +1 -1
  176. package/dist/packages/template/src/registry.d.ts +2 -1
  177. package/dist/packages/template/src/registry.js +1 -1
  178. package/dist/packages/template/src/scaffold.d.ts +5 -1
  179. package/dist/packages/template/src/scaffold.js +1 -1
  180. package/dist/packages/tsconfig/src/cli/generate/index.d.ts +3 -0
  181. package/dist/packages/tsconfig/src/cli/generate/index.js +1 -1
  182. package/dist/packages/tsconfig/src/cli/generate/utils.d.ts +10 -1
  183. package/dist/packages/tsconfig/src/cli/generate/utils.js +1 -1
  184. package/dist/packages/tsconfig/src/cli/index.js +1 -1
  185. package/dist/packages/tsconfig/src/index.d.ts +7 -4
  186. package/dist/packages/tsconfig/src/index.js +1 -1
  187. package/dist/packages/tsconfig/src/overrides.d.ts +74 -0
  188. package/dist/packages/tsconfig/src/overrides.js +1 -0
  189. package/dist/packages/tsconfig/src/resolve.d.ts +62 -0
  190. package/dist/packages/tsconfig/src/resolve.js +3 -0
  191. package/dist/packages/tsconfig/src/snapshots.d.ts +50 -0
  192. package/dist/packages/tsconfig/src/snapshots.js +1 -0
  193. package/dist/packages/tsconfig/src/sync.d.ts +14 -5
  194. package/dist/packages/tsconfig/src/sync.js +1 -1
  195. package/dist/packages/tsconfig/src/templates/tsconfig.default.js +1 -1
  196. package/dist/packages/tsconfig/src/templates.d.ts +12 -4
  197. package/dist/packages/tsconfig/src/templates.js +1 -1
  198. package/dist/packages/vite/src/index.d.ts +2 -2
  199. package/dist/packages/vite/src/index.js +1 -1
  200. package/dist/packages/vite/src/resolve.d.ts +13 -3
  201. package/dist/packages/vite/src/resolve.js +1 -1
  202. package/dist/packages/vite/src/sync.d.ts +46 -5
  203. package/dist/packages/vite/src/sync.js +5 -2
  204. package/dist/project.d.ts +4 -3
  205. package/dist/project.js +1 -1
  206. package/dist/providers.d.ts +11 -4
  207. package/dist/providers.js +1 -1
  208. package/dist/shared.d.ts +25 -6
  209. package/dist/shared.js +1 -1
  210. package/dist/sync.js +1 -1
  211. package/dist/template.d.ts +3 -2
  212. package/dist/template.js +1 -1
  213. package/dist/tooling.d.ts +21 -0
  214. package/dist/tooling.js +1 -0
  215. package/dist/tsconfig.d.ts +6 -3
  216. package/dist/tsconfig.js +1 -1
  217. package/dist/vite.d.ts +2 -2
  218. package/dist/vite.js +1 -1
  219. package/package.json +28 -23
  220. package/dist/packages/config/src/types.js +0 -1
  221. package/dist/packages/shared/src/config-schema.d.ts +0 -3928
  222. package/dist/packages/shared/src/config-schema.js +0 -1
@@ -1 +1 @@
1
- import{default as e}from"node:path";import"node:url";import.meta.url;import{readJsonAt as t}from"../../shared/src/fs-utils.js";import{projectFromPackageJson as n}from"../../shared/src/project.js";import"../../shared/src/index.js";import{detectProjectType as r}from"../../core/src/project-type.js";import{selectProjects as i}from"../../core/src/select.js";import"../../core/src/index.js";import{renderToolchainConfig as a}from"./typescript.js";import o from"node:fs";const s=`dbx.config.ts`;function c(t,n){if(!t)return{name:e.basename(n)};let r=t.match(/^(@[^/]+)\/(.+)$/);return r?.[1]&&r[2]?{name:r[2],scope:r[1]}:{name:t}}function l(l){let u=l.dryRun??!1,d=l.force??!1,f=i({root:l.root,...l.include?{include:l.include}:{},...l.exclude?{exclude:l.exclude}:{},...l.maxDepth===void 0?{}:{maxDepth:l.maxDepth}}),p=[],m=[],h=[];for(let i of f){let f=e.join(i.dir,s);if((i.hasConfig||o.existsSync(f))&&!d){h.push(i.rel),p.push({dir:i.dir,rel:i.rel,...i.name?{name:i.name}:{},type:l.type??r(i.dir),configPath:f,created:!1,skipped:`has config`});continue}let g=l.type??r(i.dir),_=t(i.dir,`package.json`),{name:v,scope:y}=c(i.name??_?.name,i.dir),b=_?n(_):void 0,x=a({name:v,...y?{scope:y}:{},type:g,...b?.packageManager?{packageManager:b.packageManager}:{},...b?.packageManagerVersion?{yarnVersion:b.packageManagerVersion}:{}});u||o.writeFileSync(f,x,`utf-8`),m.push(i.rel),p.push({dir:i.dir,rel:i.rel,...i.name?{name:i.name}:{},type:g,configPath:f,created:!0})}return{configs:p,created:m,skipped:h,dryRun:u}}export{s as GENERATED_CONFIG_FILENAME,l as generateProjectConfigs};
1
+ import{default as e}from"node:path";import"node:url";import.meta.url;import{readJsonAt as t}from"../../shared/src/fs-utils.js";import{projectFromPackageJson as n}from"../../shared/src/project.js";import"../../shared/src/index.js";import{detectProjectType as r}from"../../core/src/project-type.js";import{selectProjects as i}from"../../core/src/select.js";import"../../core/src/index.js";import{ensureViteFmtIgnore as a,extractViteObject as o,findViteConfig as s,foldViteIntoConfig as c,scanLiteralObject as l}from"../../migrate/src/vite.js";import"../../migrate/src/index.js";import{renderToolchainConfig as u}from"./typescript.js";import d from"node:fs";const f=`dbx.config.ts`;function p(t,n){if(!t)return{name:e.basename(n)};let r=t.match(/^(@[^/]+)\/(.+)$/);return r?.[1]&&r[2]?{name:r[2],scope:r[1]}:{name:t}}function m(m){let h=m.dryRun??!1,g=m.force??!1,_=i({root:m.root,...m.include?{include:m.include}:{},...m.exclude?{exclude:m.exclude}:{},...m.maxDepth===void 0?{}:{maxDepth:m.maxDepth}}),v=[],y=[],b=[];for(let i of _){let _=e.join(i.dir,f);if((i.hasConfig||d.existsSync(_))&&!g){b.push(i.rel),v.push({dir:i.dir,rel:i.rel,...i.name?{name:i.name}:{},type:m.type??r(i.dir),configPath:_,created:!1,skipped:`has config`});continue}let x=m.type??r(i.dir),S=t(i.dir,`package.json`),{name:C,scope:w}=p(i.name??S?.name,i.dir),T=S?n(S):void 0,E=u({name:C,...w?{scope:w}:{},type:x,...T?.description?{description:T.description}:{},...T?.author?{author:T.author}:{},...T?.license?{license:T.license}:{},...T?.homepage?{homepage:T.homepage}:{},...T?.repo?{repo:T.repo}:{},...T?.nodeVersion?{nodeVersion:T.nodeVersion}:{},...T?.packageManager?{packageManager:T.packageManager}:{},...T?.packageManagerVersion?{packageManagerVersion:T.packageManagerVersion}:{}}),D=E,O,k=s(i.dir);if(k)try{let e=d.readFileSync(k,`utf-8`).replace(/^\uFEFF/,``);if(!e.includes(`@deltabox/toolchain/vite`)){let t=o(e),n=`error`in t?void 0:l(t.text);if(`error`in t||!n?.ok)O={path:k,folded:!1,error:`error`in t?t.error:n.reason};else{let e=c(E,a(t.text));`content`in e?(D=e.content,O={path:k,folded:!0}):O={path:k,folded:!1,error:e.error}}}}catch(e){O={path:k,folded:!1,error:String(e)}}h||d.writeFileSync(_,D,`utf-8`),y.push(i.rel),v.push({dir:i.dir,rel:i.rel,...i.name?{name:i.name}:{},type:x,configPath:_,created:!0,...O?{vite:O}:{}})}return{configs:v,created:y,skipped:b,dryRun:h}}export{f as GENERATED_CONFIG_FILENAME,m as generateProjectConfigs};
@@ -1,12 +1,13 @@
1
1
  import __tsdown_shims_path from 'node:path';
2
2
  import __tsdown_shims_url from 'node:url';
3
- import { CATALOG_MARKER, CATALOG_PACKAGE_MANAGERS, Catalog, catalogFileFor, catalogsSyncTask, renderPnpmWorkspace, renderYarnrc, supportsCatalogs } from "./catalogs.js";
3
+ import { DEFAULT_PACKAGE_MANAGER_VERSIONS } from "../../shared/src/toolchain.js";
4
+ import { CATALOG_MARKER, CATALOG_PACKAGE_MANAGERS, Catalog, catalogFileFor, catalogsSyncTask, hasCatalog, renderPnpmWorkspace, renderYarnrc, supportsCatalogs } from "./catalogs.js";
4
5
  import { projectCommands } from "./cli/index.js";
5
6
  import { GENERATED_CONFIG_FILENAME, GenerateProjectConfigsOptions, GenerateProjectConfigsResult, GeneratedProjectConfig, generateProjectConfigs } from "./config.js";
6
7
  import { projectSyncTask } from "./sync.js";
7
- import { DEFAULT_PACKAGE_MANAGER_VERSIONS, MonorepoRootContext, ProjectContext, SCAFFOLD_CATALOG, WorkspaceContext, createMonorepoRootFiles, createRootProjectFiles, createWorkspaceFiles, renderGitignore, renderToolchainConfig, renderWorkspaceTsconfig, writeGeneratedFiles } from "./typescript.js";
8
+ import { MonorepoRootContext, ProjectContext, RootOxcFiles, SCAFFOLD_CATALOG, WorkspaceContext, WriteGeneratedFilesOptions, createMonorepoRootFiles, createRootProjectFiles, createWorkspaceFiles, findRootOxcFiles, renderApplicationEntry, renderApplicationHtml, renderGitignore, renderSourceEntry, renderSourceTest, renderToolchainConfig, renderWorkspaceTsconfig, upsertWorkspaceTsconfig, writeGeneratedFiles } from "./typescript.js";
8
9
  declare namespace index_d_exports {
9
- export { CATALOG_MARKER, CATALOG_PACKAGE_MANAGERS, Catalog, DEFAULT_PACKAGE_MANAGER_VERSIONS, GENERATED_CONFIG_FILENAME, GenerateProjectConfigsOptions, GenerateProjectConfigsResult, GeneratedProjectConfig, MonorepoRootContext, ProjectContext, SCAFFOLD_CATALOG, WorkspaceContext, catalogFileFor, catalogsSyncTask, createMonorepoRootFiles, createRootProjectFiles, createWorkspaceFiles, generateProjectConfigs, projectCommands, projectSyncTask, renderGitignore, renderPnpmWorkspace, renderToolchainConfig, renderWorkspaceTsconfig, renderYarnrc, supportsCatalogs, writeGeneratedFiles };
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 };
10
11
  }
11
12
  //#endregion
12
- export { CATALOG_MARKER, CATALOG_PACKAGE_MANAGERS, Catalog, DEFAULT_PACKAGE_MANAGER_VERSIONS, GENERATED_CONFIG_FILENAME, GenerateProjectConfigsOptions, GenerateProjectConfigsResult, GeneratedProjectConfig, MonorepoRootContext, ProjectContext, SCAFFOLD_CATALOG, WorkspaceContext, catalogFileFor, catalogsSyncTask, createMonorepoRootFiles, createRootProjectFiles, createWorkspaceFiles, generateProjectConfigs, index_d_exports, projectCommands, projectSyncTask, renderGitignore, renderPnpmWorkspace, renderToolchainConfig, renderWorkspaceTsconfig, renderYarnrc, supportsCatalogs, writeGeneratedFiles };
13
+ 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, index_d_exports, projectCommands, projectSyncTask, renderApplicationEntry, renderApplicationHtml, renderGitignore, renderPnpmWorkspace, renderSourceEntry, renderSourceTest, renderToolchainConfig, renderWorkspaceTsconfig, renderYarnrc, supportsCatalogs, upsertWorkspaceTsconfig, writeGeneratedFiles };
@@ -1 +1 @@
1
- import"node:path";import"node:url";import.meta.url;import{__exportAll as e}from"../../../_virtual/_rolldown/runtime.js";import{CATALOG_MARKER as t,CATALOG_PACKAGE_MANAGERS as n,catalogFileFor as r,catalogsSyncTask as i,renderPnpmWorkspace as a,renderYarnrc as o,supportsCatalogs as s}from"./catalogs.js";import{DEFAULT_PACKAGE_MANAGER_VERSIONS as c,SCAFFOLD_CATALOG as l,createMonorepoRootFiles as u,createRootProjectFiles as d,createWorkspaceFiles as f,renderGitignore as p,renderToolchainConfig as m,renderWorkspaceTsconfig as h,writeGeneratedFiles as g}from"./typescript.js";import{GENERATED_CONFIG_FILENAME as _,generateProjectConfigs as v}from"./config.js";import{projectCommands as y}from"./cli/index.js";import{projectSyncTask as b}from"./sync.js";var x=/* @__PURE__ */ e({CATALOG_MARKER:()=>t,CATALOG_PACKAGE_MANAGERS:()=>n,DEFAULT_PACKAGE_MANAGER_VERSIONS:()=>c,GENERATED_CONFIG_FILENAME:()=>_,SCAFFOLD_CATALOG:()=>l,catalogFileFor:()=>r,catalogsSyncTask:()=>i,createMonorepoRootFiles:()=>u,createRootProjectFiles:()=>d,createWorkspaceFiles:()=>f,generateProjectConfigs:()=>v,projectCommands:()=>y,projectSyncTask:()=>b,renderGitignore:()=>p,renderPnpmWorkspace:()=>a,renderToolchainConfig:()=>m,renderWorkspaceTsconfig:()=>h,renderYarnrc:()=>o,supportsCatalogs:()=>s,writeGeneratedFiles:()=>g});export{t as CATALOG_MARKER,n as CATALOG_PACKAGE_MANAGERS,c as DEFAULT_PACKAGE_MANAGER_VERSIONS,_ as GENERATED_CONFIG_FILENAME,l as SCAFFOLD_CATALOG,r as catalogFileFor,i as catalogsSyncTask,u as createMonorepoRootFiles,d as createRootProjectFiles,f as createWorkspaceFiles,v as generateProjectConfigs,y as projectCommands,b as projectSyncTask,p as renderGitignore,a as renderPnpmWorkspace,m as renderToolchainConfig,h as renderWorkspaceTsconfig,o as renderYarnrc,x as src_exports,s as supportsCatalogs,g as writeGeneratedFiles};
1
+ import"node:path";import"node:url";import.meta.url;import{__exportAll as e}from"../../../_virtual/_rolldown/runtime.js";import{DEFAULT_PACKAGE_MANAGER_VERSIONS as t}from"../../shared/src/toolchain.js";import{CATALOG_MARKER as n,CATALOG_PACKAGE_MANAGERS as r,catalogFileFor as i,catalogsSyncTask as a,hasCatalog as o,renderPnpmWorkspace as s,renderYarnrc as c,supportsCatalogs as l}from"./catalogs.js";import{SCAFFOLD_CATALOG as u,createMonorepoRootFiles as d,createRootProjectFiles as f,createWorkspaceFiles as p,findRootOxcFiles as m,renderApplicationEntry as h,renderApplicationHtml as g,renderGitignore as _,renderSourceEntry as v,renderSourceTest as y,renderToolchainConfig as b,renderWorkspaceTsconfig as x,upsertWorkspaceTsconfig as S,writeGeneratedFiles as C}from"./typescript.js";import{GENERATED_CONFIG_FILENAME as w,generateProjectConfigs as T}from"./config.js";import{projectCommands as E}from"./cli/index.js";import{projectSyncTask as D}from"./sync.js";var O=/* @__PURE__ */ e({CATALOG_MARKER:()=>n,CATALOG_PACKAGE_MANAGERS:()=>r,DEFAULT_PACKAGE_MANAGER_VERSIONS:()=>t,GENERATED_CONFIG_FILENAME:()=>w,SCAFFOLD_CATALOG:()=>u,catalogFileFor:()=>i,catalogsSyncTask:()=>a,createMonorepoRootFiles:()=>d,createRootProjectFiles:()=>f,createWorkspaceFiles:()=>p,findRootOxcFiles:()=>m,generateProjectConfigs:()=>T,hasCatalog:()=>o,projectCommands:()=>E,projectSyncTask:()=>D,renderApplicationEntry:()=>h,renderApplicationHtml:()=>g,renderGitignore:()=>_,renderPnpmWorkspace:()=>s,renderSourceEntry:()=>v,renderSourceTest:()=>y,renderToolchainConfig:()=>b,renderWorkspaceTsconfig:()=>x,renderYarnrc:()=>c,supportsCatalogs:()=>l,upsertWorkspaceTsconfig:()=>S,writeGeneratedFiles:()=>C});export{n as CATALOG_MARKER,r as CATALOG_PACKAGE_MANAGERS,t as DEFAULT_PACKAGE_MANAGER_VERSIONS,w as GENERATED_CONFIG_FILENAME,u as SCAFFOLD_CATALOG,i as catalogFileFor,a as catalogsSyncTask,d as createMonorepoRootFiles,f as createRootProjectFiles,p as createWorkspaceFiles,m as findRootOxcFiles,T as generateProjectConfigs,o as hasCatalog,E as projectCommands,D as projectSyncTask,h as renderApplicationEntry,g as renderApplicationHtml,_ as renderGitignore,s as renderPnpmWorkspace,v as renderSourceEntry,y as renderSourceTest,b as renderToolchainConfig,x as renderWorkspaceTsconfig,c as renderYarnrc,O as src_exports,l as supportsCatalogs,S as upsertWorkspaceTsconfig,C as writeGeneratedFiles};
@@ -1 +1 @@
1
- import{default as e}from"node:path";import"node:url";import.meta.url;import{readJsonAt as t}from"../../shared/src/fs-utils.js";import{projectToPackageJson as n,splitPackageName as r}from"../../shared/src/project.js";import"../../shared/src/index.js";import i from"node:fs";function a(t){let n=e.resolve(t);for(;;){if(i.existsSync(e.join(n,`.git`)))return n;let t=e.dirname(n);if(t===n)return;n=t}}function o(){return{name:`project`,enabled:e=>e.project!==void 0,run:i=>{let o=i.config.project;if(!o)return[];let s=t(i.cwd,`package.json`);if(!s)return[];let c=a(i.cwd),l=c&&e.resolve(c)!==e.resolve(i.cwd)?e.relative(c,i.cwd).replace(/\\/g,`/`):void 0,u={...o};if(u.name!==void 0&&u.scope===void 0&&s.name){let{scope:e}=r(s.name);e&&(u.scope=e)}let d=n(u,l?{directory:l}:{});if(Object.keys(d).length===0)return[];let f={...s,...d};return[{path:`package.json`,content:`${JSON.stringify(f,null,4)}\n`}]}}}export{o as projectSyncTask};
1
+ import{default as e}from"node:path";import"node:url";import.meta.url;import{readJsonAt as t}from"../../shared/src/fs-utils.js";import{projectToPackageJson as n,splitPackageName as r}from"../../shared/src/project.js";import"../../shared/src/index.js";import i from"node:fs";function a(t){let n=e.resolve(t);for(;;){if(i.existsSync(e.join(n,`.git`)))return n;let t=e.dirname(n);if(t===n)return;n=t}}function o(){return{name:`project`,enabled:e=>e.project!==void 0,run:i=>{let o=i.config.project;if(!o)return[];let s=t(i.cwd,`package.json`);if(!s)return[];let c=a(i.cwd),l=c&&e.resolve(c)!==e.resolve(i.cwd)?e.relative(c,i.cwd).replace(/\\/g,`/`):void 0,u={...o};if(u.name!==void 0&&u.scope===void 0&&s.name){let{scope:e}=r(s.name);e&&(u.scope=e)}let d=n(u,l?{directory:l}:{});if(Object.keys(d).length===0)return[];let f={...s,...d};return[{path:`package.json`,content:`${JSON.stringify(f,null,4)}\n`,track:!1}]}}}export{o as projectSyncTask};
@@ -1,42 +1,75 @@
1
1
  import __tsdown_shims_path from 'node:path';
2
2
  import __tsdown_shims_url from 'node:url';
3
3
  import { ProjectType } from "../../shared/src/config-types.js";
4
+ import { DEFAULT_PACKAGE_MANAGER_VERSIONS } from "../../shared/src/toolchain.js";
4
5
  import { GeneratedFile } from "../../shared/src/types.js";
5
6
  import "../../shared/src/index.js";
6
- import { MonorepoWorkspace } from "../../tsconfig/src/templates.js";
7
+ import { MonorepoWorkspace, TsconfigExtendsOptions } from "../../tsconfig/src/templates.js";
7
8
  import "../../tsconfig/src/index.js";
8
9
  //#region packages/project/src/typescript.d.ts
9
10
  /** The catalog a scaffolded root writes into its package-manager file. */
10
11
  export declare const SCAFFOLD_CATALOG: Record<string, string>;
11
- /**
12
- * Default package-manager versions used when a scaffold does not specify one.
13
- * A `packageManager` field must carry a version (corepack rejects a bare name),
14
- * so the scaffold always writes `<pm>@<version>`.
15
- */
16
- export declare const DEFAULT_PACKAGE_MANAGER_VERSIONS: Record<string, string>;
17
12
  /** The replacement values a project scaffold understands. */
18
13
  export interface ProjectContext {
19
14
  /** The project/package name (unscoped). */
20
15
  name: string;
21
16
  /** The npm scope, eg. `@acme`. */
22
17
  scope?: string;
18
+ /** Package description. */
19
+ description?: string;
23
20
  /** Package author. */
24
21
  author?: string;
25
22
  /** SPDX license id. */
26
23
  license?: string;
24
+ /** Project homepage. */
25
+ homepage?: string;
27
26
  /** Repository URL. */
27
+ repo?: string;
28
+ /** Repository URL (legacy alias for {@link repo}). */
28
29
  repoUrl?: string;
29
30
  /** Node engine range. */
30
31
  nodeVersion?: string;
31
- /** Yarn version. */
32
+ /** Package manager version. */
33
+ packageManagerVersion?: string;
34
+ /** Yarn version (legacy alias for {@link packageManagerVersion}). */
32
35
  yarnVersion?: string;
33
36
  /** Package manager name. */
34
37
  packageManager?: string;
35
38
  /** The project kind written into the scaffolded `dbx.config.ts`. */
36
39
  type?: ProjectType;
40
+ /** The scaffold flavour (an application gets Vite entry files/scripts). */
41
+ kind?: 'project' | 'application';
42
+ /** Write `fmt.oxc` / `lint.oxc` defaults (and the Oxc config files). */
43
+ oxc?: boolean;
44
+ /**
45
+ * Oxc config files already present above the scaffold root. The matching
46
+ * local file + `dbx.config.ts` opt-in are omitted so the root owns them.
47
+ */
48
+ rootOxc?: RootOxcFiles;
37
49
  /** Write a `dbx.config.ts` (default true). */
38
50
  includeConfig?: boolean;
51
+ /** Per-file `extends` overrides for the scaffolded tsconfig templates. */
52
+ tsconfigExtends?: TsconfigExtendsOptions;
53
+ }
54
+ /** Oxc config files found in an ancestor of a scaffold output directory. */
55
+ export interface RootOxcFiles {
56
+ fmt: boolean;
57
+ lint: boolean;
39
58
  }
59
+ /**
60
+ * Find the nearest ancestor that owns Oxc config files. The walk stops at the
61
+ * repository boundary (`.git`) so a nested project cannot inherit files from an
62
+ * unrelated checkout above it.
63
+ */
64
+ export declare function findRootOxcFiles(start: string): RootOxcFiles;
65
+ /** A minimal source entry so `tsdown` has an input and the scaffold builds. */
66
+ export declare function renderSourceEntry(): string;
67
+ /** The Vite entry point for an application scaffold. */
68
+ export declare function renderApplicationEntry(): string;
69
+ /** The `index.html` for an application scaffold. */
70
+ export declare function renderApplicationHtml(name: string): string;
71
+ /** A smoke test paired with {@link renderSourceEntry}. */
72
+ export declare function renderSourceTest(): string;
40
73
  /**
41
74
  * Render a `dbx.config.ts` scaffold (toolchain settings under `toolchain`). The
42
75
  * `project.type` lets the sync know whether the folder is a monorepo root, a
@@ -44,9 +77,11 @@ export interface ProjectContext {
44
77
  */
45
78
  export declare function renderToolchainConfig(ctx: ProjectContext & {
46
79
  type: ProjectType;
80
+ fmtOxc?: boolean;
81
+ lintOxc?: boolean;
47
82
  }): string;
48
83
  /** A minimal tsconfig.json that extends the default template. */
49
- export declare function renderWorkspaceTsconfig(composite?: boolean): string;
84
+ export declare function renderWorkspaceTsconfig(composite?: boolean, extendsValue?: string | string[] | false): string;
50
85
  /** Files for a single-package TypeScript project (tsconfig + tooling). */
51
86
  export declare function createRootProjectFiles(ctx: ProjectContext): GeneratedFile[];
52
87
  export interface MonorepoRootContext extends ProjectContext {
@@ -57,6 +92,13 @@ export interface MonorepoRootContext extends ProjectContext {
57
92
  }
58
93
  /** Files for a monorepo root (workspaces + monorepo tsconfig). */
59
94
  export declare function createMonorepoRootFiles(ctx: MonorepoRootContext): GeneratedFile[];
95
+ /**
96
+ * Add (or refresh) a workspace in a monorepo root's workspaces tsconfig.
97
+ * Keeps the existing file (including comments and formatting) and just upserts
98
+ * the aliases and project reference. Returns `false` when the configured file
99
+ * is absent.
100
+ */
101
+ export declare function upsertWorkspaceTsconfig(root: string, workspace: MonorepoWorkspace, scope: string | undefined, rootFile?: string): boolean;
60
102
  export interface WorkspaceContext extends ProjectContext {
61
103
  /** The workspace name (unscoped), eg. `core`. */
62
104
  wsName: string;
@@ -69,6 +111,16 @@ export interface WorkspaceContext extends ProjectContext {
69
111
  export declare function createWorkspaceFiles(ctx: WorkspaceContext): GeneratedFile[];
70
112
  /** A generic `.gitignore`. */
71
113
  export declare function renderGitignore(): string;
72
- /** Write generated files under `cwd`, creating directories as needed. */
73
- export declare function writeGeneratedFiles(files: GeneratedFile[], cwd?: string): string[];
74
- //#endregion
114
+ export interface WriteGeneratedFilesOptions {
115
+ /** Overwrite files that already exist (default false). */
116
+ force?: boolean;
117
+ }
118
+ /**
119
+ * Write generated files under `cwd`, creating directories as needed. A target
120
+ * outside `cwd` is rejected, and an existing file is never overwritten unless
121
+ * `force` is set, so a scaffold cannot escape its output directory or silently
122
+ * clobber a user's files.
123
+ */
124
+ export declare function writeGeneratedFiles(files: GeneratedFile[], cwd?: string, options?: WriteGeneratedFilesOptions): string[];
125
+ //#endregion
126
+ export { DEFAULT_PACKAGE_MANAGER_VERSIONS };
@@ -1,20 +1,25 @@
1
- import{default as e}from"node:path";import"node:url";import.meta.url;import{renderBiomeJson as t}from"../../biome/src/index.js";import{renderPnpmWorkspace as n,renderYarnrc as r,supportsCatalogs as i}from"./catalogs.js";import{renderMonorepoTsconfig as a,renderTsconfigBase as o,renderTsconfigBuild as s,renderTsconfigDefault as c}from"../../tsconfig/src/templates.js";import"../../tsconfig/src/index.js";import{version as l}from"../../../package.js";import u from"node:fs";const d={"@biomejs/biome":`^2.5.13`,"@deltabox/toolchain":`^${l}`,tsdown:`^0.23.0`,typescript:`^6.0.3`,vitest:`^5.0.0`},f=d,p={yarn:`4.17.1`,pnpm:`10.11.1`,npm:`11.19.0`,bun:`1.3.0`};function m(e,t){if(!e)return;let n=t??p[e];return n?`${e}@${n}`:e}function h(e,t){return t?Object.fromEntries(Object.keys(d).map(e=>[e,`catalog:`])):{...d}}function g(e,t){let n=e??`yarn`;return i(n)?n!==`bun`||t:!1}function _(e,t){switch(e??`yarn`){case`yarn`:return[{path:`.yarnrc.yml`,content:r({packages:d})}];case`pnpm`:return[{path:`pnpm-workspace.yaml`,content:n({packages:d},t?[`packages/*`]:void 0)}];default:return[]}}function v(e,t){return(e??`yarn`)===`bun`?{packages:t,catalog:d}:t}function y(e){return{...e}}const b=(e,t=4)=>`${JSON.stringify(e,null,t)}\n`;function x(e){let t=[[`type`,e.type],[`name`,e.name]];e.scope&&t.push([`scope`,e.scope]),e.author&&t.push([`author`,e.author]),e.license&&t.push([`license`,e.license]),e.repoUrl&&t.push([`repo`,e.repoUrl]),t.push([`nodeVersion`,e.nodeVersion??`22`]);let n=e.packageManager??`yarn`;t.push([`packageManager`,n]);let r=e.yarnVersion??p[n];return r&&t.push([`packageManagerVersion`,r]),`import { defineConfig } from '@deltabox/toolchain';
1
+ import{default as e}from"node:path";import"node:url";import.meta.url;import{projectToPackageJson as t}from"../../shared/src/project.js";import{DEFAULT_PACKAGE_MANAGER_VERSIONS as n}from"../../shared/src/toolchain.js";import{DEFAULT_FMT_RULES as r,DEFAULT_LINT_RULES as i}from"../../shared/src/vite-defaults.js";import"../../shared/src/index.js";import{renderPnpmWorkspace as a,renderYarnrc as o,supportsCatalogs as s}from"./catalogs.js";import{parseTsconfig as c}from"../../tsconfig/src/resolve.js";import{renderMonorepoTsconfig as l,renderTsconfigBase as u,renderTsconfigBuild as d,renderTsconfigDefault as f}from"../../tsconfig/src/templates.js";import"../../tsconfig/src/index.js";import{version as p}from"../../../package.js";import m from"node:fs";import{applyEdits as h,modify as g}from"jsonc-parser";const _={"@deltabox/toolchain":`^${p}`,"@types/node":`^22.10.2`,tsdown:`^0.23.0`,typescript:`^6.0.3`,vite:`^8.3.0`,"vite-plus":`^1.2.0`,vitest:`^5.0.0`},v=_;function y(e,t){if(!e)return;let r=t??n[e];return r?`${e}@${r}`:e}function b(e,t,n=[]){let r=Object.entries(_).filter(([e])=>!n.includes(e));return Object.fromEntries(t?r.map(([e])=>[e,`catalog:`]):r)}function x(e,t){let n=e??`yarn`;return s(n)?n!==`bun`||t:!1}function S(e,t,n=[]){let r=Object.fromEntries(Object.entries(_).filter(([e])=>!n.includes(e)));switch(e??`yarn`){case`yarn`:return[{path:`.yarnrc.yml`,content:o({packages:r})}];case`pnpm`:return[{path:`pnpm-workspace.yaml`,content:a({packages:r},t?[`packages/*`]:void 0)}];default:return[]}}function C(e,t){return(e??`yarn`)===`bun`?{packages:t,catalog:_}:t}function w(t){let n=e.resolve(t);if(m.existsSync(e.join(n,`.git`)))return{fmt:!1,lint:!1};let r=e.dirname(n);for(;;){let t=m.existsSync(e.join(r,`.oxfmtrc.json`)),n=m.existsSync(e.join(r,`.oxlintrc.json`));if(t||n)return{fmt:t,lint:n};if(m.existsSync(e.join(r,`.git`)))break;let i=e.dirname(r);if(i===r)break;r=i}return{fmt:!1,lint:!1}}function T(e){let{tsconfigExtends:t,rootOxc:n,...r}=e;return r}function E(e){let n=e.repo??e.repoUrl;return t({...e.description?{description:e.description}:{},...e.author?{author:e.author}:{},...e.license?{license:e.license}:{},...e.homepage?{homepage:e.homepage}:{},...n?{repo:n}:{}})}const D=(e,t=4)=>`${JSON.stringify(e,null,t)}\n`;function O(e){return`'${e.replace(/\\/g,`\\\\`).replace(/'/g,`\\'`).replace(/[\u0000-\u001f\u007f\u2028\u2029]/g,e=>`\\u${e.charCodeAt(0).toString(16).padStart(4,`0`)}`)}'`}function k(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}const A=`./node_modules/oxfmt/configuration_schema.json`,j=`./node_modules/oxlint/configuration_schema.json`;function M(e,t){return`${JSON.stringify({$schema:e,...t},null,4)}\n`}function N(){return[`export function greet(who = 'world'): string {`," return `Hello, ${who}!`;",`}`,``].join(`
2
+ `)}function P(){return[`import { greet } from './index.js';`,``,`const app = document.querySelector<HTMLDivElement>('#app');`,`if (app) app.textContent = greet('world');`,``].join(`
3
+ `)}function F(e){return[`<!doctype html>`,`<html lang="en">`,` <head>`,` <meta charset="UTF-8" />`,` <meta name="viewport" content="width=device-width, initial-scale=1.0" />`,` <title>${k(e)}</title>`,` </head>`,` <body>`,` <div id="app"></div>`,` <script type="module" src="/src/main.ts"><\/script>`,` </body>`,`</html>`,``].join(`
4
+ `)}function I(){return[`import { describe, expect, it } from 'vitest';`,``,`import { greet } from '../src/index.js';`,``,`describe('greet', () => {`,` it('greets the world by default', () => {`,` expect(greet()).toBe('Hello, world!');`,` });`,`});`,``].join(`
5
+ `)}function L(e){let t=[[`type`,e.type],[`name`,e.name]];e.scope&&t.push([`scope`,e.scope]),e.description&&t.push([`description`,e.description]),e.author&&t.push([`author`,e.author]),e.license&&t.push([`license`,e.license]),e.homepage&&t.push([`homepage`,e.homepage]);let r=e.repo??e.repoUrl;r&&t.push([`repo`,r]),t.push([`nodeVersion`,e.nodeVersion??`22`]);let i=e.packageManager??`yarn`;t.push([`packageManager`,i]);let a=e.packageManagerVersion??e.yarnVersion??n[i];a&&t.push([`packageManagerVersion`,a]);let o=t.map(([e,t])=>` ${e}: ${O(t)},`).join(`
6
+ `),s=e.fmtOxc??e.oxc===!0,c=e.lintOxc??e.oxc===!0;return`import { defineConfig } from '@deltabox/toolchain';
2
7
 
3
8
  export default defineConfig({
4
9
  toolchain: {
5
- project: {
6
- ${t.map(([e,t])=>` ${e}: ${JSON.stringify(t)},`).join(`
10
+ ${[` project: {\n${o}\n },`,...s?[` fmt: { oxc: true },`]:[],...c?[` lint: { oxc: true },`]:[]].join(`
7
11
  `)}
8
- },
9
12
  },
10
13
  });
11
- `}function S(e=!1){return b({extends:`./tsconfig.default.json`,compilerOptions:{composite:e}})}function C(e){let n={name:e.scope?`${e.scope}/${e.name}`:e.name,version:`0.1.0`,private:!0,type:`module`,description:``,...e.author?{author:e.author}:{},...e.license?{license:e.license}:{},scripts:{build:`tsdown`,format:`biome format --write .`,lint:`biome check --fix .`,test:`vitest run`,typecheck:`tsc -p tsconfig.json --noEmit`},devDependencies:h(e.packageManager,g(e.packageManager,!1)),...m(e.packageManager,e.yarnVersion)?{packageManager:m(e.packageManager,e.yarnVersion)}:{},engines:{node:e.nodeVersion?`>=${e.nodeVersion}`:`>=22`}};return[...e.includeConfig===!1?[]:[{path:`dbx.config.ts`,content:x({...e,type:e.type??`project`})}],{path:`package.json`,content:b(n)},{path:`tsconfig.base.json`,content:o(y(e))},{path:`tsconfig.default.json`,content:c(y(e))},{path:`tsconfig.build.json`,content:s(y(e))},{path:`tsconfig.json`,content:S()},{path:`biome.json`,content:t(y(e))},{path:`.gitignore`,content:E()},{path:`README.md`,content:`# ${e.name}\n`},..._(e.packageManager,!1)]}function w(e){let n={name:e.name,version:`0.1.0`,private:!0,type:`module`,...e.author?{author:e.author}:{},...e.license?{license:e.license}:{},workspaces:v(e.packageManager,e.workspaceGlobs??[`packages/*`]),devDependencies:h(e.packageManager,g(e.packageManager,!0)),...m(e.packageManager,e.yarnVersion)?{packageManager:m(e.packageManager,e.yarnVersion)}:{},engines:{node:e.nodeVersion?`>=${e.nodeVersion}`:`>=22`}};return[...e.includeConfig===!1?[]:[{path:`dbx.config.ts`,content:x({...e,type:e.type??`monorepo-root`})}],{path:`package.json`,content:b(n)},{path:`tsconfig.base.json`,content:o(y(e))},{path:`tsconfig.workspaces.json`,content:a({scope:e.scope??e.name,workspaces:e.workspaces})},{path:`biome.json`,content:t(y(e))},{path:`.gitignore`,content:E()},{path:`README.md`,content:`# ${e.name}\n`},..._(e.packageManager,!0)]}function T(e){let t=e.useCatalog?h(e.packageManager,!0):{...d},n={name:e.scope?`${e.scope}/${e.wsName}`:e.wsName,version:`0.1.0`,type:`module`,files:[`dist`],scripts:{build:`tsdown`,format:`biome format --write .`,lint:`biome check --fix .`,test:`vitest run`,typecheck:`tsc -p tsconfig.build.json --noEmit`},devDependencies:t,publishConfig:{access:`public`,provenance:!0}},r=e.wsDir.split(`/`).length;return[...e.includeConfig===!1?[]:[{path:`dbx.config.ts`,content:x({...e,type:e.type??`monorepo-workspace`})}],{path:`package.json`,content:b(n)},{path:`tsconfig.default.json`,content:b({extends:`${`../`.repeat(r)}tsconfig.base.json`,compilerOptions:{module:`NodeNext`,moduleResolution:`NodeNext`,types:[`node`]},include:[`src`,`tests`,`tsdown.config.ts`,`vitest.config.ts`]})},{path:`tsconfig.build.json`,content:S()},{path:`tsconfig.json`,content:S()},{path:`tsdown.config.ts`,content:`import { defineConfig } from 'tsdown';
14
+ `}function R(e=!1,t=`./tsconfig.default.json`){return D({...t===!1?{}:{extends:t},compilerOptions:{composite:e}})}function z(e){let t=e.kind===`application`,n=e.oxc!==!1&&e.includeConfig!==!1,a=n&&e.rootOxc?.fmt!==!0,o=n&&e.rootOxc?.lint!==!0,s={name:e.scope?`${e.scope}/${e.name}`:e.name,version:`0.1.0`,private:!0,type:`module`,...E(e),scripts:t?{dev:`vite`,build:`vite build`,preview:`vite preview`,format:`dbx fmt`,lint:`dbx lint --fix`,test:`vitest run`,typecheck:`tsc -p tsconfig.json --noEmit`}:{build:`tsdown`,format:`dbx fmt`,lint:`dbx lint --fix`,test:`vitest run`,typecheck:`tsc -p tsconfig.json --noEmit`},devDependencies:b(e.packageManager,x(e.packageManager,!1),t?[`tsdown`]:[]),...y(e.packageManager,e.packageManagerVersion??e.yarnVersion)?{packageManager:y(e.packageManager,e.packageManagerVersion??e.yarnVersion)}:{},engines:{node:e.nodeVersion?`>=${e.nodeVersion}`:`>=22`}};return[...e.includeConfig===!1?[]:[{path:`dbx.config.ts`,content:L({...e,type:e.type??`project`,fmtOxc:a,lintOxc:o})}],{path:`package.json`,content:D(s)},...t?[{path:`index.html`,content:F(e.name)},{path:`src/main.ts`,content:P()}]:[],{path:`src/index.ts`,content:N()},{path:`tests/index.test.ts`,content:I()},{path:`tsconfig.base.json`,content:u(T(e),e.tsconfigExtends?.base)},{path:`tsconfig.default.json`,content:f(T(e),e.tsconfigExtends?.default)},{path:`tsconfig.build.json`,content:d(T(e),e.tsconfigExtends?.build)},{path:`tsconfig.json`,content:R()},...a?[{path:`.oxfmtrc.json`,content:M(A,r)}]:[],...o?[{path:`.oxlintrc.json`,content:M(j,i)}]:[],{path:`.gitignore`,content:G()},{path:`README.md`,content:`# ${e.name}\n`},...S(e.packageManager,!1,t?[`tsdown`]:[])]}function B(e){let t=e.oxc!==!1&&e.includeConfig!==!1,n={name:e.name,version:`0.1.0`,private:!0,type:`module`,...E(e),scripts:{build:`dbx run --filter "./packages/*" build`,test:`dbx run --filter "./packages/*" test`,typecheck:`dbx run --filter "./packages/*" typecheck`,format:`dbx fmt`,lint:`dbx lint --fix`},workspaces:C(e.packageManager,e.workspaceGlobs??[`packages/*`]),devDependencies:b(e.packageManager,x(e.packageManager,!0)),...y(e.packageManager,e.packageManagerVersion??e.yarnVersion)?{packageManager:y(e.packageManager,e.packageManagerVersion??e.yarnVersion)}:{},engines:{node:e.nodeVersion?`>=${e.nodeVersion}`:`>=22`}};return[...e.includeConfig===!1?[]:[{path:`dbx.config.ts`,content:L({...e,type:e.type??`monorepo-root`,oxc:t})}],{path:`package.json`,content:D(n)},{path:`tsconfig.base.json`,content:u(T(e),e.tsconfigExtends?.base)},{path:`tsconfig.workspaces.json`,content:l({scope:e.scope??e.name,workspaces:e.workspaces})},{path:`tsconfig.json`,content:D({extends:`./tsconfig.workspaces.json`,compilerOptions:{composite:!1},files:[]})},...t?[{path:`.oxfmtrc.json`,content:M(A,r)},{path:`.oxlintrc.json`,content:M(j,i)}]:[],{path:`.gitignore`,content:G()},{path:`README.md`,content:`# ${e.name}\n`},...S(e.packageManager,!0)]}function V(t){let n=t.replace(/\\/g,`/`).replace(/^\.?\//,``).replace(/\/+$/,``);if(!n||e.isAbsolute(t)||/^[a-zA-Z]:/.test(t)||n.split(`/`).includes(`..`))throw Error(`invalid workspace directory "${t}" (must be relative to the root).`);return n}function H(e){let t=e.match(/^([ \t]+)\S/m)?.[1]??` `,n=!t.includes(` `);return{insertSpaces:n,tabSize:n?t.length:1}}function U(t,n,r,i=`tsconfig.workspaces.json`){let a=V(n.dir),o=e.resolve(t,i);if(!m.existsSync(o))return!1;let s=m.readFileSync(o,`utf-8`),l;try{l=c(s)}catch{return!1}let u=Array.isArray(l.references)?l.references:void 0,d=l.compilerOptions&&typeof l.compilerOptions==`object`?l.compilerOptions:{},f=/* @__PURE__ */ new Set,p=/* @__PURE__ */ new Map;if(r){let e=d.paths&&typeof d.paths==`object`?d.paths:{};for(let t of[`${r}/${n.alias}`,`${r}/${n.alias}/*`]){let n=e[t],r=Array.isArray(n)?n[0]:void 0,i=typeof r==`string`?r.match(/^\.\/(.+)\/src\/(?:index\.ts|\*)$/):void 0;i?.[1]&&f.add(i[1]);let o=[t.endsWith(`/*`)?`./${a}/src/*`:`./${a}/src/index.ts`];e[t]=o,p.set(t,o)}d.paths=e}l.compilerOptions=d;let _=`./${a}/tsconfig.json`,v=new Set([...f].filter(e=>e!==a).map(e=>`./${e}/tsconfig.json`)),y=(Array.isArray(l.references)?l.references:[]).filter(e=>!v.has(e.path));y.some(e=>e.path===_)||y.push({path:_}),l.references=y;try{let e=H(s),t=s;for(let[n,r]of p)t=h(t,g(t,[`compilerOptions`,`paths`,n],r,{formattingOptions:e}));let n=u??[],r=n.findIndex(e=>e.path===_),i=n.map((e,t)=>typeof e.path==`string`&&v.has(e.path)?t:-1).filter(e=>e>=0);if(i.length>0){r===-1&&(t=h(t,g(t,[`references`,i[0],`path`],_,{formattingOptions:e})));for(let n of i.filter((e,t)=>r!==-1||t>0).sort((e,t)=>t-e))t=h(t,g(t,[`references`,n],void 0,{formattingOptions:e}))}else r===-1&&(t=u===void 0?h(t,g(t,[`references`],[{path:_}],{formattingOptions:e})):h(t,g(t,[`references`,n.length],{path:_},{formattingOptions:e})));m.writeFileSync(o,t,`utf-8`)}catch{m.writeFileSync(o,`${JSON.stringify(l,null,4)}\n`,`utf-8`)}return!0}function W(e){let t=e.useCatalog===!0&&x(e.packageManager,!0)?b(e.packageManager,!0):{..._},n={name:e.scope?`${e.scope}/${e.wsName}`:e.wsName,version:`0.1.0`,type:`module`,...E(e),main:`./dist/index.js`,module:`./dist/index.js`,types:`./dist/index.d.ts`,exports:{".":{types:`./dist/index.d.ts`,import:`./dist/index.js`},"./package.json":`./package.json`},sideEffects:!1,files:[`dist`],scripts:{build:`tsdown`,format:`dbx fmt`,lint:`dbx lint --fix`,test:`vitest run`,typecheck:`tsc -p tsconfig.build.json --noEmit`},devDependencies:t,...e.nodeVersion?{engines:{node:`>=${e.nodeVersion}`}}:{},publishConfig:{access:`public`,provenance:!0}},r=e.wsDir.split(`/`).length;return[...e.includeConfig===!1?[]:[{path:`dbx.config.ts`,content:L({...e,name:e.wsName,type:e.type??`monorepo-workspace`})}],{path:`package.json`,content:D(n)},{path:`src/index.ts`,content:N()},{path:`tests/index.test.ts`,content:I()},{path:`tsconfig.default.json`,content:D({...e.tsconfigExtends?.default===!1?{}:{extends:e.tsconfigExtends?.default??`${`../`.repeat(r)}tsconfig.base.json`},compilerOptions:{module:`NodeNext`,moduleResolution:`NodeNext`,types:[`node`]},include:[`src`,`tests`,`tsdown.config.ts`,`vitest.config.ts`]})},{path:`tsconfig.build.json`,content:R(!1,e.tsconfigExtends?.build)},{path:`tsconfig.json`,content:R()},{path:`tsdown.config.ts`,content:`import { defineConfig } from 'tsdown';
12
15
 
13
16
  import { baseTsdownConfig } from '@deltabox/toolchain/tsdown';
14
17
 
15
18
  export default defineConfig({
16
19
  ...baseTsdownConfig,
17
20
  entry: { index: 'src/index.ts' },
21
+ // Keep the explicit package.json exports (types + import conditions).
22
+ exports: false,
18
23
  });
19
- `}]}function E(){return[`node_modules/`,`dist/`,`coverage/`,`.turbo/`,`*.tsbuildinfo`,``,`.env`,`.env.*`,`!.env.example`,`!.env.example.*`,``,`.DS_Store`,``,`# Yarn 4`,`.pnp.*`,`.yarn/*`,`!.yarn/patches`,`!.yarn/plugins`,`!.yarn/releases`,`!.yarn/sdks`,`!.yarn/versions`,``].join(`
20
- `)}function D(t,n=process.cwd()){let r=[];for(let i of t){let t=e.resolve(n,i.path);u.mkdirSync(e.dirname(t),{recursive:!0}),u.writeFileSync(t,i.content,`utf-8`),r.push(t)}return r}export{p as DEFAULT_PACKAGE_MANAGER_VERSIONS,f as SCAFFOLD_CATALOG,w as createMonorepoRootFiles,C as createRootProjectFiles,T as createWorkspaceFiles,E as renderGitignore,x as renderToolchainConfig,S as renderWorkspaceTsconfig,D as writeGeneratedFiles};
24
+ `}]}function G(){return(/* @__PURE__ */ `node_modules/,dist/,coverage/,.vite/,*.tsbuildinfo,,.env,.env.*,!.env.example,!.env.example.*,,.DS_Store,,# Toolchain state; only the manifest is committed,.dbx/toolchain/*,!.dbx/toolchain/manifest.json,,# Yarn 4,.pnp.*,.yarn/*,!.yarn/patches,!.yarn/plugins,!.yarn/releases,!.yarn/sdks,!.yarn/versions,`.split(`,`)).join(`
25
+ `)}function K(t,n){let r=process.platform===`win32`?t.toLowerCase():t,i=process.platform===`win32`?n.toLowerCase():n;return i===r||i.startsWith(`${r}${e.sep}`)}function q(t,n=process.cwd(),r={}){let i=e.resolve(n),a=t.map(t=>e.resolve(i,t.path)),o=/* @__PURE__ */ new Map;for(let t of a){if(!K(i,t))throw Error(`refusing to write outside ${i}: ${t}`);let n=process.platform===`win32`?t.toLowerCase():t,r=o.get(n);if(r!==void 0)throw Error(`refusing to write duplicate file(s): ${r} and ${e.relative(i,t)}`);o.set(n,e.relative(i,t))}if(r.force!==!0){let t=a.filter(e=>m.existsSync(e));if(t.length>0)throw Error(`refusing to overwrite existing file(s): ${t.map(t=>e.relative(i,t)).join(`, `)} (use --force to overwrite).`)}let s=[];for(let[n,r]of a.entries())m.mkdirSync(e.dirname(r),{recursive:!0}),m.writeFileSync(r,t[n].content,`utf-8`),s.push(r);return s}export{n as DEFAULT_PACKAGE_MANAGER_VERSIONS,v as SCAFFOLD_CATALOG,B as createMonorepoRootFiles,z as createRootProjectFiles,W as createWorkspaceFiles,w as findRootOxcFiles,P as renderApplicationEntry,F as renderApplicationHtml,G as renderGitignore,N as renderSourceEntry,I as renderSourceTest,L as renderToolchainConfig,R as renderWorkspaceTsconfig,U as upsertWorkspaceTsconfig,q as writeGeneratedFiles};
@@ -0,0 +1,59 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ //#region packages/shared/src/changelog-groups.d.ts
4
+ /**
5
+ * Typed `changelog.groups` configuration. The runtime implementation lives in
6
+ * `@deltabox/toolchain-changelog`; these shapes are shared so `dbx.config.*`
7
+ * gets callback-aware types without a package cycle.
8
+ */
9
+ /** The subset of a grouped changelog item exposed to callbacks. */
10
+ export interface ChangelogGroupItem {
11
+ parsed: {
12
+ type: string;
13
+ scope?: string;
14
+ breaking: boolean;
15
+ rest: string;
16
+ };
17
+ text: string;
18
+ bodyParagraphs: string[][];
19
+ }
20
+ /** Context passed to the whole `groups` callback. */
21
+ export interface ChangelogGroupsContext {
22
+ /** The CC types present in the current changelog. */
23
+ types: string[];
24
+ /** Every item being grouped. */
25
+ items: ChangelogGroupItem[];
26
+ }
27
+ /** Context passed to a per-group title/order/hidden callback. */
28
+ export interface ChangelogGroupContext extends ChangelogGroupsContext {
29
+ /** The CC type of this group. */
30
+ type: string;
31
+ /** The built-in title for this type. */
32
+ defaultTitle: string;
33
+ /** The group's position in the configured/default order. */
34
+ index: number;
35
+ /** The items in this group. */
36
+ groupItems: ChangelogGroupItem[];
37
+ }
38
+ export type ChangelogGroupTitle = string | ((ctx: ChangelogGroupContext) => string);
39
+ export type ChangelogGroupOrder = number | ((ctx: ChangelogGroupContext) => number);
40
+ export type ChangelogGroupHidden = boolean | ((ctx: ChangelogGroupContext) => boolean);
41
+ /** One group entry: a CC type, or its type + custom presentation. */
42
+ export interface ChangelogGroupConfig {
43
+ /** The CC type (required for object entries in an array). */
44
+ type?: string;
45
+ /** Custom heading title. */
46
+ title?: ChangelogGroupTitle;
47
+ /** Sort position; lower comes first. */
48
+ order?: ChangelogGroupOrder;
49
+ /** Omit this group from the rendered changelog. */
50
+ hidden?: ChangelogGroupHidden;
51
+ }
52
+ export type ChangelogGroupEntry = string | ChangelogGroupConfig;
53
+ /**
54
+ * The `changelog.groups` setting. An array sets the order (and optionally
55
+ * titles), a record maps CC types to titles/options in key order, and a callback
56
+ * computes either form from the types/items in the current run.
57
+ */
58
+ export type ChangelogGroupsSetting = ChangelogGroupEntry[] | Record<string, string | ChangelogGroupConfig | boolean> | ((ctx: ChangelogGroupsContext) => ChangelogGroupsSetting);
59
+ //#endregion
@@ -0,0 +1,10 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { z } from "zod";
4
+ //#region packages/shared/src/config-schema/biome.d.ts
5
+ /** Biome config generation (for consumers that still want a `biome.json`). */
6
+ export declare const biomeConfigSchema: z.ZodObject<{
7
+ vscode: z.ZodOptional<z.ZodBoolean>;
8
+ overrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
9
+ }, z.core.$strip>;
10
+ //#endregion
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;import{withEnabled as e}from"./meta.js";import{z as t}from"zod";const n=e(t.object({vscode:t.boolean().describe(`Write the Biome VS Code settings (default true).`).optional(),overrides:t.record(t.string(),t.unknown()).describe("Deep-merged over the generated `biome.json` (arrays union).").optional()})).describe("Biome config generation (for consumers that still want a `biome.json`).").meta({id:`ToolchainBiomeConfig`,deprecated:!0,deprecationMessage:"use `toolchain.fmt.biome` / `toolchain.lint.biome`. Still writes `biome.json`."});export{n as biomeConfigSchema};
@@ -0,0 +1,14 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { z } from "zod";
4
+ //#region packages/shared/src/config-schema/catalogs.d.ts
5
+ /**
6
+ * Package catalogs: a shared `package -> version range` map written to the
7
+ * package manager's catalog file (`.yarnrc.yml` for Yarn, `pnpm-workspace.yaml`
8
+ * for pnpm) so dependencies can be declared with `catalog:`.
9
+ */
10
+ export declare const catalogsConfigSchema: z.ZodObject<{
11
+ packages: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
12
+ named: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
13
+ }, z.core.$strip>;
14
+ //#endregion
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;import{withEnabled as e}from"./meta.js";import{z as t}from"zod";const n=e(t.object({packages:t.record(t.string(),t.string()).describe(`The default catalog: package name -> version range.`).optional(),named:t.record(t.string(),t.record(t.string(),t.string())).describe("Named catalogs (Yarn `catalogs:` / pnpm `catalogs:`): name -> packages.").optional()})).describe("Package catalogs written to the package manager catalog file (`catalog:`).").meta({id:`ToolchainCatalogsConfig`});export{n as catalogsConfigSchema};
@@ -0,0 +1,245 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { z } from "zod";
4
+ //#region packages/shared/src/config-schema/changelog.d.ts
5
+ /** Branch globs the generated changelog/CI workflows target. */
6
+ export declare const changelogBranchesConfigSchema: z.ZodObject<{
7
+ main: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
8
+ dev: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
9
+ }, z.core.$strip>;
10
+ /** commitlint output location plus the Conventional-Commits allow-lists. */
11
+ export declare const changelogCommitlintConfigSchema: z.ZodObject<{
12
+ dir: z.ZodOptional<z.ZodString>;
13
+ types: z.ZodOptional<z.ZodArray<z.ZodString>>;
14
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
15
+ }, z.core.$strip>;
16
+ /** Which `package.json` versions a changelog run bumps. */
17
+ export declare const changelogVersioningTargetSchema: z.ZodEnum<{
18
+ individual: "individual";
19
+ "root-only": "root-only";
20
+ uniform: "uniform";
21
+ }>;
22
+ /** Options for `ci.changelog.versioning` when configured as an object. */
23
+ export declare const changelogVersioningConfigSchema: z.ZodObject<{
24
+ target: z.ZodOptional<z.ZodEnum<{
25
+ individual: "individual";
26
+ "root-only": "root-only";
27
+ uniform: "uniform";
28
+ }>>;
29
+ workspaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
30
+ bump: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
31
+ allowOverBump: z.ZodOptional<z.ZodBoolean>;
32
+ commit: z.ZodOptional<z.ZodUnknown>;
33
+ provider: z.ZodOptional<z.ZodUnknown>;
34
+ }, z.core.$strip>;
35
+ /** Automatic version bumping: `true` (default), `false`, or a set of options. */
36
+ export declare const changelogVersioningSchema: z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
37
+ target: z.ZodOptional<z.ZodEnum<{
38
+ individual: "individual";
39
+ "root-only": "root-only";
40
+ uniform: "uniform";
41
+ }>>;
42
+ workspaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
43
+ bump: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
44
+ allowOverBump: z.ZodOptional<z.ZodBoolean>;
45
+ commit: z.ZodOptional<z.ZodUnknown>;
46
+ provider: z.ZodOptional<z.ZodUnknown>;
47
+ }, z.core.$strip>]>;
48
+ /**
49
+ * The changelog pipeline (`ci.changelog`): it configures the changelog workflow
50
+ * and the options the local/CI changelog run uses. The whole section is opt-in
51
+ * by presence; `enabled: false` (or `false`) disables both.
52
+ */
53
+ export declare const changelogConfigSchema: z.ZodObject<{
54
+ pushBranches: z.ZodOptional<z.ZodArray<z.ZodString>>;
55
+ pullRequestBranches: z.ZodOptional<z.ZodArray<z.ZodString>>;
56
+ triggers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
57
+ extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
58
+ steps: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
59
+ job: z.ZodOptional<z.ZodString>;
60
+ before: z.ZodOptional<z.ZodArray<z.ZodObject<{
61
+ name: z.ZodOptional<z.ZodString>;
62
+ id: z.ZodOptional<z.ZodString>;
63
+ if: z.ZodOptional<z.ZodString>;
64
+ uses: z.ZodOptional<z.ZodString>;
65
+ run: z.ZodOptional<z.ZodString>;
66
+ shell: z.ZodOptional<z.ZodString>;
67
+ 'working-directory': z.ZodOptional<z.ZodString>;
68
+ with: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
69
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
70
+ }, z.core.$strip>>>;
71
+ after: z.ZodOptional<z.ZodArray<z.ZodObject<{
72
+ name: z.ZodOptional<z.ZodString>;
73
+ id: z.ZodOptional<z.ZodString>;
74
+ if: z.ZodOptional<z.ZodString>;
75
+ uses: z.ZodOptional<z.ZodString>;
76
+ run: z.ZodOptional<z.ZodString>;
77
+ shell: z.ZodOptional<z.ZodString>;
78
+ 'working-directory': z.ZodOptional<z.ZodString>;
79
+ with: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
80
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
81
+ }, z.core.$strip>>>;
82
+ }, z.core.$strip>, z.ZodArray<z.ZodObject<{
83
+ job: z.ZodOptional<z.ZodString>;
84
+ before: z.ZodOptional<z.ZodArray<z.ZodObject<{
85
+ name: z.ZodOptional<z.ZodString>;
86
+ id: z.ZodOptional<z.ZodString>;
87
+ if: z.ZodOptional<z.ZodString>;
88
+ uses: z.ZodOptional<z.ZodString>;
89
+ run: z.ZodOptional<z.ZodString>;
90
+ shell: z.ZodOptional<z.ZodString>;
91
+ 'working-directory': z.ZodOptional<z.ZodString>;
92
+ with: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
93
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
94
+ }, z.core.$strip>>>;
95
+ after: z.ZodOptional<z.ZodArray<z.ZodObject<{
96
+ name: z.ZodOptional<z.ZodString>;
97
+ id: z.ZodOptional<z.ZodString>;
98
+ if: z.ZodOptional<z.ZodString>;
99
+ uses: z.ZodOptional<z.ZodString>;
100
+ run: z.ZodOptional<z.ZodString>;
101
+ shell: z.ZodOptional<z.ZodString>;
102
+ 'working-directory': z.ZodOptional<z.ZodString>;
103
+ with: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
104
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
105
+ }, z.core.$strip>>>;
106
+ }, z.core.$strip>>]>>;
107
+ jobs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
108
+ tokens: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
109
+ filename: z.ZodOptional<z.ZodString>;
110
+ dir: z.ZodOptional<z.ZodString>;
111
+ commitlint: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
112
+ dir: z.ZodOptional<z.ZodString>;
113
+ types: z.ZodOptional<z.ZodArray<z.ZodString>>;
114
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
115
+ }, z.core.$strip>]>>;
116
+ versioning: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
117
+ target: z.ZodOptional<z.ZodEnum<{
118
+ individual: "individual";
119
+ "root-only": "root-only";
120
+ uniform: "uniform";
121
+ }>>;
122
+ workspaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
123
+ bump: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
124
+ allowOverBump: z.ZodOptional<z.ZodBoolean>;
125
+ commit: z.ZodOptional<z.ZodUnknown>;
126
+ provider: z.ZodOptional<z.ZodUnknown>;
127
+ }, z.core.$strip>]>>;
128
+ vscode: z.ZodOptional<z.ZodBoolean>;
129
+ groups: z.ZodOptional<z.ZodUnknown>;
130
+ branches: z.ZodOptional<z.ZodObject<{
131
+ main: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
132
+ dev: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
133
+ }, z.core.$strip>>;
134
+ }, z.core.$strip>;
135
+ /** A changelog workflow setting: a toggle, raw YAML, or the pipeline config. */
136
+ export declare const changelogWorkflowSettingSchema: z.ZodUnion<readonly [z.ZodBoolean, z.ZodString, z.ZodObject<{
137
+ pushBranches: z.ZodOptional<z.ZodArray<z.ZodString>>;
138
+ pullRequestBranches: z.ZodOptional<z.ZodArray<z.ZodString>>;
139
+ triggers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
140
+ extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
141
+ steps: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
142
+ job: z.ZodOptional<z.ZodString>;
143
+ before: z.ZodOptional<z.ZodArray<z.ZodObject<{
144
+ name: z.ZodOptional<z.ZodString>;
145
+ id: z.ZodOptional<z.ZodString>;
146
+ if: z.ZodOptional<z.ZodString>;
147
+ uses: z.ZodOptional<z.ZodString>;
148
+ run: z.ZodOptional<z.ZodString>;
149
+ shell: z.ZodOptional<z.ZodString>;
150
+ 'working-directory': z.ZodOptional<z.ZodString>;
151
+ with: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
152
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
153
+ }, z.core.$strip>>>;
154
+ after: z.ZodOptional<z.ZodArray<z.ZodObject<{
155
+ name: z.ZodOptional<z.ZodString>;
156
+ id: z.ZodOptional<z.ZodString>;
157
+ if: z.ZodOptional<z.ZodString>;
158
+ uses: z.ZodOptional<z.ZodString>;
159
+ run: z.ZodOptional<z.ZodString>;
160
+ shell: z.ZodOptional<z.ZodString>;
161
+ 'working-directory': z.ZodOptional<z.ZodString>;
162
+ with: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
163
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
164
+ }, z.core.$strip>>>;
165
+ }, z.core.$strip>, z.ZodArray<z.ZodObject<{
166
+ job: z.ZodOptional<z.ZodString>;
167
+ before: z.ZodOptional<z.ZodArray<z.ZodObject<{
168
+ name: z.ZodOptional<z.ZodString>;
169
+ id: z.ZodOptional<z.ZodString>;
170
+ if: z.ZodOptional<z.ZodString>;
171
+ uses: z.ZodOptional<z.ZodString>;
172
+ run: z.ZodOptional<z.ZodString>;
173
+ shell: z.ZodOptional<z.ZodString>;
174
+ 'working-directory': z.ZodOptional<z.ZodString>;
175
+ with: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
176
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
177
+ }, z.core.$strip>>>;
178
+ after: z.ZodOptional<z.ZodArray<z.ZodObject<{
179
+ name: z.ZodOptional<z.ZodString>;
180
+ id: z.ZodOptional<z.ZodString>;
181
+ if: z.ZodOptional<z.ZodString>;
182
+ uses: z.ZodOptional<z.ZodString>;
183
+ run: z.ZodOptional<z.ZodString>;
184
+ shell: z.ZodOptional<z.ZodString>;
185
+ 'working-directory': z.ZodOptional<z.ZodString>;
186
+ with: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
187
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
188
+ }, z.core.$strip>>>;
189
+ }, z.core.$strip>>]>>;
190
+ jobs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
191
+ tokens: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
192
+ filename: z.ZodOptional<z.ZodString>;
193
+ dir: z.ZodOptional<z.ZodString>;
194
+ commitlint: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
195
+ dir: z.ZodOptional<z.ZodString>;
196
+ types: z.ZodOptional<z.ZodArray<z.ZodString>>;
197
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
198
+ }, z.core.$strip>]>>;
199
+ versioning: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
200
+ target: z.ZodOptional<z.ZodEnum<{
201
+ individual: "individual";
202
+ "root-only": "root-only";
203
+ uniform: "uniform";
204
+ }>>;
205
+ workspaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
206
+ bump: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
207
+ allowOverBump: z.ZodOptional<z.ZodBoolean>;
208
+ commit: z.ZodOptional<z.ZodUnknown>;
209
+ provider: z.ZodOptional<z.ZodUnknown>;
210
+ }, z.core.$strip>]>>;
211
+ vscode: z.ZodOptional<z.ZodBoolean>;
212
+ groups: z.ZodOptional<z.ZodUnknown>;
213
+ branches: z.ZodOptional<z.ZodObject<{
214
+ main: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
215
+ dev: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
216
+ }, z.core.$strip>>;
217
+ }, z.core.$strip>]>;
218
+ /**
219
+ * The manual changelog section. It accepts the same pipeline options as
220
+ * `ci.changelog` (without the CI-only workflow options and branches), so
221
+ * `dbx changelog`, the VS Code actions and the programmatic API can use it.
222
+ * `ci.changelog` inherits these values when it does not override them.
223
+ */
224
+ export declare const legacyChangelogConfigSchema: z.ZodObject<{
225
+ commitlint: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
226
+ dir: z.ZodOptional<z.ZodString>;
227
+ types: z.ZodOptional<z.ZodArray<z.ZodString>>;
228
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
229
+ }, z.core.$strip>]>>;
230
+ versioning: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
231
+ target: z.ZodOptional<z.ZodEnum<{
232
+ individual: "individual";
233
+ "root-only": "root-only";
234
+ uniform: "uniform";
235
+ }>>;
236
+ workspaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
237
+ bump: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
238
+ allowOverBump: z.ZodOptional<z.ZodBoolean>;
239
+ commit: z.ZodOptional<z.ZodUnknown>;
240
+ provider: z.ZodOptional<z.ZodUnknown>;
241
+ }, z.core.$strip>]>>;
242
+ vscode: z.ZodOptional<z.ZodBoolean>;
243
+ groups: z.ZodOptional<z.ZodUnknown>;
244
+ }, z.core.$strip>;
245
+ //#endregion
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;import{section as e,withEnabled as t}from"./meta.js";import{workflowOptionsSchema as n}from"./workflow.js";import{z as r}from"zod";const i=r.object({main:r.union([r.string(),r.array(r.string())]).describe('Branch glob(s) the CI + release workflows run on, and the release PR base (default `["main"]`).').optional(),dev:r.union([r.string(),r.array(r.string())]).describe("Branch glob(s) the changelog/version workflow runs on. No default: when omitted it reuses `main` (so a single-branch repo needs no `dev`).").optional()}).describe(`Branches the generated workflows target.`).meta({id:`ChangelogBranchesConfig`}),a=t(r.object({dir:r.string().describe("Directory the generated `commitlint.config.mjs` is written to (default: the project root). The husky hook and CI use `--config` to point at it.").optional(),types:r.array(r.string()).describe(`Allowed commit types (commitlint).`).optional(),scopes:r.array(r.string()).describe(`Allowed commit scopes (commitlint).`).optional()}),`Enable commitlint (default true when the changelog is enabled). Set false to generate changelogs without the Conventional-Commits pipeline.`).describe(`commitlint config, output location and allow-lists.`).meta({id:`ChangelogCommitlintConfig`}),o=r.enum([`uniform`,`root-only`,`individual`]).describe(`Where the changelog version bump is applied.`).meta({id:`ChangelogVersioningTarget`}),s=r.object({target:o.describe("`uniform` bumps the root and every workspace to one shared version; `root-only` bumps the root only; `individual` bumps each changed workspace independently (default `uniform`).").optional(),workspaces:r.array(r.string()).describe("Glob patterns selecting the workspaces to version (relative to the root). Defaults to the root `package.json` `workspaces` field; when there is none the root `package.json` is used on its own.").optional(),bump:r.record(r.string(),r.unknown()).describe(`Custom bump rules for major/minor/patch (matchers or callbacks).`).optional(),allowOverBump:r.boolean().describe(`Apply a bump once per matching change instead of once per run (default false).`).optional(),commit:r.unknown().describe(`Commit message formatting/credit options or callback.`).optional(),provider:r.unknown().describe("`default`, `changesets`, a provider id, or a custom provider/callback.").optional()}).describe(`Automatic version bumping options.`).meta({id:`ChangelogVersioningConfig`}),c=r.union([r.boolean(),s]).describe(`Automatic version bumping when a changelog entry is generated.`).meta({id:`ChangelogVersioning`}),l={commitlint:e(a).describe("commitlint config; set `false` to disable the Conventional-Commits pipeline.").optional(),versioning:c.describe("Automatic version bumping on changelog generation (default `true`).").optional(),vscode:r.boolean().describe(`Write the Conventional-Commits VS Code settings (default true).`).optional(),groups:r.unknown().describe("Conventional-Commits group order/titles: an ordered array of CC types or `{ type, title, order, hidden }`, a type->title/options record, or a callback. Titles/order/hidden also accept callbacks (TS/JS configs only).").optional()},u=t(n.extend({branches:i.describe(`Branches the generated workflows target.`).optional(),...l}),`Enable/disable the changelog workflow and pipeline (default: enabled when present).`).describe(`Changelog workflow + pipeline: versioning, VS Code settings and commitlint.`).meta({id:`ChangelogConfig`}),d=r.union([r.boolean(),r.string(),u]).describe("`true`/`false` to enable/disable, the changelog pipeline config object, or a raw YAML string written verbatim as the changelog workflow file.").meta({id:`ChangelogWorkflowSetting`}),f=t(r.object(l)).describe("Manual `toolchain.changelog` pipeline config for `dbx changelog`, the VS Code actions and the API; `ci.changelog` inherits these options.").meta({id:`ToolchainChangelogConfig`});export{i as changelogBranchesConfigSchema,a as changelogCommitlintConfigSchema,u as changelogConfigSchema,s as changelogVersioningConfigSchema,c as changelogVersioningSchema,o as changelogVersioningTargetSchema,d as changelogWorkflowSettingSchema,f as legacyChangelogConfigSchema};