@deltabox/toolchain 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,9 +1,19 @@
1
1
  # Changelog
2
2
 
3
- ## 1.6.0 (October 2026)
3
+ ## 1.6.1 (October 2026)
4
4
 
5
5
  <!-- release:start -->
6
6
 
7
+ ### Documentation
8
+ #### Config
9
+ - Inline nested sub-schemas in the generated reference ([#5a9a9e3](https://github.com/deltabox-studio/toolchain/commit/5a9a9e3) by [T0chi](https://github.com/T0chi))
10
+ - \
11
+
12
+ <!-- release:end -->
13
+
14
+
15
+ ## 1.6.0 (October 2026)
16
+
7
17
  ### New features
8
18
  #### Changelog
9
19
  - Add a configurable versioning option ([#e5cbefc](https://github.com/deltabox-studio/toolchain/commit/e5cbefc) by [T0chi](https://github.com/T0chi))
@@ -30,9 +40,6 @@
30
40
  - Re-apply the explicit changelog and tsconfig bins ([#192a2d3](https://github.com/deltabox-studio/toolchain/commit/192a2d3) by [T0chi](https://github.com/T0chi))
31
41
  - The generated version bump commit dropped the explicit \in\ mapping (object form) from both package.jsons; regenerate it from the pinned tsdown \exports.bin\ so \yarn build\ stays idempotent.
32
42
 
33
- <!-- release:end -->
34
-
35
-
36
43
  ## 1.5.0 (October 2026)
37
44
 
38
45
  ### New features
package/dist/package.js CHANGED
@@ -1 +1 @@
1
- import"node:path";import"node:url";import.meta.url;var e=`1.6.0`;export{e as version};
1
+ import"node:path";import"node:url";import.meta.url;var e=`1.6.1`;export{e as version};
@@ -70,8 +70,9 @@ export interface RenderConfigFileOptions {
70
70
  /**
71
71
  * Render a single markdown reference for a config **file** (no environment-var
72
72
  * language): one `## \`key\`` section per schema, with its fields, types,
73
- * defaults and descriptions. This is what a `dbx.config.ts`-style
74
- * reference is generated from.
73
+ * defaults and descriptions. Named sub-schemas (`$defs`) are resolved and
74
+ * expanded inline, so nested options (`changelog.versioning.target`, ...) are
75
+ * documented too. This is what a `dbx.config.ts`-style reference is generated from.
75
76
  */
76
77
  export declare function renderConfigFileMarkdown(sections: ConfigFileSection[], options?: RenderConfigFileOptions): string;
77
78
  //#endregion
@@ -1,5 +1,5 @@
1
- import{default as e}from"node:path";import"node:url";import.meta.url;import{titleCase as t}from"../../../shared/src/string-utils.js";import"../../../shared/src/index.js";import{splitBaseSchema as n,zodToJsonSchema as r}from"../schema.js";import{collectEnvVars as i}from"../collect.js";import{cliFlagLabel as a}from"./cli.js";import o from"node:fs";function s(e,t,n,r){let i=[`${n} ${t}`];return e.type===`object`&&e.properties?(i.push(...c(e,`${n}#`,r)),i):(e.env&&i.push(`- **Env**: \`${e.env}\``),i.push(`- **Type**: \`${e.tsType??(Array.isArray(e.type)?e.type.join(` | `):e.type)??`any`}\``),e.default!==void 0&&i.push(`- **Default**: \`${JSON.stringify(e.default)}\``),e.description&&i.push(``,e.description),i)}function c(e,t,n){let r=[];for(let[i,o]of Object.entries(e.properties??{})){let e=n.useFlags&&o.env?a(o.env,n):`\`${i}\``;r.push(``,...s(o,e,t,n))}return r}function l(e,r,i={}){let a=i.outline??[2,3,4],o={useFlags:e===(i.cliScope??`cli`),baseGroup:i.baseGroup??`base`,...i.envPrefix?{envPrefix:i.envPrefix}:{},...i.shortFlags?{shortFlags:i.shortFlags}:{}},{base:s,groups:l}=n(r,o.baseGroup),u=[`---`,`title: ${t(e)} Configuration`,`outline: ${JSON.stringify(a)}`,`---`,``,`# ${t(e)} Configuration`,``,`Every setting below is configured through an environment variable.`,``,`## Base`,``,...c(s,`###`,o)];for(let[e,n]of Object.entries(l.properties??{}))u.push(``,`## ${t(e)}`,``,...c(n,`###`,o));return`${u.join(`
2
- `).trim()}\n`}function u(e){return e===void 0?`—`:Array.isArray(e)?`\`${e.join(`,`)}\``:typeof e==`object`?`\`${JSON.stringify(e)}\``:`\`${String(e)}\``}function d(e,t,n){for(let r of Object.values(e.properties??{})){let e=r;if(e.type===`object`&&e.properties)d(r,t,n);else if(e.env){let r=e.envDefault??e.default;n.push({name:e.env,scope:t,...e.description?{description:e.description}:{},...r===void 0?{}:{default:r},...e.required===!0?{required:!0}:{},...e.secret?{secret:!0}:{},...e.public?{public:!0}:{}})}}}function f(e,t={}){let a=t.outline??[2,3,4],o=t.baseGroup??`base`,s=t.labels??{},c=[],l=[];for(let[t,i]of Object.entries(e)){let e=i.jsonSchema??r(i.zodSchema);d(n(e,o).base,t,l)}for(let n of i(e,t.envPrefix??`APP_`,{envPathOf:t.envPathOf}))n.required&&c.push({name:n.name,scope:n.scope,...n.description?{description:n.description}:{},...n.default===void 0?{}:{default:n.default}});let f=e=>[`| Variable | Default | Description |`,`| -------- | ------- | ----------- |`,...e.map(e=>`| \`${e.name}\` | ${u(e.default)} | ${(e.description??``).replace(/\n/g,` `).replace(/\|/g,`\\|`)} |`)].join(`
1
+ import{default as e}from"node:path";import"node:url";import.meta.url;import{titleCase as t}from"../../../shared/src/string-utils.js";import"../../../shared/src/index.js";import{splitBaseSchema as n,zodToJsonSchema as r}from"../schema.js";import{collectEnvVars as i}from"../collect.js";import{cliFlagLabel as a}from"./cli.js";import o from"node:fs";import{z as s}from"zod";function c(e,t,n,r){let i=[`${n} ${t}`];return e.type===`object`&&e.properties?(i.push(...l(e,`${n}#`,r)),i):(e.env&&i.push(`- **Env**: \`${e.env}\``),i.push(`- **Type**: \`${e.tsType??(Array.isArray(e.type)?e.type.join(` | `):e.type)??`any`}\``),e.default!==void 0&&i.push(`- **Default**: \`${JSON.stringify(e.default)}\``),e.description&&i.push(``,e.description),i)}function l(e,t,n){let r=[];for(let[i,o]of Object.entries(e.properties??{})){let e=n.useFlags&&o.env?a(o.env,n):`\`${i}\``;r.push(``,...c(o,e,t,n))}return r}function u(e,r,i={}){let a=i.outline??[2,3,4],o={useFlags:e===(i.cliScope??`cli`),baseGroup:i.baseGroup??`base`,...i.envPrefix?{envPrefix:i.envPrefix}:{},...i.shortFlags?{shortFlags:i.shortFlags}:{}},{base:s,groups:c}=n(r,o.baseGroup),u=[`---`,`title: ${t(e)} Configuration`,`outline: ${JSON.stringify(a)}`,`---`,``,`# ${t(e)} Configuration`,``,`Every setting below is configured through an environment variable.`,``,`## Base`,``,...l(s,`###`,o)];for(let[e,n]of Object.entries(c.properties??{}))u.push(``,`## ${t(e)}`,``,...l(n,`###`,o));return`${u.join(`
2
+ `).trim()}\n`}function d(e){return e===void 0?`—`:Array.isArray(e)?`\`${e.join(`,`)}\``:typeof e==`object`?`\`${JSON.stringify(e)}\``:`\`${String(e)}\``}function f(e,t,n){for(let r of Object.values(e.properties??{})){let e=r;if(e.type===`object`&&e.properties)f(r,t,n);else if(e.env){let r=e.envDefault??e.default;n.push({name:e.env,scope:t,...e.description?{description:e.description}:{},...r===void 0?{}:{default:r},...e.required===!0?{required:!0}:{},...e.secret?{secret:!0}:{},...e.public?{public:!0}:{}})}}}function p(e,t={}){let a=t.outline??[2,3,4],o=t.baseGroup??`base`,s=t.labels??{},c=[],l=[];for(let[t,i]of Object.entries(e)){let e=i.jsonSchema??r(i.zodSchema);f(n(e,o).base,t,l)}for(let n of i(e,t.envPrefix??`APP_`,{envPathOf:t.envPathOf}))n.required&&c.push({name:n.name,scope:n.scope,...n.description?{description:n.description}:{},...n.default===void 0?{}:{default:n.default}});let u=e=>[`| Variable | Default | Description |`,`| -------- | ------- | ----------- |`,...e.map(e=>`| \`${e.name}\` | ${d(e.default)} | ${(e.description??``).replace(/\n/g,` `).replace(/\|/g,`\\|`)} |`)].join(`
3
3
  `),p=s.title??`Environment variables`,m=t.intro??`Environment variables are prefixed with \`${t.envPrefix??`APP_`}\`.
4
4
  The underscore is a path separator, so every config value has an environment
5
5
  variable equivalent.`,h=t.requiredNote??`These variables have no safe default and **must** be set:`,g=t.coreNote??`The core (base) config values:`,_=t.references&&t.references.length?`\n## References\n\n${t.references.map(e=>`- [${e.label}](${e.href})`).join(`
@@ -16,12 +16,12 @@ ${m}
16
16
 
17
17
  ${h}
18
18
 
19
- ${f(c)}
19
+ ${u(c)}
20
20
 
21
21
  ## ${s.core??`Core`}
22
22
 
23
23
  ${g}
24
24
 
25
- ${f(l)}
26
- ${_}`}function p(t,n){let i=n.outline??[2,3,4],a=Object.entries(t).map(([t,a])=>[e.resolve(n.outDir,`${t}.md`),l(t,a.jsonSchema??r(a.zodSchema),{...n,outline:i})]);a.push([e.resolve(n.outDir,n.indexFilename??`index.md`),f(t,{...n,outline:i})]);for(let[t,n]of a)o.mkdirSync(e.dirname(t),{recursive:!0}),o.writeFileSync(t,n,`utf-8`);return a.map(([e])=>e)}function m(e,t={}){let n={baseGroup:`base`},i=t.title??`Configuration`,a=[`---`,`title: ${i}`,`outline: ${JSON.stringify(t.outline??[2,3,4])}`,`---`,``,`# ${i}`,``];t.intro&&a.push(t.intro,``);for(let t of e){a.push(`## \`${t.key}\``,``),t.description&&a.push(t.description,``);let e=r(t.schema);a.push(...c(e,`###`,n),``)}return`${a.join(`
27
- `).trim()}\n`}export{p as generateConfigMarkdown,m as renderConfigFileMarkdown,f as renderConfigIndex,l as renderScopeMarkdown};
25
+ ${u(l)}
26
+ ${_}`}function m(t,n){let i=n.outline??[2,3,4],a=Object.entries(t).map(([t,a])=>[e.resolve(n.outDir,`${t}.md`),u(t,a.jsonSchema??r(a.zodSchema),{...n,outline:i})]);a.push([e.resolve(n.outDir,n.indexFilename??`index.md`),p(t,{...n,outline:i})]);for(let[t,n]of a)o.mkdirSync(e.dirname(t),{recursive:!0}),o.writeFileSync(t,n,`utf-8`);return a.map(([e])=>e)}function h(e){return e.$ref?e.$ref.split(`/`).pop()??void 0:void 0}function g(e,t){let n=h(e);return n&&t[n]?t[n]:e}function _(e){return typeof e==`string`?`'${e}'`:String(e)}function v(e,t){if(e.$ref){let n=g(e,t);return n.properties||n.anyOf||n.oneOf?h(e):v(n,t)}if(e.const!==void 0)return _(e.const);if(Array.isArray(e.enum)&&e.enum.length>0)return e.enum.map(_).join(` | `);let n=e.anyOf??e.oneOf;if(n&&n.length>0)return n.map(e=>v(e,t)).join(` | `);if(e.properties)return`object`;let r=Array.isArray(e.type)?e.type:e.type?[e.type]:[];return r.includes(`array`)?`Array<${v(e.items??{},t)}>`:r.includes(`object`)?`Record<string, unknown>`:r.length===0?`unknown`:r.map(e=>e===`integer`?`number`:e).join(` | `)}function y(e,t,n){let r=h(e);if(r){if(n.has(r))return{properties:{},required:[]};n.add(r)}let i=g(e,t);if(i.properties)return{properties:i.properties,required:i.required??[]};let a=i.anyOf??i.oneOf;if(a){let e={},r=/* @__PURE__ */ new Set;for(let i of a){let a=y(i,t,n);Object.assign(e,a.properties);for(let e of a.required)r.add(e)}return{properties:e,required:[...r]}}return(Array.isArray(i.type)?i.type:i.type?[i.type]:[]).includes(`array`)&&i.items?y(i.items,t,n):{properties:{},required:[]}}function b(e,t,n,r,i,a){let o=g(t,r),s=[`${n} \`${e}\``];s.push(`- **Type**: \`${v(t,r)}\``),a&&s.push(`- **Required**`);let c=t.default??o.default;c!==void 0&&s.push(`- **Default**: \`${JSON.stringify(c)}\``);let l=t.description??o.description;l&&s.push(``,l);let u=y(t,r,i);for(let[e,t]of Object.entries(u.properties))s.push(``,...b(e,t,`${n}#`,r,i,u.required.includes(e)));return s}function x(e,t,n,r){let i=[],a=e.required??[];for(let[o,s]of Object.entries(e.properties??{}))i.push(``,...b(o,s,t,n,r,a.includes(o)));return i}function S(e,t={}){let n=t.title??`Configuration`,r=[`---`,`title: ${n}`,`outline: ${JSON.stringify(t.outline??[2,3,4])}`,`---`,``,`# ${n}`,``];t.intro&&r.push(t.intro,``);for(let t of e){r.push(`## \`${t.key}\``,``),t.description&&r.push(t.description,``);let e=s.toJSONSchema(t.schema,{target:`draft-2020-12`}),n=e.$defs??{},i=e.$ref?g(e,n):e;r.push(...x(i,`###`,n,/* @__PURE__ */ new Set),``)}return`${r.join(`
27
+ `).trim()}\n`}export{m as generateConfigMarkdown,S as renderConfigFileMarkdown,p as renderConfigIndex,u as renderScopeMarkdown};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deltabox/toolchain",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "All-in-one toolchain: scaffold projects, manage templates, configs, tsconfigs, changelogs and builds.",
5
5
  "homepage": "https://toolchain.deltabox.studio",
6
6
  "author": "Victor Sango <victor@deltabox.studio>",
@@ -76,17 +76,17 @@
76
76
  "devDependencies": {
77
77
  "@commitlint/cli": "^21.2.2",
78
78
  "@commitlint/config-conventional": "^21.2.2",
79
- "@deltabox/toolchain-biome": "1.6.0",
80
- "@deltabox/toolchain-changelog": "1.6.0",
81
- "@deltabox/toolchain-config": "1.6.0",
82
- "@deltabox/toolchain-core": "1.6.0",
83
- "@deltabox/toolchain-migrate": "1.6.0",
84
- "@deltabox/toolchain-project": "1.6.0",
85
- "@deltabox/toolchain-shared": "1.6.0",
86
- "@deltabox/toolchain-template": "1.6.0",
87
- "@deltabox/toolchain-tsconfig": "1.6.0",
88
- "@deltabox/toolchain-tsdown": "1.6.0",
89
- "@deltabox/toolchain-vite": "1.6.0",
79
+ "@deltabox/toolchain-biome": "1.6.1",
80
+ "@deltabox/toolchain-changelog": "1.6.1",
81
+ "@deltabox/toolchain-config": "1.6.1",
82
+ "@deltabox/toolchain-core": "1.6.1",
83
+ "@deltabox/toolchain-migrate": "1.6.1",
84
+ "@deltabox/toolchain-project": "1.6.1",
85
+ "@deltabox/toolchain-shared": "1.6.1",
86
+ "@deltabox/toolchain-template": "1.6.1",
87
+ "@deltabox/toolchain-tsconfig": "1.6.1",
88
+ "@deltabox/toolchain-tsdown": "1.6.1",
89
+ "@deltabox/toolchain-vite": "1.6.1",
90
90
  "@types/node": "^22.10.2",
91
91
  "@typescript/native-preview": "7.0.0-dev.20260707.2",
92
92
  "cross-env": "^10.1.0",