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