@deltabox/toolchain 1.5.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 +39 -4
- package/dist/changelog.d.ts +2 -1
- package/dist/changelog.js +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +1 -1
- package/dist/package.js +1 -1
- package/dist/packages/changelog/src/cli/index.js +1 -1
- package/dist/packages/changelog/src/index.d.ts +3 -2
- package/dist/packages/changelog/src/index.js +1 -1
- package/dist/packages/changelog/src/run.d.ts +8 -2
- package/dist/packages/changelog/src/run.js +1 -1
- package/dist/packages/changelog/src/utils/versioning.d.ts +78 -0
- package/dist/packages/changelog/src/utils/versioning.js +1 -0
- package/dist/packages/changelog/src/utils/write.js +1 -1
- package/dist/packages/config/src/generators/markdown.d.ts +3 -2
- package/dist/packages/config/src/generators/markdown.js +6 -6
- package/dist/packages/shared/src/bin.d.ts +11 -0
- package/dist/packages/shared/src/bin.js +1 -1
- package/dist/packages/shared/src/config-schema.d.ts +101 -0
- package/dist/packages/shared/src/config-schema.js +1 -1
- package/dist/packages/shared/src/config-types.d.ts +12 -0
- package/dist/packages/shared/src/index.d.ts +6 -6
- package/dist/packages/shared/src/index.js +1 -1
- package/dist/packages/shared/src/run.d.ts +22 -2
- package/dist/packages/shared/src/run.js +1 -1
- package/dist/packages/shared/src/toolchain.d.ts +3 -3
- package/dist/packages/shared/src/toolchain.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/plugin.d.ts +26 -5
- package/dist/packages/vite/src/plugin.js +1 -1
- package/dist/packages/vite/src/vp.d.ts +5 -0
- package/dist/packages/vite/src/vp.js +1 -1
- package/dist/shared.d.ts +5 -5
- package/dist/shared.js +1 -1
- package/dist/vite.d.ts +2 -2
- package/dist/vite.js +1 -1
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,16 +1,51 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
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
|
-
-
|
|
10
|
-
-
|
|
19
|
+
- Add a configurable versioning option ([#e5cbefc](https://github.com/deltabox-studio/toolchain/commit/e5cbefc) by [T0chi](https://github.com/T0chi))
|
|
20
|
+
- Add \ oolchain.changelog.versioning\ (boolean | { target, workspaces }) to the shared Zod model, defaulting to true/uniform. \ arget\ selects uniform (root + all workspaces), root-only, or individual (each changed workspace bumps on its own); \workspaces\ globs select which workspaces to version (defaulting to the root workspaces field, else the root package.json alone). The CLI now threads the changelog config into the generator and writeChangelogs takes per-workspace versions. Documented in the new 'Changelog & versioning' guide.
|
|
21
|
+
### Bug fixes
|
|
22
|
+
#### Shared
|
|
23
|
+
- Add spawn timeouts so a stalled child can't hang the tool ([#e7fdf96](https://github.com/deltabox-studio/toolchain/commit/e7fdf96) by [T0chi](https://github.com/T0chi))
|
|
24
|
+
- spawnCross/run gain \ imeoutMs\ (kills the child's whole tree — \ askkill /t\ on Windows — with a warning); runVp forwards it; the plugin's one-shot \
|
|
25
|
+
#### Vite
|
|
26
|
+
- Build DBX_TASKS from a resolved binary and warn on fallbacks ([#c1a29db](https://github.com/deltabox-studio/toolchain/commit/c1a29db) by [T0chi](https://github.com/T0chi))
|
|
27
|
+
- Vite Task runs a task's command through a shell, so a bare \dbx sync\ depended on PATH/environment and could miss or pick a stale binary. DBX_TASKS now bakes in the \
|
|
28
|
+
- Warn and fall back on missing DBX_BIN/PATH/ComSpec ([#f91ad12](https://github.com/deltabox-studio/toolchain/commit/f91ad12) by [T0chi](https://github.com/T0chi))
|
|
29
|
+
- resolveDbx now ignores a DBX_BIN that points at a missing file (warn + fall through) instead of wedging every dbx call; \which\ warns once when PATH is empty; the Windows spawner warns once when ComSpec is unset before falling back to cmd.exe.
|
|
30
|
+
- Never run a stale global dbx from a pinned project ([#d441427](https://github.com/deltabox-studio/toolchain/commit/d441427) by [T0chi](https://github.com/T0chi))
|
|
31
|
+
- resolveDbx fell back to a global \dbx\ on PATH whenever the project's own binary wasn't resolvable — which happens in the toolchain repo itself (Yarn doesn't link the root's own bin, and findOwnCliEntry needs a built dist). A stale global dbx would then run \dbx sync\ and rewrite generated files in an older format. Now a project that pins @deltabox/toolchain (node_modules or the repo itself) never uses a global dbx: it warns and uses \
|
|
32
|
+
px @deltabox/toolchain@<pinned>\; the global is only used when the project pins nothing. Adds localToolchainVersion() + tests, and documents the resolution.
|
|
33
|
+
#### Vscode
|
|
34
|
+
- Pin the npx fallback to the extension's version ([#57d27fa](https://github.com/deltabox-studio/toolchain/commit/57d27fa) by [T0chi](https://github.com/T0chi))
|
|
35
|
+
- The extension's last-resort \
|
|
36
|
+
px --yes @deltabox/toolchain\ resolved \@latest\, which could drift from the workspace's generated files. It now pins its own version (\@deltabox/toolchain@<extension version>\), since the extension is versioned in lockstep with the toolchain.
|
|
37
|
+
#### Tsdown
|
|
38
|
+
- Let Yarn own the single-entry bin field ([#d6198b5](https://github.com/deltabox-studio/toolchain/commit/d6198b5) by [T0chi](https://github.com/T0chi))
|
|
39
|
+
- Reproduced (and minimised) the 'unexplained' bin revert: Yarn 4 normalises a single-entry \in\ object to a plain string on every \yarn install\, so an explicit tsdown \in\ object could never persist — install and build fought over package.json. Set tsdown's \exports.bin\ to \alse\ so tsdown leaves the field alone, and commit the string form Yarn writes. install + build are now idempotent.
|
|
40
|
+
- Re-apply the explicit changelog and tsconfig bins ([#192a2d3](https://github.com/deltabox-studio/toolchain/commit/192a2d3) by [T0chi](https://github.com/T0chi))
|
|
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.
|
|
11
42
|
|
|
12
|
-
|
|
43
|
+
## 1.5.0 (October 2026)
|
|
13
44
|
|
|
45
|
+
### New features
|
|
46
|
+
#### Changelog
|
|
47
|
+
- Emit the husky commit-msg hook for consumers ([#6898386](https://github.com/deltabox-studio/toolchain/issues/6898386) by [T0chi](https://github.com/T0chi))
|
|
48
|
+
- \dbx sync\ now writes .husky/commit-msg (running commitlint) alongside the workflows and commitlint.config.mjs, so consumers using the Conventional-Commits CI lint commits locally too. The docs recommend \postinstall: husky\ (Yarn Berry never runs \prepare\) and \.husky/* text eol=lf\ (a trailing CR breaks the hook).
|
|
14
49
|
|
|
15
50
|
## 1.4.1 (October 2026)
|
|
16
51
|
|
package/dist/changelog.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { DEFAULT_WORKFLOW_TOKENS, RenderWorkflowOptions, WORKFLOW_FILENAMES, Wor
|
|
|
12
12
|
import { RanWorkflow, RunWorkflowsOptions, RunWorkflowsResult, resolveWorkflowId, runWorkflows } from "./packages/changelog/src/run-workflows.js";
|
|
13
13
|
import { COMMITLINT_HEADER, COMMIT_MSG_HOOK, HOOK_HEADER, WORKFLOW_HEADER, changelogSyncTask, workflowFilenames } from "./packages/changelog/src/sync.js";
|
|
14
14
|
import { CommitlintOptions, conventionalCommitsVscodeExtensions, conventionalCommitsVscodeSettings, renderCommitlintConfig } from "./packages/changelog/src/templates.js";
|
|
15
|
+
import { PlanVersionsOptions, ResolvedVersioning, VersionPackages, VersionPlan, VersioningTarget, discoverVersionPackages, planVersions, readPackageVersion, resolveVersioning, writePackageVersion } from "./packages/changelog/src/utils/versioning.js";
|
|
15
16
|
import "./packages/changelog/src/index.js";
|
|
16
17
|
import { changelogCommands } from "./packages/changelog/src/cli/index.js";
|
|
17
|
-
export { AuthorInfo, BumpType, COMMITLINT_HEADER, COMMIT_MSG_HOOK, CliOptions, CommitRecord, CommitlintOptions, DEFAULT_WORKFLOW_TOKENS, ExistingEntry, GroupedItem, GroupedRule, HOOK_HEADER, IssueInfo, ParsedCommit, ProcessingMethod, RanWorkflow, RenderWorkflowOptions, RunWorkflowsOptions, RunWorkflowsResult, WORKFLOW_FILENAMES, WORKFLOW_HEADER, Workflow, WorkflowId, WorkflowJob, applyWorkflowConfig, buildSummary, changelogCommands, changelogSyncTask, conventionalCommitsVscodeExtensions, conventionalCommitsVscodeSettings, defaultWorkflows, deriveBump, formatBody, groupItems, isEnabled, main, parseArgsCli, parseCcSubject, parseExistingChangelog, readCommits, reformatChangelogContent, renderChangelogEntry, renderCommitRef, renderCommitlintConfig, renderGroups, renderWorkflow, renderWorkflows, resolveWorkflowId, ruleTitle, runChangelog, runWorkflows, splitInlineDescription, workflowFilenames };
|
|
18
|
+
export { AuthorInfo, BumpType, COMMITLINT_HEADER, COMMIT_MSG_HOOK, CliOptions, CommitRecord, CommitlintOptions, DEFAULT_WORKFLOW_TOKENS, ExistingEntry, GroupedItem, GroupedRule, HOOK_HEADER, IssueInfo, ParsedCommit, PlanVersionsOptions, ProcessingMethod, RanWorkflow, RenderWorkflowOptions, ResolvedVersioning, RunWorkflowsOptions, RunWorkflowsResult, VersionPackages, VersionPlan, VersioningTarget, WORKFLOW_FILENAMES, WORKFLOW_HEADER, Workflow, WorkflowId, WorkflowJob, applyWorkflowConfig, buildSummary, changelogCommands, changelogSyncTask, conventionalCommitsVscodeExtensions, conventionalCommitsVscodeSettings, defaultWorkflows, deriveBump, discoverVersionPackages, formatBody, groupItems, isEnabled, main, parseArgsCli, parseCcSubject, parseExistingChangelog, planVersions, readCommits, readPackageVersion, reformatChangelogContent, renderChangelogEntry, renderCommitRef, renderCommitlintConfig, renderGroups, renderWorkflow, renderWorkflows, resolveVersioning, resolveWorkflowId, ruleTitle, runChangelog, runWorkflows, splitInlineDescription, workflowFilenames, writePackageVersion };
|
package/dist/changelog.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node:path";import"node:url";import.meta.url;import{parseArgsCli as e}from"./packages/changelog/src/utils/args.js";import{deriveBump as t,readCommits as n}from"./packages/changelog/src/utils/git.js";import{formatBody as r,groupItems as i,parseCcSubject as a,renderGroups as o,ruleTitle as s,splitInlineDescription as c}from"./packages/changelog/src/utils/format.js";import{renderChangelogEntry as l}from"./packages/changelog/src/utils/version.js";import{parseExistingChangelog as u,reformatChangelogContent as d}from"./packages/changelog/src/utils/reformat.js";import{buildSummary as f,renderCommitRef as p}from"./packages/changelog/src/utils/summary.js";import{
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;import{parseArgsCli as e}from"./packages/changelog/src/utils/args.js";import{deriveBump as t,readCommits as n}from"./packages/changelog/src/utils/git.js";import{formatBody as r,groupItems as i,parseCcSubject as a,renderGroups as o,ruleTitle as s,splitInlineDescription as c}from"./packages/changelog/src/utils/format.js";import{renderChangelogEntry as l}from"./packages/changelog/src/utils/version.js";import{parseExistingChangelog as u,reformatChangelogContent as d}from"./packages/changelog/src/utils/reformat.js";import{buildSummary as f,renderCommitRef as p}from"./packages/changelog/src/utils/summary.js";import{discoverVersionPackages as m,planVersions as h,readPackageVersion as g,resolveVersioning as _,writePackageVersion as v}from"./packages/changelog/src/utils/versioning.js";import{main as y,runChangelog as b}from"./packages/changelog/src/run.js";import{DEFAULT_WORKFLOW_TOKENS as x,WORKFLOW_FILENAMES as S,applyWorkflowConfig as C,defaultWorkflows as w,isEnabled as T,renderWorkflow as E,renderWorkflows as D}from"./packages/changelog/src/workflows.js";import{resolveWorkflowId as O,runWorkflows as k}from"./packages/changelog/src/run-workflows.js";import{conventionalCommitsVscodeExtensions as A,conventionalCommitsVscodeSettings as j,renderCommitlintConfig as M}from"./packages/changelog/src/templates.js";import{COMMITLINT_HEADER as N,COMMIT_MSG_HOOK as P,HOOK_HEADER as F,WORKFLOW_HEADER as I,changelogSyncTask as L,workflowFilenames as R}from"./packages/changelog/src/sync.js";import"./packages/changelog/src/index.js";import{changelogCommands as z}from"./packages/changelog/src/cli/index.js";export{N as COMMITLINT_HEADER,P as COMMIT_MSG_HOOK,x as DEFAULT_WORKFLOW_TOKENS,F as HOOK_HEADER,S as WORKFLOW_FILENAMES,I as WORKFLOW_HEADER,C as applyWorkflowConfig,f as buildSummary,z as changelogCommands,L as changelogSyncTask,A as conventionalCommitsVscodeExtensions,j as conventionalCommitsVscodeSettings,w as defaultWorkflows,t as deriveBump,m as discoverVersionPackages,r as formatBody,i as groupItems,T as isEnabled,y as main,e as parseArgsCli,a as parseCcSubject,u as parseExistingChangelog,h as planVersions,n as readCommits,g as readPackageVersion,d as reformatChangelogContent,l as renderChangelogEntry,p as renderCommitRef,M as renderCommitlintConfig,o as renderGroups,E as renderWorkflow,D as renderWorkflows,_ as resolveVersioning,O as resolveWorkflowId,s as ruleTitle,b as runChangelog,k as runWorkflows,c as splitInlineDescription,R as workflowFilenames,v as writePackageVersion};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
import { TOOLCHAIN_PACKAGE, findOwnCliEntry } from "./packages/shared/src/bin.js";
|
|
3
|
+
import { TOOLCHAIN_PACKAGE, findOwnCliEntry, localToolchainVersion } from "./packages/shared/src/bin.js";
|
|
4
4
|
import { mergeJsonAt, readJsonAt, readJsonFile, toJson, writeJsonFile } from "./packages/shared/src/fs-utils.js";
|
|
5
5
|
import { Colors, LOG_LEVELS, LogChannel, LogLevel, Logger, LoggerConfig, LoggerOptions, configureLogger, createLogger, getLogOverrides, getLogger, isLogLevel, logger, normalizeLogLevel, setLogConfig, setLogOverrides, stripAnsi } from "./packages/shared/src/logger.js";
|
|
6
6
|
import { Sortable, deepMerge, isPlainObject, mapValues, resolveSort, sort } from "./packages/shared/src/object-utils.js";
|
|
7
7
|
import { ToolchainProvider, ToolchainProviderAction, ToolchainProviderCommand, providerActions } from "./packages/shared/src/provider.js";
|
|
8
|
-
import { RunOptions, run, spawnCross } from "./packages/shared/src/run.js";
|
|
8
|
+
import { RunOptions, SpawnCrossOptions, killProcessTree, run, spawnCross } from "./packages/shared/src/run.js";
|
|
9
9
|
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";
|
|
10
10
|
import { ReplacementOptions, ReplacementValue, Replacements, Replacer, applyReplacements, applyReplacementsDeep, createReplacer, defineReplacements, extractTokens, hasUnresolvedTokens, tokenPattern } from "./packages/shared/src/template.js";
|
|
11
|
-
import { ChangelogWorkflowsConfig, DbxConfigSections, ProjectType, ToolchainBiomeConfig, ToolchainChangelogConfig, ToolchainConfigSections, ToolchainLoggerConfig, ToolchainProjectConfig, ToolchainProvidersConfig, ToolchainTemplateKind, ToolchainTemplateSource, ToolchainTemplateSourceType, ToolchainTemplatesConfig, ToolchainTsconfigConfig, ToolchainViteConfig, ToolchainWatchConfig, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig } from "./packages/shared/src/config-types.js";
|
|
11
|
+
import { ChangelogVersioning, ChangelogVersioningConfig, ChangelogVersioningTarget, ChangelogWorkflowsConfig, DbxConfigSections, ProjectType, ToolchainBiomeConfig, ToolchainChangelogConfig, ToolchainConfigSections, ToolchainLoggerConfig, ToolchainProjectConfig, ToolchainProvidersConfig, ToolchainTemplateKind, ToolchainTemplateSource, ToolchainTemplateSourceType, ToolchainTemplatesConfig, ToolchainTsconfigConfig, ToolchainViteConfig, ToolchainWatchConfig, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig } from "./packages/shared/src/config-types.js";
|
|
12
12
|
import { Awaitable, GeneratedFile, JsonValue, PackageJson, ToolchainArgument, ToolchainCommand, ToolchainCommandContext, ToolchainOption } from "./packages/shared/src/types.js";
|
|
13
|
-
import { CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, biomeConfigSchema, changelogConfigSchema, changelogWorkflowsConfigSchema, dbxConfigSchema, loggerConfigSchema, projectConfigSchema, projectTypeSchema, providersConfigSchema, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema } from "./packages/shared/src/config-schema.js";
|
|
13
|
+
import { CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, biomeConfigSchema, changelogConfigSchema, changelogVersioningConfigSchema, changelogVersioningSchema, changelogVersioningTargetSchema, changelogWorkflowsConfigSchema, dbxConfigSchema, loggerConfigSchema, projectConfigSchema, projectTypeSchema, providersConfigSchema, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema } from "./packages/shared/src/config-schema.js";
|
|
14
14
|
import { CONFIG_FILE_NAMES, DbxConfig, ManagedFile, SyncContext, SyncSummary, SyncTask, ToolchainConfig, ToolchainHooks, ToolchainSection, defineConfig, repoSlugFromUrl, resolveTokens, sectionConfig, sectionEnabled } from "./packages/shared/src/toolchain.js";
|
|
15
15
|
import { YamlValue, toYaml } from "./packages/shared/src/yaml.js";
|
|
16
16
|
import { index_d_exports as index_d_exports$5 } from "./packages/shared/src/index.js";
|
|
@@ -33,4 +33,4 @@ import { index_d_exports as index_d_exports$6 } from "./packages/tsconfig/src/in
|
|
|
33
33
|
import { index_d_exports as index_d_exports$4 } from "./packages/project/src/index.js";
|
|
34
34
|
import { index_d_exports as index_d_exports$7 } from "./packages/tsdown/src/index.js";
|
|
35
35
|
import { defaultSyncTasks } from "./sync.js";
|
|
36
|
-
export { Awaitable, BuildProjectGraphOptions, CONFIG_FILE_NAMES, CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, ChangelogWorkflowsConfig, Colors, DBX_GITIGNORE_BLOCK, DbxConfig, DbxConfigSections, GeneratedFile, IGNORED_DIRS, JsonValue, LOG_LEVELS, LoadedConfig, LogChannel, LogLevel, Logger, LoggerConfig, LoggerOptions, MANIFEST_DIR, MANIFEST_FILE, ManagedFile, Manifest, PackageJson, PackageManager, ProjectGraph, ProjectNode, ProjectType, ReplacementOptions, ReplacementValue, Replacements, Replacer, ResetProjectsOptions, ResetProjectsResult, ResetSelectors, ResetToolchainOptions, ResetToolchainResult, RunOptions, RunSyncOptions, RunWatchOptions, SelectProjectsOptions, SelectedProject, Sortable, SyncContext, SyncResult, SyncSummary, SyncTask, TOOLCHAIN_PACKAGE, ToolchainArgument, ToolchainBiomeConfig, ToolchainChangelogConfig, ToolchainCommand, ToolchainCommandContext, ToolchainConfig, ToolchainConfigSections, ToolchainHooks, ToolchainLoggerConfig, ToolchainOption, ToolchainProjectConfig, ToolchainProvider, ToolchainProviderAction, ToolchainProviderCommand, ToolchainProvidersConfig, ToolchainSection, ToolchainTemplateKind, ToolchainTemplateSource, ToolchainTemplateSourceType, ToolchainTemplatesConfig, ToolchainTsconfigConfig, ToolchainViteConfig, ToolchainWatchConfig, 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, configureLogger, constantCase, index_d_exports$3 as core, createLogger, createReplacer, dbxConfigSchema, deepMerge, defaultSyncTasks, defineConfig, defineReplacements, detectPackageManager, detectProjectType, ensureDbxGitignore, ensureLeadingSlash, ensureSlashes, ensureTrailingSlash, extractTokens, findConfigFile, findOwnCliEntry, formatCliFlag, getLogOverrides, getLogger, hasText, hasUnresolvedTokens, indent, isLocalhost, isLogLevel, isPlainObject, kebabCase, loadToolchainConfig, logger, loggerConfigSchema, mapValues, mergeJsonAt, normalizeLogLevel, orderProjects, pascalCase, index_d_exports$4 as project, projectConfigSchema, projectGraphPath, projectTypeSchema, providerActions, providerRegistryPath, providersConfigSchema, readJsonAt, readJsonFile, readManifest, readProjectGraph, readProviderRegistry, removeDoubleSlashes, removeLeadingSlash, removeTrailingSlash, repoSlugFromUrl, resetProjects, resetToolchain, resolveProjectType, resolveSort, resolveTokens, run, runSync, runWatch, sanitizeSlashes, sectionConfig, sectionEnabled, selectProjects, setLogConfig, setLogOverrides, index_d_exports$5 as shared, snakeCase, sort, spawnCross, str, stripAnsi, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, titleCase, toJson, toYaml, tokenPattern, toolchainConfigSchema, index_d_exports$6 as tsconfig, tsconfigConfigSchema, index_d_exports$7 as tsdown, viteConfigSchema, vscodeSyncTask, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema, writeJsonFile, writeManifest, writeProjectGraph, writeProviderRegistry };
|
|
36
|
+
export { Awaitable, BuildProjectGraphOptions, CONFIG_FILE_NAMES, CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, ChangelogVersioning, ChangelogVersioningConfig, ChangelogVersioningTarget, ChangelogWorkflowsConfig, Colors, DBX_GITIGNORE_BLOCK, DbxConfig, DbxConfigSections, GeneratedFile, IGNORED_DIRS, JsonValue, LOG_LEVELS, LoadedConfig, LogChannel, LogLevel, Logger, LoggerConfig, LoggerOptions, MANIFEST_DIR, MANIFEST_FILE, ManagedFile, Manifest, PackageJson, PackageManager, ProjectGraph, ProjectNode, ProjectType, ReplacementOptions, ReplacementValue, Replacements, Replacer, ResetProjectsOptions, ResetProjectsResult, ResetSelectors, ResetToolchainOptions, ResetToolchainResult, RunOptions, RunSyncOptions, RunWatchOptions, SelectProjectsOptions, SelectedProject, Sortable, SpawnCrossOptions, SyncContext, SyncResult, SyncSummary, SyncTask, TOOLCHAIN_PACKAGE, ToolchainArgument, ToolchainBiomeConfig, ToolchainChangelogConfig, ToolchainCommand, ToolchainCommandContext, ToolchainConfig, ToolchainConfigSections, ToolchainHooks, ToolchainLoggerConfig, ToolchainOption, ToolchainProjectConfig, ToolchainProvider, ToolchainProviderAction, ToolchainProviderCommand, ToolchainProvidersConfig, ToolchainSection, ToolchainTemplateKind, ToolchainTemplateSource, ToolchainTemplateSourceType, ToolchainTemplatesConfig, ToolchainTsconfigConfig, ToolchainViteConfig, ToolchainWatchConfig, 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, changelogVersioningConfigSchema, changelogVersioningSchema, changelogVersioningTargetSchema, changelogWorkflowsConfigSchema, index_d_exports$2 as config, configureLogger, constantCase, index_d_exports$3 as core, createLogger, createReplacer, dbxConfigSchema, deepMerge, defaultSyncTasks, defineConfig, defineReplacements, detectPackageManager, detectProjectType, ensureDbxGitignore, ensureLeadingSlash, ensureSlashes, ensureTrailingSlash, extractTokens, findConfigFile, findOwnCliEntry, formatCliFlag, getLogOverrides, getLogger, hasText, hasUnresolvedTokens, indent, isLocalhost, isLogLevel, isPlainObject, kebabCase, killProcessTree, loadToolchainConfig, localToolchainVersion, logger, loggerConfigSchema, mapValues, mergeJsonAt, normalizeLogLevel, orderProjects, pascalCase, index_d_exports$4 as project, projectConfigSchema, projectGraphPath, projectTypeSchema, providerActions, providerRegistryPath, providersConfigSchema, readJsonAt, readJsonFile, readManifest, readProjectGraph, readProviderRegistry, removeDoubleSlashes, removeLeadingSlash, removeTrailingSlash, repoSlugFromUrl, resetProjects, resetToolchain, resolveProjectType, resolveSort, resolveTokens, run, runSync, runWatch, sanitizeSlashes, sectionConfig, sectionEnabled, selectProjects, setLogConfig, setLogOverrides, index_d_exports$5 as shared, snakeCase, sort, spawnCross, str, stripAnsi, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, titleCase, toJson, toYaml, tokenPattern, toolchainConfigSchema, index_d_exports$6 as tsconfig, tsconfigConfigSchema, index_d_exports$7 as tsdown, viteConfigSchema, vscodeSyncTask, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema, writeJsonFile, writeManifest, writeProjectGraph, writeProviderRegistry };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node:path";import"node:url";import.meta.url;import{TOOLCHAIN_PACKAGE as e,findOwnCliEntry as t}from"./packages/shared/src/bin.js";import{deepMerge as
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;import{TOOLCHAIN_PACKAGE as e,findOwnCliEntry as t,localToolchainVersion as n}from"./packages/shared/src/bin.js";import{deepMerge as r,isPlainObject as i,mapValues as a,resolveSort as o,sort as s}from"./packages/shared/src/object-utils.js";import{mergeJsonAt as c,readJsonAt as l,readJsonFile as u,toJson as d,writeJsonFile as f}from"./packages/shared/src/fs-utils.js";import{LOG_LEVELS as p,configureLogger as m,createLogger as h,getLogOverrides as g,getLogger as _,isLogLevel as v,logger as y,normalizeLogLevel as b,setLogConfig as x,setLogOverrides as S,stripAnsi as C}from"./packages/shared/src/logger.js";import{providerActions as w}from"./packages/shared/src/provider.js";import{killProcessTree as T,run as E,spawnCross as D}from"./packages/shared/src/run.js";import{asString as O,camelCase as k,camelCaseId as A,capitalize as j,constantCase as M,ensureLeadingSlash as N,ensureSlashes as P,ensureTrailingSlash as F,formatCliFlag as I,hasText as L,indent as R,isLocalhost as z,kebabCase as B,pascalCase as V,removeDoubleSlashes as H,removeLeadingSlash as U,removeTrailingSlash as W,sanitizeSlashes as G,snakeCase as K,str as q,titleCase as J}from"./packages/shared/src/string-utils.js";import{applyReplacements as Y,applyReplacementsDeep as X,createReplacer as Z,defineReplacements as Q,extractTokens as $,hasUnresolvedTokens as ee,tokenPattern as te}from"./packages/shared/src/template.js";import{CONFIG_SECTION_DESCRIPTIONS as ne,CONFIG_SECTION_SCHEMAS as re,CONFIG_TYPE_SCHEMAS as ie,biomeConfigSchema as ae,changelogConfigSchema as oe,changelogVersioningConfigSchema as se,changelogVersioningSchema as ce,changelogVersioningTargetSchema as le,changelogWorkflowsConfigSchema as ue,dbxConfigSchema as de,loggerConfigSchema as fe,projectConfigSchema as pe,projectTypeSchema as me,providersConfigSchema as he,templateKindSchema as ge,templateSourceSchema as _e,templateSourceTypeSchema as ve,templatesConfigSchema as ye,toolchainConfigSchema as be,tsconfigConfigSchema as xe,viteConfigSchema as Se,watchConfigSchema as Ce,workflowConfigSchema as we,workflowSettingSchema as Te,workflowStepSchema as Ee,workflowStepsConfigSchema as De}from"./packages/shared/src/config-schema.js";import{CONFIG_FILE_NAMES as Oe,defineConfig as ke,repoSlugFromUrl as Ae,resolveTokens as je,sectionConfig as Me,sectionEnabled as Ne}from"./packages/shared/src/toolchain.js";import{toYaml as Pe}from"./packages/shared/src/yaml.js";import{src_exports as Fe}from"./packages/shared/src/index.js";import{src_exports as Ie}from"./packages/biome/src/index.js";import{src_exports as Le}from"./packages/changelog/src/index.js";import{src_exports as Re}from"./packages/config/src/index.js";import{DBX_GITIGNORE_BLOCK as ze,ensureDbxGitignore as Be}from"./packages/core/src/gitignore.js";import{detectProjectType as Ve,resolveProjectType as He}from"./packages/core/src/project-type.js";import{findConfigFile as Ue,loadToolchainConfig as We}from"./packages/core/src/loader.js";import{IGNORED_DIRS as Ge,buildProjectGraph as Ke,detectPackageManager as qe,orderProjects as Je,projectGraphPath as Ye,readProjectGraph as Xe,writeProjectGraph as Ze}from"./packages/core/src/graph.js";import{MANIFEST_DIR as Qe,MANIFEST_FILE as $e,readManifest as et,writeManifest as tt}from"./packages/core/src/manifest.js";import{providerRegistryPath as nt,readProviderRegistry as rt,writeProviderRegistry as it}from"./packages/core/src/provider-registry.js";import{selectProjects as at}from"./packages/core/src/select.js";import{resetProjects as ot,resetToolchain as st}from"./packages/core/src/reset.js";import{runSync as ct}from"./packages/core/src/sync.js";import{vscodeSyncTask as lt}from"./packages/core/src/vscode.js";import{runWatch as ut}from"./packages/core/src/watch.js";import{src_exports as dt}from"./packages/core/src/index.js";import{src_exports as ft}from"./packages/tsconfig/src/index.js";import{src_exports as pt}from"./packages/project/src/index.js";import{src_exports as mt}from"./packages/tsdown/src/index.js";import{defaultSyncTasks as ht}from"./sync.js";export{Oe as CONFIG_FILE_NAMES,ne as CONFIG_SECTION_DESCRIPTIONS,re as CONFIG_SECTION_SCHEMAS,ie as CONFIG_TYPE_SCHEMAS,ze as DBX_GITIGNORE_BLOCK,Ge as IGNORED_DIRS,p as LOG_LEVELS,Qe as MANIFEST_DIR,$e as MANIFEST_FILE,e as TOOLCHAIN_PACKAGE,Y as applyReplacements,X as applyReplacementsDeep,O as asString,Ie as biome,ae as biomeConfigSchema,Ke as buildProjectGraph,k as camelCase,A as camelCaseId,j as capitalize,Le as changelog,oe as changelogConfigSchema,se as changelogVersioningConfigSchema,ce as changelogVersioningSchema,le as changelogVersioningTargetSchema,ue as changelogWorkflowsConfigSchema,Re as config,m as configureLogger,M as constantCase,dt as core,h as createLogger,Z as createReplacer,de as dbxConfigSchema,r as deepMerge,ht as defaultSyncTasks,ke as defineConfig,Q as defineReplacements,qe as detectPackageManager,Ve as detectProjectType,Be as ensureDbxGitignore,N as ensureLeadingSlash,P as ensureSlashes,F as ensureTrailingSlash,$ as extractTokens,Ue as findConfigFile,t as findOwnCliEntry,I as formatCliFlag,g as getLogOverrides,_ as getLogger,L as hasText,ee as hasUnresolvedTokens,R as indent,z as isLocalhost,v as isLogLevel,i as isPlainObject,B as kebabCase,T as killProcessTree,We as loadToolchainConfig,n as localToolchainVersion,y as logger,fe as loggerConfigSchema,a as mapValues,c as mergeJsonAt,b as normalizeLogLevel,Je as orderProjects,V as pascalCase,pt as project,pe as projectConfigSchema,Ye as projectGraphPath,me as projectTypeSchema,w as providerActions,nt as providerRegistryPath,he as providersConfigSchema,l as readJsonAt,u as readJsonFile,et as readManifest,Xe as readProjectGraph,rt as readProviderRegistry,H as removeDoubleSlashes,U as removeLeadingSlash,W as removeTrailingSlash,Ae as repoSlugFromUrl,ot as resetProjects,st as resetToolchain,He as resolveProjectType,o as resolveSort,je as resolveTokens,E as run,ct as runSync,ut as runWatch,G as sanitizeSlashes,Me as sectionConfig,Ne as sectionEnabled,at as selectProjects,x as setLogConfig,S as setLogOverrides,Fe as shared,K as snakeCase,s as sort,D as spawnCross,q as str,C as stripAnsi,ge as templateKindSchema,_e as templateSourceSchema,ve as templateSourceTypeSchema,ye as templatesConfigSchema,J as titleCase,d as toJson,Pe as toYaml,te as tokenPattern,be as toolchainConfigSchema,ft as tsconfig,xe as tsconfigConfigSchema,mt as tsdown,Se as viteConfigSchema,lt as vscodeSyncTask,Ce as watchConfigSchema,we as workflowConfigSchema,Te as workflowSettingSchema,Ee as workflowStepSchema,De as workflowStepsConfigSchema,f as writeJsonFile,tt as writeManifest,Ze as writeProjectGraph,it as writeProviderRegistry};
|
package/dist/package.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node:path";import"node:url";import.meta.url;var e=`1.
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;var e=`1.6.1`;export{e as version};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node:path";import"node:url";import.meta.url;import{logger as e}from"../../../shared/src/logger.js";import"../../../shared/src/index.js";import{runChangelog as
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;import{logger as e}from"../../../shared/src/logger.js";import{sectionConfig as t}from"../../../shared/src/toolchain.js";import"../../../shared/src/index.js";import{runChangelog as n}from"../run.js";import{runWorkflows as r}from"../run-workflows.js";function i(){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(t,n)=>{let i=t.workflows,a=Array.isArray(i)?i:i?[String(i)]:void 0,o=await r({cwd:t.cwd??n.cwd,config:n.config,...a?{workflows:a}:{},...t.ref?{ref:t.ref}:{},...t.gh?{gh:t.gh}:{}}),s=!1;for(let t of o.ran)t.code===0?e.info(`triggered ${t.file}`):(s=!0,e.error(`${t.file} exited ${t.code}`));s&&(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:(e,r)=>{let i=[];e.range&&i.push(`--range`,String(e.range)),e.dryRun&&i.push(`--dry-run`),e.version&&i.push(`--version`,String(e.version)),e.baseVersion&&i.push(`--base-version`,String(e.baseVersion)),e.processingMethod&&i.push(`--processing-method`,String(e.processingMethod)),e.formatOnly&&i.push(`--format-only`),e.packageChangesSection===!1&&i.push(`--no-package-changes-section`),n(i,t(r.config.changelog))}}]}export{i as changelogCommands};
|
|
@@ -12,8 +12,9 @@ import { DEFAULT_WORKFLOW_TOKENS, RenderWorkflowOptions, WORKFLOW_FILENAMES, Wor
|
|
|
12
12
|
import { RanWorkflow, RunWorkflowsOptions, RunWorkflowsResult, resolveWorkflowId, runWorkflows } from "./run-workflows.js";
|
|
13
13
|
import { COMMITLINT_HEADER, COMMIT_MSG_HOOK, HOOK_HEADER, WORKFLOW_HEADER, changelogSyncTask, workflowFilenames } from "./sync.js";
|
|
14
14
|
import { CommitlintOptions, conventionalCommitsVscodeExtensions, conventionalCommitsVscodeSettings, renderCommitlintConfig } from "./templates.js";
|
|
15
|
+
import { PlanVersionsOptions, ResolvedVersioning, VersionPackages, VersionPlan, VersioningTarget, discoverVersionPackages, planVersions, readPackageVersion, resolveVersioning, writePackageVersion } from "./utils/versioning.js";
|
|
15
16
|
declare namespace index_d_exports {
|
|
16
|
-
export { AuthorInfo, BumpType, COMMITLINT_HEADER, COMMIT_MSG_HOOK, CliOptions, CommitRecord, CommitlintOptions, DEFAULT_WORKFLOW_TOKENS, ExistingEntry, GroupedItem, GroupedRule, HOOK_HEADER, 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, renderCommitRef, renderCommitlintConfig, renderGroups, renderWorkflow, renderWorkflows, resolveWorkflowId, ruleTitle, runChangelog, runWorkflows, splitInlineDescription, workflowFilenames };
|
|
17
|
+
export { AuthorInfo, BumpType, COMMITLINT_HEADER, COMMIT_MSG_HOOK, CliOptions, CommitRecord, CommitlintOptions, DEFAULT_WORKFLOW_TOKENS, ExistingEntry, GroupedItem, GroupedRule, HOOK_HEADER, IssueInfo, ParsedCommit, PlanVersionsOptions, ProcessingMethod, RanWorkflow, RenderWorkflowOptions, ResolvedVersioning, RunWorkflowsOptions, RunWorkflowsResult, VersionPackages, VersionPlan, VersioningTarget, WORKFLOW_FILENAMES, WORKFLOW_HEADER, Workflow, WorkflowId, WorkflowJob, applyWorkflowConfig, buildSummary, changelogSyncTask, conventionalCommitsVscodeExtensions, conventionalCommitsVscodeSettings, defaultWorkflows, deriveBump, discoverVersionPackages, formatBody, groupItems, isEnabled, main, parseArgsCli, parseCcSubject, parseExistingChangelog, planVersions, readCommits, readPackageVersion, reformatChangelogContent, renderChangelogEntry, renderCommitRef, renderCommitlintConfig, renderGroups, renderWorkflow, renderWorkflows, resolveVersioning, resolveWorkflowId, ruleTitle, runChangelog, runWorkflows, splitInlineDescription, workflowFilenames, writePackageVersion };
|
|
17
18
|
}
|
|
18
19
|
//#endregion
|
|
19
|
-
export { AuthorInfo, BumpType, COMMITLINT_HEADER, COMMIT_MSG_HOOK, CliOptions, CommitRecord, CommitlintOptions, DEFAULT_WORKFLOW_TOKENS, ExistingEntry, GroupedItem, GroupedRule, HOOK_HEADER, 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, renderCommitRef, renderCommitlintConfig, renderGroups, renderWorkflow, renderWorkflows, resolveWorkflowId, ruleTitle, runChangelog, runWorkflows, splitInlineDescription, workflowFilenames };
|
|
20
|
+
export { AuthorInfo, BumpType, COMMITLINT_HEADER, COMMIT_MSG_HOOK, CliOptions, CommitRecord, CommitlintOptions, DEFAULT_WORKFLOW_TOKENS, ExistingEntry, GroupedItem, GroupedRule, HOOK_HEADER, IssueInfo, ParsedCommit, PlanVersionsOptions, ProcessingMethod, RanWorkflow, RenderWorkflowOptions, ResolvedVersioning, RunWorkflowsOptions, RunWorkflowsResult, VersionPackages, VersionPlan, VersioningTarget, WORKFLOW_FILENAMES, WORKFLOW_HEADER, Workflow, WorkflowId, WorkflowJob, applyWorkflowConfig, buildSummary, changelogSyncTask, conventionalCommitsVscodeExtensions, conventionalCommitsVscodeSettings, defaultWorkflows, deriveBump, discoverVersionPackages, formatBody, groupItems, index_d_exports, isEnabled, main, parseArgsCli, parseCcSubject, parseExistingChangelog, planVersions, readCommits, readPackageVersion, reformatChangelogContent, renderChangelogEntry, renderCommitRef, renderCommitlintConfig, renderGroups, renderWorkflow, renderWorkflows, resolveVersioning, resolveWorkflowId, ruleTitle, runChangelog, runWorkflows, splitInlineDescription, workflowFilenames, writePackageVersion };
|
|
@@ -1 +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,renderCommitRef as m}from"./utils/summary.js";import{
|
|
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,renderCommitRef as m}from"./utils/summary.js";import{discoverVersionPackages as h,planVersions as g,readPackageVersion as _,resolveVersioning as v,writePackageVersion as y}from"./utils/versioning.js";import{main as b,runChangelog as x}from"./run.js";import{DEFAULT_WORKFLOW_TOKENS as S,WORKFLOW_FILENAMES as C,applyWorkflowConfig as w,defaultWorkflows as T,isEnabled as E,renderWorkflow as D,renderWorkflows as O}from"./workflows.js";import{resolveWorkflowId as k,runWorkflows as A}from"./run-workflows.js";import{conventionalCommitsVscodeExtensions as j,conventionalCommitsVscodeSettings as M,renderCommitlintConfig as N}from"./templates.js";import{COMMITLINT_HEADER as P,COMMIT_MSG_HOOK as F,HOOK_HEADER as I,WORKFLOW_HEADER as L,changelogSyncTask as R,workflowFilenames as z}from"./sync.js";var B=/* @__PURE__ */ e({COMMITLINT_HEADER:()=>P,COMMIT_MSG_HOOK:()=>F,DEFAULT_WORKFLOW_TOKENS:()=>S,HOOK_HEADER:()=>I,WORKFLOW_FILENAMES:()=>C,WORKFLOW_HEADER:()=>L,applyWorkflowConfig:()=>w,buildSummary:()=>p,changelogSyncTask:()=>R,conventionalCommitsVscodeExtensions:()=>j,conventionalCommitsVscodeSettings:()=>M,defaultWorkflows:()=>T,deriveBump:()=>n,discoverVersionPackages:()=>h,formatBody:()=>i,groupItems:()=>a,isEnabled:()=>E,main:()=>b,parseArgsCli:()=>t,parseCcSubject:()=>o,parseExistingChangelog:()=>d,planVersions:()=>g,readCommits:()=>r,readPackageVersion:()=>_,reformatChangelogContent:()=>f,renderChangelogEntry:()=>u,renderCommitRef:()=>m,renderCommitlintConfig:()=>N,renderGroups:()=>s,renderWorkflow:()=>D,renderWorkflows:()=>O,resolveVersioning:()=>v,resolveWorkflowId:()=>k,ruleTitle:()=>c,runChangelog:()=>x,runWorkflows:()=>A,splitInlineDescription:()=>l,workflowFilenames:()=>z,writePackageVersion:()=>y});export{P as COMMITLINT_HEADER,F as COMMIT_MSG_HOOK,S as DEFAULT_WORKFLOW_TOKENS,I as HOOK_HEADER,C as WORKFLOW_FILENAMES,L as WORKFLOW_HEADER,w as applyWorkflowConfig,p as buildSummary,R as changelogSyncTask,j as conventionalCommitsVscodeExtensions,M as conventionalCommitsVscodeSettings,T as defaultWorkflows,n as deriveBump,h as discoverVersionPackages,i as formatBody,a as groupItems,E as isEnabled,b as main,t as parseArgsCli,o as parseCcSubject,d as parseExistingChangelog,g as planVersions,r as readCommits,_ as readPackageVersion,f as reformatChangelogContent,u as renderChangelogEntry,m as renderCommitRef,N as renderCommitlintConfig,s as renderGroups,D as renderWorkflow,O as renderWorkflows,v as resolveVersioning,k as resolveWorkflowId,c as ruleTitle,x as runChangelog,A as runWorkflows,l as splitInlineDescription,B as src_exports,z as workflowFilenames,y as writePackageVersion};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { ToolchainChangelogConfig } from "../../shared/src/config-types.js";
|
|
4
|
+
import "../../shared/src/index.js";
|
|
3
5
|
import { parseArgsCli } from "./utils/args.js";
|
|
4
6
|
import { formatBody, groupItems, parseCcSubject, renderGroups, ruleTitle, splitInlineDescription } from "./utils/format.js";
|
|
5
7
|
import { deriveBump, readCommits } from "./utils/git.js";
|
|
@@ -7,8 +9,12 @@ import { parseExistingChangelog, reformatChangelogContent } from "./utils/reform
|
|
|
7
9
|
import { buildSummary } from "./utils/summary.js";
|
|
8
10
|
import { renderChangelogEntry } from "./utils/version.js";
|
|
9
11
|
//#region packages/changelog/src/run.d.ts
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Run the changelog pipeline (bump versions + write changelogs). `changelog` is
|
|
14
|
+
* the consumer's `toolchain.changelog` section (threaded from `dbx changelog`);
|
|
15
|
+
* the standalone bin runs with the defaults (`versioning: true`, uniform).
|
|
16
|
+
*/
|
|
17
|
+
export declare function runChangelog(argv?: string[], changelog?: ToolchainChangelogConfig): void;
|
|
12
18
|
/** Alias kept for backwards compatibility. */
|
|
13
19
|
export declare const main: typeof runChangelog;
|
|
14
20
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolve as e}from"node:path";import{fileURLToPath as t}from"node:url";import.meta.url;import{logger as n}from"../../shared/src/logger.js";import"../../shared/src/index.js";import{parseArgsCli as r}from"./utils/args.js";import{deriveBump as i,readCommits as a}from"./utils/git.js";import{changelogFiles as o,readRootVersion as s,repoRoot as c,writeVersion as l}from"./utils/repo.js";import{packageChangesForCurrent as u}from"./utils/packages.js";import"./utils/format.js";import{
|
|
1
|
+
import{resolve as e}from"node:path";import{fileURLToPath as t}from"node:url";import.meta.url;import{logger as n}from"../../shared/src/logger.js";import"../../shared/src/index.js";import{parseArgsCli as r}from"./utils/args.js";import{deriveBump as i,readCommits as a}from"./utils/git.js";import{changelogFiles as o,readRootVersion as s,repoRoot as c,writeVersion as l}from"./utils/repo.js";import{packageChangesForCurrent as u}from"./utils/packages.js";import"./utils/format.js";import{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{planVersions as v,resolveVersioning as y,writePackageVersion as b}from"./utils/versioning.js";import{writeChangelogs as x}from"./utils/write.js";import{existsSync as S,readFileSync as C,realpathSync as w,writeFileSync as T}from"node:fs";function E(t=process.argv.slice(2),w){let E=r(t);if(E.formatOnly){n.info(`[format-only] Reformatting ${o().length} changelog file(s)${E.dryRun?` (dry run)`:``}.`),m(E.dryRun,E.packageChanges);return}let D=s();if(E.version){let e=E.version.trim();if(!/^\d+\.\d+\.\d+$/.test(e))throw Error(`Invalid version: ${e}`);if(e===D){n.info(`Version is already ${e}; nothing to do.`);return}l(e),p(D,e),n.info(`Retagged versions ${D} -> ${e}.`);return}let O=D;if(E.baseVersion){if(!/^\d+\.\d+\.\d+$/.test(E.baseVersion.trim()))throw Error(`Invalid base version: ${E.baseVersion}`);O=E.baseVersion.trim()}let k=E.processingMethod,A=k===`all`,j=k!==`latest`&&k!==`all`?k:E.range,M=a(j),N=i(M),P=_(M),F=y(w),I=v({versioning:F,rootVersion:O,bump:N,range:j}),L=I.rootVersion;if(E.dryRun){let t=c(),r=e(t,`CHANGELOG.md`),i=S(r)?C(r,`utf8`):``,a=h(i)[0]?.version,o=E.packageChanges&&a?u(a):``,s=f(L,P,/* @__PURE__ */ new Date,!0,o);n.info(`[DRY-RUN] Range: ${j}`),n.info(`[DRY-RUN] Processing method: ${k}${A?` (backward reformat)`:``}`),n.info(`[DRY-RUN] Bump: ${N} (\`${O}\` -> \`${L}\`)`),n.info(`[DRY-RUN] Versioning: ${F.enabled?F.target:`disabled`}`),n.info(`[DRY-RUN] ${M.length} commit(s) scanned. Project files untouched.`),n.info(``),n.info(`Proposed new CHANGELOG.md entry (new version only):`),n.info(``),n.raw(s),n.info(`--- end of proposed entry ---`);let l=A?g(E.packageChanges):i,p=d(l,s),m=e(t,`CHANGELOG.proposed.md`);T(m,p,`utf8`),n.info(`Wrote ${m}`)}else{for(let[e,t]of I.writes)b(e,t);x(L,j,M,P,A,E.packageChanges,I.entries),F.enabled?n.info(`Bumped ${O} -> ${L} (${N}) from ${M.length} commit(s).`):n.info(`Wrote changelogs for ${L} (${N}) from ${M.length} commit(s); versioning disabled.`)}}const D=E,O=t(import.meta.url);process.argv[1]&&/[\\/]run\.[cm]?[jt]s$/.test(O)&&k(process.argv[1])===O&&E();function k(e){try{return w(e)}catch{return e}}export{D as main,E as runChangelog};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { ToolchainChangelogConfig } from "../../../shared/src/config-types.js";
|
|
4
|
+
import "../../../shared/src/index.js";
|
|
5
|
+
import { BumpType, CommitRecord } from "./types.js";
|
|
6
|
+
//#region packages/changelog/src/utils/versioning.d.ts
|
|
7
|
+
/** How/where a changelog run applies its version bump. */
|
|
8
|
+
export type VersioningTarget = 'uniform' | 'root-only' | 'individual';
|
|
9
|
+
/** The normalized `changelog.versioning` config. */
|
|
10
|
+
export interface ResolvedVersioning {
|
|
11
|
+
/** Whether versions are written to `package.json` at all. */
|
|
12
|
+
enabled: boolean;
|
|
13
|
+
/** Where the bump is applied. */
|
|
14
|
+
target: VersioningTarget;
|
|
15
|
+
/** Explicit workspace globs (when configured). */
|
|
16
|
+
workspaces?: string[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Normalize the `changelog.versioning` union (`boolean | { target, workspaces }`)
|
|
20
|
+
* into a concrete plan input. `true`/absent means uniform with defaults; `false`
|
|
21
|
+
* disables writing versions while still generating changelog entries.
|
|
22
|
+
*/
|
|
23
|
+
export declare function resolveVersioning(changelog?: ToolchainChangelogConfig): ResolvedVersioning;
|
|
24
|
+
/** The packages a changelog run versions. */
|
|
25
|
+
export interface VersionPackages {
|
|
26
|
+
/** The repository root. */
|
|
27
|
+
root: string;
|
|
28
|
+
/** Whether the root has a `package.json`. */
|
|
29
|
+
rootHasPackage: boolean;
|
|
30
|
+
/** Workspace directories (root excluded) that have a `package.json`. */
|
|
31
|
+
workspaces: string[];
|
|
32
|
+
}
|
|
33
|
+
/** Read the `version` field of a directory's `package.json` (if any). */
|
|
34
|
+
export declare function readPackageVersion(dir: string): string | undefined;
|
|
35
|
+
/** Write `version` into a directory's `package.json` in place (minimal diff). */
|
|
36
|
+
export declare function writePackageVersion(dir: string, version: string): void;
|
|
37
|
+
/**
|
|
38
|
+
* Resolve the packages to version: the explicit `workspaces` globs, else the
|
|
39
|
+
* root `package.json` `workspaces` field, else the root `package.json` alone.
|
|
40
|
+
* Warns (never throws) when neither a root `package.json` nor a matching
|
|
41
|
+
* workspace is found, so a broken checkout can't wedge a release.
|
|
42
|
+
*/
|
|
43
|
+
export declare function discoverVersionPackages(workspaces?: string[], root?: string): VersionPackages;
|
|
44
|
+
/** The version bump plan for a changelog run. */
|
|
45
|
+
export interface VersionPlan {
|
|
46
|
+
/** The version heading for the root changelog. */
|
|
47
|
+
rootVersion: string;
|
|
48
|
+
/** `package.json` writes to apply (empty when versioning is disabled). */
|
|
49
|
+
writes: Map<string, string>;
|
|
50
|
+
/** Workspace dirs to give a changelog entry, and the version to head it with. */
|
|
51
|
+
entries: Map<string, string>;
|
|
52
|
+
}
|
|
53
|
+
export interface PlanVersionsOptions {
|
|
54
|
+
versioning: ResolvedVersioning;
|
|
55
|
+
/** The starting root version (`--base-version` when provided). */
|
|
56
|
+
rootVersion: string;
|
|
57
|
+
/** The bump derived from all scanned commits. */
|
|
58
|
+
bump: BumpType;
|
|
59
|
+
/** The git revision range the commits were read from. */
|
|
60
|
+
range: string;
|
|
61
|
+
/** The repository root (default: resolved from cwd). */
|
|
62
|
+
root?: string;
|
|
63
|
+
/** Read the commits touching a workspace dir (injected for tests). */
|
|
64
|
+
commitsFor?: (dir: string) => CommitRecord[];
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Compute which packages get which version, and which changelogs get an entry.
|
|
68
|
+
*
|
|
69
|
+
* - `uniform`: the root (when present) and every workspace share one version.
|
|
70
|
+
* - `root-only`: only the root is versioned; workspaces get no entry.
|
|
71
|
+
* - `individual`: the root tracks the overall bump; each workspace that has
|
|
72
|
+
* commits in the range is bumped on its own.
|
|
73
|
+
*
|
|
74
|
+
* A disabled `versioning` writes no `package.json` but still heads the
|
|
75
|
+
* changelogs as `uniform` would, so the entries stay complete.
|
|
76
|
+
*/
|
|
77
|
+
export declare function planVersions(options: PlanVersionsOptions): VersionPlan;
|
|
78
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{relative as e,resolve as t}from"node:path";import"node:url";import.meta.url;import{logger as n}from"../../../shared/src/logger.js";import"../../../shared/src/index.js";import{deriveBump as r,readCommits as i}from"./git.js";import{repoRoot as a}from"./repo.js";import{bumpVersion as o}from"./version.js";import{existsSync as s,globSync as c,readFileSync as l,writeFileSync as u}from"node:fs";function d(e){let t=e?.versioning;return t===!1?{enabled:!1,target:`uniform`}:t===void 0||t===!0?{enabled:!0,target:`uniform`}:{enabled:!0,target:t.target??`uniform`,...t.workspaces?{workspaces:t.workspaces}:{}}}function f(e){try{let n=JSON.parse(l(t(e,`package.json`),`utf8`));return typeof n.version==`string`?n.version:void 0}catch{return}}function p(e,r){let i=t(e,`package.json`),a=l(i,`utf8`),o=a.replace(/("version"\s*:\s*)"[^"]*"/,`$1"${r}"`);o!==a&&(u(i,o,`utf8`),n.info(` bumped ${i}`))}function m(e,r=a()){let i=s(t(r,`package.json`)),o=e;if(o===void 0&&i)try{o=JSON.parse(l(t(r,`package.json`),`utf8`)).workspaces}catch{o=void 0}let u=/* @__PURE__ */ new Set;for(let e of o??[])if(e===`.`)u.add(r);else for(let n of c(e,{cwd:r})){let e=t(r,n);s(t(e,`package.json`))&&u.add(e)}return u.delete(r),!i&&u.size===0&&n.warn(`[changelog] versioning: no root package.json and no matching workspaces — nothing to version.`),{root:r,rootHasPackage:i,workspaces:[...u]}}function h(t){let{versioning:n,bump:s,range:c}=t,l=t.root??a(),{rootHasPackage:u,workspaces:d}=m(n.workspaces,l),p=t.commitsFor??(t=>i(c,e(l,t).replace(/\\/g,`/`))),h=o(t.rootVersion,s),g=/* @__PURE__ */ new Map,_=/* @__PURE__ */ new Map,v=n.enabled?n.target:`uniform`;if(u&&n.enabled&&g.set(l,h),v===`individual`)for(let e of d){let t=p(e);if(t.length===0)continue;let i=o(f(e)??`0.0.0`,r(t));_.set(e,i),n.enabled&&g.set(e,i)}else if(v===`uniform`)for(let e of d)_.set(e,h),n.enabled&&g.set(e,h);return{rootVersion:h,writes:g,entries:_}}export{m as discoverVersionPackages,h as planVersions,f as readPackageVersion,d as resolveVersioning,p as writePackageVersion};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{relative as e,resolve as t}from"node:path";import"node:url";import.meta.url;import{logger as n}from"../../../shared/src/logger.js";import"../../../shared/src/index.js";import{readCommits as r,repoSlug as i}from"./git.js";import{discoverWorkspaceDirs as a,repoRoot as o}from"./repo.js";import{packageChangesForCurrent as s}from"./packages.js";import{formatChangelogFile as c}from"./format.js";import{prependChangelogEntry as l,renderChangelogEntry as u}from"./version.js";import{parseExistingChangelog as d,reformatRootChangelog as f}from"./reformat.js";import{buildSummary as p}from"./summary.js";import{existsSync as m,readFileSync as h,writeFileSync as g}from"node:fs";function _(_,v,y,b,x,S=!1){let
|
|
1
|
+
import{relative as e,resolve as t}from"node:path";import"node:url";import.meta.url;import{logger as n}from"../../../shared/src/logger.js";import"../../../shared/src/index.js";import{readCommits as r,repoSlug as i}from"./git.js";import{discoverWorkspaceDirs as a,repoRoot as o}from"./repo.js";import{packageChangesForCurrent as s}from"./packages.js";import{formatChangelogFile as c}from"./format.js";import{prependChangelogEntry as l,renderChangelogEntry as u}from"./version.js";import{parseExistingChangelog as d,reformatRootChangelog as f}from"./reformat.js";import{buildSummary as p}from"./summary.js";import{existsSync as m,readFileSync as h,writeFileSync as g}from"node:fs";function _(_,v,y,b,x,S=!1,C){let w=o(),T=i(),E=t(w,`CHANGELOG.md`),D=``;if(S&&m(E)){let e=d(h(E,`utf8`))[0];e&&(D=s(e.version))}if(x){let e=f(S);e&&(g(E,e,`utf8`),n.info(` reformatted ${E}`))}let O=u(_,b,/* @__PURE__ */ new Date,!0,D);l(E,O),n.info(` updated ${E}`);let k=C??new Map(a().filter(e=>t(e)!==t(w)).map(e=>[e,_]));for(let[i,a]of k){let o=t(i,`CHANGELOG.md`);if(!m(o))continue;let s=e(w,i).replace(/\\/g,`/`),c=r(v,s);if(c.length===0){n.info(` skipped ${o} (no commits in ${s})`);continue}let d=p(c);l(o,u(a,d,/* @__PURE__ */ new Date)),n.info(` updated ${o}`)}let A=/* @__PURE__ */ new Set([...a(),...k.keys()]);for(let e of A){let n=t(e,`CHANGELOG.md`);m(n)&&c(n,T)}}export{_ as writeChangelogs};
|
|
@@ -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.
|
|
74
|
-
*
|
|
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
|
|
2
|
-
`).trim()}\n`}function
|
|
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
|
-
${
|
|
19
|
+
${u(c)}
|
|
20
20
|
|
|
21
21
|
## ${s.core??`Core`}
|
|
22
22
|
|
|
23
23
|
${g}
|
|
24
24
|
|
|
25
|
-
${
|
|
26
|
-
${_}`}function
|
|
27
|
-
`).trim()}\n`}export{
|
|
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};
|
|
@@ -18,4 +18,15 @@ export declare const TOOLCHAIN_PACKAGE = "@deltabox/toolchain";
|
|
|
18
18
|
* toolchain repo's own CLI instead of a global `dbx`.
|
|
19
19
|
*/
|
|
20
20
|
export declare function findOwnCliEntry(cwd?: string): string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* The version of the `@deltabox/toolchain` this project pins — from the nearest
|
|
23
|
+
* `node_modules/@deltabox/toolchain/package.json`, else the nearest enclosing
|
|
24
|
+
* `@deltabox/toolchain` package (so the toolchain repo resolves its own version
|
|
25
|
+
* even before `dist` is built). `undefined` when the project doesn't pin the
|
|
26
|
+
* toolchain at all, in which case only a global install / `npx` is available.
|
|
27
|
+
*
|
|
28
|
+
* A pinned project must never run a global `dbx`: a stale global install would
|
|
29
|
+
* write older-format generated files, silently reverting the project's own.
|
|
30
|
+
*/
|
|
31
|
+
export declare function localToolchainVersion(cwd?: string): string | undefined;
|
|
21
32
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as e}from"node:path";import"node:url";import.meta.url;import t from"node:fs";const n=`@deltabox/toolchain`;function r(n=process.cwd()){let r=e.resolve(n);for(;;){let n=e.join(r,`package.json`);if(t.existsSync(n))try{let i=JSON.parse(t.readFileSync(n,`utf-8`));if(i.name===`@deltabox/toolchain`){let n=typeof i.bin==`string`?i.bin:i.bin?.dbx;if(n){let i=e.resolve(r,n);if(t.existsSync(i))return i}}}catch{}let i=e.dirname(r);if(i===r)return;r=i}}export{n as TOOLCHAIN_PACKAGE,r as findOwnCliEntry};
|
|
1
|
+
import{default as e}from"node:path";import"node:url";import.meta.url;import t from"node:fs";const n=`@deltabox/toolchain`;function r(n=process.cwd()){let r=e.resolve(n);for(;;){let n=e.join(r,`package.json`);if(t.existsSync(n))try{let i=JSON.parse(t.readFileSync(n,`utf-8`));if(i.name===`@deltabox/toolchain`){let n=typeof i.bin==`string`?i.bin:i.bin?.dbx;if(n){let i=e.resolve(r,n);if(t.existsSync(i))return i}}}catch{}let i=e.dirname(r);if(i===r)return;r=i}}function i(e){try{let n=JSON.parse(t.readFileSync(e,`utf-8`));return typeof n.version==`string`?n.version:void 0}catch{return}}function a(r=process.cwd()){let a=e.resolve(r),o;for(;;){let r=i(e.join(a,`node_modules`,n,`package.json`));if(r)return r;let s=e.join(a,`package.json`);if(o===void 0&&t.existsSync(s))try{let e=JSON.parse(t.readFileSync(s,`utf-8`));e.name===`@deltabox/toolchain`&&typeof e.version==`string`&&(o=e.version)}catch{}let c=e.dirname(a);if(c===a)return o;a=c}}export{n as TOOLCHAIN_PACKAGE,r as findOwnCliEntry,a as localToolchainVersion};
|