@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;import{sectionConfig as e}from"../../packages/shared/src/toolchain.js";import"../../packages/shared/src/index.js";import{defaultSyncTasks as t}from"../../sync.js";const n=[{flags:`--cwd <dir>`,description:`Project root (default: cwd).`},{flags:`-q, --quiet`,description:`Only log errors.`}];function r(n){let r=e(n.config.watch);return{tasks:t(),cwd:n.cwd,projectType:n.projectType,config:n.config,tokens:n.tokens,...n.configPath?{configPath:n.configPath}:{},...r?.debounce===void 0?{}:{debounce:r.debounce}}}export{n as baseOptions,r as watchOptions};
@@ -0,0 +1 @@
1
+ import{default as e}from"node:path";import"node:url";import.meta.url;import{loadToolingConfig as t}from"../../packages/core/src/loader.js";import{buildProjectGraph as n,writeProjectGraph as r}from"../../packages/core/src/graph.js";import{runSync as i}from"../../packages/core/src/sync.js";import{runWatch as a}from"../../packages/core/src/watch.js";import"../../packages/core/src/index.js";import{defaultSyncTasks as o}from"../../sync.js";import{baseOptions as s,watchOptions as c}from"./shared.js";function l(){return{name:`sync`,description:`Regenerate every managed file from dbx.config.*.`,options:[...s,{flags:`--check`,description:`Do not write; fail if files are out of date.`},{flags:`--watch`,description:`Keep running and re-sync on change.`},{flags:`--recursive`,description:`Sync every discovered dbx project in dependency order.`},{flags:`--force`,description:`Run even when no dbx.config.* is present.`}],run:async(s,l)=>{let u=!!s.quiet,d=!!s.check;if(s.recursive){let a=n(l.cwd);r(l.cwd,a);for(let n of a.order){let r=e.resolve(l.cwd,n),a=await t(r),s=await i({tasks:o(),cwd:r,projectType:a.projectType,config:a.config,tokens:a.tokens,check:d,quiet:u});d&&!s.upToDate&&(process.exitCode=1)}return}if(!l.configPath&&!s.force){console.warn(`dbx: no dbx.config.* found here; nothing to sync (use --force to run anyway).`);return}if(s.watch){await a({...c(l),quiet:u});return}let f=await i({...c(l),check:d,quiet:u});d&&!f.upToDate&&(process.exitCode=1);try{r(l.cwd,n(l.cwd))}catch{}}}}export{l as syncCommand};
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;import{sectionConfig as e}from"../../packages/shared/src/toolchain.js";import"../../packages/shared/src/index.js";import{runWatch as t}from"../../packages/core/src/watch.js";import"../../packages/core/src/index.js";import{baseOptions as n,watchOptions as r}from"./shared.js";function i(){return{name:`watch`,description:`Sync once, then watch key files and re-sync on change.`,options:[...n,{flags:`--force`,description:`Run even when no dbx.config.* is present.`}],run:async(n,i)=>{!i.configPath&&!n.force?console.warn(`dbx: no dbx.config.* found here; nothing to watch (use --force to run anyway).`):e(i.config.watch)?.enabled===!1?console.warn(`dbx: watch is disabled in the config.`):await t({...r(i),quiet:!!n.quiet})}}}export{i as watchCommand};
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;import{loadToolingConfig as e}from"../packages/core/src/loader.js";import"../packages/core/src/index.js";const t=/* @__PURE__ */ new Map;function n(n){let r=t.get(n);return r||(r=e(n),t.set(n,r)),r}export{n as loadContext};
@@ -0,0 +1,15 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { ToolingCommand } from "../packages/shared/src/types.js";
4
+ import "../packages/shared/src/index.js";
5
+ import { registerToolingCommands } from "./register.js";
6
+ import { Command } from "commander";
7
+ //#region src/cli/index.d.ts
8
+ /** The commands built into the root CLI (config commands need a consumer engine). */
9
+ export declare function builtinCommands(): ToolingCommand[];
10
+ /** Build the `dbx` commander program. */
11
+ export declare function createCli(): Command;
12
+ /** Parse and run the CLI. */
13
+ export declare function runCli(argv?: string[]): Promise<void>;
14
+ //#endregion
15
+ export { registerToolingCommands };
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import"node:path";import{fileURLToPath as e}from"node:url";import.meta.url;import{projectCommands as t}from"../packages/project/src/cli/index.js";import{changelogCommands as n}from"../packages/changelog/src/cli/index.js";import{migrateCommands as r}from"../packages/migrate/src/cli/index.js";import{viteCommands as i}from"../packages/vite/src/cli/index.js";import{templateCommands as a}from"../packages/template/src/cli/index.js";import{tsconfigCommands as o}from"../packages/tsconfig/src/cli/index.js";import{cleanupCommands as s}from"../packages/tsdown/src/cli/index.js";import{version as c}from"../package.js";import{syncCommands as l}from"./commands/index.js";import{registerToolingCommands as u}from"./register.js";import{realpathSync as d}from"node:fs";import{Command as f}from"commander";function p(){return[...l(),...o(),...s(),...n(),...r(),...t(),...a(),...i()]}function m(){let e=new f;return e.name(`dbx`).description(`All-in-one project toolchain: configs, tsconfigs, changelogs, scaffolding.`).version(c,`-V, --version`,`Output the version number`).showHelpAfterError(),u(e,p()),e}async function h(e=process.argv){await m().parseAsync(e)}function g(){let t=process.argv[1];if(!t)return!1;try{return d(t)===e(import.meta.url)}catch{return!1}}g()&&h();export{p as builtinCommands,m as createCli,u as registerToolingCommands,h as runCli};
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;import{camelCase as e}from"../packages/shared/src/string-utils.js";import"../packages/shared/src/index.js";function t(t){let n=[];for(let r of t.split(`,`)){let t=r.trim().match(/^--(?:no-)?([^ <]+)/);t?.[1]&&n.push(e(t[1]))}return n}export{t as optionKeys};
@@ -0,0 +1,14 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { ToolingCommand } from "../packages/shared/src/types.js";
4
+ import "../packages/shared/src/index.js";
5
+ import { Command } from "commander";
6
+ //#region src/cli/register.d.ts
7
+ /**
8
+ * Register {@link ToolingCommand} descriptors on a commander program. Before a
9
+ * command runs, the consumer's `dbx.config.*` is loaded (once per cwd)
10
+ * and passed as context. Only flags the user *explicitly typed* are forwarded,
11
+ * so config-derived defaults win unless overridden on the CLI.
12
+ */
13
+ export declare function registerToolingCommands(program: Command, commands: ToolingCommand[]): Command;
14
+ //#endregion
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;import{loadContext as e}from"./context.js";import{optionKeys as t}from"./options.js";function n(n,r){for(let i of r){let r=n.command(i.name).description(i.description);i.passthrough&&r.allowUnknownOption(!0).allowExcessArguments(!0);let a=/* @__PURE__ */ new Set;for(let e of i.options??[]){for(let n of t(e.flags))a.add(n);e.default===void 0?r.option(e.flags,e.description):r.option(e.flags,e.description,e.default)}for(let e of i.args??[]){let t=e.required===!1?`[`:`<`,n=e.required===!1?`]`:`>`;r.argument(`${t}${e.name}${e.variadic?`...`:``}${n}`,e.description)}r.action(async(...t)=>{let n=t.pop(),r=t.pop()??{},o={};for(let e of a)n.getOptionValueSource(e)===`cli`&&(o[e]=r[e]);if(i.passthrough)o.args=n.args.slice();else for(let[e,n]of(i.args??[]).entries())t[e]!==void 0&&(o[n.name]=t[e]);let s=o.cwd??process.cwd();try{if(i.passthrough)await i.run(o,{cwd:s,projectType:`project`,config:{},tokens:{}});else{let t=await e(s),n={cwd:s,projectType:t.projectType,config:t.config,tokens:t.tokens,...t.path?{configPath:t.path}:{}};await i.run(o,n)}}catch(e){let t=e instanceof Error?e.message:String(e);console.error(`dbx: ${t}`),process.exitCode=1}})}return n}export{n as registerToolingCommands};
@@ -0,0 +1,18 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { ConfigEngineOptions, ConfigScopeDef, ConfigScopes, EnvValueType, EnvVarDef, EnvVarMeta, envPathOf } from "./packages/config/src/types.js";
4
+ import { CollectEnvVarsOptions, DEFAULT_ENV_PREFIX, collectEnvVars, collectRequiredEnvVars } from "./packages/config/src/collect.js";
5
+ import { BuildConfigJsonOptions, ConfigJsonDoc, ConfigJsonEntry, buildConfigJson } from "./packages/config/src/config-json.js";
6
+ import { EnvFileOptions, generateEnvFile } from "./packages/config/src/env-file.js";
7
+ import { CliArgsOptionConfig, CliArgsParser, CliArgsResult, CliArgsValues, CliFlagOptions, CliOptionDef, GenerateCliOptionsOptions, cliFlagLabel, cliFlagOf, cliShortOf, createCliArgsParser, flagOf, generateCliArgsOptions, generateCliOptions } from "./packages/config/src/generators/cli.js";
8
+ import { GenerateEnvTypesOptions, generateEnv, generateEnvDts, generateEnvTypes } from "./packages/config/src/generators/env.js";
9
+ import { GenerateJsonSchemaOptions, generateConfigJsonSchema, generateJsonSchemaFile } from "./packages/config/src/generators/json.js";
10
+ import { ConfigFileSection, GenerateMarkdownOptions, RenderConfigFileOptions, RenderMarkdownOptions, generateConfigMarkdown, renderConfigFileMarkdown, renderConfigIndex, renderScopeMarkdown } from "./packages/config/src/generators/markdown.js";
11
+ import { GenerateTypesOptions, generateConfigTypes, renderAllConfigTypes, renderConfigTypes, resolveScopeSchema } from "./packages/config/src/generators/types.js";
12
+ import { ConfigEngine, createConfigEngine } from "./packages/config/src/engine.js";
13
+ import { EnvSource, EnvTree, applyOverrides, envBool, envInt, envList, envMap, envString, parseEnvTree, readEnvPath, trimTrailingSlashes } from "./packages/config/src/env.js";
14
+ import { findProjectRoot, monorepoRoot } from "./packages/config/src/root.js";
15
+ import { SplitSchema, compileZodSchema, envMetaOf, flattenBaseSchema, resolveUntypedSchema, splitBaseSchema, zodToJsonSchema, zodToUntypedDefinition } from "./packages/config/src/schema.js";
16
+ import "./packages/config/src/index.js";
17
+ import { ConfigCommandContext, ConfigCommandDefaults, configCommands } from "./packages/config/src/cli/index.js";
18
+ export { BuildConfigJsonOptions, CliArgsOptionConfig, CliArgsParser, CliArgsResult, CliArgsValues, CliFlagOptions, CliOptionDef, CollectEnvVarsOptions, ConfigCommandContext, ConfigCommandDefaults, ConfigEngine, ConfigEngineOptions, ConfigFileSection, ConfigJsonDoc, ConfigJsonEntry, ConfigScopeDef, ConfigScopes, DEFAULT_ENV_PREFIX, EnvFileOptions, EnvSource, EnvTree, EnvValueType, EnvVarDef, EnvVarMeta, GenerateCliOptionsOptions, GenerateEnvTypesOptions, GenerateJsonSchemaOptions, GenerateMarkdownOptions, GenerateTypesOptions, RenderConfigFileOptions, RenderMarkdownOptions, SplitSchema, applyOverrides, buildConfigJson, cliFlagLabel, cliFlagOf, cliShortOf, collectEnvVars, collectRequiredEnvVars, compileZodSchema, configCommands, createCliArgsParser, createConfigEngine, envBool, envInt, envList, envMap, envMetaOf, envPathOf, envString, findProjectRoot, flagOf, flattenBaseSchema, generateCliArgsOptions, generateCliOptions, generateConfigJsonSchema, generateConfigMarkdown, generateConfigTypes, generateEnv, generateEnvDts, generateEnvFile, generateEnvTypes, generateJsonSchemaFile, monorepoRoot, parseEnvTree, readEnvPath, renderAllConfigTypes, renderConfigFileMarkdown, renderConfigIndex, renderConfigTypes, renderScopeMarkdown, resolveScopeSchema, resolveUntypedSchema, splitBaseSchema, trimTrailingSlashes, zodToJsonSchema, zodToUntypedDefinition };
package/dist/config.js ADDED
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;import{compileZodSchema as e,envMetaOf as t,flattenBaseSchema as n,resolveUntypedSchema as r,splitBaseSchema as i,zodToJsonSchema as a,zodToUntypedDefinition as o}from"./packages/config/src/schema.js";import{envPathOf as s}from"./packages/config/src/types.js";import{DEFAULT_ENV_PREFIX as c,collectEnvVars as l,collectRequiredEnvVars as u}from"./packages/config/src/collect.js";import{buildConfigJson as d}from"./packages/config/src/config-json.js";import{generateEnvFile as f}from"./packages/config/src/env-file.js";import{cliFlagLabel as p,cliFlagOf as m,cliShortOf as h,createCliArgsParser as g,flagOf as _,generateCliArgsOptions as v,generateCliOptions as y}from"./packages/config/src/generators/cli.js";import{generateEnv as b,generateEnvDts as x,generateEnvTypes as S}from"./packages/config/src/generators/env.js";import{generateConfigJsonSchema as C,generateJsonSchemaFile as w}from"./packages/config/src/generators/json.js";import{generateConfigMarkdown as T,renderConfigFileMarkdown as E,renderConfigIndex as D,renderScopeMarkdown as O}from"./packages/config/src/generators/markdown.js";import{generateConfigTypes as k,renderAllConfigTypes as A,renderConfigTypes as j,resolveScopeSchema as M}from"./packages/config/src/generators/types.js";import{findProjectRoot as N,monorepoRoot as P}from"./packages/config/src/root.js";import{createConfigEngine as F}from"./packages/config/src/engine.js";import{applyOverrides as I,envBool as L,envInt as R,envList as z,envMap as B,envString as V,parseEnvTree as H,readEnvPath as U,trimTrailingSlashes as W}from"./packages/config/src/env.js";import"./packages/config/src/index.js";import{configCommands as G}from"./packages/config/src/cli/index.js";export{c as DEFAULT_ENV_PREFIX,I as applyOverrides,d as buildConfigJson,p as cliFlagLabel,m as cliFlagOf,h as cliShortOf,l as collectEnvVars,u as collectRequiredEnvVars,e as compileZodSchema,G as configCommands,g as createCliArgsParser,F as createConfigEngine,L as envBool,R as envInt,z as envList,B as envMap,t as envMetaOf,s as envPathOf,V as envString,N as findProjectRoot,_ as flagOf,n as flattenBaseSchema,v as generateCliArgsOptions,y as generateCliOptions,C as generateConfigJsonSchema,T as generateConfigMarkdown,k as generateConfigTypes,b as generateEnv,x as generateEnvDts,f as generateEnvFile,S as generateEnvTypes,w as generateJsonSchemaFile,P as monorepoRoot,H as parseEnvTree,U as readEnvPath,A as renderAllConfigTypes,E as renderConfigFileMarkdown,D as renderConfigIndex,j as renderConfigTypes,O as renderScopeMarkdown,M as resolveScopeSchema,r as resolveUntypedSchema,i as splitBaseSchema,W as trimTrailingSlashes,a as zodToJsonSchema,o as zodToUntypedDefinition};
package/dist/core.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { BuildProjectGraphOptions, IGNORED_DIRS, PackageManager, ProjectGraph, ProjectNode, buildProjectGraph, detectPackageManager, orderProjects, projectGraphPath, readProjectGraph, writeProjectGraph } from "./packages/core/src/graph.js";
4
+ import { LoadedConfig, findConfigFile, loadToolingConfig } from "./packages/core/src/loader.js";
5
+ import { MANIFEST_DIR, MANIFEST_FILE, Manifest, readManifest, writeManifest } from "./packages/core/src/manifest.js";
6
+ import { detectProjectType, resolveProjectType } from "./packages/core/src/project-type.js";
7
+ import { SelectProjectsOptions, SelectedProject, selectProjects } from "./packages/core/src/select.js";
8
+ import { ResetProjectsOptions, ResetProjectsResult, ResetSelectors, ResetToolingOptions, ResetToolingResult, resetProjects, resetTooling } from "./packages/core/src/reset.js";
9
+ import { RunSyncOptions, SyncResult, runSync } from "./packages/core/src/sync.js";
10
+ import { VscodeSyncOptions, vscodeSyncTask } from "./packages/core/src/vscode.js";
11
+ import { RunWatchOptions, runWatch } from "./packages/core/src/watch.js";
12
+ import "./packages/core/src/index.js";
13
+ export { BuildProjectGraphOptions, IGNORED_DIRS, LoadedConfig, MANIFEST_DIR, MANIFEST_FILE, Manifest, PackageManager, ProjectGraph, ProjectNode, ResetProjectsOptions, ResetProjectsResult, ResetSelectors, ResetToolingOptions, ResetToolingResult, RunSyncOptions, RunWatchOptions, SelectProjectsOptions, SelectedProject, SyncResult, VscodeSyncOptions, buildProjectGraph, detectPackageManager, detectProjectType, findConfigFile, loadToolingConfig, orderProjects, projectGraphPath, readManifest, readProjectGraph, resetProjects, resetTooling, resolveProjectType, runSync, runWatch, selectProjects, vscodeSyncTask, writeManifest, writeProjectGraph };
package/dist/core.js ADDED
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;import{detectProjectType as e,resolveProjectType as t}from"./packages/core/src/project-type.js";import{findConfigFile as n,loadToolingConfig as r}from"./packages/core/src/loader.js";import{IGNORED_DIRS as i,buildProjectGraph as a,detectPackageManager as o,orderProjects as s,projectGraphPath as c,readProjectGraph as l,writeProjectGraph as u}from"./packages/core/src/graph.js";import{MANIFEST_DIR as d,MANIFEST_FILE as f,readManifest as p,writeManifest as m}from"./packages/core/src/manifest.js";import{selectProjects as h}from"./packages/core/src/select.js";import{resetProjects as g,resetTooling as _}from"./packages/core/src/reset.js";import{runSync as v}from"./packages/core/src/sync.js";import{vscodeSyncTask as y}from"./packages/core/src/vscode.js";import{runWatch as b}from"./packages/core/src/watch.js";import"./packages/core/src/index.js";export{i as IGNORED_DIRS,d as MANIFEST_DIR,f as MANIFEST_FILE,a as buildProjectGraph,o as detectPackageManager,e as detectProjectType,n as findConfigFile,r as loadToolingConfig,s as orderProjects,c as projectGraphPath,p as readManifest,l as readProjectGraph,g as resetProjects,_ as resetTooling,t as resolveProjectType,v as runSync,b as runWatch,h as selectProjects,y as vscodeSyncTask,m as writeManifest,u as writeProjectGraph};
@@ -0,0 +1,31 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { mergeJsonAt, readJsonAt, readJsonFile, toJson, writeJsonFile } from "./packages/shared/src/fs-utils.js";
4
+ import { Sortable, deepMerge, isPlainObject, mapValues, resolveSort, sort } from "./packages/shared/src/object-utils.js";
5
+ import { ToolingProvider, ToolingProviderAction, ToolingProviderCommand, providerActions } from "./packages/shared/src/provider.js";
6
+ import { RunOptions, run, spawnCross } from "./packages/shared/src/run.js";
7
+ import { asString, camelCase, camelCaseId, capitalize, constantCase, ensureLeadingSlash, ensureSlashes, ensureTrailingSlash, formatCliFlag, hasText, indent, isLocalhost, kebabCase, pascalCase, removeDoubleSlashes, removeLeadingSlash, removeTrailingSlash, sanitizeSlashes, snakeCase, str, titleCase } from "./packages/shared/src/string-utils.js";
8
+ import { ReplacementOptions, ReplacementValue, Replacements, Replacer, applyReplacements, applyReplacementsDeep, createReplacer, defineReplacements, extractTokens, hasUnresolvedTokens, tokenPattern } from "./packages/shared/src/template.js";
9
+ import { CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, ChangelogWorkflowsConfig, DbxConfigSections, ProjectType, ToolingBiomeConfig, ToolingChangelogConfig, ToolingConfigSections, ToolingProjectConfig, ToolingTemplateKind, ToolingTemplateSource, ToolingTemplateSourceType, ToolingTemplatesConfig, ToolingTsconfigConfig, ToolingViteConfig, ToolingWatchConfig, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig, biomeConfigSchema, changelogConfigSchema, changelogWorkflowsConfigSchema, dbxConfigSchema, projectConfigSchema, projectTypeSchema, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, toolingConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema } from "./packages/shared/src/config-schema.js";
10
+ import { Awaitable, GeneratedFile, JsonValue, PackageJson, ToolingArgument, ToolingCommand, ToolingCommandContext, ToolingOption } from "./packages/shared/src/types.js";
11
+ import { CONFIG_FILE_NAMES, DbxConfig, ManagedFile, SyncContext, SyncSummary, SyncTask, ToolingConfig, ToolingHooks, ToolingSection, defineConfig, repoSlugFromUrl, resolveTokens, sectionConfig, sectionEnabled } from "./packages/shared/src/toolchain.js";
12
+ import { YamlValue, toYaml } from "./packages/shared/src/yaml.js";
13
+ import { index_d_exports as index_d_exports$5 } from "./packages/shared/src/index.js";
14
+ import { index_d_exports } from "./packages/biome/src/index.js";
15
+ import { index_d_exports as index_d_exports$1 } from "./packages/changelog/src/index.js";
16
+ import { index_d_exports as index_d_exports$2 } from "./packages/config/src/index.js";
17
+ import { BuildProjectGraphOptions, IGNORED_DIRS, PackageManager, ProjectGraph, ProjectNode, buildProjectGraph, detectPackageManager, orderProjects, projectGraphPath, readProjectGraph, writeProjectGraph } from "./packages/core/src/graph.js";
18
+ import { LoadedConfig, findConfigFile, loadToolingConfig } from "./packages/core/src/loader.js";
19
+ import { MANIFEST_DIR, MANIFEST_FILE, Manifest, readManifest, writeManifest } from "./packages/core/src/manifest.js";
20
+ import { detectProjectType, resolveProjectType } from "./packages/core/src/project-type.js";
21
+ import { SelectProjectsOptions, SelectedProject, selectProjects } from "./packages/core/src/select.js";
22
+ import { ResetProjectsOptions, ResetProjectsResult, ResetSelectors, ResetToolingOptions, ResetToolingResult, resetProjects, resetTooling } from "./packages/core/src/reset.js";
23
+ import { RunSyncOptions, SyncResult, runSync } from "./packages/core/src/sync.js";
24
+ import { VscodeSyncOptions, vscodeSyncTask } from "./packages/core/src/vscode.js";
25
+ import { RunWatchOptions, runWatch } from "./packages/core/src/watch.js";
26
+ import { index_d_exports as index_d_exports$3 } from "./packages/core/src/index.js";
27
+ import { index_d_exports as index_d_exports$6 } from "./packages/tsconfig/src/index.js";
28
+ import { index_d_exports as index_d_exports$4 } from "./packages/project/src/index.js";
29
+ import { index_d_exports as index_d_exports$7 } from "./packages/tsdown/src/index.js";
30
+ import { defaultSyncTasks } from "./sync.js";
31
+ export { Awaitable, BuildProjectGraphOptions, CONFIG_FILE_NAMES, CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, ChangelogWorkflowsConfig, DbxConfig, DbxConfigSections, GeneratedFile, IGNORED_DIRS, JsonValue, LoadedConfig, MANIFEST_DIR, MANIFEST_FILE, ManagedFile, Manifest, PackageJson, PackageManager, ProjectGraph, ProjectNode, ProjectType, ReplacementOptions, ReplacementValue, Replacements, Replacer, ResetProjectsOptions, ResetProjectsResult, ResetSelectors, ResetToolingOptions, ResetToolingResult, RunOptions, RunSyncOptions, RunWatchOptions, SelectProjectsOptions, SelectedProject, Sortable, SyncContext, SyncResult, SyncSummary, SyncTask, ToolingArgument, ToolingBiomeConfig, ToolingChangelogConfig, ToolingCommand, ToolingCommandContext, ToolingConfig, ToolingConfigSections, ToolingHooks, ToolingOption, ToolingProjectConfig, ToolingProvider, ToolingProviderAction, ToolingProviderCommand, ToolingSection, ToolingTemplateKind, ToolingTemplateSource, ToolingTemplateSourceType, ToolingTemplatesConfig, ToolingTsconfigConfig, ToolingViteConfig, ToolingWatchConfig, VscodeSyncOptions, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig, type YamlValue, applyReplacements, applyReplacementsDeep, asString, index_d_exports as biome, biomeConfigSchema, buildProjectGraph, camelCase, camelCaseId, capitalize, index_d_exports$1 as changelog, changelogConfigSchema, changelogWorkflowsConfigSchema, index_d_exports$2 as config, constantCase, index_d_exports$3 as core, createReplacer, dbxConfigSchema, deepMerge, defaultSyncTasks, defineConfig, defineReplacements, detectPackageManager, detectProjectType, ensureLeadingSlash, ensureSlashes, ensureTrailingSlash, extractTokens, findConfigFile, formatCliFlag, hasText, hasUnresolvedTokens, indent, isLocalhost, isPlainObject, kebabCase, loadToolingConfig, mapValues, mergeJsonAt, orderProjects, pascalCase, index_d_exports$4 as project, projectConfigSchema, projectGraphPath, projectTypeSchema, providerActions, readJsonAt, readJsonFile, readManifest, readProjectGraph, removeDoubleSlashes, removeLeadingSlash, removeTrailingSlash, repoSlugFromUrl, resetProjects, resetTooling, resolveProjectType, resolveSort, resolveTokens, run, runSync, runWatch, sanitizeSlashes, sectionConfig, sectionEnabled, selectProjects, index_d_exports$5 as shared, snakeCase, sort, spawnCross, str, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, titleCase, toJson, toYaml, tokenPattern, toolingConfigSchema, index_d_exports$6 as tsconfig, tsconfigConfigSchema, index_d_exports$7 as tsdown, viteConfigSchema, vscodeSyncTask, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema, writeJsonFile, writeManifest, writeProjectGraph };
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;import{deepMerge as e,isPlainObject as t,mapValues as n,resolveSort as r,sort as i}from"./packages/shared/src/object-utils.js";import{mergeJsonAt as a,readJsonAt as o,readJsonFile as s,toJson as c,writeJsonFile as l}from"./packages/shared/src/fs-utils.js";import{providerActions as u}from"./packages/shared/src/provider.js";import{run as d,spawnCross as f}from"./packages/shared/src/run.js";import{asString as p,camelCase as m,camelCaseId as h,capitalize as g,constantCase as _,ensureLeadingSlash as v,ensureSlashes as y,ensureTrailingSlash as b,formatCliFlag as x,hasText as S,indent as C,isLocalhost as w,kebabCase as T,pascalCase as E,removeDoubleSlashes as D,removeLeadingSlash as O,removeTrailingSlash as k,sanitizeSlashes as A,snakeCase as j,str as M,titleCase as N}from"./packages/shared/src/string-utils.js";import{applyReplacements as P,applyReplacementsDeep as F,createReplacer as I,defineReplacements as L,extractTokens as R,hasUnresolvedTokens as z,tokenPattern as B}from"./packages/shared/src/template.js";import{CONFIG_SECTION_DESCRIPTIONS as V,CONFIG_SECTION_SCHEMAS as H,biomeConfigSchema as U,changelogConfigSchema as W,changelogWorkflowsConfigSchema as G,dbxConfigSchema as K,projectConfigSchema as q,projectTypeSchema as J,templateKindSchema as Y,templateSourceSchema as X,templateSourceTypeSchema as Z,templatesConfigSchema as Q,toolingConfigSchema as $,tsconfigConfigSchema as ee,viteConfigSchema as te,watchConfigSchema as ne,workflowConfigSchema as re,workflowSettingSchema as ie,workflowStepSchema as ae,workflowStepsConfigSchema as oe}from"./packages/shared/src/config-schema.js";import{CONFIG_FILE_NAMES as se,defineConfig as ce,repoSlugFromUrl as le,resolveTokens as ue,sectionConfig as de,sectionEnabled as fe}from"./packages/shared/src/toolchain.js";import{toYaml as pe}from"./packages/shared/src/yaml.js";import{src_exports as me}from"./packages/shared/src/index.js";import{src_exports as he}from"./packages/biome/src/index.js";import{src_exports as ge}from"./packages/changelog/src/index.js";import{src_exports as _e}from"./packages/config/src/index.js";import{detectProjectType as ve,resolveProjectType as ye}from"./packages/core/src/project-type.js";import{findConfigFile as be,loadToolingConfig as xe}from"./packages/core/src/loader.js";import{IGNORED_DIRS as Se,buildProjectGraph as Ce,detectPackageManager as we,orderProjects as Te,projectGraphPath as Ee,readProjectGraph as De,writeProjectGraph as Oe}from"./packages/core/src/graph.js";import{MANIFEST_DIR as ke,MANIFEST_FILE as Ae,readManifest as je,writeManifest as Me}from"./packages/core/src/manifest.js";import{selectProjects as Ne}from"./packages/core/src/select.js";import{resetProjects as Pe,resetTooling as Fe}from"./packages/core/src/reset.js";import{runSync as Ie}from"./packages/core/src/sync.js";import{vscodeSyncTask as Le}from"./packages/core/src/vscode.js";import{runWatch as Re}from"./packages/core/src/watch.js";import{src_exports as ze}from"./packages/core/src/index.js";import{src_exports as Be}from"./packages/tsconfig/src/index.js";import{src_exports as Ve}from"./packages/project/src/index.js";import{src_exports as He}from"./packages/tsdown/src/index.js";import{defaultSyncTasks as Ue}from"./sync.js";export{se as CONFIG_FILE_NAMES,V as CONFIG_SECTION_DESCRIPTIONS,H as CONFIG_SECTION_SCHEMAS,Se as IGNORED_DIRS,ke as MANIFEST_DIR,Ae as MANIFEST_FILE,P as applyReplacements,F as applyReplacementsDeep,p as asString,he as biome,U as biomeConfigSchema,Ce as buildProjectGraph,m as camelCase,h as camelCaseId,g as capitalize,ge as changelog,W as changelogConfigSchema,G as changelogWorkflowsConfigSchema,_e as config,_ as constantCase,ze as core,I as createReplacer,K as dbxConfigSchema,e as deepMerge,Ue as defaultSyncTasks,ce as defineConfig,L as defineReplacements,we as detectPackageManager,ve as detectProjectType,v as ensureLeadingSlash,y as ensureSlashes,b as ensureTrailingSlash,R as extractTokens,be as findConfigFile,x as formatCliFlag,S as hasText,z as hasUnresolvedTokens,C as indent,w as isLocalhost,t as isPlainObject,T as kebabCase,xe as loadToolingConfig,n as mapValues,a as mergeJsonAt,Te as orderProjects,E as pascalCase,Ve as project,q as projectConfigSchema,Ee as projectGraphPath,J as projectTypeSchema,u as providerActions,o as readJsonAt,s as readJsonFile,je as readManifest,De as readProjectGraph,D as removeDoubleSlashes,O as removeLeadingSlash,k as removeTrailingSlash,le as repoSlugFromUrl,Pe as resetProjects,Fe as resetTooling,ye as resolveProjectType,r as resolveSort,ue as resolveTokens,d as run,Ie as runSync,Re as runWatch,A as sanitizeSlashes,de as sectionConfig,fe as sectionEnabled,Ne as selectProjects,me as shared,j as snakeCase,i as sort,f as spawnCross,M as str,Y as templateKindSchema,X as templateSourceSchema,Z as templateSourceTypeSchema,Q as templatesConfigSchema,N as titleCase,c as toJson,pe as toYaml,B as tokenPattern,$ as toolingConfigSchema,Be as tsconfig,ee as tsconfigConfigSchema,He as tsdown,te as viteConfigSchema,Le as vscodeSyncTask,ne as watchConfigSchema,re as workflowConfigSchema,ie as workflowSettingSchema,ae as workflowStepSchema,oe as workflowStepsConfigSchema,l as writeJsonFile,Me as writeManifest,Oe as writeProjectGraph};
@@ -0,0 +1,15 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { MigrateTarget, MigrateTool, MigrationContext, MigrationFile, MigrationResult, ToolingMigration, UnmappedItem } from "./packages/migrate/src/types.js";
4
+ import { BIOME_CONFIG_FILES, biomeToOx, findBiomeConfig, readJsonc, stripJsonc } from "./packages/migrate/src/biome.js";
5
+ import { FileDiff, FileStatus, diffFiles, hasPending } from "./packages/migrate/src/check.js";
6
+ import { migrateCommands } from "./packages/migrate/src/cli/index.js";
7
+ import { dprintToOx, findDprintConfig, mapDprintToOxfmt } from "./packages/migrate/src/dprint.js";
8
+ import { eslintToOx, findEslintConfig, mapRuleName, runOxlintMigrate } from "./packages/migrate/src/eslint.js";
9
+ import { DEFAULT_IGNORE, OxfmtMapping, mapBiomeFormatter, mapBiomeIncludes, mapBiomeToOxfmt, mapOrganizeImports } from "./packages/migrate/src/oxfmt-map.js";
10
+ import { OxlintMapping, RULE_MAP, mapBiomeToOxlint } from "./packages/migrate/src/oxlint-map.js";
11
+ import { findPrettierConfig, mapPrettierToOxfmt, prettierToOx, readPrettierIgnore } from "./packages/migrate/src/prettier.js";
12
+ import { MigrationInfo, detectMigrations, findMigration, listMigrations, migrations, runDetectedMigrations, runMigration } from "./packages/migrate/src/registry.js";
13
+ import { findTopLevelValue, matchBracket, mergeViteConfig, renderViteTarget, serializeTs, writeViteTarget } from "./packages/migrate/src/vite-target.js";
14
+ import "./packages/migrate/src/index.js";
15
+ export { BIOME_CONFIG_FILES, DEFAULT_IGNORE, FileDiff, FileStatus, MigrateTarget, MigrateTool, MigrationContext, MigrationFile, MigrationInfo, MigrationResult, OxfmtMapping, OxlintMapping, RULE_MAP, ToolingMigration, UnmappedItem, biomeToOx, detectMigrations, diffFiles, dprintToOx, eslintToOx, findBiomeConfig, findDprintConfig, findEslintConfig, findMigration, findPrettierConfig, findTopLevelValue, hasPending, listMigrations, mapBiomeFormatter, mapBiomeIncludes, mapBiomeToOxfmt, mapBiomeToOxlint, mapDprintToOxfmt, mapOrganizeImports, mapPrettierToOxfmt, mapRuleName, matchBracket, mergeViteConfig, migrateCommands, migrations, prettierToOx, readJsonc, readPrettierIgnore, renderViteTarget, runDetectedMigrations, runMigration, runOxlintMigrate, serializeTs, stripJsonc, writeViteTarget };
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;import{diffFiles as e,hasPending as t}from"./packages/migrate/src/check.js";import{DEFAULT_IGNORE as n,mapBiomeFormatter as r,mapBiomeIncludes as i,mapBiomeToOxfmt as a,mapOrganizeImports as o}from"./packages/migrate/src/oxfmt-map.js";import{RULE_MAP as s,mapBiomeToOxlint as c}from"./packages/migrate/src/oxlint-map.js";import{findTopLevelValue as l,matchBracket as u,mergeViteConfig as d,renderViteTarget as f,serializeTs as p,writeViteTarget as m}from"./packages/migrate/src/vite-target.js";import{BIOME_CONFIG_FILES as h,biomeToOx as g,findBiomeConfig as _,readJsonc as v,stripJsonc as y}from"./packages/migrate/src/biome.js";import{dprintToOx as b,findDprintConfig as x,mapDprintToOxfmt as S}from"./packages/migrate/src/dprint.js";import{eslintToOx as C,findEslintConfig as w,mapRuleName as T,runOxlintMigrate as E}from"./packages/migrate/src/eslint.js";import{findPrettierConfig as D,mapPrettierToOxfmt as O,prettierToOx as k,readPrettierIgnore as A}from"./packages/migrate/src/prettier.js";import{detectMigrations as j,findMigration as M,listMigrations as N,migrations as P,runDetectedMigrations as F,runMigration as I}from"./packages/migrate/src/registry.js";import{migrateCommands as L}from"./packages/migrate/src/cli/index.js";import"./packages/migrate/src/index.js";export{h as BIOME_CONFIG_FILES,n as DEFAULT_IGNORE,s as RULE_MAP,g as biomeToOx,j as detectMigrations,e as diffFiles,b as dprintToOx,C as eslintToOx,_ as findBiomeConfig,x as findDprintConfig,w as findEslintConfig,M as findMigration,D as findPrettierConfig,l as findTopLevelValue,t as hasPending,N as listMigrations,r as mapBiomeFormatter,i as mapBiomeIncludes,a as mapBiomeToOxfmt,c as mapBiomeToOxlint,S as mapDprintToOxfmt,o as mapOrganizeImports,O as mapPrettierToOxfmt,T as mapRuleName,u as matchBracket,d as mergeViteConfig,L as migrateCommands,P as migrations,k as prettierToOx,v as readJsonc,A as readPrettierIgnore,f as renderViteTarget,F as runDetectedMigrations,I as runMigration,E as runOxlintMigrate,p as serializeTs,y as stripJsonc,m as writeViteTarget};
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;var e=`1.1.21`;export{e as version};
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;var e={$schema:`https://biomejs.dev/schemas/2.5.13/schema.json`,vcs:{enabled:!0,clientKind:`git`,useIgnoreFile:!0},files:{includes:[`**/*.{ts,tsx,d.ts,js,json,css}`,`!*.json`,`!apps/*/*.json`,`!docs/*/*.json`,`!packages/*/*.json`,`!sdk/*/*.json`,`!**/*/dist`,`!**/*/node_modules`,`!**/.turbo/**`,`!**/.generated`]},formatter:{enabled:!0,formatWithErrors:!1,indentStyle:`space`,indentWidth:4,lineEnding:`lf`,lineWidth:100,attributePosition:`auto`,bracketSameLine:!1,bracketSpacing:!0,expand:`never`,useEditorconfig:!1,includes:[`**/*.{ts,tsx,d.ts,js,json,css}`,`!*.json`,`!apps/*/*.json`,`!docs/*/*.json`,`!packages/*/*.json`,`!sdk/*/*.json`,`!**/*/dist`,`!**/*/node_modules`,`!**/.turbo/**`,`!**/.generated`]},linter:{enabled:!0,rules:{a11y:{useAltText:`off`,useAriaPropsForRole:`info`,useButtonType:`off`,useFocusableInteractive:`off`,useKeyWithClickEvents:`off`,useSemanticElements:`warn`,noStaticElementInteractions:`off`,noSvgWithoutTitle:`off`,noLabelWithoutControl:`off`},complexity:{noBannedTypes:`off`,noImportantStyles:`off`,noUselessEscapeInRegex:`info`,noUselessEmptyExport:`off`,noStaticOnlyClass:`off`},correctness:{noConstantCondition:`off`,noInnerDeclarations:`off`,noUnusedFunctionParameters:`off`,noUnusedImports:`off`,noUnusedVariables:`warn`,noSwitchDeclarations:`off`,useExhaustiveDependencies:`info`},performance:{noAccumulatingSpread:`off`},style:{useExponentiationOperator:`off`,noNonNullAssertion:`off`,useNodejsImportProtocol:`off`,useTemplate:`off`},suspicious:{noAssignInExpressions:`off`,noDoubleEquals:`warn`,noExplicitAny:`off`,noImplicitAnyLet:`off`,noUnknownAtRules:{level:`warn`,options:{ignore:[`apply`,`config`,`screen`,`tailwind`]}},noUselessEscapeInString:`off`}}},javascript:{formatter:{jsxQuoteStyle:`double`,quoteProperties:`asNeeded`,trailingCommas:`es5`,semicolons:`always`,arrowParentheses:`asNeeded`,bracketSameLine:!1,quoteStyle:`single`,attributePosition:`auto`,bracketSpacing:!0}},css:{parser:{tailwindDirectives:!0}},html:{formatter:{indentScriptAndStyle:!1,selfCloseVoidElements:`always`}},assist:{enabled:!0,actions:{source:{organizeImports:{level:`on`,options:{groups:[[`:BUN:`,`:NODE:`],`:BLANK_LINE:`,[`:PACKAGE:`,`!lucide*`,`!iconify*`,`!{{name}}`,`!{{name}}/**`,`!{{scope}}/**`],`:BLANK_LINE:`,[`{{name}}`,`{{name}}/**`,`{{scope}}/**`],`:BLANK_LINE:`,[`@/lib/**`,`@/utils/**`],`:BLANK_LINE:`,[`@/pages/**`],`:BLANK_LINE:`,[`@/components/**`],`:BLANK_LINE:`,[`lucide*`,`iconify*`],`:BLANK_LINE:`,[`:ALIAS:`,`!@/lib/**`,`!@/utils/**`,`!@/pages/**`,`!@/components/**`],`:BLANK_LINE:`,[`:PATH:`]]}}}}}};export{e as default};
@@ -0,0 +1,34 @@
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 { SyncTask } from "../../shared/src/toolchain.js";
5
+ import "../../shared/src/index.js";
6
+ declare namespace index_d_exports {
7
+ export { biomeConfig, biomeSyncTask, biomeVscodeSettings, mergeBiomeConfig, renderBiomeConfig, renderBiomeJson, renderVscodeSettings };
8
+ }
9
+ /** The generic Biome configuration (with `{{name}}` / `{{scope}}` tokens). */
10
+ export declare const biomeConfig: Record<string, unknown>;
11
+ /** The recommended Biome VS Code settings. */
12
+ export declare const biomeVscodeSettings: Record<string, unknown>;
13
+ /**
14
+ * Merge an override over a base config: object keys merge recursively and
15
+ * arrays are unioned (so `files.includes` can be extended, not replaced).
16
+ */
17
+ export declare function mergeBiomeConfig(base: unknown, patch: unknown): unknown;
18
+ /**
19
+ * Render the Biome config for a project by resolving its replacement tokens
20
+ * (`{{name}}` = unscoped project name, `{{scope}}` = npm scope, eg. `@acme`)
21
+ * and merging the consumer's `overrides` over the defaults.
22
+ */
23
+ export declare function renderBiomeConfig(replacements?: Replacements, overrides?: Record<string, unknown>): Record<string, unknown>;
24
+ /** Serialize the rendered Biome config to JSON text. */
25
+ export declare function renderBiomeJson(replacements?: Replacements, overrides?: Record<string, unknown>, indent?: number): string;
26
+ /** Serialize the recommended VS Code settings to JSON text. */
27
+ export declare function renderVscodeSettings(indent?: number): string;
28
+ /**
29
+ * The biome sync task: writes `biome.json` from the generic config, resolving
30
+ * the `{{name}}` / `{{scope}}` tokens and merging `config.biome.overrides`.
31
+ */
32
+ export declare function biomeSyncTask(): SyncTask;
33
+ //#endregion
34
+ export { 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{isPlainObject as t}from"../../shared/src/object-utils.js";import{applyReplacementsDeep as n}from"../../shared/src/template.js";import{sectionConfig as r,sectionEnabled as i}from"../../shared/src/toolchain.js";import"../../shared/src/index.js";import a from"./config.js";import o from"./vscode-settings.js";var s=/* @__PURE__ */ e({biomeConfig:()=>c,biomeSyncTask:()=>m,biomeVscodeSettings:()=>l,mergeBiomeConfig:()=>u,renderBiomeConfig:()=>d,renderBiomeJson:()=>f,renderVscodeSettings:()=>p});const c=a,l=o;function u(e,n){if(Array.isArray(e)&&Array.isArray(n))return[.../* @__PURE__ */ new Set([...e,...n])];if(t(e)&&t(n)){let t={...e};for(let[e,r]of Object.entries(n))t[e]=e in t?u(t[e],r):r;return t}return n}function d(e={},t={}){return u(n(c,e),n(t,e))}function f(e={},t={},n=4){return`${JSON.stringify(d(e,t),null,n)}\n`}function p(e=4){return`${JSON.stringify(l,null,e)}\n`}function m(){return{name:`biome`,projectTypes:[`monorepo-root`,`monorepo-workspace`,`project`],enabled:e=>i(e.biome),run:e=>[{path:`biome.json`,content:f(e.tokens,r(e.config.biome)?.overrides??{})}]}}export{c as biomeConfig,m as biomeSyncTask,l as biomeVscodeSettings,u as mergeBiomeConfig,d as renderBiomeConfig,f as renderBiomeJson,p as renderVscodeSettings,s as src_exports};
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;var e={"biome.lsp.watcher.kind":`none`};export{e as default};
@@ -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/changelog/src/cli/index.d.ts
6
+ /** Build the changelog commands (`changelog`, `workflow`). */
7
+ export declare function changelogCommands(): ToolingCommand[];
8
+ //#endregion
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;import{runChangelog as e}from"../run.js";import{runWorkflows as t}from"../run-workflows.js";function n(){return[{name:`workflow`,description:"Trigger one or more generated GitHub workflows (via `gh workflow run`).",args:[{name:`workflows`,description:`Workflow ids or file names (default: every enabled workflow).`,variadic:!0,required:!1}],options:[{flags:`--cwd <dir>`,description:`Project root (default: cwd).`},{flags:`--ref <ref>`,description:`Git ref to run the workflow on.`},{flags:`--gh <cmd>`,description:`The gh executable (default: gh).`}],run:async(e,n)=>{let r=e.workflows,i=Array.isArray(r)?r:r?[String(r)]:void 0,a=await t({cwd:e.cwd??n.cwd,config:n.config,...i?{workflows:i}:{},...e.ref?{ref:e.ref}:{},...e.gh?{gh:e.gh}:{}}),o=!1;for(let e of a.ran)e.code===0?console.log(`dbx: triggered ${e.file}`):(o=!0,console.error(`dbx: ${e.file} exited ${e.code}`));o&&(process.exitCode=1)}},{name:`changelog`,description:`Scan commits, derive the semver bump and update the CHANGELOG.md files + versions.`,options:[{flags:`--range <range>`,description:`Git revision range to scan.`},{flags:`--dry-run`,description:`Print the proposed entry without writing.`},{flags:`--version <semver>`,description:`Override the version.`},{flags:`--base-version <semver>`,description:`Bump from this version instead.`},{flags:`--processing-method <method>`,description:"`latest` (default), `all`, or a git range."},{flags:`--format-only`,description:`Only regroup existing changelogs.`},{flags:`--no-package-changes-section`,description:`Skip the package-changes footer.`}],run:t=>{let n=[];t.range&&n.push(`--range`,String(t.range)),t.dryRun&&n.push(`--dry-run`),t.version&&n.push(`--version`,String(t.version)),t.baseVersion&&n.push(`--base-version`,String(t.baseVersion)),t.processingMethod&&n.push(`--processing-method`,String(t.processingMethod)),t.formatOnly&&n.push(`--format-only`),t.packageChangesSection===!1&&n.push(`--no-package-changes-section`),e(n)}}]}export{n as changelogCommands};
@@ -0,0 +1,19 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { AuthorInfo, BumpType, CliOptions, CommitRecord, ExistingEntry, GroupedItem, GroupedRule, IssueInfo, ParsedCommit, ProcessingMethod } from "./utils/types.js";
4
+ import { parseArgsCli } from "./utils/args.js";
5
+ import { formatBody, groupItems, parseCcSubject, renderGroups, ruleTitle, splitInlineDescription } from "./utils/format.js";
6
+ import { deriveBump, readCommits } from "./utils/git.js";
7
+ import { parseExistingChangelog, reformatChangelogContent } from "./utils/reformat.js";
8
+ import { buildSummary } from "./utils/summary.js";
9
+ import { renderChangelogEntry } from "./utils/version.js";
10
+ import { main, runChangelog } from "./run.js";
11
+ import { DEFAULT_WORKFLOW_TOKENS, RenderWorkflowOptions, WORKFLOW_FILENAMES, Workflow, WorkflowId, WorkflowJob, applyWorkflowConfig, defaultWorkflows, isEnabled, renderWorkflow, renderWorkflows } from "./workflows.js";
12
+ import { RanWorkflow, RunWorkflowsOptions, RunWorkflowsResult, resolveWorkflowId, runWorkflows } from "./run-workflows.js";
13
+ import { COMMITLINT_HEADER, WORKFLOW_HEADER, changelogSyncTask, workflowFilenames } from "./sync.js";
14
+ import { CommitlintOptions, conventionalCommitsVscodeExtensions, conventionalCommitsVscodeSettings, renderCommitlintConfig } from "./templates.js";
15
+ declare namespace index_d_exports {
16
+ export { AuthorInfo, BumpType, COMMITLINT_HEADER, CliOptions, CommitRecord, CommitlintOptions, DEFAULT_WORKFLOW_TOKENS, ExistingEntry, GroupedItem, GroupedRule, IssueInfo, ParsedCommit, ProcessingMethod, RanWorkflow, RenderWorkflowOptions, RunWorkflowsOptions, RunWorkflowsResult, WORKFLOW_FILENAMES, WORKFLOW_HEADER, Workflow, WorkflowId, WorkflowJob, applyWorkflowConfig, buildSummary, changelogSyncTask, conventionalCommitsVscodeExtensions, conventionalCommitsVscodeSettings, defaultWorkflows, deriveBump, formatBody, groupItems, isEnabled, main, parseArgsCli, parseCcSubject, parseExistingChangelog, readCommits, reformatChangelogContent, renderChangelogEntry, renderCommitlintConfig, renderGroups, renderWorkflow, renderWorkflows, resolveWorkflowId, ruleTitle, runChangelog, runWorkflows, splitInlineDescription, workflowFilenames };
17
+ }
18
+ //#endregion
19
+ export { AuthorInfo, BumpType, COMMITLINT_HEADER, CliOptions, CommitRecord, CommitlintOptions, DEFAULT_WORKFLOW_TOKENS, ExistingEntry, GroupedItem, GroupedRule, IssueInfo, ParsedCommit, ProcessingMethod, RanWorkflow, RenderWorkflowOptions, RunWorkflowsOptions, RunWorkflowsResult, WORKFLOW_FILENAMES, WORKFLOW_HEADER, Workflow, WorkflowId, WorkflowJob, applyWorkflowConfig, buildSummary, changelogSyncTask, conventionalCommitsVscodeExtensions, conventionalCommitsVscodeSettings, defaultWorkflows, deriveBump, formatBody, groupItems, index_d_exports, isEnabled, main, parseArgsCli, parseCcSubject, parseExistingChangelog, readCommits, reformatChangelogContent, renderChangelogEntry, renderCommitlintConfig, renderGroups, renderWorkflow, renderWorkflows, resolveWorkflowId, ruleTitle, runChangelog, runWorkflows, splitInlineDescription, workflowFilenames };
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;import{__exportAll as e}from"../../../_virtual/_rolldown/runtime.js";import{parseArgsCli as t}from"./utils/args.js";import{deriveBump as n,readCommits as r}from"./utils/git.js";import{formatBody as i,groupItems as a,parseCcSubject as o,renderGroups as s,ruleTitle as c,splitInlineDescription as l}from"./utils/format.js";import{renderChangelogEntry as u}from"./utils/version.js";import{parseExistingChangelog as d,reformatChangelogContent as f}from"./utils/reformat.js";import{buildSummary as p}from"./utils/summary.js";import{main as m,runChangelog as h}from"./run.js";import{DEFAULT_WORKFLOW_TOKENS as g,WORKFLOW_FILENAMES as _,applyWorkflowConfig as v,defaultWorkflows as y,isEnabled as b,renderWorkflow as x,renderWorkflows as S}from"./workflows.js";import{resolveWorkflowId as C,runWorkflows as w}from"./run-workflows.js";import{conventionalCommitsVscodeExtensions as T,conventionalCommitsVscodeSettings as E,renderCommitlintConfig as D}from"./templates.js";import{COMMITLINT_HEADER as O,WORKFLOW_HEADER as k,changelogSyncTask as A,workflowFilenames as j}from"./sync.js";var M=/* @__PURE__ */ e({COMMITLINT_HEADER:()=>O,DEFAULT_WORKFLOW_TOKENS:()=>g,WORKFLOW_FILENAMES:()=>_,WORKFLOW_HEADER:()=>k,applyWorkflowConfig:()=>v,buildSummary:()=>p,changelogSyncTask:()=>A,conventionalCommitsVscodeExtensions:()=>T,conventionalCommitsVscodeSettings:()=>E,defaultWorkflows:()=>y,deriveBump:()=>n,formatBody:()=>i,groupItems:()=>a,isEnabled:()=>b,main:()=>m,parseArgsCli:()=>t,parseCcSubject:()=>o,parseExistingChangelog:()=>d,readCommits:()=>r,reformatChangelogContent:()=>f,renderChangelogEntry:()=>u,renderCommitlintConfig:()=>D,renderGroups:()=>s,renderWorkflow:()=>x,renderWorkflows:()=>S,resolveWorkflowId:()=>C,ruleTitle:()=>c,runChangelog:()=>h,runWorkflows:()=>w,splitInlineDescription:()=>l,workflowFilenames:()=>j});export{O as COMMITLINT_HEADER,g as DEFAULT_WORKFLOW_TOKENS,_ as WORKFLOW_FILENAMES,k as WORKFLOW_HEADER,v as applyWorkflowConfig,p as buildSummary,A as changelogSyncTask,T as conventionalCommitsVscodeExtensions,E as conventionalCommitsVscodeSettings,y as defaultWorkflows,n as deriveBump,i as formatBody,a as groupItems,b as isEnabled,m as main,t as parseArgsCli,o as parseCcSubject,d as parseExistingChangelog,r as readCommits,f as reformatChangelogContent,u as renderChangelogEntry,D as renderCommitlintConfig,s as renderGroups,x as renderWorkflow,S as renderWorkflows,C as resolveWorkflowId,c as ruleTitle,h as runChangelog,w as runWorkflows,l as splitInlineDescription,M as src_exports,j as workflowFilenames};
@@ -0,0 +1,35 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { ToolingConfig } from "../../shared/src/toolchain.js";
4
+ import "../../shared/src/index.js";
5
+ import { WorkflowId } from "./workflows.js";
6
+ //#region packages/changelog/src/run-workflows.d.ts
7
+ export interface RunWorkflowsOptions {
8
+ /** The project root the workflows live under. */
9
+ cwd: string;
10
+ /** Workflow ids or file names to run (default: every enabled workflow). */
11
+ workflows?: string[];
12
+ /** Git ref to run the workflow on (eg. `main`). */
13
+ ref?: string;
14
+ /** The loaded tooling config, used to check `changelog.workflows`. */
15
+ config?: ToolingConfig;
16
+ /** The `gh` executable (default `gh`). */
17
+ gh?: string;
18
+ }
19
+ export interface RanWorkflow {
20
+ id: WorkflowId;
21
+ file: string;
22
+ /** The `gh` exit code (0 = triggered). */
23
+ code: number;
24
+ }
25
+ export interface RunWorkflowsResult {
26
+ ran: RanWorkflow[];
27
+ }
28
+ /** Resolve a workflow id or file name (`ci` / `ci.yml`) to a known id. */
29
+ export declare function resolveWorkflowId(name: string): WorkflowId | undefined;
30
+ /**
31
+ * Trigger the requested workflows (all enabled ones when none are named).
32
+ * Throws when a workflow is unknown, disabled in the config or not generated.
33
+ */
34
+ export declare function runWorkflows(options: RunWorkflowsOptions): Promise<RunWorkflowsResult>;
35
+ //#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{WORKFLOW_FILENAMES as r,isEnabled as i}from"./workflows.js";import a from"node:fs";import{spawn as o}from"node:child_process";function s(e){let t=e.trim().replace(/\.ya?ml$/i,``).toLowerCase();return Object.keys(r).find(e=>e===t)}function c(e,t,n){return new Promise(r=>{let i=o(n,e,{cwd:t,stdio:`inherit`});i.on(`error`,()=>r(1)),i.on(`exit`,e=>r(e??0))})}async function l(o){let{cwd:l}=o,u=e=>n(o.config?.changelog)&&i(t(o.config?.changelog)?.workflows?.[e]),d=(o.workflows??[]).map(e=>e.trim()).filter(Boolean),f=[];if(d.length===0){for(let e of Object.keys(r))u(e)&&f.push(e);if(f.length===0)throw Error(`No workflows are enabled in dbx.config.* (changelog.workflows).`)}else for(let e of d){let t=s(e);if(!t)throw Error(`Unknown workflow "${e}". Known workflows: ${Object.keys(r).join(`, `)}.`);if(!u(t))throw Error(`Workflow "${t}" is not enabled in dbx.config.* (changelog.workflows.${t}).`);f.includes(t)||f.push(t)}let p=o.gh??`gh`,m=[];for(let t of f){let n=r[t],i=e.resolve(l,`.github/workflows`,n);if(!a.existsSync(i))throw Error(`Workflow file not found: .github/workflows/${n}. Run \`dbx sync\` first.`);let s=[`workflow`,`run`,n];o.ref&&s.push(`--ref`,o.ref),m.push({id:t,file:n,code:await c(s,l,p)})}return{ran:m}}export{s as resolveWorkflowId,l as runWorkflows};
@@ -0,0 +1,14 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { parseArgsCli } from "./utils/args.js";
4
+ import { formatBody, groupItems, parseCcSubject, renderGroups, ruleTitle, splitInlineDescription } from "./utils/format.js";
5
+ import { deriveBump, readCommits } from "./utils/git.js";
6
+ import { parseExistingChangelog, reformatChangelogContent } from "./utils/reformat.js";
7
+ import { buildSummary } from "./utils/summary.js";
8
+ import { renderChangelogEntry } from "./utils/version.js";
9
+ //#region packages/changelog/src/run.d.ts
10
+ /** Run the changelog pipeline (bump versions + write changelogs). */
11
+ export declare function runChangelog(argv?: string[]): void;
12
+ /** Alias kept for backwards compatibility. */
13
+ export declare const main: typeof runChangelog;
14
+ //#endregion
@@ -0,0 +1 @@
1
+ import{resolve as e}from"node:path";import{fileURLToPath as t}from"node:url";import.meta.url;import{parseArgsCli as n}from"./utils/args.js";import{deriveBump as r,readCommits as i}from"./utils/git.js";import{changelogFiles as a,readRootVersion as o,repoRoot as s,writeVersion as c}from"./utils/repo.js";import{packageChangesForCurrent as l}from"./utils/packages.js";import"./utils/format.js";import{bumpVersion as u,insertNewEntry as d,renderChangelogEntry as f,retagChangelogs as p}from"./utils/version.js";import{formatExistingChangelogs as m,parseExistingChangelog as h,reformatRootChangelog as g}from"./utils/reformat.js";import{buildSummary as _}from"./utils/summary.js";import{writeChangelogs as v}from"./utils/write.js";import{existsSync as y,readFileSync as b,realpathSync as x,writeFileSync as S}from"node:fs";function C(t=process.argv.slice(2)){let x=n(t);if(x.formatOnly){console.log(`[format-only] Reformatting ${a().length} changelog file(s)${x.dryRun?` (dry run)`:``}.`),m(x.dryRun,x.packageChanges);return}let C=o();if(x.version){let e=x.version.trim();if(!/^\d+\.\d+\.\d+$/.test(e))throw Error(`Invalid version: ${e}`);if(e===C){console.log(`Version is already ${e}; nothing to do.`);return}c(e),p(C,e),console.log(`Retagged versions ${C} -> ${e}.`);return}let w=C;if(x.baseVersion){if(!/^\d+\.\d+\.\d+$/.test(x.baseVersion.trim()))throw Error(`Invalid base version: ${x.baseVersion}`);w=x.baseVersion.trim()}let T=x.processingMethod,E=T===`all`,D=T!==`latest`&&T!==`all`?T:x.range,O=i(D),k=r(O),A=_(O),j=u(w,k);if(x.dryRun){let t=s(),n=e(t,`CHANGELOG.md`),r=y(n)?b(n,`utf8`):``,i=h(r)[0]?.version,a=x.packageChanges&&i?l(i):``,o=f(j,A,/* @__PURE__ */ new Date,!0,a);console.log(`[DRY-RUN] Range: ${D}`),console.log(`[DRY-RUN] Processing method: ${T}${E?` (backward reformat)`:``}`),console.log(`[DRY-RUN] Bump: ${k} (\`${w}\` -> \`${j}\`)`),console.log(`[DRY-RUN] ${O.length} commit(s) scanned. Project files untouched.`),console.log(``),console.log(`Proposed new CHANGELOG.md entry (new version only):`),console.log(``),console.log(o),console.log(`--- end of proposed entry ---`);let c=E?g(x.packageChanges):r,u=d(c,o),p=e(t,`CHANGELOG.proposed.md`);S(p,u,`utf8`),console.log(`Wrote ${p}`)}else c(j),v(j,D,O,A,E,x.packageChanges),console.log(`Bumped ${w} -> ${j} (${k}) from ${O.length} commit(s).`)}const w=C;process.argv[1]&&T(process.argv[1])===t(import.meta.url)&&C();function T(e){try{return x(e)}catch{return e}}export{w as main,C as runChangelog};
@@ -0,0 +1,18 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { SyncTask, ToolingConfig } from "../../shared/src/toolchain.js";
4
+ import "../../shared/src/index.js";
5
+ //#region packages/changelog/src/sync.d.ts
6
+ /** The header prepended to every generated GitHub workflow. */
7
+ export declare const WORKFLOW_HEADER = "# Generated by @deltabox/toolchain — edit dbx.config.* and run `dbx sync`.";
8
+ /** The header prepended to the generated commitlint config. */
9
+ export declare const COMMITLINT_HEADER = "// Generated by @deltabox/toolchain — edit dbx.config.* and run `dbx sync`.";
10
+ /** The workflow file names produced for a config. */
11
+ export declare function workflowFilenames(config: ToolingConfig): string[];
12
+ /**
13
+ * The changelog sync task: writes the GitHub workflows + the commitlint config
14
+ * from the loaded `dbx.config.*`. Branches, triggers, steps, jobs and
15
+ * per-workflow tokens are all taken from the config.
16
+ */
17
+ export declare function changelogSyncTask(): SyncTask;
18
+ //#endregion
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;import{sectionConfig as e,sectionEnabled as t}from"../../shared/src/toolchain.js";import"../../shared/src/index.js";import{renderWorkflows as n}from"./workflows.js";import{renderCommitlintConfig as r}from"./templates.js";const i="# Generated by @deltabox/toolchain — edit dbx.config.* and run `dbx sync`.",a="// Generated by @deltabox/toolchain — edit dbx.config.* and run `dbx sync`.";function o(t){return Object.keys(n({},e(t.changelog)?.workflows??{}))}function s(){return{name:`changelog`,projectTypes:[`monorepo-root`,`project`],enabled:e=>t(e.changelog),run:t=>{let o=e(t.config.changelog)??{},s=[];for(let[e,r]of Object.entries(n(t.tokens,o.workflows??{})))s.push({path:`.github/workflows/${e}`,content:`${i}\n${r}`});return s.push({path:`commitlint.config.mjs`,content:`${a}\n${r({...o.types?{types:o.types}:{},...o.scopes?{scopes:o.scopes}:{}})}`}),s}}}export{a as COMMITLINT_HEADER,i as WORKFLOW_HEADER,s as changelogSyncTask,o as workflowFilenames};
@@ -0,0 +1,27 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ //#region packages/changelog/src/templates.d.ts
4
+ /**
5
+ * Conventional-Commits supporting templates (commitlint config + the VS Code
6
+ * settings/extensions). The GitHub Actions workflows are built as data in
7
+ * `workflows.ts`.
8
+ */
9
+ export interface CommitlintOptions {
10
+ /** Allowed commit types (defaults to the Conventional-Commits set). */
11
+ types?: string[];
12
+ /** Allowed scopes (only enforced when a scope is present). */
13
+ scopes?: string[];
14
+ }
15
+ /** Render a `commitlint.config.mjs` module string (Oxfmt-formatted). */
16
+ export declare function renderCommitlintConfig(options?: CommitlintOptions): string;
17
+ /** The recommended VS Code settings for Conventional Commits. */
18
+ export declare const conventionalCommitsVscodeSettings: {
19
+ readonly 'conventionalCommits.autoCommit': false;
20
+ readonly 'conventionalCommits.gitmoji': false;
21
+ readonly 'git.postCommitCommand': 'none';
22
+ };
23
+ /** The recommended VS Code extension for Conventional Commits. */
24
+ export declare const conventionalCommitsVscodeExtensions: {
25
+ readonly recommendations: readonly ['vivaxy.vscode-conventional-commits'];
26
+ };
27
+ //#endregion
@@ -0,0 +1,27 @@
1
+ import"node:path";import"node:url";import.meta.url;const e=[`feat`,`fix`,`docs`,`codegen`,`style`,`refactor`,`perf`,`test`,`build`,`ci`,`chore`,`revert`,`release`],t=[`server`,`frontend`,`cli`,`sdk`,`scripts`,`shared`,`types`,`ci`,`docker`,`security`,`release`,`deps`];function n(n={}){let r=n.types??e,i=n.scopes??t,a=e=>e.map(e=>` '${e}',`).join(`
2
+ `);return`/**
3
+ * Conventional Commits enforcement (https://www.conventionalcommits.org/en/v1.0.0/).
4
+ * Generated by @deltabox/toolchain-changelog.
5
+ */
6
+ export default {
7
+ extends: ['@commitlint/config-conventional'],
8
+ rules: {
9
+ 'type-enum': [
10
+ 2,
11
+ 'always',
12
+ [
13
+ ${a(r)}
14
+ ],
15
+ ],
16
+ 'scope-enum': [
17
+ 2,
18
+ 'always',
19
+ [
20
+ ${a(i)}
21
+ ],
22
+ ],
23
+ 'body-max-line-length': [0],
24
+ 'footer-max-line-length': [0],
25
+ },
26
+ };
27
+ `}const r={"conventionalCommits.autoCommit":!1,"conventionalCommits.gitmoji":!1,"git.postCommitCommand":`none`},i={recommendations:[`vivaxy.vscode-conventional-commits`]};export{i as conventionalCommitsVscodeExtensions,r as conventionalCommitsVscodeSettings,n as renderCommitlintConfig};
@@ -0,0 +1,7 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { CliOptions } from "./types.js";
4
+ //#region packages/changelog/src/utils/args.d.ts
5
+ /** Parse the CLI argv into the pipeline options. */
6
+ export declare function parseArgsCli(argv: string[]): CliOptions;
7
+ //#endregion
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;import{parseArgs as e}from"node:util";function t(t){let{values:n,positionals:r}=e({args:t,allowPositionals:!0,options:{range:{type:`string`},"dry-run":{type:`boolean`,default:!1},version:{type:`string`},"base-version":{type:`string`},"processing-method":{type:`string`},"format-only":{type:`boolean`,default:!1},"no-package-changes-section":{type:`boolean`,default:!1}}}),i=n[`processing-method`]?.trim()||process.env.CHANGELOG_PROCESSING_METHOD?.trim()||`latest`;return{range:n.range??r[0]??`HEAD`,dryRun:n[`dry-run`]??!1,version:n.version,baseVersion:n[`base-version`],processingMethod:i,formatOnly:n[`format-only`]??!1,packageChanges:!(n[`no-package-changes-section`]??!1)}}export{t as parseArgsCli};
@@ -0,0 +1,27 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { GroupedItem, GroupedRule, ParsedCommit } from "./types.js";
4
+ //#region packages/changelog/src/utils/format.d.ts
5
+ export declare function ruleTitle(type: string): string;
6
+ /** Parse a Conventional-Commits subject into its parts. */
7
+ export declare function parseCcSubject(subject: string): ParsedCommit;
8
+ /** Group a list of parsed commits by CC rule, then by scope. */
9
+ export declare function groupItems(items: GroupedItem[]): GroupedRule[];
10
+ export declare function renderGroups(groups: GroupedRule[]): string;
11
+ /**
12
+ * Split a changelog bullet's trailing inline content (after the commit credit
13
+ * suffix `([#<hash>](<url>) by <author>)` and an optional `(fixes ...)` block)
14
+ * into a description, so it can be nested under the commit like the rest.
15
+ */
16
+ export declare function splitInlineDescription(rest: string): {
17
+ main: string;
18
+ inline: string;
19
+ };
20
+ /**
21
+ * Split a commit body into description paragraphs and conventional footers
22
+ * (`KEY: value` lines), skipping bullet/numbered lists and issue-only lines so
23
+ * each commit's details are rendered as nested bullets rather than one long
24
+ * line. Blank lines separate paragraphs.
25
+ */
26
+ export declare function formatBody(body: string): string[][];
27
+ //#endregion
@@ -0,0 +1,5 @@
1
+ import"node:path";import"node:url";import.meta.url;import{readFileSync as e,writeFileSync as t}from"node:fs";const n={feat:`New features`,fix:`Bug fixes`,refactor:`Refactors`,docs:`Documentation`,style:`Styles`,chore:`Chores`,test:`Tests`,perf:`Performance`,build:`Build system`,ci:`CI`,revert:`Reverts`,breaking:`Breaking changes`},r=[`breaking`,`feat`,`fix`,`perf`,`refactor`,`docs`,`style`,`test`,`build`,`ci`,`chore`,`revert`];function i(e){return n[e]??n[e.toLowerCase()]??`Other changes`}function a(e){let t=/^([a-zA-Z][a-zA-Z0-9]*)(\(([^)]*)\))?(!)?:\s*(.*)$/.exec(e);return t?{type:t[1].toLowerCase(),scope:t[3]?.trim()||void 0,breaking:!!t[4],rest:t[5]??``}:{type:`chore`,breaking:!1,rest:e}}function o(e){let t=/* @__PURE__ */ new Map;for(let n of e){let{parsed:e}=n,r=t.get(e.type)??{title:i(e.type),ungrouped:[],scopes:/* @__PURE__ */ new Map};if(e.scope){let t=r.scopes.get(e.scope)??[];t.push(n),r.scopes.set(e.scope,t)}else r.ungrouped.push(n);t.set(e.type,r)}return[...t.entries()].sort((e,t)=>{let n=r.indexOf(e[0]),i=r.indexOf(t[0]);return(n===-1?r.length:n)-(i===-1?r.length:i)}).map(([,e])=>e)}function s(e){if(e.length===0)return`- No description provided.`;let t=[];for(let n of e){t.push(`### ${n.title}`);for(let e of n.ungrouped)t.push(e.text),t.push(...c(e.bodyParagraphs));for(let[e,r]of n.scopes){t.push(`#### ${l(e)}`);for(let e of r)t.push(e.text),t.push(...c(e.bodyParagraphs))}}return t.join(`
2
+ `)}function c(e){let t=[];for(let n of e){let[e,...r]=n;e&&(t.push(` - ${e}`),t.push(...r.map(e=>` ${e}`)))}return t}function l(e){return e.charAt(0).toUpperCase()+e.slice(1)}function u(e){return e.length>0?e.charAt(0).toUpperCase()+e.slice(1):e}function d(e){let t=e.lastIndexOf(`([#`);if(t===-1)return{main:e,inline:``};let n=e.slice(t),r=/^(\(\[#[^\]]+\]\([^)]*\) by [^)]*\)\)?)(?:\(fixes [^)]*\)\)?)?/.exec(n);if(!r)return{main:e,inline:``};let i=r[0]??``;return{main:e.slice(0,t)+i,inline:e.slice(t+i.length).trim()}}function f(e){let t=[],n=[];for(let r of e.split(`
3
+ `)){let e=r.trim();if(!e){n.length>0&&(t.push(n),n=[]);continue}if(e.startsWith(`-`)||e.startsWith(`*`)||/^[0-9]+[.)]/.test(e)||!e.replace(/(?:close[sd]?|fixe?s|fixed|resolves?|resolved)\b\s*:?\s*#\d+\s*[,;]?\s*/gi,``).trim())continue;let i=/^(BREAKING CHANGE|Reviewed-by|Signed-off-by|Co-authored-by|Acked-by|Co-developed-by|Helped-by|Reported-by|Suggested-by|Tested-by|Cc):\s+(.+)$/i.exec(e);i&&!/^(http|https)\b/.test(e)?(n.length>0&&(t.push(n),n=[]),t.push([`**${(i[1]??``).trim()}:** ${(i[2]??``).trim()}`])):n.push(e)}return n.length>0&&t.push(n),t}function p(e,t){return`https://github.com/${e}/commit/${t}`}function m(e,t){return`https://github.com/${e}/issues/${t}`}function h(e,t){return e.replace(/\[(#[0-9a-fA-F]{6,40})\]\(([^)]*)\)/g,(e,n)=>{let r=n.replace(`#`,``).slice(0,7);return`[#${r}](${p(t,r)})`}).replace(/(^|[^\w[])#([0-9a-fA-F]{7,40})(?![0-9a-fA-F])(?=[)\].,;:\s]|$)/g,(e,n,r)=>{let i=r.slice(0,7);return`${n}[#${i}](${p(t,i)})`})}function g(e,t){return e.replace(/\[#(\d+)(?=[ \]])(?:[^\]]*)\]\([^)]*\)/g,(e,n)=>`[#${n}](${m(t,n)})`).replace(/(^|[^\w[])#(\d+)(?=[)\].,;:\s]|$)/g,(e,n,r)=>`${n}[#${r}](${m(t,r)})`)}function _(e,t){if(!t)return e;let n=h(e,t);return n=g(n,t),n}function v(n,r){if(!r)return;let i=e(n,`utf8`),a=i.split(`
4
+ `).map(e=>_(e,r)).join(`
5
+ `);a!==i&&(t(n,a,`utf8`),console.log(` formatted ${n}`))}export{u as capitalize,f as formatBody,v as formatChangelogFile,_ as formatLine,o as groupItems,a as parseCcSubject,s as renderGroups,i as ruleTitle,d as splitInlineDescription};
@@ -0,0 +1,9 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { BumpType, CommitRecord } from "./types.js";
4
+ //#region packages/changelog/src/utils/git.d.ts
5
+ /** Read the commits in a git range (optionally limited to a path), newest first. */
6
+ export declare function readCommits(range: string, path?: string): CommitRecord[];
7
+ /** Derive the semver bump from the commits (major > minor > patch). */
8
+ export declare function deriveBump(records: CommitRecord[]): BumpType;
9
+ //#endregion
@@ -0,0 +1 @@
1
+ import"node:path";import"node:url";import.meta.url;import{execFileSync as e}from"node:child_process";function t(t,n){let r=[`log`,`--no-merges`,`--pretty=format:%H%x1f%s%x1f%b%x1f%an%x1f%ae%x1e`,t];return n&&r.push(`--`,n),e(`git`,r,{encoding:`utf8`,stdio:[`ignore`,`pipe`,`pipe`]}).split(``).filter(e=>e.length>0).map(e=>{let[t,n,r,i,a]=e.split(``);return{hash:t.trim(),subject:(n??``).trim(),body:(r??``).trim(),author:(i??``).trim(),authorEmail:(a??``).trim()}}).filter(e=>e.subject.length>0)}function n(){try{let t=e(`git`,[`remote`,`get-url`,`origin`],{encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]}).trim().match(/(?:github\.com[/:])([^/]+)\/([^/.]+?)(?:\.git)?$/);if(t?.[1]&&t[2])return`${t[1]}/${t[2]}`}catch{}}let r;function i(){if(r!==void 0)return r;try{e(`gh`,[`auth`,`status`],{encoding:`utf8`,stdio:[`ignore`,`pipe`,`pipe`]}),r=!0}catch{r=!1}return r}const a=/* @__PURE__ */ new Map;function o(t,n,r){if(!i())return;let o=`repos/${t}${n}::${r}`;if(a.has(o))return a.get(o);let s;try{let i=e(`gh`,[`api`,`repos/${t}${n}`,`--jq`,r],{encoding:`utf8`,stdio:[`ignore`,`pipe`,`pipe`]}).trim();s=i&&i!==`null`?i:void 0}catch{s=void 0}return a.set(o,s),s}function s(e){return/^(\d+)\+([^@]+)@users\.noreply\.github\.com$/.exec(e.trim())?.[2]}function c(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function l(e,t){let n;t&&(n=o(t,`/commits/${e.hash}/pulls`,`.[0].user.login`),n||=o(t,`/commits/${e.hash}`,`.author.login`)),n||=s(e.authorEmail);let r=n??e.author;return c(r)&&(r=s(r)??r.split(`@`)[0]??r),{name:r,url:n?`https://github.com/${n}`:void 0}}function u(e){return e.url?`[${e.name}](${e.url})`:e.name}function d(e){let t=/* @__PURE__ */ new Set;for(let n of e.matchAll(/\b(?:close[sd]?|fixe?s|fixed|resolves?|resolved)\b\s*:?\s*#(\d+)/gi)){let e=Number(n[1]);Number.isInteger(e)&&t.add(e)}return[...t]}function f(e,t){let n={number:t},r=o(e,`/issues/${t}`,`[.title,.html_url]`);if(r)try{let e=JSON.parse(r);n.title=e[0]||void 0,n.url=e[1]||void 0}catch{}return n}function p(e,t){let n=d(`${e.subject}\n${e.body}`);return n.length===0?[]:t?n.map(e=>f(t,e)):n.map(e=>({number:e}))}function m(e){return e.length===0?``:` (fixes ${e.map(e=>e.url&&e.title?`[#${e.number} ${e.title}](${e.url})`:e.url?`[#${e.number}](${e.url})`:`#${e.number}`).join(`, `)})`}function h(e){return/\[(#[0-9a-fA-F]{6,40})\]\([^)]*\)/.exec(e)?.[1]?.replace(`#`,``)}function g(t){try{return e(`git`,[`log`,`-1`,`--format=%aI`,t],{encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]}).trim()}catch{return}}function _(t){for(let n of[`v${t}`,t])try{let t=e(`git`,[`log`,`-1`,`--format=%aI`,n],{encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]}).trim();if(t)return t}catch{}}function v(e,t){let n=_(e);if(n)return new Date(n);for(let e of t){let t=h(e);if(t){let e=g(t);if(e)return new Date(e)}}}let y;function b(){if(y)return y;let t=/* @__PURE__ */ new Map;try{let n=e(`git`,[`log`,`--no-merges`,`--all`,`--format=%H%x1f%s%x1f%b%x1e`],{encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`],maxBuffer:134217728});for(let e of n.split(``)){if(!e.trim())continue;let[n=``,r=``,i=``]=e.split(``);if(!n)continue;let a={subject:r.trim(),body:i.trim()};t.set(n.trim(),a),t.set(n.trim().slice(0,7),a)}}catch{}return y=t,t}function x(e){return b().get(e)}function S(e){let t=`patch`;for(let n of e){let e=`${n.subject}\n${n.body}`;/\bBREAKING CHANGE\b/.test(e)||/^[a-zA-Z]+(\([^)]*\))?!:/.test(n.subject)?t=`major`:t!==`major`&&/^feat(\([^)]*\))?:/i.test(n.subject)&&(t=`minor`)}return t}export{h as bulletHash,S as deriveBump,v as deriveVersionDate,x as readCommit,t as readCommits,p as recordIssues,u as renderAuthor,m as renderIssues,n as repoSlug,l as resolveAuthorInfo};
@@ -0,0 +1,4 @@
1
+ import{resolve as e}from"node:path";import"node:url";import.meta.url;import{discoverWorkspaceDirs as t,repoRoot as n}from"./repo.js";import{readFileSync as r}from"node:fs";import{execFileSync as i}from"node:child_process";const a=[`dependencies`,`devDependencies`,`peerDependencies`,`optionalDependencies`];function o(e,t,n){for(let r of a){let i=e[r];if(i&&typeof i==`object`)for(let[e,r]of Object.entries(i)){let i=String(r);t.set(e,i===`catalog:`?n.get(e)??i:i)}}let r=e.resolutions;if(r&&typeof r==`object`)for(let[e,n]of Object.entries(r))t.set(`resolutions:${e}`,String(n))}function s(e,t){let n=!1;for(let r of e.split(`
2
+ `)){if(/^catalog:\s*$/.test(r)){n=!0;continue}if(!n||r.trim()===``)continue;if(!/^\s/.test(r)){n=!1;continue}let e=/^\s+(?:"([^"]+)"|([^:\s]+)):\s*(.+?)\s*$/.exec(r);e&&t.set(e[1]??e[2],e[3])}}function c(){let i=n(),a=/* @__PURE__ */ new Map;try{s(r(e(i,`.yarnrc.yml`),`utf8`),a)}catch{}let c=new Map(a);for(let n of t())try{o(JSON.parse(r(e(n,`package.json`),`utf8`)),c,a)}catch{}return c}function l(e){let t;try{t=i(`git`,[`ls-tree`,`-r`,`--name-only`,e],{encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]}).split(`
3
+ `).map(e=>e.trim()).filter(e=>e===`package.json`||e.endsWith(`/package.json`))}catch{return}if(t.length===0)return;let n=/* @__PURE__ */ new Map;try{s(i(`git`,[`show`,`${e}:.yarnrc.yml`],{encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]}),n)}catch{}let r=new Map(n);for(let a of t)try{let t=i(`git`,[`show`,`${e}:${a}`],{encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]});o(JSON.parse(t),r,n)}catch{}return r}function u(e){for(let t of[`v${e}`,e])try{return i(`git`,[`rev-parse`,`--verify`,`--quiet`,t],{stdio:[`ignore`,`pipe`,`ignore`]}),t}catch{}try{let t=i(`git`,[`log`,`--all`,`--grep=version packages (${e})`,`--format=%H`,`-1`],{encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]}).trim();if(t)return t}catch{}}function d(e,t){return e.name.localeCompare(t.name)}function f(e,t){let n=[],r=[],i=[];for(let[i,a]of t)e.has(i)?e.get(i)!==a&&r.push({name:i,from:e.get(i),to:a}):n.push({name:i,to:a});for(let[n,r]of e)t.has(n)||i.push({name:n,from:r});return{added:n.sort(d),updated:r.sort(d),removed:i.sort(d)}}function p(e){let{added:t,updated:n,removed:r}=e;if(t.length===0&&n.length===0&&r.length===0)return``;let i=[`### Package changes`];if(t.length>0){i.push(`#### Added`);for(let e of t)i.push(`- \`${e.name}\` \`${e.to}\``)}if(n.length>0){i.push(`#### Updated`);for(let e of n)i.push(`- \`${e.name}\` \`${e.from}\` → \`${e.to}\``)}if(r.length>0){i.push(`#### Removed`);for(let e of r)i.push(`- \`${e.name}\``)}return i.join(`
4
+ `)}function m(e,t){let n=u(e),r=u(t);if(!n||!r)return``;let i=l(n),a=l(r);return!i||!a?``:p(f(a,i))}function h(e){let t=u(e);if(!t)return``;let n=l(t);return n?p(f(n,c())):``}export{f as diffDependencies,h as packageChangesForCurrent,m as packageChangesForVersion,c as readCurrentDependencies,l as readDependenciesAtRef,p as renderPackageChanges,u as resolveVersionRef};
@@ -0,0 +1,9 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { ExistingEntry } from "./types.js";
4
+ //#region packages/changelog/src/utils/reformat.d.ts
5
+ /** Split a changelog into `## <version>` sections with their bullet lines. */
6
+ export declare function parseExistingChangelog(content: string): ExistingEntry[];
7
+ /** Backward-reformat an entire changelog file's content (all versions). */
8
+ export declare function reformatChangelogContent(content: string, repo: string | undefined, markersOnNewest?: boolean, includePackageChanges?: boolean): string;
9
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import{resolve as e}from"node:path";import"node:url";import.meta.url;import{bulletHash as t,deriveVersionDate as n,readCommit as r,repoSlug as i}from"./git.js";import{changelogFiles as a,repoRoot as o}from"./repo.js";import{packageChangesForVersion as s}from"./packages.js";import{capitalize as c,formatBody as l,formatLine as u,groupItems as d,parseCcSubject as f,renderGroups as p}from"./format.js";import{renderChangelogEntry as m}from"./version.js";import{existsSync as h,readFileSync as g,writeFileSync as _}from"node:fs";function v(e){let t=[],n;for(let r of e.split(`
2
+ `)){let e=/^##\s+([0-9]+\.[0-9]+\.[0-9]+)(?:\s*\(.*\))?\s*$/.exec(r);e?(n={version:e[1],bullets:[]},t.push(n)):n&&(r.includes(`<!-- release:`)||r.startsWith(`- `)&&n.bullets.push(r))}return t}function y(e){let t=e.lastIndexOf(`([#`);if(t===-1)return``;let n=e.slice(t);return/^(\(\[#[^\]]+\]\([^)]*\) by [^)]*\)\)?)(?:\(fixes [^)]*\)\)?)?/.exec(n)?.[0]??``}function b(e,i,a=!1,o=``){let s=[];for(let n of e.bullets){let e=n.replace(/^-\s+/,``),a=t(n),o=a?r(a):void 0,d=o?.subject??e.replace(/\*\*/g,``),p=f(d),m=y(e),h=`- ${[u(c(p.rest),i),m].filter(Boolean).join(` `)}`,g=o?l(o.body):[];s.push({parsed:p,text:h,bodyParagraphs:g})}let h=n(e.version,e.bullets);return m(e.version,p(d(s)),h,a,o)}function x(e,t,n=!1,r=!1){let i=v(e);if(i.length===0)return e;let a=e.split(`
3
+ `)[0]??`# Changelog`;return`${a.startsWith(`# `)?a:`# Changelog`}\n\n${i.map((e,a)=>{let o=i[a+1],c=r&&o?s(e.version,o.version):``;return b(e,t,n&&a===0,c)}).filter(Boolean).join(`
4
+
5
+
6
+ `)}\n`}function S(t=!1){let n=o(),r=e(n,`CHANGELOG.md`);return h(r)?x(g(r,`utf8`),i(),!1,t):``}function C(t,n=!1){let r=e(o(),`CHANGELOG.md`);for(let e of a()){let a=x(g(e,`utf8`),i(),!0,n&&e===r);if(t){let t=e.replace(/CHANGELOG\.md$/,`CHANGELOG.proposed.md`);_(t,a,`utf8`),console.log(`[DRY-RUN] Wrote ${t}`)}else _(e,a,`utf8`),console.log(` formatted ${e}`)}}export{C as formatExistingChangelogs,v as parseExistingChangelog,x as reformatChangelogContent,S as reformatRootChangelog};
@@ -0,0 +1 @@
1
+ import{resolve as e}from"node:path";import"node:url";import.meta.url;import{existsSync as t,globSync as n,readFileSync as r,writeFileSync as i}from"node:fs";function a(){let n=process.cwd();for(let r=0;r<8;r++){if(t(e(n,`package.json`)))return n;let r=e(n,`..`);if(r===n)break;n=r}return process.cwd()}function o(){let i=a(),o=JSON.parse(r(e(i,`package.json`),`utf8`)),s=/* @__PURE__ */ new Set([i]);for(let r of o.workspaces??[])if(r!==`.`)for(let a of n(r,{cwd:i})){let n=e(i,a);t(e(n,`package.json`))&&s.add(n)}return[...s]}function s(){let t=e(a(),`package.json`);return JSON.parse(r(t,`utf8`)).version??`0.0.0`}function c(n){for(let a of o()){let o=e(a,`package.json`);if(!t(o))continue;let s=r(o,`utf8`),c=s.replace(/("version"\s*:\s*)"[^"]*"/,`$1"${n}"`);c!==s&&(i(o,c,`utf8`),console.log(` bumped ${o}`))}}function l(){let n=a();return[e(n,`CHANGELOG.md`),...o().filter(t=>e(t)!==e(n)).map(t=>e(t,`CHANGELOG.md`))].filter(e=>t(e))}export{l as changelogFiles,o as discoverWorkspaceDirs,s as readRootVersion,a as repoRoot,c as writeVersion};