@deltabox/toolchain 0.0.0-stage → 1.1.21

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 (237) hide show
  1. package/CHANGELOG.md +314 -0
  2. package/LICENSE +373 -0
  3. package/README.md +235 -2
  4. package/dist/_virtual/_rolldown/runtime.js +1 -0
  5. package/dist/biome.d.ts +4 -0
  6. package/dist/biome.js +1 -0
  7. package/dist/changelog.d.ts +17 -0
  8. package/dist/changelog.js +1 -0
  9. package/dist/cli/commands/index.js +1 -0
  10. package/dist/cli/commands/projects.js +1 -0
  11. package/dist/cli/commands/providers.js +1 -0
  12. package/dist/cli/commands/reset.js +1 -0
  13. package/dist/cli/commands/shared.js +1 -0
  14. package/dist/cli/commands/sync.js +1 -0
  15. package/dist/cli/commands/watch.js +1 -0
  16. package/dist/cli/context.js +1 -0
  17. package/dist/cli/index.d.ts +15 -0
  18. package/dist/cli/index.js +2 -0
  19. package/dist/cli/options.js +1 -0
  20. package/dist/cli/register.d.ts +14 -0
  21. package/dist/cli/register.js +1 -0
  22. package/dist/config.d.ts +18 -0
  23. package/dist/config.js +1 -0
  24. package/dist/core.d.ts +13 -0
  25. package/dist/core.js +1 -0
  26. package/dist/index.d.ts +31 -0
  27. package/dist/index.js +1 -0
  28. package/dist/migrate.d.ts +15 -0
  29. package/dist/migrate.js +1 -0
  30. package/dist/package.js +1 -0
  31. package/dist/packages/biome/src/config.js +1 -0
  32. package/dist/packages/biome/src/index.d.ts +34 -0
  33. package/dist/packages/biome/src/index.js +1 -0
  34. package/dist/packages/biome/src/vscode-settings.js +1 -0
  35. package/dist/packages/changelog/src/cli/index.d.ts +8 -0
  36. package/dist/packages/changelog/src/cli/index.js +1 -0
  37. package/dist/packages/changelog/src/index.d.ts +19 -0
  38. package/dist/packages/changelog/src/index.js +1 -0
  39. package/dist/packages/changelog/src/run-workflows.d.ts +35 -0
  40. package/dist/packages/changelog/src/run-workflows.js +1 -0
  41. package/dist/packages/changelog/src/run.d.ts +14 -0
  42. package/dist/packages/changelog/src/run.js +1 -0
  43. package/dist/packages/changelog/src/sync.d.ts +18 -0
  44. package/dist/packages/changelog/src/sync.js +1 -0
  45. package/dist/packages/changelog/src/templates.d.ts +27 -0
  46. package/dist/packages/changelog/src/templates.js +27 -0
  47. package/dist/packages/changelog/src/utils/args.d.ts +7 -0
  48. package/dist/packages/changelog/src/utils/args.js +1 -0
  49. package/dist/packages/changelog/src/utils/format.d.ts +27 -0
  50. package/dist/packages/changelog/src/utils/format.js +5 -0
  51. package/dist/packages/changelog/src/utils/git.d.ts +9 -0
  52. package/dist/packages/changelog/src/utils/git.js +1 -0
  53. package/dist/packages/changelog/src/utils/packages.js +4 -0
  54. package/dist/packages/changelog/src/utils/reformat.d.ts +9 -0
  55. package/dist/packages/changelog/src/utils/reformat.js +6 -0
  56. package/dist/packages/changelog/src/utils/repo.js +1 -0
  57. package/dist/packages/changelog/src/utils/summary.d.ts +7 -0
  58. package/dist/packages/changelog/src/utils/summary.js +1 -0
  59. package/dist/packages/changelog/src/utils/types.d.ts +58 -0
  60. package/dist/packages/changelog/src/utils/version.d.ts +6 -0
  61. package/dist/packages/changelog/src/utils/version.js +14 -0
  62. package/dist/packages/changelog/src/utils/write.js +1 -0
  63. package/dist/packages/changelog/src/workflows.d.ts +53 -0
  64. package/dist/packages/changelog/src/workflows.js +5 -0
  65. package/dist/packages/config/src/cli/index.d.ts +28 -0
  66. package/dist/packages/config/src/cli/index.js +1 -0
  67. package/dist/packages/config/src/collect.d.ts +19 -0
  68. package/dist/packages/config/src/collect.js +1 -0
  69. package/dist/packages/config/src/config-json.d.ts +33 -0
  70. package/dist/packages/config/src/config-json.js +1 -0
  71. package/dist/packages/config/src/engine.d.ts +56 -0
  72. package/dist/packages/config/src/engine.js +1 -0
  73. package/dist/packages/config/src/env-file.d.ts +33 -0
  74. package/dist/packages/config/src/env-file.js +3 -0
  75. package/dist/packages/config/src/env.d.ts +31 -0
  76. package/dist/packages/config/src/env.js +1 -0
  77. package/dist/packages/config/src/generators/cli.d.ts +78 -0
  78. package/dist/packages/config/src/generators/cli.js +1 -0
  79. package/dist/packages/config/src/generators/env.d.ts +42 -0
  80. package/dist/packages/config/src/generators/env.js +23 -0
  81. package/dist/packages/config/src/generators/index.d.ts +8 -0
  82. package/dist/packages/config/src/generators/index.js +1 -0
  83. package/dist/packages/config/src/generators/json.d.ts +24 -0
  84. package/dist/packages/config/src/generators/json.js +1 -0
  85. package/dist/packages/config/src/generators/markdown.d.ts +77 -0
  86. package/dist/packages/config/src/generators/markdown.js +27 -0
  87. package/dist/packages/config/src/generators/types.d.ts +32 -0
  88. package/dist/packages/config/src/generators/types.js +1 -0
  89. package/dist/packages/config/src/index.d.ts +21 -0
  90. package/dist/packages/config/src/index.js +1 -0
  91. package/dist/packages/config/src/root.d.ts +11 -0
  92. package/dist/packages/config/src/root.js +1 -0
  93. package/dist/packages/config/src/schema.d.ts +34 -0
  94. package/dist/packages/config/src/schema.js +1 -0
  95. package/dist/packages/config/src/types.d.ts +75 -0
  96. package/dist/packages/config/src/types.js +1 -0
  97. package/dist/packages/core/src/graph.d.ts +55 -0
  98. package/dist/packages/core/src/graph.js +1 -0
  99. package/dist/packages/core/src/index.d.ts +16 -0
  100. package/dist/packages/core/src/index.js +1 -0
  101. package/dist/packages/core/src/loader.d.ts +27 -0
  102. package/dist/packages/core/src/loader.js +1 -0
  103. package/dist/packages/core/src/manifest.d.ts +17 -0
  104. package/dist/packages/core/src/manifest.js +1 -0
  105. package/dist/packages/core/src/project-type.d.ts +14 -0
  106. package/dist/packages/core/src/project-type.js +1 -0
  107. package/dist/packages/core/src/reset.d.ts +51 -0
  108. package/dist/packages/core/src/reset.js +1 -0
  109. package/dist/packages/core/src/select.d.ts +32 -0
  110. package/dist/packages/core/src/select.js +1 -0
  111. package/dist/packages/core/src/sync.d.ts +42 -0
  112. package/dist/packages/core/src/sync.js +1 -0
  113. package/dist/packages/core/src/vscode.d.ts +27 -0
  114. package/dist/packages/core/src/vscode.js +1 -0
  115. package/dist/packages/core/src/watch.d.ts +17 -0
  116. package/dist/packages/core/src/watch.js +1 -0
  117. package/dist/packages/migrate/src/biome.d.ts +18 -0
  118. package/dist/packages/migrate/src/biome.js +2 -0
  119. package/dist/packages/migrate/src/check.d.ts +14 -0
  120. package/dist/packages/migrate/src/check.js +1 -0
  121. package/dist/packages/migrate/src/cli/index.d.ts +12 -0
  122. package/dist/packages/migrate/src/cli/index.js +1 -0
  123. package/dist/packages/migrate/src/dprint.d.ts +18 -0
  124. package/dist/packages/migrate/src/dprint.js +1 -0
  125. package/dist/packages/migrate/src/eslint.d.ts +24 -0
  126. package/dist/packages/migrate/src/eslint.js +1 -0
  127. package/dist/packages/migrate/src/index.d.ts +14 -0
  128. package/dist/packages/migrate/src/index.js +1 -0
  129. package/dist/packages/migrate/src/oxfmt-map.d.ts +28 -0
  130. package/dist/packages/migrate/src/oxfmt-map.js +1 -0
  131. package/dist/packages/migrate/src/oxlint-map.d.ts +22 -0
  132. package/dist/packages/migrate/src/oxlint-map.js +1 -0
  133. package/dist/packages/migrate/src/prettier.d.ts +20 -0
  134. package/dist/packages/migrate/src/prettier.js +2 -0
  135. package/dist/packages/migrate/src/registry.d.ts +26 -0
  136. package/dist/packages/migrate/src/registry.js +1 -0
  137. package/dist/packages/migrate/src/types.d.ts +75 -0
  138. package/dist/packages/migrate/src/vite-target.d.ts +31 -0
  139. package/dist/packages/migrate/src/vite-target.js +5 -0
  140. package/dist/packages/project/src/cli/index.d.ts +8 -0
  141. package/dist/packages/project/src/cli/index.js +1 -0
  142. package/dist/packages/project/src/config.d.ts +55 -0
  143. package/dist/packages/project/src/config.js +1 -0
  144. package/dist/packages/project/src/index.d.ts +10 -0
  145. package/dist/packages/project/src/index.js +1 -0
  146. package/dist/packages/project/src/typescript.d.ts +66 -0
  147. package/dist/packages/project/src/typescript.js +22 -0
  148. package/dist/packages/shared/src/config-schema.d.ts +2039 -0
  149. package/dist/packages/shared/src/config-schema.js +1 -0
  150. package/dist/packages/shared/src/fs-utils.d.ts +18 -0
  151. package/dist/packages/shared/src/fs-utils.js +1 -0
  152. package/dist/packages/shared/src/index.d.ts +17 -0
  153. package/dist/packages/shared/src/index.js +1 -0
  154. package/dist/packages/shared/src/object-utils.d.ts +15 -0
  155. package/dist/packages/shared/src/object-utils.js +1 -0
  156. package/dist/packages/shared/src/provider.d.ts +66 -0
  157. package/dist/packages/shared/src/provider.js +1 -0
  158. package/dist/packages/shared/src/run.d.ts +26 -0
  159. package/dist/packages/shared/src/run.js +1 -0
  160. package/dist/packages/shared/src/string-utils.d.ts +52 -0
  161. package/dist/packages/shared/src/string-utils.js +3 -0
  162. package/dist/packages/shared/src/template.d.ts +53 -0
  163. package/dist/packages/shared/src/template.js +1 -0
  164. package/dist/packages/shared/src/toolchain.d.ts +159 -0
  165. package/dist/packages/shared/src/toolchain.js +1 -0
  166. package/dist/packages/shared/src/types.d.ts +100 -0
  167. package/dist/packages/shared/src/yaml.d.ts +17 -0
  168. package/dist/packages/shared/src/yaml.js +5 -0
  169. package/dist/packages/template/src/builtin.d.ts +10 -0
  170. package/dist/packages/template/src/builtin.js +1 -0
  171. package/dist/packages/template/src/cli/index.d.ts +8 -0
  172. package/dist/packages/template/src/cli/index.js +1 -0
  173. package/dist/packages/template/src/index.d.ts +10 -0
  174. package/dist/packages/template/src/index.js +1 -0
  175. package/dist/packages/template/src/local.d.ts +20 -0
  176. package/dist/packages/template/src/local.js +1 -0
  177. package/dist/packages/template/src/online.d.ts +17 -0
  178. package/dist/packages/template/src/online.js +1 -0
  179. package/dist/packages/template/src/registry.d.ts +48 -0
  180. package/dist/packages/template/src/registry.js +1 -0
  181. package/dist/packages/template/src/scaffold.d.ts +25 -0
  182. package/dist/packages/template/src/scaffold.js +1 -0
  183. package/dist/packages/template/src/types.d.ts +59 -0
  184. package/dist/packages/tsconfig/src/cli/generate/index.d.ts +35 -0
  185. package/dist/packages/tsconfig/src/cli/generate/index.js +1 -0
  186. package/dist/packages/tsconfig/src/cli/generate/utils.d.ts +43 -0
  187. package/dist/packages/tsconfig/src/cli/generate/utils.js +1 -0
  188. package/dist/packages/tsconfig/src/cli/index.d.ts +11 -0
  189. package/dist/packages/tsconfig/src/cli/index.js +1 -0
  190. package/dist/packages/tsconfig/src/index.d.ts +10 -0
  191. package/dist/packages/tsconfig/src/index.js +1 -0
  192. package/dist/packages/tsconfig/src/sync.d.ts +15 -0
  193. package/dist/packages/tsconfig/src/sync.js +1 -0
  194. package/dist/packages/tsconfig/src/templates/tsconfig.base.js +1 -0
  195. package/dist/packages/tsconfig/src/templates/tsconfig.build.js +1 -0
  196. package/dist/packages/tsconfig/src/templates/tsconfig.default.js +1 -0
  197. package/dist/packages/tsconfig/src/templates.d.ts +38 -0
  198. package/dist/packages/tsconfig/src/templates.js +1 -0
  199. package/dist/packages/tsdown/src/cleanup.d.ts +17 -0
  200. package/dist/packages/tsdown/src/cleanup.js +1 -0
  201. package/dist/packages/tsdown/src/cli/index.d.ts +11 -0
  202. package/dist/packages/tsdown/src/cli/index.js +1 -0
  203. package/dist/packages/tsdown/src/config/node.d.ts +37 -0
  204. package/dist/packages/tsdown/src/config/node.js +3 -0
  205. package/dist/packages/tsdown/src/index.d.ts +9 -0
  206. package/dist/packages/tsdown/src/index.js +1 -0
  207. package/dist/packages/vite/src/cli/index.d.ts +8 -0
  208. package/dist/packages/vite/src/cli/index.js +1 -0
  209. package/dist/packages/vite/src/commands.d.ts +29 -0
  210. package/dist/packages/vite/src/commands.js +1 -0
  211. package/dist/packages/vite/src/index.d.ts +9 -0
  212. package/dist/packages/vite/src/index.js +1 -0
  213. package/dist/packages/vite/src/plugin.d.ts +65 -0
  214. package/dist/packages/vite/src/plugin.js +1 -0
  215. package/dist/packages/vite/src/provider.d.ts +11 -0
  216. package/dist/packages/vite/src/provider.js +1 -0
  217. package/dist/packages/vite/src/sync.d.ts +25 -0
  218. package/dist/packages/vite/src/sync.js +2 -0
  219. package/dist/packages/vite/src/vp.d.ts +59 -0
  220. package/dist/packages/vite/src/vp.js +1 -0
  221. package/dist/project.d.ts +7 -0
  222. package/dist/project.js +1 -0
  223. package/dist/providers.d.ts +11 -0
  224. package/dist/providers.js +1 -0
  225. package/dist/shared.d.ts +14 -0
  226. package/dist/shared.js +1 -0
  227. package/dist/sync.d.ts +12 -0
  228. package/dist/sync.js +1 -0
  229. package/dist/template.d.ts +11 -0
  230. package/dist/template.js +1 -0
  231. package/dist/tsconfig.d.ts +8 -0
  232. package/dist/tsconfig.js +1 -0
  233. package/dist/tsdown.d.ts +7 -0
  234. package/dist/tsdown.js +1 -0
  235. package/dist/vite.d.ts +10 -0
  236. package/dist/vite.js +1 -0
  237. package/package.json +114 -3
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;const e=[{id:`project`,name:`TypeScript project`,description:`A single-package TypeScript project (tsconfig, tsdown, biome).`,kind:`project`,builtin:`single`,source:{type:`builtin`,locate:`project`},tags:[`typescript`,`library`]},{id:`application`,name:`Application`,description:`A runnable application package (tsconfig, tsdown, biome).`,kind:`application`,builtin:`application`,source:{type:`builtin`,locate:`application`},tags:[`application`,`app`]},{id:`folder`,name:`Folder`,description:`A bare folder (a README) to drop files into.`,kind:`folder`,builtin:`folder`,source:{type:`builtin`,locate:`folder`},tags:[`folder`]},{id:`monorepo`,name:`Monorepo`,description:`A monorepo root (workspaces, turbo, monorepo tsconfig) + one example package.`,kind:`project`,builtin:`monorepo-root`,source:{type:`builtin`,locate:`monorepo`},tags:[`monorepo`,`turbo`]},{id:`workspace`,name:`Monorepo workspace`,description:`A workspace package added to an existing monorepo root.`,kind:`workspace`,builtin:`monorepo-workspace`,source:{type:`builtin`,locate:`workspace`},tags:[`monorepo`,`workspace`]},{id:`vite-plus`,name:`Vite+ app`,description:"Create a new project through `vp create` (interactive or templated).",kind:`project`,source:{type:`vite-plus`,locate:``},tags:[`vite`,`vite-plus`],online:!0}];export{e as BUILTIN_TEMPLATES};
@@ -0,0 +1,8 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { ToolingCommand } from "../../../shared/src/types.js";
4
+ import "../../../shared/src/index.js";
5
+ //#region packages/template/src/cli/index.d.ts
6
+ /** The `template:*` commands plus the template-driven `create`. */
7
+ export declare function templateCommands(): ToolingCommand[];
8
+ //#endregion
@@ -0,0 +1 @@
1
+ import{default as e}from"node:path";import"node:url";import.meta.url;import{TEMPLATE_MANIFEST as t,writeTemplateManifest as n}from"../local.js";import{parseSourceSpec as r}from"../online.js";import{addTemplateSource as i,loadTemplates as a,readTemplateRegistry as o,removeTemplateSource as s}from"../registry.js";import{scaffoldTemplate as c}from"../scaffold.js";import l from"node:fs";const u={flags:`--cwd <dir>`,description:`Project root (default: cwd).`},d={flags:`--kind <kind>`,description:`project | workspace | application | folder | tooling | pipeline.`};function f(e){return{id:e.id,name:e.name,...e.description?{description:e.description}:{},kind:e.kind,type:e.source.type,online:!!e.online,...e.tags?{tags:e.tags}:{},...e.variables?{variables:e.variables}:{}}}function p(e){let t={};for(let n of e??[]){let e=n.indexOf(`=`);e!==-1&&(t[n.slice(0,e)]=n.slice(e+1))}return t}function m(e){return(e??[]).map(e=>{let t=e.indexOf(`:`);return t===-1?{name:e}:{name:e.slice(0,t),default:e.slice(t+1)}})}function h(){return[{name:`template:list`,description:`List templates (builtin + local + opted-in online sources).`,options:[u,{flags:`--online`,description:`Resolve online sources (npm/git).`},{flags:`--offline`,description:`Force offline (skip npm/git).`},d,{flags:`--registry`,description:`List only the .dbx/toolchain/templates.json sources.`},{flags:`--json`,description:`Print the templates as JSON.`}],run:async(e,t)=>{let n=e.cwd??t.cwd;if(e.registry){let t=o(n).sources;if(e.json){console.log(JSON.stringify(t.map(e=>({key:`${e.type}:${e.locate}`,...e})),null,4));return}if(t.length===0){console.log(`dbx: the template registry is empty.`);return}for(let e of t)console.log(` ${`${e.type}:${e.locate}`.padEnd(40)} ${e.name??e.id??``}`);return}let r=!!e.online&&!e.offline,i=await a({cwd:n,config:t.config,online:r}),s=e.kind,c=s?i.filter(e=>e.kind===s):i;if(e.json)console.log(JSON.stringify(c.map(f),null,4));else if(c.length===0)console.log(`dbx: no templates found.`);else for(let e of c){let t=[e.kind,e.source.type,e.online?`online`:`offline`].join(`, `);console.log(` ${e.id.padEnd(24)} ${e.name} [${t}]${e.description?`\n ${e.description}`:``}`)}}},{name:`template:init`,description:`Write a template.json to a directory, making it a local template.`,args:[{name:`dir`,description:`Directory (default: cwd).`,required:!1}],options:[u,d,{flags:`--name <name>`,description:`Display name (default: folder name).`},{flags:`--description <text>`,description:`Description.`},{flags:`--var <pair...>`,description:`Variable name[:default] (repeatable).`},{flags:`--tag <tag...>`,description:`Tag (repeatable).`},{flags:`--force`,description:`Overwrite an existing template.json.`},{flags:`--add`,description:`Also record the folder in .dbx/toolchain/templates.json.`},{flags:`--json`,description:`Print the manifest as JSON.`}],run:(r,a)=>{let o=e.resolve(a.cwd,String(r.dir??`.`)),s=e.join(o,t);if(l.existsSync(s)&&!r.force)throw Error(`template.json already exists at ${s} (use --force).`);let c=m(r.var),u={name:String(r.name??e.basename(o)),kind:r.kind??`folder`,...r.description?{description:String(r.description)}:{},...c.length?{variables:c}:{},...r.tag?{tags:r.tag}:{}};n(o,u),r.add&&i(a.cwd,{type:`local`,locate:o,kind:u.kind}),r.json?console.log(JSON.stringify(u,null,4)):(console.log(`dbx: wrote ${s}`),r.add&&console.log(`dbx: registered the folder as a template.`))}},{name:`template:add`,description:`Record a template source in .dbx/toolchain/templates.json.`,args:[{name:`source`,description:`local path | git URL | @scope/create | type:locate`}],options:[u,{flags:`--type <type>`,description:`Force: builtin | local | npm | git | vite-plus.`},{flags:`--name <name>`,description:`Display name.`},d,{flags:`--ref <ref>`,description:`Git branch/tag/commit.`},{flags:`--subdir <dir>`,description:`Subdirectory within the source.`},{flags:`--json`,description:`Print the updated registry as JSON.`}],run:(t,a)=>{let o=r(String(t.source),a.cwd);t.type&&(o.type=t.type),t.name&&(o.name=String(t.name)),t.kind&&(o.kind=t.kind),t.ref&&(o.ref=String(t.ref)),t.subdir&&(o.subdir=String(t.subdir)),o.type===`local`&&!l.existsSync(e.join(o.locate,`template.json`))&&n(o.locate,{name:o.name??e.basename(o.locate),kind:t.kind??`folder`});let s=i(a.cwd,o);t.json?console.log(JSON.stringify(s,null,4)):console.log(`dbx: added ${o.type}:${o.locate} (${s.sources.length} source(s)).`)}},{name:`template:remove`,description:`Remove a source from .dbx/toolchain/templates.json.`,args:[{name:`id`,description:`Source id or type:locate.`}],options:[u,{flags:`--json`,description:`Print the registry as JSON.`}],run:(e,t)=>{let{registry:n,removed:r}=s(t.cwd,String(e.id));e.json?console.log(JSON.stringify(n,null,4)):r===0?(console.error(`dbx: no source matching "${e.id}".`),process.exitCode=1):console.log(`dbx: removed ${r} source(s) (${n.sources.length} left).`)}},{name:`template:info`,description:`Show one template by id.`,args:[{name:`id`,description:`The template id.`}],options:[u,{flags:`--online`,description:`Resolve online sources.`}],run:async(e,t)=>{let n=e.cwd??t.cwd,r=(await a({cwd:n,config:t.config,online:!!e.online})).find(t=>t.id===e.id);r?console.log(JSON.stringify(f(r),null,4)):(console.error(`dbx: unknown template "${e.id}".`),process.exitCode=1)}},{name:`create`,description:`Scaffold a project from a template (builtin, local or Vite+).`,options:[{flags:`-t, --template <id>`,description:`Template id (see template:list).`},d,{flags:`-n, --name <name>`,description:`Project / package name.`},{flags:`-s, --scope <scope>`,description:`npm scope, eg. @acme.`},{flags:`-o, --out <dir>`,description:`Output directory (default: cwd).`},u,{flags:`--var <pair...>`,description:`Template variables as key=value (repeatable).`},{flags:`--online`,description:`Resolve online templates too.`},{flags:`--json`,description:`Print the result as JSON.`}],run:async(e,t)=>{let n=e.out??t.cwd,r=String(e.template??``),i=e.kind,o=await a({cwd:t.cwd,config:t.config,online:!0}),s=o.find(e=>e.id===r);if(!s&&!r&&i&&(s=o.find(e=>e.kind===i)),!s&&r&&(s={id:r,name:r,kind:i??`project`,source:{type:`vite-plus`,locate:r},online:!0}),!s)throw Error("No template selected. Pass --template <id> or --kind <kind> (see `dbx template:list`).");let l={name:e.name??t.config.project?.name??`app`,...e.scope?{scope:e.scope}:{},...t.config.project},u=p(e.var),d=await c(s,{cwd:n,tokens:l,variables:u});if(e.json)console.log(JSON.stringify({template:s.id,out:n,...d},null,4));else if(s.source.type===`vite-plus`||s.source.type===`npm`||s.source.type===`git`)d.code&&(process.exitCode=d.code);else for(let e of d.written)console.log(`Created ${e}`)}}]}export{h as templateCommands};
@@ -0,0 +1,10 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { Template, TemplateKind, TemplateManifest, TemplateVariable } from "./types.js";
4
+ import { BUILTIN_TEMPLATES } from "./builtin.js";
5
+ import { templateCommands } from "./cli/index.js";
6
+ import { TEMPLATE_MANIFEST, isTemplateDir, loadLocalTemplates, readTemplateDir, readTemplateManifest, writeTemplateManifest } from "./local.js";
7
+ import { gitTemplate, loadNpmTemplates, parseSourceSpec } from "./online.js";
8
+ import { LoadTemplatesOptions, REGISTRY_DIR, REGISTRY_FILE, TemplateRegistry, addTemplateSource, collectSources, loadTemplates, readTemplateRegistry, removeTemplateSource, writeTemplateRegistry } from "./registry.js";
9
+ import { ScaffoldOptions, ScaffoldResult, scaffoldTemplate } from "./scaffold.js";
10
+ export { BUILTIN_TEMPLATES, LoadTemplatesOptions, REGISTRY_DIR, REGISTRY_FILE, ScaffoldOptions, ScaffoldResult, TEMPLATE_MANIFEST, Template, TemplateKind, TemplateManifest, TemplateRegistry, TemplateVariable, addTemplateSource, collectSources, gitTemplate, isTemplateDir, loadLocalTemplates, loadNpmTemplates, loadTemplates, parseSourceSpec, readTemplateDir, readTemplateManifest, readTemplateRegistry, removeTemplateSource, scaffoldTemplate, templateCommands, writeTemplateManifest, writeTemplateRegistry };
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;import{TEMPLATE_MANIFEST as e,isTemplateDir as t,loadLocalTemplates as n,readTemplateDir as r,readTemplateManifest as i,writeTemplateManifest as a}from"./local.js";import{gitTemplate as o,loadNpmTemplates as s,parseSourceSpec as c}from"./online.js";import{BUILTIN_TEMPLATES as l}from"./builtin.js";import{REGISTRY_DIR as u,REGISTRY_FILE as d,addTemplateSource as f,collectSources as p,loadTemplates as m,readTemplateRegistry as h,removeTemplateSource as g,writeTemplateRegistry as _}from"./registry.js";import{scaffoldTemplate as v}from"./scaffold.js";import{templateCommands as y}from"./cli/index.js";export{l as BUILTIN_TEMPLATES,u as REGISTRY_DIR,d as REGISTRY_FILE,e as TEMPLATE_MANIFEST,f as addTemplateSource,p as collectSources,o as gitTemplate,t as isTemplateDir,n as loadLocalTemplates,s as loadNpmTemplates,m as loadTemplates,c as parseSourceSpec,r as readTemplateDir,i as readTemplateManifest,h as readTemplateRegistry,g as removeTemplateSource,v as scaffoldTemplate,y as templateCommands,a as writeTemplateManifest,_ as writeTemplateRegistry};
@@ -0,0 +1,20 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { Template, TemplateManifest } from "./types.js";
4
+ //#region packages/template/src/local.d.ts
5
+ /** The manifest file that marks a directory as a local template. */
6
+ export declare const TEMPLATE_MANIFEST = "template.json";
7
+ /** Whether `dir` holds a `template.json`. */
8
+ export declare function isTemplateDir(dir: string): boolean;
9
+ /** Read a `template.json` from a remembered path (for scaffolding). */
10
+ export declare function readTemplateManifest(dir: string): TemplateManifest | undefined;
11
+ /** Write a `template.json` into `dir` (used by `template:init`). */
12
+ export declare function writeTemplateManifest(dir: string, manifest: TemplateManifest): string;
13
+ /** Read a local template directory into a {@link Template}. */
14
+ export declare function readTemplateDir(dir: string, id?: string): Template | undefined;
15
+ /**
16
+ * Load the local templates in `root`: the root itself when it is a template,
17
+ * plus every immediate subdirectory holding a `template.json`.
18
+ */
19
+ export declare function loadLocalTemplates(root: string, idPrefix?: string): Template[];
20
+ //#endregion
@@ -0,0 +1 @@
1
+ import{default as e}from"node:path";import"node:url";import.meta.url;import t from"node:fs";const n=`template.json`;function r(e){try{return JSON.parse(t.readFileSync(e,`utf-8`).replace(/^\uFEFF/,``))}catch{return}}function i(r){return t.existsSync(e.join(r,n))}function a(t){return r(e.join(t,n))}function o(r,i){t.mkdirSync(r,{recursive:!0});let a=e.join(r,n);return t.writeFileSync(a,`${JSON.stringify(i,null,4)}\n`,`utf-8`),a}function s(t,n){let r=a(t);if(!r)return;let i=r.name??e.basename(t);return{id:n??e.basename(t),name:i,...r.description?{description:r.description}:{},kind:r.kind??`project`,source:{type:`local`,locate:t},...r.tags?{tags:r.tags}:{},dir:t,...r.variables?{variables:r.variables}:{},...r.tokens?{tokens:r.tokens}:{}}}function c(n,r){let a=[];if(i(n)){let e=s(n,r);e&&a.push(e)}let o;try{o=t.readdirSync(n,{withFileTypes:!0})}catch{return a}for(let t of o){if(!t.isDirectory()||t.name.startsWith(`.`))continue;let o=e.join(n,t.name);if(!i(o))continue;let c=s(o,r?`${r}/${t.name}`:t.name);c&&a.push(c)}return a}export{n as TEMPLATE_MANIFEST,i as isTemplateDir,c as loadLocalTemplates,s as readTemplateDir,a as readTemplateManifest,o as writeTemplateManifest};
@@ -0,0 +1,17 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { ToolingTemplateSource } from "../../shared/src/config-schema.js";
4
+ import "../../shared/src/index.js";
5
+ import { Template } from "./types.js";
6
+ //#region packages/template/src/online.d.ts
7
+ /** List the templates an npm `@scope/create` package publishes. */
8
+ export declare function loadNpmTemplates(pkg: string): Promise<Template[]>;
9
+ /** A single template backed by a git repository. */
10
+ export declare function gitTemplate(source: ToolingTemplateSource): Template;
11
+ /**
12
+ * Parse a `template:add` spec: `type:locate` (eg. `local:./tpl`, `git:https://…`,
13
+ * `npm:@acme/create`) or an inferred source (a path that exists -> local, an
14
+ * `@scope/name` -> npm, a URL/scp -> git).
15
+ */
16
+ export declare function parseSourceSpec(spec: string, cwd?: string): ToolingTemplateSource;
17
+ //#endregion
@@ -0,0 +1 @@
1
+ import{default as e}from"node:path";import"node:url";import.meta.url;function t(e){if(!Array.isArray(e))return;let t=e.map(String).filter(Boolean);return t.length?t:void 0}function n(e,n){if(!Array.isArray(n))return[];let r=[];for(let i of n){let n=typeof i==`string`?{name:i}:i&&typeof i==`object`?i:void 0;if(!n)continue;let a=String(n.name??n.template??`template`),o=String(n.label??a),s=typeof n.description==`string`?n.description:void 0,c=t(n.tags);r.push({id:`${e}/${a}`,name:o,...s?{description:s}:{},kind:`project`,source:{type:`npm`,locate:e,subdir:a,online:!0},online:!0,...c?{tags:c}:{}})}return r}async function r(e){let t=e.replace(/^npm:/,``);try{let e=await fetch(`https://registry.npmjs.org/${encodeURIComponent(t)}/latest`,{headers:{accept:`application/json`}});if(!e.ok)return[];let r=await e.json();return n(t,r.createConfig?.templates??r.dbx?.templates??r.dbxTemplates)}catch{return[]}}function i(e){let t=e.locate.replace(/\.git$/,``).split(/[/:]/).filter(Boolean).pop()??`template`;return{id:e.id??`git:${t}`,name:e.name??t,...e.description?{description:e.description}:{},kind:e.kind??`project`,source:e,...e.tags?{tags:e.tags}:{},online:!0}}function a(t,n=process.cwd()){let r=t.match(/^(builtin|local|npm|git|vite-plus):(.+)$/i);return r?.[1]&&r[2]?{type:r[1].toLowerCase(),locate:r[2]}:/^(https?:|git@|git:\/\/|ssh:\/\/)/.test(t)||t.endsWith(`.git`)?{type:`git`,locate:t,online:!0}:/^@[^/]+\/[^/]+$/.test(t)?{type:`npm`,locate:t,online:!0}:{type:`local`,locate:e.resolve(n,t)}}export{i as gitTemplate,r as loadNpmTemplates,a as parseSourceSpec};
@@ -0,0 +1,48 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { ToolingTemplateSource } from "../../shared/src/config-schema.js";
4
+ import { ToolingConfig } from "../../shared/src/toolchain.js";
5
+ import "../../shared/src/index.js";
6
+ import { Template } from "./types.js";
7
+ //#region packages/template/src/registry.d.ts
8
+ /** Where `template:add` records sources, relative to a project root. */
9
+ export declare const REGISTRY_DIR = ".dbx/toolchain";
10
+ export declare const REGISTRY_FILE = "templates.json";
11
+ /** The on-disk registry of template sources. */
12
+ export interface TemplateRegistry {
13
+ sources: ToolingTemplateSource[];
14
+ }
15
+ /** Read `<cwd>/.dbx/toolchain/templates.json` (empty when missing/invalid). */
16
+ export declare function readTemplateRegistry(cwd: string): TemplateRegistry;
17
+ /** Write `<cwd>/.dbx/toolchain/templates.json`. */
18
+ export declare function writeTemplateRegistry(cwd: string, sources: ToolingTemplateSource[]): void;
19
+ /** Append a source to the registry, deduplicating on `type:locate`. */
20
+ export declare function addTemplateSource(cwd: string, source: ToolingTemplateSource): TemplateRegistry;
21
+ /**
22
+ * Remove a source from the registry by `type:locate` (or by id). Returns the
23
+ * updated registry and how many sources were removed.
24
+ */
25
+ export declare function removeTemplateSource(cwd: string, match: string): {
26
+ registry: TemplateRegistry;
27
+ removed: number;
28
+ };
29
+ export interface LoadTemplatesOptions {
30
+ /** Project root. */
31
+ cwd: string;
32
+ /** The loaded tooling config (its `templates.sources` are included). */
33
+ config?: ToolingConfig;
34
+ /** Resolve online sources (`npm`/`git`). Default: false. */
35
+ online?: boolean;
36
+ /** Include the builtin templates (default: true). */
37
+ builtin?: boolean;
38
+ /** Extra sources on top of the config + registry. */
39
+ sources?: ToolingTemplateSource[];
40
+ }
41
+ /** Every source considered: builtin + config `templates.sources` + registry + extras. */
42
+ export declare function collectSources(options: LoadTemplatesOptions): ToolingTemplateSource[];
43
+ /**
44
+ * Resolve every template: builtin, local directories (offline, always), and —
45
+ * when `online` — npm `@scope/create` manifests + git repositories.
46
+ */
47
+ export declare function loadTemplates(options: LoadTemplatesOptions): Promise<Template[]>;
48
+ //#endregion
@@ -0,0 +1 @@
1
+ import{default as e}from"node:path";import"node:url";import.meta.url;import{sectionConfig as t,sectionEnabled as n}from"../../shared/src/toolchain.js";import"../../shared/src/index.js";import{loadLocalTemplates as r}from"./local.js";import{gitTemplate as i,loadNpmTemplates as a}from"./online.js";import{BUILTIN_TEMPLATES as o}from"./builtin.js";import s from"node:fs";const c=`.dbx/toolchain`,l=`templates.json`;function u(t){let n=e.join(t,c,l);try{let e=s.readFileSync(n,`utf-8`).replace(/^\uFEFF/,``),t=JSON.parse(e);return{sources:Array.isArray(t.sources)?t.sources:[]}}catch{return{sources:[]}}}function d(t,n){let r=e.join(t,c,l);s.mkdirSync(e.dirname(r),{recursive:!0}),s.writeFileSync(r,`${JSON.stringify({sources:n},null,4)}\n`,`utf-8`)}function f(e,t){let n=u(e),r=e=>`${e.type}:${e.locate}`,i=n.sources.filter(e=>r(e)!==r(t));return i.push(t),d(e,i),{sources:i}}function p(e,t){let n=u(e),r=n.sources.filter(e=>e.id!==t&&`${e.type}:${e.locate}`!==t),i=n.sources.length-r.length;return i>0&&d(e,r),{registry:{sources:r},removed:i}}function m(e){return[...e.config&&n(e.config.templates)?t(e.config.templates)?.sources??[]:[],...u(e.cwd).sources,...e.sources??[]]}async function h(e){let t=/* @__PURE__ */ new Set,n=[],s=e=>{t.has(e.id)||(t.add(e.id),n.push(e))};if(e.builtin!==!1)for(let e of o)s(e);for(let t of m(e))switch(t.type){case`builtin`:{let e=o.find(e=>e.id===t.locate);e&&s(t.id?{...e,id:t.id}:e);break}case`local`:for(let e of r(t.locate,t.id))s(e);break;case`git`:s(i(t));break;case`npm`:if(e.online)for(let e of await a(t.locate))s(e);break;case`vite-plus`:s({id:t.id??`vite-plus`,name:t.name??`Vite+ app`,...t.description?{description:t.description}:{},kind:t.kind??`project`,source:t,...t.tags?{tags:t.tags}:{},online:!0})}return n}export{c as REGISTRY_DIR,l as REGISTRY_FILE,f as addTemplateSource,m as collectSources,h as loadTemplates,u as readTemplateRegistry,p as removeTemplateSource,d as writeTemplateRegistry};
@@ -0,0 +1,25 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { Replacements } from "../../shared/src/template.js";
4
+ import "../../shared/src/index.js";
5
+ import { Template } from "./types.js";
6
+ //#region packages/template/src/scaffold.d.ts
7
+ export interface ScaffoldOptions {
8
+ /** Where the files are written. */
9
+ cwd: string;
10
+ /** Replacement tokens (eg. `{ name, scope, author }`). */
11
+ tokens?: Replacements;
12
+ /** Per-template variable values (merged over `tokens`). */
13
+ variables?: Record<string, string>;
14
+ /** Overwrite existing files (local templates; default true). */
15
+ overwrite?: boolean;
16
+ }
17
+ export interface ScaffoldResult {
18
+ /** Absolute paths written (empty when delegated to `vp`). */
19
+ written: string[];
20
+ /** The `vp` exit code when the template was created through Vite+. */
21
+ code?: number;
22
+ }
23
+ /** Scaffold a project (or tooling) from a template. */
24
+ export declare function scaffoldTemplate(template: Template, options: ScaffoldOptions): Promise<ScaffoldResult>;
25
+ //#endregion
@@ -0,0 +1 @@
1
+ import{default as e}from"node:path";import"node:url";import.meta.url;import{applyReplacements as t}from"../../shared/src/template.js";import"../../shared/src/index.js";import{createMonorepoRootFiles as n,createRootProjectFiles as r,createWorkspaceFiles as i,writeGeneratedFiles as a}from"../../project/src/typescript.js";import"../../project/src/index.js";import{readTemplateManifest as o}from"./local.js";import{runVp as s}from"../../vite/src/vp.js";import"../../vite/src/index.js";import c from"node:fs";const l=/* @__PURE__ */ new Set([`node_modules`,`.git`,`dist`,`.turbo`,`.dbx`,`.DS_Store`,`template.json`]);function u(e){return{...e.tokens,...e.variables}}function d(e,t){let o=u(t),s=String(o.name??`app`),c=o.scope?String(o.scope):void 0,l=[];switch(e.builtin){case`monorepo-root`:{let e=c??`@${s}`;l.push(...n({name:s,scope:e,type:`monorepo-root`,workspaces:[{alias:`core`,dir:`packages/core`}]})),l.push(...i({name:s,scope:e,wsName:`core`,wsDir:`packages/core`,type:`monorepo-workspace`}).map(e=>({...e,path:`packages/core/${e.path}`})));break}case`monorepo-workspace`:{let e=`packages/${s}`;l.push(...i({name:s,...c?{scope:c}:{},wsName:s,wsDir:e,type:`monorepo-workspace`}).map(t=>({...t,path:`${e}/${t.path}`})));break}case`folder`:l.push({path:`README.md`,content:`# ${s}\n`});break;default:l.push(...r({name:s,...c?{scope:c}:{},type:`project`}))}return{written:a(l,t.cwd)}}function f(n,r){let i=n.dir;if(!i)throw Error(`Local template "${n.id}" has no directory.`);let a=o(i),s=/* @__PURE__ */ new Set([...l,...a?.ignore??[]]),d=n.tokens?.open??`{{`,f=n.tokens?.close??`}}`,p=u(r),m=r.overwrite!==!1,h=[],g=n=>{let a=e.join(i,n);for(let o of c.readdirSync(a,{withFileTypes:!0})){if(s.has(o.name))continue;let a=n?`${n}/${o.name}`:o.name;if(o.isDirectory()){g(a);continue}let l=e.join(r.cwd,t(a,p,{open:d,close:f}));if(!m&&c.existsSync(l))continue;c.mkdirSync(e.dirname(l),{recursive:!0});let u=c.readFileSync(e.join(i,a),`utf-8`);c.writeFileSync(l,t(u,p,{open:d,close:f}),`utf-8`),h.push(l)}};return g(``),{written:h}}async function p(e,t){let n=e.source.subdir?`${e.source.locate}/${e.source.subdir}`:e.source.locate,r=[`create`];n&&r.push(n);let i=t.tokens?.name;return i&&r.push(String(i)),{written:[],code:(await s(r,{cwd:t.cwd})).code}}async function m(e,t){if(e.builtin)return d(e,t);switch(e.source.type){case`local`:return f(e,t);case`vite-plus`:case`npm`:case`git`:return p(e,t);default:throw Error(`Template "${e.id}" has no scaffold handler.`)}}export{m as scaffoldTemplate};
@@ -0,0 +1,59 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { ToolingTemplateKind, ToolingTemplateSource } from "../../shared/src/config-schema.js";
4
+ import "../../shared/src/index.js";
5
+ //#region packages/template/src/types.d.ts
6
+ /** What a template produces (shared with the registry source model). */
7
+ export type TemplateKind = ToolingTemplateKind;
8
+ /** A value a local template prompts for / substitutes. */
9
+ export interface TemplateVariable {
10
+ /** The token name (also the `{{ token }}` used in files). */
11
+ name: string;
12
+ /** Prompt text. */
13
+ prompt?: string;
14
+ /** Default value. */
15
+ default?: string;
16
+ }
17
+ /** A resolved template (builtin, local directory, or an online source). */
18
+ export interface Template {
19
+ /** Stable id, used by `create --template <id>`. */
20
+ id: string;
21
+ /** Display name. */
22
+ name: string;
23
+ description?: string;
24
+ kind: TemplateKind;
25
+ /** How/where the template is loaded from. */
26
+ source: ToolingTemplateSource;
27
+ tags?: string[];
28
+ /** Whether creating from it needs network access. */
29
+ online?: boolean;
30
+ /** Builtin templates only: which local generator to run. */
31
+ builtin?: 'single' | 'application' | 'folder' | 'monorepo-root' | 'monorepo-workspace';
32
+ /** Local templates only: the absolute directory holding `template.json`. */
33
+ dir?: string;
34
+ /** Variables a local template declares. */
35
+ variables?: TemplateVariable[];
36
+ /** The token prefix used by a local template's files (default `{{`/`}}`). */
37
+ tokens?: {
38
+ open?: string;
39
+ close?: string;
40
+ };
41
+ }
42
+ /** The `template.json` a local template directory may contain. */
43
+ export interface TemplateManifest {
44
+ name?: string;
45
+ description?: string;
46
+ kind?: TemplateKind;
47
+ tags?: string[];
48
+ variables?: TemplateVariable[];
49
+ /** Globs/paths (relative) never copied. */
50
+ ignore?: string[];
51
+ /** Commands to run after scaffolding (documentation only for now). */
52
+ post?: string[];
53
+ /** Custom token delimiters. */
54
+ tokens?: {
55
+ open?: string;
56
+ close?: string;
57
+ };
58
+ }
59
+ //#endregion
@@ -0,0 +1,35 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { GeneratedTsconfigResult } from "./utils.js";
4
+ //#region packages/tsconfig/src/cli/generate/index.d.ts
5
+ export interface GenerateTsconfigsOptions {
6
+ /** The repo root to scan (default `process.cwd()`). */
7
+ cwd?: string;
8
+ /** Inject path aliases from the monorepo config (default true). */
9
+ aliases?: boolean;
10
+ /** Emit `composite: true` + project references (default false). */
11
+ composite?: boolean;
12
+ /** Wire project references between workspaces (default false). */
13
+ refs?: boolean;
14
+ /** JSON indentation (default 4). */
15
+ indent?: number;
16
+ /** The glob for the workspace `tsconfig.default.json` files. */
17
+ glob?: string;
18
+ /** The glob for "override" (app) workspaces. */
19
+ appGlob?: string;
20
+ /** The monorepo tsconfig file name (default `tsconfig.monorepo.json`). */
21
+ monorepoTsconfigFilename?: string;
22
+ /** Log progress (default true). */
23
+ log?: boolean;
24
+ /** Write the generated files to disk (default true; false for a dry run). */
25
+ write?: boolean;
26
+ }
27
+ /**
28
+ * Extend every workspace `tsconfig.default.json` into a generated
29
+ * `tsconfig.json` (and rewrite its `tsconfig.build.json`), optionally wiring
30
+ * path aliases + project references from `tsconfig.monorepo.json`.
31
+ */
32
+ export declare function generateTsconfigs(options?: GenerateTsconfigsOptions): GeneratedTsconfigResult[];
33
+ /** CLI entry (used by the `tsconfig` command). */
34
+ export declare function runTsconfigCli(argv?: string[]): void;
35
+ //#endregion
@@ -0,0 +1 @@
1
+ import{default as e}from"node:path";import{pathToFileURL as t}from"node:url";import.meta.url;import{generateTsconfig as n}from"./utils.js";import r from"node:fs";import{parseArgs as i}from"node:util";import{Glob as a}from"glob";function o(t={}){let{aliases:i=!0,composite:o=!1,refs:s=!1,indent:c=4,glob:l=`**/tsconfig.default.json`,appGlob:u=`apps/**/tsconfig.default.json`,monorepoTsconfigFilename:d=`tsconfig.monorepo.json`,log:f=!0,write:p=!0}=t,m=t.cwd??process.cwd(),h=e=>{f&&console.log(e)};i||h(`Ignoring path aliases for all tsconfigs...`),o||h(`Disabling compilerOptions.composite for all tsconfigs...`),s||h(`Ignoring project references for all tsconfigs...`);let g=e.resolve(m,d),_=e.relative(m,g),v=new a(l,{cwd:m,withFileTypes:!0}).walkSync(),y=new a(u,{cwd:m,withFileTypes:!0}).walkSync().map(e=>e.fullpath());h(`Extending ${v.length} tsconfigs with ${_}...`);let b=[];for(let t of v){let r=t.fullpath(),a=e.dirname(r),l=s&&y.some(e=>e===r);b.push(n({cwd:m,dirname:a,tsconfigPath:r,monorepoTsconfigPath:g,tsconfigBuildPath:e.resolve(a,`tsconfig.build.json`),targetTsconfigPath:e.resolve(a,`tsconfig.json`),targetTsconfigBuildPath:e.resolve(a,`tsconfig.build.json`),indent:c,disableComposite:!o||l,ignoreAliases:!i,ignoreReferences:!s,write:p}))}if(!s)return b;h(`Checking for additional tsconfig changes...`);for(let t of b){let{dirname:n,dirnameRelative:i,tsconfigPath:a,targetTsconfigPath:o,config:s}=t;h(` - ${i}`),!y.some(e=>e===a)&&(s.references?.length&&(s.references=s.references.filter(t=>{let i=e.resolve(n,t.path);if(!r.existsSync(i))return h(` tsconfig not found for ${t.path}, skipping.`),!1;let a=JSON.parse(r.readFileSync(i,`utf-8`));return a.compilerOptions?.composite!=null&&a.compilerOptions?.composite!==!1})),p&&r.writeFileSync(o,`${JSON.stringify(s,null,c)}\n`))}return b}function s(e=process.argv.slice(2)){let{values:t}=i({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`}}});o({aliases:t.aliases,composite:t.composite,refs:t.refs,indent:Number.parseInt(t.indent,10)})}if(import.meta.url===t(process.argv[1]??``).href)try{s()}catch(e){console.error(`Failed to generate tsconfigs due to:`,e),process.exit(1)}export{o as generateTsconfigs,s as runTsconfigCli};
@@ -0,0 +1,43 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { TsConfigJson } from "/home/runner/work/toolchain/toolchain/node_modules/type-fest/index.js";
4
+ //#region packages/tsconfig/src/cli/generate/utils.d.ts
5
+ export type GeneratedTsconfigResult = ReturnType<typeof generateTsconfig>;
6
+ export declare function generateTsconfig(options: {
7
+ cwd: string;
8
+ dirname: string;
9
+ tsconfigPath: string;
10
+ monorepoTsconfigPath: string;
11
+ tsconfigBuildPath: string;
12
+ targetTsconfigPath: string;
13
+ targetTsconfigBuildPath: string;
14
+ indent?: number;
15
+ ignoreAliases?: boolean;
16
+ ignoreReferences?: boolean;
17
+ disableComposite?: boolean;
18
+ /** Write the generated files to disk (default true). */
19
+ write?: boolean;
20
+ }): {
21
+ cwd: string;
22
+ dirname: string;
23
+ tsconfigPath: string;
24
+ monorepoTsconfigPath: string;
25
+ tsconfigBuildPath: string;
26
+ targetTsconfigPath: string;
27
+ targetTsconfigBuildPath: string;
28
+ indent?: number;
29
+ ignoreAliases?: boolean;
30
+ ignoreReferences?: boolean;
31
+ disableComposite?: boolean;
32
+ /** Write the generated files to disk (default true). */
33
+ write?: boolean;
34
+ dirnameRelative: string;
35
+ tsconfigFilename: string;
36
+ config: TsConfigJson;
37
+ newTsconfig: TsConfigJson;
38
+ newTsconfigBuild: TsConfigJson | undefined;
39
+ originalConfig: TsConfigJson;
40
+ tsconfigMonorepo: TsConfigJson;
41
+ tsconfigBuild: TsConfigJson | undefined;
42
+ };
43
+ //#endregion
@@ -0,0 +1 @@
1
+ import{default as e}from"node:path";import"node:url";import.meta.url;import t from"node:fs";function n(n){let{cwd:i,dirname:a,tsconfigPath:o,monorepoTsconfigPath:s,tsconfigBuildPath:c,targetTsconfigPath:l,targetTsconfigBuildPath:u,indent:d=4,disableComposite:f,ignoreAliases:p,ignoreReferences:m,write:h=!0}=n,g=e.relative(i,a).replace(/\\/g,`/`)||`.`;try{if(!t.existsSync(o))throw Error(`Source tsconfig not found: ${o}`);if(!s)throw Error(`options.monorepoTsconfigPath not set for ${o}`);if(!t.existsSync(s))throw Error(`Root 'tsconfig.monorepo.json' not found: ${s}`);console.log(` - ${g}`);let i=e.basename(o),u=t.existsSync(c),_=JSON.parse(t.readFileSync(s,`utf-8`)),v=JSON.parse(t.readFileSync(o,`utf-8`)),y=u?JSON.parse(t.readFileSync(c,`utf-8`)):void 0,b=f?[]:[.../* @__PURE__ */ new Set([...v.compilerOptions?.types??[],...f?[]:_.compilerOptions?.types??[]])],x={...f?{}:_,extends:`./${i}`,compilerOptions:{...f?{composite:!1}:_.compilerOptions,...b.length?{types:b}:{},...p?{}:{paths:{...v.compilerOptions?.paths,..._.compilerOptions?.paths?Object.fromEntries(Object.entries(_.compilerOptions.paths).reduce((e,t)=>{let[n,i]=t,o=!0,s=i.map(e=>r(e,a)),c=[];for(let{newPath:e,isRoot:t,inRootDir:n}of s)(!t&&!n||/^.$/.test(g))&&(o=!1,c.push(e));return o?e:e.concat([[n,c]])},[])):{}}}},...m?{}:{references:(v.references??[]).concat(_.references??[]).reduce((e,t)=>{if(e.find(e=>e.path===t.path))return e;let{newPath:n,isRoot:i,inRootDir:o}=r(t.path,a);return(i||o)&&!/^.$/.test(g)?e:e.concat([{...t,path:n}])},[])}},S=u?{...y,extends:`./${i}`}:void 0;return h&&t.writeFileSync(l,`${JSON.stringify(x,null,d)}\n`),{...n,dirnameRelative:g,tsconfigFilename:i,config:x,newTsconfig:x,newTsconfigBuild:S,originalConfig:v,tsconfigMonorepo:_,tsconfigBuild:y}}catch(e){console.error(` Failed to extend tsconfig for`,g,`due to:`,e),process.exit(1)}}function r(t,n){let r=t.split(`/`);if(!r.length||!r[r.length-1])return{isRoot:!1,newPath:t};let i=e.basename(t),a=e.dirname(t),o=!1,s=!1,c=e.join(e.relative(n,a),i).replace(/\\/g,`/`);c=c.startsWith(`.`)?c:`./${c}`;let l=e.dirname(e.resolve(n,c));return n===l&&(o=!0),l.startsWith(n)&&(s=!0),{isRoot:o,inRootDir:s,newPath:c,newPathDirname:l}}export{n as generateTsconfig};
@@ -0,0 +1,11 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { ToolingCommand } from "../../../shared/src/types.js";
4
+ import "../../../shared/src/index.js";
5
+ //#region packages/tsconfig/src/cli/index.d.ts
6
+ /**
7
+ * The `tsconfig` command. Defaults come from `dbx.config.tsconfig.*;
8
+ * (via the command context); any CLI flag overrides them.
9
+ */
10
+ export declare function tsconfigCommands(): ToolingCommand[];
11
+ //#endregion
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;import{sectionConfig as e}from"../../../shared/src/toolchain.js";import"../../../shared/src/index.js";import{generateTsconfigs as t}from"./generate/index.js";function n(){return[{name:`tsconfig`,description:`Generate workspace tsconfig.json files from tsconfig.default.json (aliases + references).`,options:[{flags:`--cwd <dir>`,description:`Repo root to scan (default: cwd).`},{flags:`--no-aliases`,description:`Skip path aliases.`},{flags:`--composite`,description:`Emit composite + references.`},{flags:`--refs`,description:`Wire project references.`},{flags:`-i, --indent <n>`,description:`JSON indentation.`},{flags:`--glob <glob>`,description:`Glob for tsconfig.default.json files.`},{flags:`--app-glob <glob>`,description:`Glob for app override workspaces.`},{flags:`--root-file <file>`,description:`Monorepo tsconfig file name.`}],run:(n,r)=>{let i=e(r.config.tsconfig)??{};t({cwd:r.cwd,aliases:n.aliases??i.aliases??!0,composite:n.composite??i.composite??!1,refs:n.refs??i.refs??!1,indent:n.indent===void 0?i.indent:Number.parseInt(String(n.indent),10),glob:n.glob??i.glob??`**/tsconfig.default.json`,appGlob:n.appGlob??i.appGlob??`apps/**/tsconfig.default.json`,monorepoTsconfigFilename:n.rootFile??i.rootFile??`tsconfig.monorepo.json`})}}]}export{n as tsconfigCommands};
@@ -0,0 +1,10 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { GenerateTsconfigsOptions, generateTsconfigs, runTsconfigCli } from "./cli/generate/index.js";
4
+ import { tsconfigSyncTask } from "./sync.js";
5
+ import { DEFAULT_TSCONFIG_REPLACEMENTS, MonorepoTsconfigOptions, MonorepoWorkspace, buildMonorepoTsconfig, renderMonorepoTsconfig, renderTsconfigBase, renderTsconfigBuild, renderTsconfigDefault, renderTsconfigTemplates, tsconfigBaseTemplate, tsconfigBuildTemplate, tsconfigDefaultTemplate } from "./templates.js";
6
+ declare namespace index_d_exports {
7
+ export { DEFAULT_TSCONFIG_REPLACEMENTS, GenerateTsconfigsOptions, MonorepoTsconfigOptions, MonorepoWorkspace, buildMonorepoTsconfig, generateTsconfigs, renderMonorepoTsconfig, renderTsconfigBase, renderTsconfigBuild, renderTsconfigDefault, renderTsconfigTemplates, runTsconfigCli, tsconfigBaseTemplate, tsconfigBuildTemplate, tsconfigDefaultTemplate, tsconfigSyncTask };
8
+ }
9
+ //#endregion
10
+ export { DEFAULT_TSCONFIG_REPLACEMENTS, GenerateTsconfigsOptions, MonorepoTsconfigOptions, MonorepoWorkspace, buildMonorepoTsconfig, generateTsconfigs, index_d_exports, renderMonorepoTsconfig, renderTsconfigBase, renderTsconfigBuild, renderTsconfigDefault, renderTsconfigTemplates, runTsconfigCli, tsconfigBaseTemplate, tsconfigBuildTemplate, tsconfigDefaultTemplate, tsconfigSyncTask };
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;import{__exportAll as e}from"../../../_virtual/_rolldown/runtime.js";import{generateTsconfigs as t,runTsconfigCli as n}from"./cli/generate/index.js";import{tsconfigSyncTask as r}from"./sync.js";import{DEFAULT_TSCONFIG_REPLACEMENTS as i,buildMonorepoTsconfig as a,renderMonorepoTsconfig as o,renderTsconfigBase as s,renderTsconfigBuild as c,renderTsconfigDefault as l,renderTsconfigTemplates as u,tsconfigBaseTemplate as d,tsconfigBuildTemplate as f,tsconfigDefaultTemplate as p}from"./templates.js";var m=/* @__PURE__ */ e({DEFAULT_TSCONFIG_REPLACEMENTS:()=>i,buildMonorepoTsconfig:()=>a,generateTsconfigs:()=>t,renderMonorepoTsconfig:()=>o,renderTsconfigBase:()=>s,renderTsconfigBuild:()=>c,renderTsconfigDefault:()=>l,renderTsconfigTemplates:()=>u,runTsconfigCli:()=>n,tsconfigBaseTemplate:()=>d,tsconfigBuildTemplate:()=>f,tsconfigDefaultTemplate:()=>p,tsconfigSyncTask:()=>r});export{i as DEFAULT_TSCONFIG_REPLACEMENTS,a as buildMonorepoTsconfig,t as generateTsconfigs,o as renderMonorepoTsconfig,s as renderTsconfigBase,c as renderTsconfigBuild,l as renderTsconfigDefault,u as renderTsconfigTemplates,n as runTsconfigCli,m as src_exports,d as tsconfigBaseTemplate,f as tsconfigBuildTemplate,p as tsconfigDefaultTemplate,r as tsconfigSyncTask};
@@ -0,0 +1,15 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { SyncTask } from "../../shared/src/toolchain.js";
4
+ import "../../shared/src/index.js";
5
+ //#region packages/tsconfig/src/sync.d.ts
6
+ /**
7
+ * The tsconfig sync task: regenerates every workspace `tsconfig.json` from the
8
+ * `tsconfig.default.json` files, applying the monorepo aliases + references.
9
+ * `tsconfig.build.json` is treated as a user-owned input (like
10
+ * `tsconfig.default.json`) and is never rewritten. Watches
11
+ * `tsconfig.monorepo.json` and any `tsconfig.default.json` so a change re-runs
12
+ * it in watch mode.
13
+ */
14
+ export declare function tsconfigSyncTask(): SyncTask;
15
+ //#endregion
@@ -0,0 +1 @@
1
+ import{default as e}from"node:path";import"node:url";import.meta.url;import{sectionConfig as t,sectionEnabled as n}from"../../shared/src/toolchain.js";import"../../shared/src/index.js";import{generateTsconfigs as r}from"./cli/generate/index.js";import i from"node:fs";function a(t,n){return e.relative(t,n).replace(/\\/g,`/`)}function o(){return{name:`tsconfig`,projectTypes:[`monorepo-root`],enabled:e=>n(e.tsconfig),watch:[`tsconfig.monorepo.json`,`**/tsconfig.default.json`],keep:[`tsconfig.build.json`],run:n=>{let o=t(n.config.tsconfig)??{},s=o.rootFile??`tsconfig.monorepo.json`;if(!i.existsSync(e.resolve(n.cwd,s)))return n.log(`tsconfig: no ${s} at the root; skipping.`),[];let c=o.indent??4,l=r({cwd:n.cwd,aliases:o.aliases??!0,composite:o.composite??!1,refs:o.refs??!1,indent:c,glob:o.glob??`**/tsconfig.default.json`,appGlob:o.appGlob??`apps/**/tsconfig.default.json`,monorepoTsconfigFilename:s,log:!1,write:!1}),u=[];for(let e of l)u.push({path:a(n.cwd,e.targetTsconfigPath),content:`${JSON.stringify(e.newTsconfig,null,c)}\n`});return n.log(`tsconfig: regenerated ${l.length} workspace tsconfig(s).`),u}}}export{o as tsconfigSyncTask};
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;var e={compilerOptions:{target:`ES2022`,module:`ESNext`,moduleResolution:`Bundler`,lib:[`ES2022`],strict:!0,skipLibCheck:!0,noEmit:!0,allowJs:!0,esModuleInterop:!0,forceConsistentCasingInFileNames:!0,resolveJsonModule:!0,isolatedModules:!0,noUncheckedIndexedAccess:!0,noFallthroughCasesInSwitch:!0}};export{e as default};
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;var e={extends:`./tsconfig.default.json`,include:[`src`,`{{envTypesFile}}`,`apps/*/src`,`packages/*/src`,`scripts`,`sdk/*/src`],exclude:[`**/dist`,`**/node_modules`,`docs`]};export{e as default};
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;var e={extends:`./tsconfig.base.json`,compilerOptions:{module:`ESNext`,moduleResolution:`Bundler`,jsx:`react-jsx`,lib:[`ES2022`,`DOM`,`DOM.Iterable`],types:[`node`]},exclude:[`**/dist`,`**/node_modules`,`apps`,`docs`,`packages`,`sdk`],include:[`src`,`{{envTypesFile}}`,`scripts`,`.oas/**/*`,`package.json`]};export{e as default};
@@ -0,0 +1,38 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { Replacements } from "../../shared/src/template.js";
4
+ import "../../shared/src/index.js";
5
+ //#region packages/tsconfig/src/templates.d.ts
6
+ /** The static tsconfig templates (with `{{envTypesFile}}` tokens). */
7
+ export declare const tsconfigBaseTemplate: Record<string, unknown>;
8
+ export declare const tsconfigDefaultTemplate: Record<string, unknown>;
9
+ export declare const tsconfigBuildTemplate: Record<string, unknown>;
10
+ /** The default replacement values for the tsconfig templates. */
11
+ export declare const DEFAULT_TSCONFIG_REPLACEMENTS: Replacements;
12
+ export declare function renderTsconfigBase(replacements?: Replacements): string;
13
+ export declare function renderTsconfigDefault(replacements?: Replacements): string;
14
+ export declare function renderTsconfigBuild(replacements?: Replacements): string;
15
+ /** A workspace entry for the generated monorepo tsconfig. */
16
+ export interface MonorepoWorkspace {
17
+ /** The path alias suffix, eg. `server` -> `@scope/server`. */
18
+ alias: string;
19
+ /** The workspace directory relative to the repo root, eg. `packages/server`. */
20
+ dir: string;
21
+ }
22
+ export interface MonorepoTsconfigOptions {
23
+ /** The npm scope, eg. `@acme` (used as the alias prefix). */
24
+ scope: string;
25
+ /** The workspaces to wire into `paths` + `references`. */
26
+ workspaces: MonorepoWorkspace[];
27
+ /** Extra compiler options to merge in. */
28
+ compilerOptions?: Record<string, unknown>;
29
+ /** Enable `composite` for the generated monorepo config (default true). */
30
+ composite?: boolean;
31
+ }
32
+ /** Build a project-references + path-aliases `tsconfig.monorepo.json` object. */
33
+ export declare function buildMonorepoTsconfig(options: MonorepoTsconfigOptions): Record<string, unknown>;
34
+ /** Render the monorepo tsconfig as JSON text. */
35
+ export declare function renderMonorepoTsconfig(options: MonorepoTsconfigOptions): string;
36
+ /** Render every tsconfig template, keyed by file name. */
37
+ export declare function renderTsconfigTemplates(replacements?: Replacements): Record<string, string>;
38
+ //#endregion
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;import{applyReplacementsDeep as e}from"../../shared/src/template.js";import"../../shared/src/index.js";import t from"./templates/tsconfig.base.js";import n from"./templates/tsconfig.build.js";import r from"./templates/tsconfig.default.js";const i=t,a=r,o=n,s={envTypesFile:`src/env.d.ts`};function c(t={}){return`${JSON.stringify(e(i,{...s,...t}),null,4)}\n`}function l(t={}){return`${JSON.stringify(e(a,{...s,...t}),null,4)}\n`}function u(t={}){return`${JSON.stringify(e(o,{...s,...t}),null,4)}\n`}function d(e){let t={},n=[];for(let r of e.workspaces)t[`${e.scope}/${r.alias}`]=[`./${r.dir}/src/index.ts`],t[`${e.scope}/${r.alias}/*`]=[`./${r.dir}/src/*`],n.push({path:`./${r.dir}/tsconfig.json`});return{compilerOptions:{composite:e.composite??!0,types:[`node`],allowJs:!0,noEmit:!1,declaration:!0,emitDeclarationOnly:!0,...e.compilerOptions,paths:t},references:n}}function f(e){return`${JSON.stringify(d(e),null,4)}\n`}function p(e={}){return{"tsconfig.base.json":c(e),"tsconfig.default.json":l(e),"tsconfig.build.json":u(e)}}export{s as DEFAULT_TSCONFIG_REPLACEMENTS,d as buildMonorepoTsconfig,f as renderMonorepoTsconfig,c as renderTsconfigBase,u as renderTsconfigBuild,l as renderTsconfigDefault,p as renderTsconfigTemplates,i as tsconfigBaseTemplate,o as tsconfigBuildTemplate,a as tsconfigDefaultTemplate};
@@ -0,0 +1,17 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ //#region packages/tsdown/src/cleanup.d.ts
4
+ export interface CleanupOptions {
5
+ /** Directory to search from (default `process.cwd()`). */
6
+ cwd?: string;
7
+ /** Glob patterns to ignore (default `['**\/node_modules\/**']`). */
8
+ ignore?: string[];
9
+ /** Return the removed paths instead of logging each one. */
10
+ silent?: boolean;
11
+ }
12
+ /**
13
+ * Remove files/directories matching `patterns` from `cwd`. Used by the
14
+ * `cleanup` (build) and `cleanup:turbo` commands.
15
+ */
16
+ export declare function cleanup(type: string, patterns: string | string[], options?: CleanupOptions): string[];
17
+ //#endregion
@@ -0,0 +1 @@
1
+ import{default as e}from"node:path";import"node:url";import.meta.url;import t from"node:fs";import{Glob as n}from"glob";function r(r,i,a={}){let o=Array.isArray(i)?i:[i];if(!o.length)return a.silent||console.log(`Search pattern not provided. Skipping ${r} cleanup.`),[];let s=a.cwd??process.cwd(),c=new n(o,{cwd:s,dot:!0,ignore:a.ignore??[`**/node_modules/**`]}).walkSync();if(!c.length)return a.silent||console.log(`No ${r} artifacts found. Skipping cleanup.`),[];a.silent||console.log(`Cleaning up ${r} artifacts:`);let l=[];for(let n of c)t.rmSync(e.resolve(s,n),{recursive:!0,force:!0}),l.push(n),a.silent||console.log(` - ${n}`);return l}export{r as cleanup};
@@ -0,0 +1,11 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { ToolingCommand } from "../../../shared/src/types.js";
4
+ import "../../../shared/src/index.js";
5
+ //#region packages/tsdown/src/cli/index.d.ts
6
+ /**
7
+ * The cleanup commands (`cleanup`, `cleanup:turbo`). The working directory
8
+ * comes from `context.cwd` (the root the config was loaded from).
9
+ */
10
+ export declare function cleanupCommands(): ToolingCommand[];
11
+ //#endregion
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;import{cleanup as e}from"../cleanup.js";function t(){return[{name:`cleanup`,description:`Remove build artifacts (*.tsbuildinfo, dist/).`,options:[{flags:`--cwd <dir>`,description:`Directory to clean (default: cwd).`},{flags:`--pattern <glob...>`,description:`Override the match globs.`}],run:(t,n)=>{let r=Array.isArray(t.pattern)&&t.pattern.length?t.pattern:[`**/*.tsbuildinfo`,`**/dist/`];e(`build`,r,{cwd:n.cwd})}},{name:`cleanup:turbo`,description:`Remove the turbo cache (.turbo/).`,options:[{flags:`--cwd <dir>`,description:`Directory to clean (default: cwd).`}],run:(t,n)=>{e(`turbo cache`,[`**/.turbo/`],{cwd:n.cwd})}}]}export{t as cleanupCommands};
@@ -0,0 +1,37 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { UserConfig } from "tsdown";
4
+ //#region packages/tsdown/src/config/node.d.ts
5
+ /**
6
+ * The shared tsdown base configuration. Kept project-agnostic: the ASCII/banner
7
+ * branding is opt-in via {@link createPostBanner} and consumer metadata.
8
+ */
9
+ export declare const baseTsdownConfig: UserConfig;
10
+ /** Options for a branded tsdown "post banner". */
11
+ export interface PostBannerOptions {
12
+ /** The project/package name (eg. `Proxified`). */
13
+ name?: string;
14
+ /** The version to embed. */
15
+ version?: string;
16
+ /** The license identifier. */
17
+ license?: string;
18
+ /** The project homepage. */
19
+ homepage?: string;
20
+ /** A custom multi-line ASCII banner. */
21
+ banner?: string;
22
+ /** A custom copyright line. */
23
+ copyright?: string;
24
+ }
25
+ /**
26
+ * Build tsdown's `outputOptions.postBanner` hook from project metadata so the
27
+ * consumer's branding (name, version, license, ASCII art) is applied generically.
28
+ */
29
+ export declare function createPostBanner(options?: PostBannerOptions): (ctx: {
30
+ fileName: string;
31
+ }) => string;
32
+ /**
33
+ * Create a tsdown config by merging the base config with per-project overrides
34
+ * and an optional branded post banner.
35
+ */
36
+ export declare function createTsdownConfig(overrides?: UserConfig, banner?: PostBannerOptions): UserConfig;
37
+ //#endregion
@@ -0,0 +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(`
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};
@@ -0,0 +1,9 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { CleanupOptions, cleanup } from "./cleanup.js";
4
+ import { PostBannerOptions, baseTsdownConfig, createPostBanner, createTsdownConfig } from "./config/node.js";
5
+ declare namespace index_d_exports {
6
+ export { CleanupOptions, PostBannerOptions, baseTsdownConfig, cleanup, createPostBanner, createTsdownConfig };
7
+ }
8
+ //#endregion
9
+ export { CleanupOptions, PostBannerOptions, baseTsdownConfig, cleanup, createPostBanner, createTsdownConfig, index_d_exports };
@@ -0,0 +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};
@@ -0,0 +1,8 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { ToolingCommand } from "../../../shared/src/types.js";
4
+ import "../../../shared/src/index.js";
5
+ //#region packages/vite/src/cli/index.d.ts
6
+ /** Every Vite+ passthrough command (the generic `vite` + one per subcommand). */
7
+ export declare function viteCommands(): ToolingCommand[];
8
+ //#endregion
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;import{VP_COMMANDS as e,viteCommandName as t}from"../commands.js";import{runVp as n}from"../vp.js";const r={flags:`--cwd <dir>`,description:"Project root to run `vp` in (default: cwd)."};function i(e,t,i){return{name:e,description:t,passthrough:!0,options:[r],run:async(e,t)=>{let r=e.args??[],a=e.cwd??t.cwd,o=await n([...i,...r],{cwd:a});o.code!==0&&(process.exitCode=o.code)}}}function a(){return[i(`vite`,"Run any Vite+ command through `vp` (eg. `dbx vite dev`).",[]),...e.map(e=>i(t(e.name),`Vite+: ${e.description}`,[e.name]))]}export{a as viteCommands};
@@ -0,0 +1,29 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ //#region packages/vite/src/commands.d.ts
4
+ /**
5
+ * The Vite+ (`vp`) command catalog.
6
+ *
7
+ * Every `vp` subcommand is surfaced as a first-class `dbx vite:<name>`
8
+ * passthrough, and the whole set is also reachable through the generic
9
+ * `dbx vite <anything>` escape hatch. The catalog drives both the CLI
10
+ * registration and the provider descriptor the VS Code extension consumes.
11
+ */
12
+ /** A UI group for a vp command. */
13
+ export type VpGroup = 'start' | 'develop' | 'execute' | 'build' | 'deps' | 'maintain';
14
+ /** A vp subcommand description. */
15
+ export interface VpCommandInfo {
16
+ /** The vp subcommand, eg. `dev`. */
17
+ name: string;
18
+ /** Human-readable description. */
19
+ description: string;
20
+ /** UI group. */
21
+ group: VpGroup;
22
+ /** Alternate names vp accepts, eg. `i` for `install`. */
23
+ aliases?: string[];
24
+ }
25
+ /** Every `vp` subcommand, grouped as the Vite+ `vp help` output is. */
26
+ export declare const VP_COMMANDS: VpCommandInfo[];
27
+ /** The `dbx` command name for a vp subcommand (`dev` -> `vite:dev`). */
28
+ export declare function viteCommandName(subcommand: string): string;
29
+ //#endregion