@deltabox/toolchain 1.9.1 → 1.10.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.
Files changed (50) hide show
  1. package/CHANGELOG.md +94 -4
  2. package/dist/cli/commands/sync.js +1 -1
  3. package/dist/cli/context.js +1 -1
  4. package/dist/cli/index.js +1 -1
  5. package/dist/cli/register.js +1 -1
  6. package/dist/core.d.ts +2 -2
  7. package/dist/index.d.ts +4 -4
  8. package/dist/index.js +1 -1
  9. package/dist/package.js +1 -1
  10. package/dist/packages/core/src/index.d.ts +3 -3
  11. package/dist/packages/core/src/loader.d.ts +16 -1
  12. package/dist/packages/core/src/loader.js +1 -1
  13. package/dist/packages/project/src/catalogs.d.ts +43 -0
  14. package/dist/packages/project/src/catalogs.js +1 -0
  15. package/dist/packages/project/src/cli/index.js +1 -1
  16. package/dist/packages/project/src/config.js +1 -1
  17. package/dist/packages/project/src/index.d.ts +4 -3
  18. package/dist/packages/project/src/index.js +1 -1
  19. package/dist/packages/project/src/sync.js +1 -1
  20. package/dist/packages/project/src/typescript.d.ts +11 -3
  21. package/dist/packages/project/src/typescript.js +7 -9
  22. package/dist/packages/shared/src/config-schema.d.ts +40 -0
  23. package/dist/packages/shared/src/config-schema.js +1 -1
  24. package/dist/packages/shared/src/config-types.d.ts +10 -0
  25. package/dist/packages/shared/src/index.d.ts +4 -4
  26. package/dist/packages/shared/src/index.js +1 -1
  27. package/dist/packages/shared/src/project.js +1 -1
  28. package/dist/packages/shared/src/toolchain.d.ts +3 -3
  29. package/dist/packages/shared/src/toolchain.js +1 -1
  30. package/dist/packages/shared/src/types.d.ts +6 -0
  31. package/dist/packages/template/src/builtin.d.ts +3 -0
  32. package/dist/packages/template/src/builtin.js +1 -1
  33. package/dist/packages/template/src/cli/index.js +1 -1
  34. package/dist/packages/template/src/index.d.ts +2 -2
  35. package/dist/packages/template/src/local.js +1 -1
  36. package/dist/packages/template/src/scaffold.d.ts +4 -0
  37. package/dist/packages/template/src/scaffold.js +1 -1
  38. package/dist/packages/template/src/types.d.ts +51 -2
  39. package/dist/packages/vite/src/index.d.ts +2 -2
  40. package/dist/packages/vite/src/plugin.d.ts +12 -8
  41. package/dist/packages/vite/src/plugin.js +1 -1
  42. package/dist/packages/vite/src/vp.js +1 -1
  43. package/dist/project.d.ts +3 -2
  44. package/dist/project.js +1 -1
  45. package/dist/shared.d.ts +3 -3
  46. package/dist/shared.js +1 -1
  47. package/dist/sync.js +1 -1
  48. package/dist/template.d.ts +2 -2
  49. package/dist/vite.d.ts +2 -2
  50. package/package.json +14 -14
@@ -937,6 +937,16 @@ export declare const templatesConfigSchema: z.ZodObject<{
937
937
  online: z.ZodOptional<z.ZodBoolean>;
938
938
  }, z.core.$strip>>>;
939
939
  }, z.core.$strip>;
940
+ /**
941
+ * Package catalogs: a shared `package -> version range` map written to the
942
+ * package manager's catalog file (`.yarnrc.yml` for Yarn, `pnpm-workspace.yaml`
943
+ * for pnpm) so dependencies can be declared with `catalog:`.
944
+ */
945
+ export declare const catalogsConfigSchema: z.ZodObject<{
946
+ enabled: z.ZodOptional<z.ZodBoolean>;
947
+ packages: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
948
+ named: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
949
+ }, z.core.$strip>;
940
950
  /**
941
951
  * Vite+ configuration: the raw `vite.config.ts` object, held under
942
952
  * `toolchain.vite`, plus the single toolchain opt-out `config`.
@@ -1328,6 +1338,11 @@ export declare const toolchainConfigSchema: z.ZodObject<{
1328
1338
  online: z.ZodOptional<z.ZodBoolean>;
1329
1339
  }, z.core.$strip>>>;
1330
1340
  }, z.core.$strip>]>>;
1341
+ catalogs: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
1342
+ enabled: z.ZodOptional<z.ZodBoolean>;
1343
+ packages: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1344
+ named: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
1345
+ }, z.core.$strip>]>>;
1331
1346
  vite: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
1332
1347
  config: z.ZodOptional<z.ZodBoolean>;
1333
1348
  }, z.core.$catchall<z.ZodUnknown>>]>>;
@@ -1732,6 +1747,11 @@ export declare const dbxConfigSchema: z.ZodObject<{
1732
1747
  online: z.ZodOptional<z.ZodBoolean>;
1733
1748
  }, z.core.$strip>>>;
1734
1749
  }, z.core.$strip>]>>;
1750
+ catalogs: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
1751
+ enabled: z.ZodOptional<z.ZodBoolean>;
1752
+ packages: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1753
+ named: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
1754
+ }, z.core.$strip>]>>;
1735
1755
  vite: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
1736
1756
  config: z.ZodOptional<z.ZodBoolean>;
1737
1757
  }, z.core.$catchall<z.ZodUnknown>>]>>;
@@ -2656,6 +2676,11 @@ export declare const CONFIG_TYPE_SCHEMAS: {
2656
2676
  online: z.ZodOptional<z.ZodBoolean>;
2657
2677
  }, z.core.$strip>>>;
2658
2678
  }, z.core.$strip>;
2679
+ readonly ToolchainCatalogsConfig: z.ZodObject<{
2680
+ enabled: z.ZodOptional<z.ZodBoolean>;
2681
+ packages: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2682
+ named: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
2683
+ }, z.core.$strip>;
2659
2684
  readonly ToolchainViteConfig: z.ZodObject<{
2660
2685
  config: z.ZodOptional<z.ZodBoolean>;
2661
2686
  }, z.core.$catchall<z.ZodUnknown>>;
@@ -3051,6 +3076,11 @@ export declare const CONFIG_TYPE_SCHEMAS: {
3051
3076
  online: z.ZodOptional<z.ZodBoolean>;
3052
3077
  }, z.core.$strip>>>;
3053
3078
  }, z.core.$strip>]>>;
3079
+ catalogs: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
3080
+ enabled: z.ZodOptional<z.ZodBoolean>;
3081
+ packages: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
3082
+ named: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
3083
+ }, z.core.$strip>]>>;
3054
3084
  vite: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
3055
3085
  config: z.ZodOptional<z.ZodBoolean>;
3056
3086
  }, z.core.$catchall<z.ZodUnknown>>]>>;
@@ -3454,6 +3484,11 @@ export declare const CONFIG_TYPE_SCHEMAS: {
3454
3484
  online: z.ZodOptional<z.ZodBoolean>;
3455
3485
  }, z.core.$strip>>>;
3456
3486
  }, z.core.$strip>]>>;
3487
+ catalogs: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
3488
+ enabled: z.ZodOptional<z.ZodBoolean>;
3489
+ packages: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
3490
+ named: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
3491
+ }, z.core.$strip>]>>;
3457
3492
  vite: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
3458
3493
  config: z.ZodOptional<z.ZodBoolean>;
3459
3494
  }, z.core.$catchall<z.ZodUnknown>>]>>;
@@ -3859,6 +3894,11 @@ export declare const CONFIG_SECTION_SCHEMAS: {
3859
3894
  online: z.ZodOptional<z.ZodBoolean>;
3860
3895
  }, z.core.$strip>>>;
3861
3896
  }, z.core.$strip>;
3897
+ readonly catalogs: z.ZodObject<{
3898
+ enabled: z.ZodOptional<z.ZodBoolean>;
3899
+ packages: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
3900
+ named: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
3901
+ }, z.core.$strip>;
3862
3902
  readonly vite: z.ZodObject<{
3863
3903
  config: z.ZodOptional<z.ZodBoolean>;
3864
3904
  }, z.core.$catchall<z.ZodUnknown>>;
@@ -1 +1 @@
1
- import"node:path";import"node:url";import.meta.url;import{z as e}from"zod";const t=e.enum([`monorepo-root`,`monorepo-workspace`,`project`]).describe(`The project kind (detected when omitted).`).meta({id:`ProjectType`}),n=e.object({type:t.optional(),name:e.string().describe("The unscoped project name (written as `<scope>/<name>`).").optional(),scope:e.string().describe("The npm scope, eg. `@acme`.").optional(),author:e.string().describe("Package author (`package.json` `author`).").optional(),license:e.string().describe("SPDX license id (`package.json` `license`).").optional(),homepage:e.string().describe("Project homepage (`package.json` `homepage`).").optional(),repo:e.string().describe("Repository URL (`package.json` `repository`). For a workspace it also resolves to the workspace path (`repository.directory`).").optional(),nodeVersion:e.string().describe("Node version for CI/templates, eg. `22` (not `package.json` `engines`).").optional(),packageManager:e.string().describe("Package manager name, written as `<name>@<version>` (default `yarn`).").optional(),packageManagerVersion:e.string().describe("Package manager version, eg. `4.17.1`.").optional(),description:e.string().describe("One-line description (`package.json` `description`).").optional(),inherit:e.boolean().describe(`Inherit the parent project metadata (default true). Set false to keep this project entirely independent of the root config.`).optional()}).meta({id:`ToolchainProjectConfig`}),r=e.object({name:e.string().describe(`Step display name.`).optional(),id:e.string().describe("Step id (for `steps.<id>` outputs).").optional(),if:e.string().describe("Conditional expression (`if:`).").optional(),uses:e.string().describe("Action to run (`uses:`), eg. `actions/checkout@v4`.").optional(),run:e.string().describe("Shell command(s) to run (`run:`).").optional(),shell:e.string().describe("Shell to run `run` in, eg. `bash`.").optional(),"working-directory":e.string().describe(`Directory the step runs in.`).optional(),with:e.record(e.string(),e.union([e.string(),e.number(),e.boolean()])).describe("Inputs for a `uses` action.").optional(),env:e.record(e.string(),e.string()).describe(`Environment variables for the step.`).optional()}).meta({id:`WorkflowStep`}),i=e.object({job:e.string().describe(`Target job id (defaults to the primary/first job).`).optional(),before:e.array(r).describe(`Steps inserted at the start.`).optional(),after:e.array(r).describe(`Steps appended at the end.`).optional()}).meta({id:`WorkflowStepsConfig`}),a=e.object({enabled:e.boolean().describe(`Enable/disable this workflow (default true).`).optional(),pushBranches:e.array(e.string()).describe("Replace `on.push.branches`.").optional(),pullRequestBranches:e.array(e.string()).describe("Replace `on.pull_request.branches`.").optional(),triggers:e.record(e.string(),e.unknown()).describe("Extra `on.*` triggers.").optional(),extra:e.record(e.string(),e.unknown()).describe("Extra top-level keys (`permissions`, `concurrency`, `env`, ...).").optional(),steps:e.union([i,e.array(i)]).describe(`Extra steps for a job (one group, or per-job groups).`).optional(),jobs:e.record(e.string(),e.unknown()).describe(`Extra complete jobs merged in.`).optional(),tokens:e.record(e.string(),e.union([e.string(),e.number(),e.boolean()])).describe("Per-workflow token overrides (`nodeVersion`, `packageManager`, ...).").optional()}).meta({id:`WorkflowConfig`}),o=e.union([e.boolean(),e.string(),a]).describe("`true`/`false` to enable/disable, an object to override parts of the default, or a raw YAML string written verbatim as the workflow file.").meta({id:`WorkflowSetting`}),s=e.object({ci:o.describe("The CI workflow (`ci.yml`).").optional(),changelog:o.describe("The changelog/version workflow (`changelog.yml`).").optional(),release:o.describe("The release workflow (`release.yml`).").optional(),issues:o.describe("The issue-title workflow (`issues.yml`).").optional(),sync:o.describe("The toolchain sync workflow (`sync.yml`).").optional()}).meta({id:`ChangelogWorkflowsConfig`}),c=e.enum([`uniform`,`root-only`,`individual`]).describe(`Where the changelog version bump is applied.`).meta({id:`ChangelogVersioningTarget`}),l=e.object({target:c.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:e.array(e.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()}).meta({id:`ChangelogVersioningConfig`}),u=e.union([e.boolean(),l]).describe(`Automatic version bumping when a changelog entry is generated.`).meta({id:`ChangelogVersioning`}),d=e.object({enabled:e.boolean().describe(`Master switch (enabled when the section is defined).`).optional(),workflows:s.describe("Which workflows to write into `.github/workflows`. Each id is `true`/`false`, an object of overrides, or a raw YAML string written verbatim.").optional(),branches:e.object({main:e.union([e.string(),e.array(e.string())]).describe('Branch glob(s) the CI + release workflows run on, and the release PR base (default `["main"]`).').optional(),dev:e.union([e.string(),e.array(e.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.`).optional(),types:e.array(e.string()).describe(`Allowed commit types (commitlint).`).optional(),scopes:e.array(e.string()).describe(`Allowed commit scopes (commitlint).`).optional(),commitlint:e.object({dir:e.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()}).describe(`commitlint config output location.`).optional(),versioning:u.describe("Automatic version bumping on changelog generation (default `true`).").optional(),vscode:e.boolean().describe(`Write the Conventional-Commits VS Code settings.`).optional()}).meta({id:`ToolchainChangelogConfig`}),f=e.object({enabled:e.boolean().describe(`Master switch (enabled when the section is defined).`).optional(),vscode:e.boolean().describe(`Write the Biome VS Code settings (default true).`).optional(),overrides:e.record(e.string(),e.unknown()).describe("Deep-merged over the generated `biome.json` (arrays union).").optional()}).meta({id:`ToolchainBiomeConfig`}),p=e.object({enabled:e.boolean().describe(`Master switch (enabled when the section is defined).`).optional(),glob:e.union([e.string(),e.array(e.string())]).describe("Glob(s) for the workspace default tsconfig files. Defaults to matching every `defaultFile` recursively.").optional(),exclude:e.union([e.string(),e.array(e.string())]).describe("Glob(s) to exclude from `glob`. Defaults to the common ignored paths (`node_modules`, `.dbx`, `dist`, `build`, ...).").optional(),gitignore:e.boolean().describe("Also respect `.gitignore` files (root + nested) when matching `glob` (default true).").optional(),refs:e.boolean().describe(`Wire project references (default false).`).optional(),composite:e.boolean().describe("Emit `composite: true` (default false).").optional(),aliases:e.boolean().describe(`Inject path aliases (default true).`).optional(),indent:e.number().describe(`JSON indentation (default 4).`).optional(),rootFile:e.string().describe("The workspaces tsconfig file name that holds `paths` + `references` (default `tsconfig.workspaces.json`).").optional(),defaultFile:e.string().describe("The workspace default tsconfig file name that the generator expands (default `tsconfig.default.json`).").optional(),buildFile:e.string().describe("The workspace build tsconfig file name (default `tsconfig.build.json`).").optional()}).meta({id:`ToolchainTsconfigConfig`}),m=e.object({enabled:e.boolean().describe(`Watch by default (enabled when the section is defined).`).optional(),debounce:e.number().describe(`Debounce window in ms (default 150).`).optional(),exclude:e.union([e.string(),e.array(e.string())]).describe("Glob(s) excluded from watching. Defaults to the common ignored paths (`node_modules`, `.dbx`, `dist`, `build`, ...).").optional(),gitignore:e.boolean().describe("Also respect `.gitignore` files (root + nested) when watching (default true).").optional()}).meta({id:`ToolchainWatchConfig`}),h=e.object({level:e.enum([`debug`,`info`,`warn`,`error`,`silent`]).describe("Minimum level to print (default `info`).").optional(),color:e.boolean().describe("Force colours on/off (default: on; `--no-color` disables).").optional(),name:e.string().describe("Prefix non-indented lines with `<name>:` (default `dbx`).").optional()}).meta({id:`ToolchainLoggerConfig`}),g=e.object({color:e.boolean().describe(`Force provider command colours on/off (default: inherit the logger).`).optional()}).meta({id:`ToolchainProvidersConfig`}),_=e.enum([`builtin`,`local`,`npm`,`git`,`vite-plus`]).describe(`How to load the source.`).meta({id:`ToolchainTemplateSourceType`}),v=e.enum([`project`,`workspace`,`application`,`folder`,`tooling`,`pipeline`]).describe(`What the template produces.`).meta({id:`ToolchainTemplateKind`}),y=e.object({type:_.describe(`How to load the source.`),locate:e.string().describe(`A builtin id, local dir, npm scope, git URL or Vite+ id.`),id:e.string().describe(`Stable id (defaults to the basename/scope).`).optional(),name:e.string().describe(`Display name override.`).optional(),description:e.string().describe(`Description override.`).optional(),kind:v.describe(`What the template produces.`).optional(),ref:e.string().describe(`Git branch/tag/commit.`).optional(),subdir:e.string().describe(`Subdirectory within the source that holds the template.`).optional(),tags:e.array(e.string()).describe(`Free-form tags.`).optional(),online:e.boolean().describe(`Whether the source needs network access.`).optional()}).meta({id:`ToolchainTemplateSource`}),b=e.object({enabled:e.boolean().describe(`Master switch (enabled when the section is defined).`).optional(),sources:e.array(y).describe(`Extra sources on top of the builtin + registry sources.`).optional()}).meta({id:`ToolchainTemplatesConfig`}),x=e.object({config:e.boolean().describe("Write the managed `vite.config.ts` (default true).").optional()}).catchall(e.unknown()).meta({id:`ToolchainViteConfig`});function S(t){return e.union([e.boolean(),t])}const C=e.object({project:n.describe("Project metadata: canonical `package.json` fields and template tokens (inherited by workspaces).").optional(),changelog:S(d).describe(`Conventional-Commits CI, commitlint and the changelog pipeline.`).optional(),biome:S(f).describe("Biome config generation (for consumers that still want a `biome.json`).").optional(),tsconfig:S(p).describe(`Workspace tsconfig generation (path aliases + project references).`).optional(),templates:S(b).describe(`Template sources / scaffolding.`).optional(),vite:S(x).describe("The full Vite+ config; `dbx sync` writes the root `vite.config.ts` from it.").optional(),watch:S(m).describe("Watch behaviour for `dbx watch`.").optional(),logger:S(h).describe(`Logging level, colours and prefix for toolchain output.`).optional(),providers:S(g).describe(`Provider command behaviour (eg. colour for the passthrough commands).`).optional()}).meta({id:`ToolchainConfigSections`}),w=e.object({toolchain:C.describe("The `@deltabox/toolchain` settings (every section is opt-in by presence).").optional()}).meta({id:`DbxConfigSections`}),T={ProjectType:t,ToolchainProjectConfig:n,WorkflowStep:r,WorkflowStepsConfig:i,WorkflowConfig:a,WorkflowSetting:o,ChangelogWorkflowsConfig:s,ChangelogVersioningTarget:c,ChangelogVersioningConfig:l,ChangelogVersioning:u,ToolchainChangelogConfig:d,ToolchainBiomeConfig:f,ToolchainTsconfigConfig:p,ToolchainWatchConfig:m,ToolchainTemplateSourceType:_,ToolchainTemplateKind:v,ToolchainTemplateSource:y,ToolchainTemplatesConfig:b,ToolchainViteConfig:x,ToolchainLoggerConfig:h,ToolchainProvidersConfig:g,ToolchainConfigSections:C,DbxConfigSections:w},E={project:n,changelog:d,biome:f,tsconfig:p,templates:b,vite:x,watch:m,logger:h,providers:g},D={project:"Project metadata: canonical `package.json` fields (applied on sync, inherited by workspaces) plus the replacement tokens every template understands.",changelog:`Conventional-Commits CI, commitlint and the changelog pipeline.`,biome:"Biome config generation (for consumers that still want a `biome.json`).",tsconfig:`Workspace tsconfig generation (path aliases + project references).`,templates:`Template sources / scaffolding.`,vite:"The full Vite+ config; `dbx sync` writes the root `vite.config.ts` from it.",watch:"Watch behaviour for `dbx watch`.",logger:`Logging level, colours and prefix for toolchain output.`,providers:`Provider command behaviour (eg. colour for the provider passthrough commands).`};export{D as CONFIG_SECTION_DESCRIPTIONS,E as CONFIG_SECTION_SCHEMAS,T as CONFIG_TYPE_SCHEMAS,f as biomeConfigSchema,d as changelogConfigSchema,l as changelogVersioningConfigSchema,u as changelogVersioningSchema,c as changelogVersioningTargetSchema,s as changelogWorkflowsConfigSchema,w as dbxConfigSchema,h as loggerConfigSchema,n as projectConfigSchema,t as projectTypeSchema,g as providersConfigSchema,v as templateKindSchema,y as templateSourceSchema,_ as templateSourceTypeSchema,b as templatesConfigSchema,C as toolchainConfigSchema,p as tsconfigConfigSchema,x as viteConfigSchema,m as watchConfigSchema,a as workflowConfigSchema,o as workflowSettingSchema,r as workflowStepSchema,i as workflowStepsConfigSchema};
1
+ import"node:path";import"node:url";import.meta.url;import{z as e}from"zod";const t=e.enum([`monorepo-root`,`monorepo-workspace`,`project`]).describe(`The project kind (detected when omitted).`).meta({id:`ProjectType`}),n=e.object({type:t.optional(),name:e.string().describe("The unscoped project name (written as `<scope>/<name>`).").optional(),scope:e.string().describe("The npm scope, eg. `@acme`.").optional(),author:e.string().describe("Package author (`package.json` `author`).").optional(),license:e.string().describe("SPDX license id (`package.json` `license`).").optional(),homepage:e.string().describe("Project homepage (`package.json` `homepage`).").optional(),repo:e.string().describe("Repository URL (`package.json` `repository`). For a workspace it also resolves to the workspace path (`repository.directory`).").optional(),nodeVersion:e.string().describe("Node version for CI/templates, eg. `22` (not `package.json` `engines`).").optional(),packageManager:e.string().describe("Package manager name, written as `<name>@<version>` (default `yarn`).").optional(),packageManagerVersion:e.string().describe("Package manager version, eg. `4.17.1`.").optional(),description:e.string().describe("One-line description (`package.json` `description`).").optional(),inherit:e.boolean().describe(`Inherit the parent project metadata (default true). Set false to keep this project entirely independent of the root config.`).optional()}).meta({id:`ToolchainProjectConfig`}),r=e.object({name:e.string().describe(`Step display name.`).optional(),id:e.string().describe("Step id (for `steps.<id>` outputs).").optional(),if:e.string().describe("Conditional expression (`if:`).").optional(),uses:e.string().describe("Action to run (`uses:`), eg. `actions/checkout@v4`.").optional(),run:e.string().describe("Shell command(s) to run (`run:`).").optional(),shell:e.string().describe("Shell to run `run` in, eg. `bash`.").optional(),"working-directory":e.string().describe(`Directory the step runs in.`).optional(),with:e.record(e.string(),e.union([e.string(),e.number(),e.boolean()])).describe("Inputs for a `uses` action.").optional(),env:e.record(e.string(),e.string()).describe(`Environment variables for the step.`).optional()}).meta({id:`WorkflowStep`}),i=e.object({job:e.string().describe(`Target job id (defaults to the primary/first job).`).optional(),before:e.array(r).describe(`Steps inserted at the start.`).optional(),after:e.array(r).describe(`Steps appended at the end.`).optional()}).meta({id:`WorkflowStepsConfig`}),a=e.object({enabled:e.boolean().describe(`Enable/disable this workflow (default true).`).optional(),pushBranches:e.array(e.string()).describe("Replace `on.push.branches`.").optional(),pullRequestBranches:e.array(e.string()).describe("Replace `on.pull_request.branches`.").optional(),triggers:e.record(e.string(),e.unknown()).describe("Extra `on.*` triggers.").optional(),extra:e.record(e.string(),e.unknown()).describe("Extra top-level keys (`permissions`, `concurrency`, `env`, ...).").optional(),steps:e.union([i,e.array(i)]).describe(`Extra steps for a job (one group, or per-job groups).`).optional(),jobs:e.record(e.string(),e.unknown()).describe(`Extra complete jobs merged in.`).optional(),tokens:e.record(e.string(),e.union([e.string(),e.number(),e.boolean()])).describe("Per-workflow token overrides (`nodeVersion`, `packageManager`, ...).").optional()}).meta({id:`WorkflowConfig`}),o=e.union([e.boolean(),e.string(),a]).describe("`true`/`false` to enable/disable, an object to override parts of the default, or a raw YAML string written verbatim as the workflow file.").meta({id:`WorkflowSetting`}),s=e.object({ci:o.describe("The CI workflow (`ci.yml`).").optional(),changelog:o.describe("The changelog/version workflow (`changelog.yml`).").optional(),release:o.describe("The release workflow (`release.yml`).").optional(),issues:o.describe("The issue-title workflow (`issues.yml`).").optional(),sync:o.describe("The toolchain sync workflow (`sync.yml`).").optional()}).meta({id:`ChangelogWorkflowsConfig`}),c=e.enum([`uniform`,`root-only`,`individual`]).describe(`Where the changelog version bump is applied.`).meta({id:`ChangelogVersioningTarget`}),l=e.object({target:c.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:e.array(e.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()}).meta({id:`ChangelogVersioningConfig`}),u=e.union([e.boolean(),l]).describe(`Automatic version bumping when a changelog entry is generated.`).meta({id:`ChangelogVersioning`}),d=e.object({enabled:e.boolean().describe(`Master switch (enabled when the section is defined).`).optional(),workflows:s.describe("Which workflows to write into `.github/workflows`. Each id is `true`/`false`, an object of overrides, or a raw YAML string written verbatim.").optional(),branches:e.object({main:e.union([e.string(),e.array(e.string())]).describe('Branch glob(s) the CI + release workflows run on, and the release PR base (default `["main"]`).').optional(),dev:e.union([e.string(),e.array(e.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.`).optional(),types:e.array(e.string()).describe(`Allowed commit types (commitlint).`).optional(),scopes:e.array(e.string()).describe(`Allowed commit scopes (commitlint).`).optional(),commitlint:e.object({dir:e.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()}).describe(`commitlint config output location.`).optional(),versioning:u.describe("Automatic version bumping on changelog generation (default `true`).").optional(),vscode:e.boolean().describe(`Write the Conventional-Commits VS Code settings.`).optional()}).meta({id:`ToolchainChangelogConfig`}),f=e.object({enabled:e.boolean().describe(`Master switch (enabled when the section is defined).`).optional(),vscode:e.boolean().describe(`Write the Biome VS Code settings (default true).`).optional(),overrides:e.record(e.string(),e.unknown()).describe("Deep-merged over the generated `biome.json` (arrays union).").optional()}).meta({id:`ToolchainBiomeConfig`}),p=e.object({enabled:e.boolean().describe(`Master switch (enabled when the section is defined).`).optional(),glob:e.union([e.string(),e.array(e.string())]).describe("Glob(s) for the workspace default tsconfig files. Defaults to matching every `defaultFile` recursively.").optional(),exclude:e.union([e.string(),e.array(e.string())]).describe("Glob(s) to exclude from `glob`. Defaults to the common ignored paths (`node_modules`, `.dbx`, `dist`, `build`, ...).").optional(),gitignore:e.boolean().describe("Also respect `.gitignore` files (root + nested) when matching `glob` (default true).").optional(),refs:e.boolean().describe(`Wire project references (default false).`).optional(),composite:e.boolean().describe("Emit `composite: true` (default false).").optional(),aliases:e.boolean().describe(`Inject path aliases (default true).`).optional(),indent:e.number().describe(`JSON indentation (default 4).`).optional(),rootFile:e.string().describe("The workspaces tsconfig file name that holds `paths` + `references` (default `tsconfig.workspaces.json`).").optional(),defaultFile:e.string().describe("The workspace default tsconfig file name that the generator expands (default `tsconfig.default.json`).").optional(),buildFile:e.string().describe("The workspace build tsconfig file name (default `tsconfig.build.json`).").optional()}).meta({id:`ToolchainTsconfigConfig`}),m=e.object({enabled:e.boolean().describe(`Watch by default (enabled when the section is defined).`).optional(),debounce:e.number().describe(`Debounce window in ms (default 150).`).optional(),exclude:e.union([e.string(),e.array(e.string())]).describe("Glob(s) excluded from watching. Defaults to the common ignored paths (`node_modules`, `.dbx`, `dist`, `build`, ...).").optional(),gitignore:e.boolean().describe("Also respect `.gitignore` files (root + nested) when watching (default true).").optional()}).meta({id:`ToolchainWatchConfig`}),h=e.object({level:e.enum([`debug`,`info`,`warn`,`error`,`silent`]).describe("Minimum level to print (default `info`).").optional(),color:e.boolean().describe("Force colours on/off (default: on; `--no-color` disables).").optional(),name:e.string().describe("Prefix non-indented lines with `<name>:` (default `dbx`).").optional()}).meta({id:`ToolchainLoggerConfig`}),g=e.object({color:e.boolean().describe(`Force provider command colours on/off (default: inherit the logger).`).optional()}).meta({id:`ToolchainProvidersConfig`}),_=e.enum([`builtin`,`local`,`npm`,`git`,`vite-plus`]).describe(`How to load the source.`).meta({id:`ToolchainTemplateSourceType`}),v=e.enum([`project`,`workspace`,`application`,`folder`,`tooling`,`pipeline`]).describe(`What the template produces.`).meta({id:`ToolchainTemplateKind`}),y=e.object({type:_.describe(`How to load the source.`),locate:e.string().describe(`A builtin id, local dir, npm scope, git URL or Vite+ id.`),id:e.string().describe(`Stable id (defaults to the basename/scope).`).optional(),name:e.string().describe(`Display name override.`).optional(),description:e.string().describe(`Description override.`).optional(),kind:v.describe(`What the template produces.`).optional(),ref:e.string().describe(`Git branch/tag/commit.`).optional(),subdir:e.string().describe(`Subdirectory within the source that holds the template.`).optional(),tags:e.array(e.string()).describe(`Free-form tags.`).optional(),online:e.boolean().describe(`Whether the source needs network access.`).optional()}).meta({id:`ToolchainTemplateSource`}),b=e.object({enabled:e.boolean().describe(`Master switch (enabled when the section is defined).`).optional(),sources:e.array(y).describe(`Extra sources on top of the builtin + registry sources.`).optional()}).meta({id:`ToolchainTemplatesConfig`}),x=e.object({enabled:e.boolean().describe(`Master switch (enabled when the section is defined).`).optional(),packages:e.record(e.string(),e.string()).describe(`The default catalog: package name -> version range.`).optional(),named:e.record(e.string(),e.record(e.string(),e.string())).describe("Named catalogs (Yarn `catalogs:` / pnpm `catalogs:`): name -> packages.").optional()}).meta({id:`ToolchainCatalogsConfig`}),S=e.object({config:e.boolean().describe("Write the managed `vite.config.ts` (default true).").optional()}).catchall(e.unknown()).meta({id:`ToolchainViteConfig`});function C(t){return e.union([e.boolean(),t])}const w=e.object({project:n.describe("Project metadata: canonical `package.json` fields and template tokens (inherited by workspaces).").optional(),changelog:C(d).describe(`Conventional-Commits CI, commitlint and the changelog pipeline.`).optional(),biome:C(f).describe("Biome config generation (for consumers that still want a `biome.json`).").optional(),tsconfig:C(p).describe(`Workspace tsconfig generation (path aliases + project references).`).optional(),templates:C(b).describe(`Template sources / scaffolding.`).optional(),catalogs:C(x).describe("Package catalogs written to the package manager catalog file (`catalog:`).").optional(),vite:C(S).describe("The full Vite+ config; `dbx sync` writes the root `vite.config.ts` from it.").optional(),watch:C(m).describe("Watch behaviour for `dbx watch`.").optional(),logger:C(h).describe(`Logging level, colours and prefix for toolchain output.`).optional(),providers:C(g).describe(`Provider command behaviour (eg. colour for the passthrough commands).`).optional()}).meta({id:`ToolchainConfigSections`}),T=e.object({toolchain:w.describe("The `@deltabox/toolchain` settings (every section is opt-in by presence).").optional()}).meta({id:`DbxConfigSections`}),E={ProjectType:t,ToolchainProjectConfig:n,WorkflowStep:r,WorkflowStepsConfig:i,WorkflowConfig:a,WorkflowSetting:o,ChangelogWorkflowsConfig:s,ChangelogVersioningTarget:c,ChangelogVersioningConfig:l,ChangelogVersioning:u,ToolchainChangelogConfig:d,ToolchainBiomeConfig:f,ToolchainTsconfigConfig:p,ToolchainWatchConfig:m,ToolchainTemplateSourceType:_,ToolchainTemplateKind:v,ToolchainTemplateSource:y,ToolchainTemplatesConfig:b,ToolchainCatalogsConfig:x,ToolchainViteConfig:S,ToolchainLoggerConfig:h,ToolchainProvidersConfig:g,ToolchainConfigSections:w,DbxConfigSections:T},D={project:n,changelog:d,biome:f,tsconfig:p,templates:b,catalogs:x,vite:S,watch:m,logger:h,providers:g},O={project:"Project metadata: canonical `package.json` fields (applied on sync, inherited by workspaces) plus the replacement tokens every template understands.",changelog:`Conventional-Commits CI, commitlint and the changelog pipeline.`,biome:"Biome config generation (for consumers that still want a `biome.json`).",tsconfig:`Workspace tsconfig generation (path aliases + project references).`,templates:`Template sources / scaffolding.`,catalogs:"Package catalogs written to the package manager catalog file (`catalog:`).",vite:"The full Vite+ config; `dbx sync` writes the root `vite.config.ts` from it.",watch:"Watch behaviour for `dbx watch`.",logger:`Logging level, colours and prefix for toolchain output.`,providers:`Provider command behaviour (eg. colour for the provider passthrough commands).`};export{O as CONFIG_SECTION_DESCRIPTIONS,D as CONFIG_SECTION_SCHEMAS,E as CONFIG_TYPE_SCHEMAS,f as biomeConfigSchema,x as catalogsConfigSchema,d as changelogConfigSchema,l as changelogVersioningConfigSchema,u as changelogVersioningSchema,c as changelogVersioningTargetSchema,s as changelogWorkflowsConfigSchema,T as dbxConfigSchema,h as loggerConfigSchema,n as projectConfigSchema,t as projectTypeSchema,g as providersConfigSchema,v as templateKindSchema,y as templateSourceSchema,_ as templateSourceTypeSchema,b as templatesConfigSchema,w as toolchainConfigSchema,p as tsconfigConfigSchema,S as viteConfigSchema,m as watchConfigSchema,a as workflowConfigSchema,o as workflowSettingSchema,r as workflowStepSchema,i as workflowStepsConfigSchema};
@@ -217,6 +217,14 @@ export interface ToolchainTemplatesConfig {
217
217
  /** Extra sources on top of the builtin + registry sources. */
218
218
  sources?: Array<ToolchainTemplateSource>;
219
219
  }
220
+ export interface ToolchainCatalogsConfig {
221
+ /** Master switch (enabled when the section is defined). */
222
+ enabled?: boolean;
223
+ /** The default catalog: package name -> version range. */
224
+ packages?: Record<string, string>;
225
+ /** Named catalogs (Yarn `catalogs:` / pnpm `catalogs:`): name -> packages. */
226
+ named?: Record<string, Record<string, string>>;
227
+ }
220
228
  export type ToolchainViteConfig = ViteUserConfig & {
221
229
  /** Write the managed `vite.config.ts` (default true). */
222
230
  config?: boolean;
@@ -243,6 +251,8 @@ export interface ToolchainConfigSections {
243
251
  tsconfig?: boolean | ToolchainTsconfigConfig;
244
252
  /** Template sources / scaffolding. */
245
253
  templates?: boolean | ToolchainTemplatesConfig;
254
+ /** Package catalogs written to the package manager catalog file (`catalog:`). */
255
+ catalogs?: boolean | ToolchainCatalogsConfig;
246
256
  /** The full Vite+ config; `dbx sync` writes the root `vite.config.ts` from it. */
247
257
  vite?: boolean | ToolchainViteConfig;
248
258
  /** Watch behaviour for `dbx watch`. */
@@ -5,9 +5,9 @@ import { mergeJsonAt, readJsonAt, readJsonFile, toJson, writeJsonFile } from "./
5
5
  import { DEFAULT_IGNORE_PATTERNS, IgnoreOptions, collectGitignorePatterns, isIgnoredPath, resolveIgnorePatterns } from "./ignore.js";
6
6
  import { Colors, LOG_LEVELS, LogChannel, LogLevel, Logger, LoggerConfig, LoggerOptions, configureLogger, createLogger, getLogOverrides, getLogger, isLogLevel, logger, normalizeLogLevel, setLogConfig, setLogOverrides, stripAnsi } from "./logger.js";
7
7
  import { Sortable, deepMerge, isPlainObject, mapValues, resolveSort, sort } from "./object-utils.js";
8
- 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 "./config-types.js";
8
+ import { ChangelogVersioning, ChangelogVersioningConfig, ChangelogVersioningTarget, ChangelogWorkflowsConfig, DbxConfigSections, ProjectType, ToolchainBiomeConfig, ToolchainCatalogsConfig, ToolchainChangelogConfig, ToolchainConfigSections, ToolchainLoggerConfig, ToolchainProjectConfig, ToolchainProvidersConfig, ToolchainTemplateKind, ToolchainTemplateSource, ToolchainTemplateSourceType, ToolchainTemplatesConfig, ToolchainTsconfigConfig, ToolchainViteConfig, ToolchainWatchConfig, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig } from "./config-types.js";
9
9
  import { ReplacementOptions, ReplacementValue, Replacements, Replacer, applyReplacements, applyReplacementsDeep, createReplacer, defineReplacements, extractTokens, hasUnresolvedTokens, tokenPattern } from "./template.js";
10
- 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 "./config-schema.js";
10
+ import { CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, biomeConfigSchema, catalogsConfigSchema, changelogConfigSchema, changelogVersioningConfigSchema, changelogVersioningSchema, changelogVersioningTargetSchema, changelogWorkflowsConfigSchema, dbxConfigSchema, loggerConfigSchema, projectConfigSchema, projectTypeSchema, providersConfigSchema, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema } from "./config-schema.js";
11
11
  import { CONFIG_FILE_NAMES, DbxConfig, ManagedFile, SyncContext, SyncSummary, SyncTask, ToolchainConfig, ToolchainHooks, ToolchainSection, defineConfig, repoSlugFromUrl, resolveChangelogBranches, resolveTokens, sectionConfig, sectionEnabled } from "./toolchain.js";
12
12
  import { Awaitable, GeneratedFile, JsonValue, PackageJson, ToolchainArgument, ToolchainCommand, ToolchainCommandContext, ToolchainOption } from "./types.js";
13
13
  import { projectFromPackageJson, projectToPackageJson, splitPackageName } from "./project.js";
@@ -16,7 +16,7 @@ import { RunOptions, SpawnCrossOptions, killProcessTree, run, spawnCross } from
16
16
  import { asString, camelCase, camelCaseId, capitalize, constantCase, ensureLeadingSlash, ensureSlashes, ensureTrailingSlash, formatCliFlag, hasText, indent, isLocalhost, kebabCase, pascalCase, removeDoubleSlashes, removeLeadingSlash, removeTrailingSlash, sanitizeSlashes, sanitizeText, snakeCase, str, stripControlChars, stripEscapeArtifacts, titleCase } from "./string-utils.js";
17
17
  import { YamlValue, toYaml } from "./yaml.js";
18
18
  declare namespace index_d_exports {
19
- export { Awaitable, CONFIG_FILE_NAMES, CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, ChangelogVersioning, ChangelogVersioningConfig, ChangelogVersioningTarget, ChangelogWorkflowsConfig, Colors, DEFAULT_IGNORE_PATTERNS, DbxConfig, DbxConfigSections, GeneratedFile, IgnoreOptions, JsonValue, LOG_LEVELS, LogChannel, LogLevel, Logger, LoggerConfig, LoggerOptions, ManagedFile, PackageJson, ProjectType, ReplacementOptions, ReplacementValue, Replacements, Replacer, RunOptions, Sortable, SpawnCrossOptions, SyncContext, 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, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig, YamlValue, applyReplacements, applyReplacementsDeep, asString, biomeConfigSchema, camelCase, camelCaseId, capitalize, changelogConfigSchema, changelogVersioningConfigSchema, changelogVersioningSchema, changelogVersioningTargetSchema, changelogWorkflowsConfigSchema, collectGitignorePatterns, configureLogger, constantCase, createLogger, createReplacer, dbxConfigSchema, deepMerge, defineConfig, defineReplacements, ensureLeadingSlash, ensureSlashes, ensureTrailingSlash, extractTokens, findOwnCliEntry, formatCliFlag, getLogOverrides, getLogger, hasText, hasUnresolvedTokens, indent, isIgnoredPath, isLocalhost, isLogLevel, isPlainObject, kebabCase, killProcessTree, localToolchainVersion, logger, loggerConfigSchema, mapValues, mergeJsonAt, normalizeLogLevel, pascalCase, projectConfigSchema, projectFromPackageJson, projectToPackageJson, projectTypeSchema, providerActions, providersConfigSchema, readJsonAt, readJsonFile, removeDoubleSlashes, removeLeadingSlash, removeTrailingSlash, repoSlugFromUrl, resolveChangelogBranches, resolveIgnorePatterns, resolveSort, resolveTokens, run, sanitizeSlashes, sanitizeText, sectionConfig, sectionEnabled, setLogConfig, setLogOverrides, snakeCase, sort, spawnCross, splitPackageName, str, stripAnsi, stripControlChars, stripEscapeArtifacts, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, titleCase, toJson, toYaml, tokenPattern, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema, writeJsonFile };
19
+ export { Awaitable, CONFIG_FILE_NAMES, CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, ChangelogVersioning, ChangelogVersioningConfig, ChangelogVersioningTarget, ChangelogWorkflowsConfig, Colors, DEFAULT_IGNORE_PATTERNS, DbxConfig, DbxConfigSections, GeneratedFile, IgnoreOptions, JsonValue, LOG_LEVELS, LogChannel, LogLevel, Logger, LoggerConfig, LoggerOptions, ManagedFile, PackageJson, ProjectType, ReplacementOptions, ReplacementValue, Replacements, Replacer, RunOptions, Sortable, SpawnCrossOptions, SyncContext, SyncSummary, SyncTask, TOOLCHAIN_PACKAGE, ToolchainArgument, ToolchainBiomeConfig, ToolchainCatalogsConfig, ToolchainChangelogConfig, ToolchainCommand, ToolchainCommandContext, ToolchainConfig, ToolchainConfigSections, ToolchainHooks, ToolchainLoggerConfig, ToolchainOption, ToolchainProjectConfig, ToolchainProvider, ToolchainProviderAction, ToolchainProviderCommand, ToolchainProvidersConfig, ToolchainSection, ToolchainTemplateKind, ToolchainTemplateSource, ToolchainTemplateSourceType, ToolchainTemplatesConfig, ToolchainTsconfigConfig, ToolchainViteConfig, ToolchainWatchConfig, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig, YamlValue, applyReplacements, applyReplacementsDeep, asString, biomeConfigSchema, camelCase, camelCaseId, capitalize, catalogsConfigSchema, changelogConfigSchema, changelogVersioningConfigSchema, changelogVersioningSchema, changelogVersioningTargetSchema, changelogWorkflowsConfigSchema, collectGitignorePatterns, configureLogger, constantCase, createLogger, createReplacer, dbxConfigSchema, deepMerge, defineConfig, defineReplacements, ensureLeadingSlash, ensureSlashes, ensureTrailingSlash, extractTokens, findOwnCliEntry, formatCliFlag, getLogOverrides, getLogger, hasText, hasUnresolvedTokens, indent, isIgnoredPath, isLocalhost, isLogLevel, isPlainObject, kebabCase, killProcessTree, localToolchainVersion, logger, loggerConfigSchema, mapValues, mergeJsonAt, normalizeLogLevel, pascalCase, projectConfigSchema, projectFromPackageJson, projectToPackageJson, projectTypeSchema, providerActions, providersConfigSchema, readJsonAt, readJsonFile, removeDoubleSlashes, removeLeadingSlash, removeTrailingSlash, repoSlugFromUrl, resolveChangelogBranches, resolveIgnorePatterns, resolveSort, resolveTokens, run, sanitizeSlashes, sanitizeText, sectionConfig, sectionEnabled, setLogConfig, setLogOverrides, snakeCase, sort, spawnCross, splitPackageName, str, stripAnsi, stripControlChars, stripEscapeArtifacts, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, titleCase, toJson, toYaml, tokenPattern, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema, writeJsonFile };
20
20
  }
21
21
  //#endregion
22
- export { Awaitable, CONFIG_FILE_NAMES, CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, ChangelogVersioning, ChangelogVersioningConfig, ChangelogVersioningTarget, ChangelogWorkflowsConfig, Colors, DEFAULT_IGNORE_PATTERNS, DbxConfig, DbxConfigSections, GeneratedFile, IgnoreOptions, JsonValue, LOG_LEVELS, LogChannel, LogLevel, Logger, LoggerConfig, LoggerOptions, ManagedFile, PackageJson, ProjectType, ReplacementOptions, ReplacementValue, Replacements, Replacer, RunOptions, Sortable, SpawnCrossOptions, SyncContext, 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, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig, type YamlValue, applyReplacements, applyReplacementsDeep, asString, biomeConfigSchema, camelCase, camelCaseId, capitalize, changelogConfigSchema, changelogVersioningConfigSchema, changelogVersioningSchema, changelogVersioningTargetSchema, changelogWorkflowsConfigSchema, collectGitignorePatterns, configureLogger, constantCase, createLogger, createReplacer, dbxConfigSchema, deepMerge, defineConfig, defineReplacements, ensureLeadingSlash, ensureSlashes, ensureTrailingSlash, extractTokens, findOwnCliEntry, formatCliFlag, getLogOverrides, getLogger, hasText, hasUnresolvedTokens, indent, index_d_exports, isIgnoredPath, isLocalhost, isLogLevel, isPlainObject, kebabCase, killProcessTree, localToolchainVersion, logger, loggerConfigSchema, mapValues, mergeJsonAt, normalizeLogLevel, pascalCase, projectConfigSchema, projectFromPackageJson, projectToPackageJson, projectTypeSchema, providerActions, providersConfigSchema, readJsonAt, readJsonFile, removeDoubleSlashes, removeLeadingSlash, removeTrailingSlash, repoSlugFromUrl, resolveChangelogBranches, resolveIgnorePatterns, resolveSort, resolveTokens, run, sanitizeSlashes, sanitizeText, sectionConfig, sectionEnabled, setLogConfig, setLogOverrides, snakeCase, sort, spawnCross, splitPackageName, str, stripAnsi, stripControlChars, stripEscapeArtifacts, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, titleCase, toJson, toYaml, tokenPattern, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema, writeJsonFile };
22
+ export { Awaitable, CONFIG_FILE_NAMES, CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, ChangelogVersioning, ChangelogVersioningConfig, ChangelogVersioningTarget, ChangelogWorkflowsConfig, Colors, DEFAULT_IGNORE_PATTERNS, DbxConfig, DbxConfigSections, GeneratedFile, IgnoreOptions, JsonValue, LOG_LEVELS, LogChannel, LogLevel, Logger, LoggerConfig, LoggerOptions, ManagedFile, PackageJson, ProjectType, ReplacementOptions, ReplacementValue, Replacements, Replacer, RunOptions, Sortable, SpawnCrossOptions, SyncContext, SyncSummary, SyncTask, TOOLCHAIN_PACKAGE, ToolchainArgument, ToolchainBiomeConfig, ToolchainCatalogsConfig, ToolchainChangelogConfig, ToolchainCommand, ToolchainCommandContext, ToolchainConfig, ToolchainConfigSections, ToolchainHooks, ToolchainLoggerConfig, ToolchainOption, ToolchainProjectConfig, ToolchainProvider, ToolchainProviderAction, ToolchainProviderCommand, ToolchainProvidersConfig, ToolchainSection, ToolchainTemplateKind, ToolchainTemplateSource, ToolchainTemplateSourceType, ToolchainTemplatesConfig, ToolchainTsconfigConfig, ToolchainViteConfig, ToolchainWatchConfig, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig, type YamlValue, applyReplacements, applyReplacementsDeep, asString, biomeConfigSchema, camelCase, camelCaseId, capitalize, catalogsConfigSchema, changelogConfigSchema, changelogVersioningConfigSchema, changelogVersioningSchema, changelogVersioningTargetSchema, changelogWorkflowsConfigSchema, collectGitignorePatterns, configureLogger, constantCase, createLogger, createReplacer, dbxConfigSchema, deepMerge, defineConfig, defineReplacements, ensureLeadingSlash, ensureSlashes, ensureTrailingSlash, extractTokens, findOwnCliEntry, formatCliFlag, getLogOverrides, getLogger, hasText, hasUnresolvedTokens, indent, index_d_exports, isIgnoredPath, isLocalhost, isLogLevel, isPlainObject, kebabCase, killProcessTree, localToolchainVersion, logger, loggerConfigSchema, mapValues, mergeJsonAt, normalizeLogLevel, pascalCase, projectConfigSchema, projectFromPackageJson, projectToPackageJson, projectTypeSchema, providerActions, providersConfigSchema, readJsonAt, readJsonFile, removeDoubleSlashes, removeLeadingSlash, removeTrailingSlash, repoSlugFromUrl, resolveChangelogBranches, resolveIgnorePatterns, resolveSort, resolveTokens, run, sanitizeSlashes, sanitizeText, sectionConfig, sectionEnabled, setLogConfig, setLogOverrides, snakeCase, sort, spawnCross, splitPackageName, str, stripAnsi, stripControlChars, stripEscapeArtifacts, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, titleCase, toJson, toYaml, tokenPattern, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema, writeJsonFile };
@@ -1 +1 @@
1
- import"node:path";import"node:url";import.meta.url;import{__exportAll as ee}from"../../../_virtual/_rolldown/runtime.js";import{TOOLCHAIN_PACKAGE as e,findOwnCliEntry as t,localToolchainVersion as n}from"./bin.js";import{deepMerge as r,isPlainObject as i,mapValues as a,resolveSort as o,sort as s}from"./object-utils.js";import{mergeJsonAt as c,readJsonAt as l,readJsonFile as u,toJson as d,writeJsonFile as f}from"./fs-utils.js";import{DEFAULT_IGNORE_PATTERNS as p,collectGitignorePatterns as m,isIgnoredPath as h,resolveIgnorePatterns as g}from"./ignore.js";import{LOG_LEVELS as _,configureLogger as v,createLogger as y,getLogOverrides as b,getLogger as x,isLogLevel as S,logger as C,normalizeLogLevel as w,setLogConfig as T,setLogOverrides as E,stripAnsi as D}from"./logger.js";import{projectFromPackageJson as O,projectToPackageJson as k,splitPackageName as A}from"./project.js";import{providerActions as j}from"./provider.js";import{killProcessTree as M,run as N,spawnCross as P}from"./run.js";import{asString as F,camelCase as I,camelCaseId as L,capitalize as R,constantCase as z,ensureLeadingSlash as B,ensureSlashes as V,ensureTrailingSlash as H,formatCliFlag as U,hasText as W,indent as G,isLocalhost as K,kebabCase as q,pascalCase as J,removeDoubleSlashes as Y,removeLeadingSlash as X,removeTrailingSlash as Z,sanitizeSlashes as te,sanitizeText as Q,snakeCase as $,str as ne,stripControlChars as re,stripEscapeArtifacts as ie,titleCase as ae}from"./string-utils.js";import{applyReplacements as oe,applyReplacementsDeep as se,createReplacer as ce,defineReplacements as le,extractTokens as ue,hasUnresolvedTokens as de,tokenPattern as fe}from"./template.js";import{CONFIG_SECTION_DESCRIPTIONS as pe,CONFIG_SECTION_SCHEMAS as me,CONFIG_TYPE_SCHEMAS as he,biomeConfigSchema as ge,changelogConfigSchema as _e,changelogVersioningConfigSchema as ve,changelogVersioningSchema as ye,changelogVersioningTargetSchema as be,changelogWorkflowsConfigSchema as xe,dbxConfigSchema as Se,loggerConfigSchema as Ce,projectConfigSchema as we,projectTypeSchema as Te,providersConfigSchema as Ee,templateKindSchema as De,templateSourceSchema as Oe,templateSourceTypeSchema as ke,templatesConfigSchema as Ae,toolchainConfigSchema as je,tsconfigConfigSchema as Me,viteConfigSchema as Ne,watchConfigSchema as Pe,workflowConfigSchema as Fe,workflowSettingSchema as Ie,workflowStepSchema as Le,workflowStepsConfigSchema as Re}from"./config-schema.js";import{CONFIG_FILE_NAMES as ze,defineConfig as Be,repoSlugFromUrl as Ve,resolveChangelogBranches as He,resolveTokens as Ue,sectionConfig as We,sectionEnabled as Ge}from"./toolchain.js";import{toYaml as Ke}from"./yaml.js";var qe=/* @__PURE__ */ ee({CONFIG_FILE_NAMES:()=>ze,CONFIG_SECTION_DESCRIPTIONS:()=>pe,CONFIG_SECTION_SCHEMAS:()=>me,CONFIG_TYPE_SCHEMAS:()=>he,DEFAULT_IGNORE_PATTERNS:()=>p,LOG_LEVELS:()=>_,TOOLCHAIN_PACKAGE:()=>e,applyReplacements:()=>oe,applyReplacementsDeep:()=>se,asString:()=>F,biomeConfigSchema:()=>ge,camelCase:()=>I,camelCaseId:()=>L,capitalize:()=>R,changelogConfigSchema:()=>_e,changelogVersioningConfigSchema:()=>ve,changelogVersioningSchema:()=>ye,changelogVersioningTargetSchema:()=>be,changelogWorkflowsConfigSchema:()=>xe,collectGitignorePatterns:()=>m,configureLogger:()=>v,constantCase:()=>z,createLogger:()=>y,createReplacer:()=>ce,dbxConfigSchema:()=>Se,deepMerge:()=>r,defineConfig:()=>Be,defineReplacements:()=>le,ensureLeadingSlash:()=>B,ensureSlashes:()=>V,ensureTrailingSlash:()=>H,extractTokens:()=>ue,findOwnCliEntry:()=>t,formatCliFlag:()=>U,getLogOverrides:()=>b,getLogger:()=>x,hasText:()=>W,hasUnresolvedTokens:()=>de,indent:()=>G,isIgnoredPath:()=>h,isLocalhost:()=>K,isLogLevel:()=>S,isPlainObject:()=>i,kebabCase:()=>q,killProcessTree:()=>M,localToolchainVersion:()=>n,logger:()=>C,loggerConfigSchema:()=>Ce,mapValues:()=>a,mergeJsonAt:()=>c,normalizeLogLevel:()=>w,pascalCase:()=>J,projectConfigSchema:()=>we,projectFromPackageJson:()=>O,projectToPackageJson:()=>k,projectTypeSchema:()=>Te,providerActions:()=>j,providersConfigSchema:()=>Ee,readJsonAt:()=>l,readJsonFile:()=>u,removeDoubleSlashes:()=>Y,removeLeadingSlash:()=>X,removeTrailingSlash:()=>Z,repoSlugFromUrl:()=>Ve,resolveChangelogBranches:()=>He,resolveIgnorePatterns:()=>g,resolveSort:()=>o,resolveTokens:()=>Ue,run:()=>N,sanitizeSlashes:()=>te,sanitizeText:()=>Q,sectionConfig:()=>We,sectionEnabled:()=>Ge,setLogConfig:()=>T,setLogOverrides:()=>E,snakeCase:()=>$,sort:()=>s,spawnCross:()=>P,splitPackageName:()=>A,str:()=>ne,stripAnsi:()=>D,stripControlChars:()=>re,stripEscapeArtifacts:()=>ie,templateKindSchema:()=>De,templateSourceSchema:()=>Oe,templateSourceTypeSchema:()=>ke,templatesConfigSchema:()=>Ae,titleCase:()=>ae,toJson:()=>d,toYaml:()=>Ke,tokenPattern:()=>fe,toolchainConfigSchema:()=>je,tsconfigConfigSchema:()=>Me,viteConfigSchema:()=>Ne,watchConfigSchema:()=>Pe,workflowConfigSchema:()=>Fe,workflowSettingSchema:()=>Ie,workflowStepSchema:()=>Le,workflowStepsConfigSchema:()=>Re,writeJsonFile:()=>f});export{ze as CONFIG_FILE_NAMES,pe as CONFIG_SECTION_DESCRIPTIONS,me as CONFIG_SECTION_SCHEMAS,he as CONFIG_TYPE_SCHEMAS,p as DEFAULT_IGNORE_PATTERNS,_ as LOG_LEVELS,e as TOOLCHAIN_PACKAGE,oe as applyReplacements,se as applyReplacementsDeep,F as asString,ge as biomeConfigSchema,I as camelCase,L as camelCaseId,R as capitalize,_e as changelogConfigSchema,ve as changelogVersioningConfigSchema,ye as changelogVersioningSchema,be as changelogVersioningTargetSchema,xe as changelogWorkflowsConfigSchema,m as collectGitignorePatterns,v as configureLogger,z as constantCase,y as createLogger,ce as createReplacer,Se as dbxConfigSchema,r as deepMerge,Be as defineConfig,le as defineReplacements,B as ensureLeadingSlash,V as ensureSlashes,H as ensureTrailingSlash,ue as extractTokens,t as findOwnCliEntry,U as formatCliFlag,b as getLogOverrides,x as getLogger,W as hasText,de as hasUnresolvedTokens,G as indent,h as isIgnoredPath,K as isLocalhost,S as isLogLevel,i as isPlainObject,q as kebabCase,M as killProcessTree,n as localToolchainVersion,C as logger,Ce as loggerConfigSchema,a as mapValues,c as mergeJsonAt,w as normalizeLogLevel,J as pascalCase,we as projectConfigSchema,O as projectFromPackageJson,k as projectToPackageJson,Te as projectTypeSchema,j as providerActions,Ee as providersConfigSchema,l as readJsonAt,u as readJsonFile,Y as removeDoubleSlashes,X as removeLeadingSlash,Z as removeTrailingSlash,Ve as repoSlugFromUrl,He as resolveChangelogBranches,g as resolveIgnorePatterns,o as resolveSort,Ue as resolveTokens,N as run,te as sanitizeSlashes,Q as sanitizeText,We as sectionConfig,Ge as sectionEnabled,T as setLogConfig,E as setLogOverrides,$ as snakeCase,s as sort,P as spawnCross,A as splitPackageName,qe as src_exports,ne as str,D as stripAnsi,re as stripControlChars,ie as stripEscapeArtifacts,De as templateKindSchema,Oe as templateSourceSchema,ke as templateSourceTypeSchema,Ae as templatesConfigSchema,ae as titleCase,d as toJson,Ke as toYaml,fe as tokenPattern,je as toolchainConfigSchema,Me as tsconfigConfigSchema,Ne as viteConfigSchema,Pe as watchConfigSchema,Fe as workflowConfigSchema,Ie as workflowSettingSchema,Le as workflowStepSchema,Re as workflowStepsConfigSchema,f as writeJsonFile};
1
+ import"node:path";import"node:url";import.meta.url;import{__exportAll as ee}from"../../../_virtual/_rolldown/runtime.js";import{TOOLCHAIN_PACKAGE as e,findOwnCliEntry as t,localToolchainVersion as n}from"./bin.js";import{deepMerge as r,isPlainObject as i,mapValues as a,resolveSort as o,sort as s}from"./object-utils.js";import{mergeJsonAt as c,readJsonAt as l,readJsonFile as u,toJson as d,writeJsonFile as f}from"./fs-utils.js";import{DEFAULT_IGNORE_PATTERNS as p,collectGitignorePatterns as m,isIgnoredPath as h,resolveIgnorePatterns as g}from"./ignore.js";import{LOG_LEVELS as _,configureLogger as v,createLogger as y,getLogOverrides as b,getLogger as x,isLogLevel as S,logger as C,normalizeLogLevel as w,setLogConfig as T,setLogOverrides as E,stripAnsi as D}from"./logger.js";import{projectFromPackageJson as O,projectToPackageJson as k,splitPackageName as A}from"./project.js";import{providerActions as j}from"./provider.js";import{killProcessTree as M,run as N,spawnCross as P}from"./run.js";import{asString as F,camelCase as I,camelCaseId as L,capitalize as R,constantCase as z,ensureLeadingSlash as B,ensureSlashes as V,ensureTrailingSlash as H,formatCliFlag as U,hasText as W,indent as G,isLocalhost as K,kebabCase as q,pascalCase as J,removeDoubleSlashes as Y,removeLeadingSlash as X,removeTrailingSlash as Z,sanitizeSlashes as te,sanitizeText as Q,snakeCase as $,str as ne,stripControlChars as re,stripEscapeArtifacts as ie,titleCase as ae}from"./string-utils.js";import{applyReplacements as oe,applyReplacementsDeep as se,createReplacer as ce,defineReplacements as le,extractTokens as ue,hasUnresolvedTokens as de,tokenPattern as fe}from"./template.js";import{CONFIG_SECTION_DESCRIPTIONS as pe,CONFIG_SECTION_SCHEMAS as me,CONFIG_TYPE_SCHEMAS as he,biomeConfigSchema as ge,catalogsConfigSchema as _e,changelogConfigSchema as ve,changelogVersioningConfigSchema as ye,changelogVersioningSchema as be,changelogVersioningTargetSchema as xe,changelogWorkflowsConfigSchema as Se,dbxConfigSchema as Ce,loggerConfigSchema as we,projectConfigSchema as Te,projectTypeSchema as Ee,providersConfigSchema as De,templateKindSchema as Oe,templateSourceSchema as ke,templateSourceTypeSchema as Ae,templatesConfigSchema as je,toolchainConfigSchema as Me,tsconfigConfigSchema as Ne,viteConfigSchema as Pe,watchConfigSchema as Fe,workflowConfigSchema as Ie,workflowSettingSchema as Le,workflowStepSchema as Re,workflowStepsConfigSchema as ze}from"./config-schema.js";import{CONFIG_FILE_NAMES as Be,defineConfig as Ve,repoSlugFromUrl as He,resolveChangelogBranches as Ue,resolveTokens as We,sectionConfig as Ge,sectionEnabled as Ke}from"./toolchain.js";import{toYaml as qe}from"./yaml.js";var Je=/* @__PURE__ */ ee({CONFIG_FILE_NAMES:()=>Be,CONFIG_SECTION_DESCRIPTIONS:()=>pe,CONFIG_SECTION_SCHEMAS:()=>me,CONFIG_TYPE_SCHEMAS:()=>he,DEFAULT_IGNORE_PATTERNS:()=>p,LOG_LEVELS:()=>_,TOOLCHAIN_PACKAGE:()=>e,applyReplacements:()=>oe,applyReplacementsDeep:()=>se,asString:()=>F,biomeConfigSchema:()=>ge,camelCase:()=>I,camelCaseId:()=>L,capitalize:()=>R,catalogsConfigSchema:()=>_e,changelogConfigSchema:()=>ve,changelogVersioningConfigSchema:()=>ye,changelogVersioningSchema:()=>be,changelogVersioningTargetSchema:()=>xe,changelogWorkflowsConfigSchema:()=>Se,collectGitignorePatterns:()=>m,configureLogger:()=>v,constantCase:()=>z,createLogger:()=>y,createReplacer:()=>ce,dbxConfigSchema:()=>Ce,deepMerge:()=>r,defineConfig:()=>Ve,defineReplacements:()=>le,ensureLeadingSlash:()=>B,ensureSlashes:()=>V,ensureTrailingSlash:()=>H,extractTokens:()=>ue,findOwnCliEntry:()=>t,formatCliFlag:()=>U,getLogOverrides:()=>b,getLogger:()=>x,hasText:()=>W,hasUnresolvedTokens:()=>de,indent:()=>G,isIgnoredPath:()=>h,isLocalhost:()=>K,isLogLevel:()=>S,isPlainObject:()=>i,kebabCase:()=>q,killProcessTree:()=>M,localToolchainVersion:()=>n,logger:()=>C,loggerConfigSchema:()=>we,mapValues:()=>a,mergeJsonAt:()=>c,normalizeLogLevel:()=>w,pascalCase:()=>J,projectConfigSchema:()=>Te,projectFromPackageJson:()=>O,projectToPackageJson:()=>k,projectTypeSchema:()=>Ee,providerActions:()=>j,providersConfigSchema:()=>De,readJsonAt:()=>l,readJsonFile:()=>u,removeDoubleSlashes:()=>Y,removeLeadingSlash:()=>X,removeTrailingSlash:()=>Z,repoSlugFromUrl:()=>He,resolveChangelogBranches:()=>Ue,resolveIgnorePatterns:()=>g,resolveSort:()=>o,resolveTokens:()=>We,run:()=>N,sanitizeSlashes:()=>te,sanitizeText:()=>Q,sectionConfig:()=>Ge,sectionEnabled:()=>Ke,setLogConfig:()=>T,setLogOverrides:()=>E,snakeCase:()=>$,sort:()=>s,spawnCross:()=>P,splitPackageName:()=>A,str:()=>ne,stripAnsi:()=>D,stripControlChars:()=>re,stripEscapeArtifacts:()=>ie,templateKindSchema:()=>Oe,templateSourceSchema:()=>ke,templateSourceTypeSchema:()=>Ae,templatesConfigSchema:()=>je,titleCase:()=>ae,toJson:()=>d,toYaml:()=>qe,tokenPattern:()=>fe,toolchainConfigSchema:()=>Me,tsconfigConfigSchema:()=>Ne,viteConfigSchema:()=>Pe,watchConfigSchema:()=>Fe,workflowConfigSchema:()=>Ie,workflowSettingSchema:()=>Le,workflowStepSchema:()=>Re,workflowStepsConfigSchema:()=>ze,writeJsonFile:()=>f});export{Be as CONFIG_FILE_NAMES,pe as CONFIG_SECTION_DESCRIPTIONS,me as CONFIG_SECTION_SCHEMAS,he as CONFIG_TYPE_SCHEMAS,p as DEFAULT_IGNORE_PATTERNS,_ as LOG_LEVELS,e as TOOLCHAIN_PACKAGE,oe as applyReplacements,se as applyReplacementsDeep,F as asString,ge as biomeConfigSchema,I as camelCase,L as camelCaseId,R as capitalize,_e as catalogsConfigSchema,ve as changelogConfigSchema,ye as changelogVersioningConfigSchema,be as changelogVersioningSchema,xe as changelogVersioningTargetSchema,Se as changelogWorkflowsConfigSchema,m as collectGitignorePatterns,v as configureLogger,z as constantCase,y as createLogger,ce as createReplacer,Ce as dbxConfigSchema,r as deepMerge,Ve as defineConfig,le as defineReplacements,B as ensureLeadingSlash,V as ensureSlashes,H as ensureTrailingSlash,ue as extractTokens,t as findOwnCliEntry,U as formatCliFlag,b as getLogOverrides,x as getLogger,W as hasText,de as hasUnresolvedTokens,G as indent,h as isIgnoredPath,K as isLocalhost,S as isLogLevel,i as isPlainObject,q as kebabCase,M as killProcessTree,n as localToolchainVersion,C as logger,we as loggerConfigSchema,a as mapValues,c as mergeJsonAt,w as normalizeLogLevel,J as pascalCase,Te as projectConfigSchema,O as projectFromPackageJson,k as projectToPackageJson,Ee as projectTypeSchema,j as providerActions,De as providersConfigSchema,l as readJsonAt,u as readJsonFile,Y as removeDoubleSlashes,X as removeLeadingSlash,Z as removeTrailingSlash,He as repoSlugFromUrl,Ue as resolveChangelogBranches,g as resolveIgnorePatterns,o as resolveSort,We as resolveTokens,N as run,te as sanitizeSlashes,Q as sanitizeText,Ge as sectionConfig,Ke as sectionEnabled,T as setLogConfig,E as setLogOverrides,$ as snakeCase,s as sort,P as spawnCross,A as splitPackageName,Je as src_exports,ne as str,D as stripAnsi,re as stripControlChars,ie as stripEscapeArtifacts,Oe as templateKindSchema,ke as templateSourceSchema,Ae as templateSourceTypeSchema,je as templatesConfigSchema,ae as titleCase,d as toJson,qe as toYaml,fe as tokenPattern,Me as toolchainConfigSchema,Ne as tsconfigConfigSchema,Pe as viteConfigSchema,Fe as watchConfigSchema,Ie as workflowConfigSchema,Le as workflowSettingSchema,Re as workflowStepSchema,ze as workflowStepsConfigSchema,f as writeJsonFile};
@@ -1 +1 @@
1
- import"node:path";import"node:url";import.meta.url;function e(e){if(!e)return{};let t=e.match(/^(@[^/]+)\/(.+)$/);return t?.[1]&&t[2]?{name:t[2],scope:t[1]}:{name:e}}function t(e){if(typeof e==`string`)return e||void 0;if(e&&typeof e==`object`){let t=e;if(!t.name)return;let n=t.email?` <${t.email}>`:``,r=t.url?` (${t.url})`:``;return`${t.name}${n}${r}`}}function n(e){let t=typeof e==`string`?e:e&&typeof e==`object`?e.url:void 0;if(t)return t.replace(/^git\+/,``).replace(/\.git$/,``)}function r(e){return e.startsWith(`git+`)||e.startsWith(`git@`)?e:/^https?:\/\//.test(e)&&!e.endsWith(`.git`)?`git+${e}.git`:e}function i(e){if(typeof e!=`string`||!e)return{};let t=e.match(/^(@?[^@]+)@(.+)$/);return t?.[1]&&t[2]?{name:t[1],version:t[2]}:{name:e}}function a(e){if(typeof e==`string`&&e)return e.replace(/^[^\d]*/,``).trim()||void 0}function o(r){let{name:o,scope:s}=e(r.name),c=i(r.packageManager),l=r.engines??{},u=typeof r.description==`string`?r.description:void 0,d=t(r.author),f=typeof r.license==`string`?r.license:void 0,p=typeof r.homepage==`string`?r.homepage:void 0,m=n(r.repository),h=a(l.node);return{...o?{name:o}:{},...s?{scope:s}:{},...u?{description:u}:{},...d?{author:d}:{},...f?{license:f}:{},...p?{homepage:p}:{},...m?{repo:m}:{},...h?{nodeVersion:h}:{},...c.name?{packageManager:c.name}:{},...c.version?{packageManagerVersion:c.version}:{}}}function s(e,t={}){let n={};return e.name&&(n.name=e.scope?`${e.scope}/${e.name}`:e.name),e.description!==void 0&&(n.description=e.description),e.author!==void 0&&(n.author=e.author),e.license!==void 0&&(n.license=e.license),e.homepage!==void 0&&(n.homepage=e.homepage),e.repo!==void 0&&(n.repository={type:`git`,url:r(e.repo),...t.directory?{directory:t.directory}:{}}),e.packageManager!==void 0&&(n.packageManager=e.packageManagerVersion?`${e.packageManager}@${e.packageManagerVersion}`:e.packageManager),n}export{o as projectFromPackageJson,s as projectToPackageJson,e as splitPackageName};
1
+ import"node:path";import"node:url";import.meta.url;function e(e){if(!e)return{};let t=e.match(/^(@[^/]+)\/(.+)$/);return t?.[1]&&t[2]?{name:t[2],scope:t[1]}:{name:e}}function t(e){if(typeof e==`string`)return e||void 0;if(e&&typeof e==`object`){let t=e;if(!t.name)return;let n=t.email?` <${t.email}>`:``,r=t.url?` (${t.url})`:``;return`${t.name}${n}${r}`}}function n(e){let t=typeof e==`string`?e:e&&typeof e==`object`?e.url:void 0;if(t)return t.replace(/^git\+/,``).replace(/\.git$/,``)}function r(e){return e.startsWith(`git+`)||e.startsWith(`git@`)?e:/^https?:\/\//.test(e)&&!e.endsWith(`.git`)?`git+${e}.git`:e}function i(e){if(typeof e!=`string`||!e)return{};let t=e.match(/^(@?[^@]+)@(.+)$/);return t?.[1]&&t[2]?{name:t[1],version:t[2]}:{name:e}}function a(e){if(typeof e==`string`&&e)return e.replace(/^[^\d]*/,``).trim()||void 0}function o(r){let{name:o,scope:s}=e(r.name),c=i(r.packageManager),l=r.engines??{},u=typeof r.description==`string`?r.description:void 0,d=t(r.author),f=typeof r.license==`string`?r.license:void 0,p=typeof r.homepage==`string`?r.homepage:void 0,m=n(r.repository),h=a(l.node);return{...o?{name:o}:{},...s?{scope:s}:{},...u?{description:u}:{},...d?{author:d}:{},...f?{license:f}:{},...p?{homepage:p}:{},...m?{repo:m}:{},...h?{nodeVersion:h}:{},...c.name?{packageManager:c.name}:{},...c.version?{packageManagerVersion:c.version}:{}}}function s(e,t={}){let n={};return e.name&&(n.name=e.scope?`${e.scope}/${e.name}`:e.name),e.description!==void 0&&(n.description=e.description),e.author!==void 0&&(n.author=e.author),e.license!==void 0&&(n.license=e.license),e.homepage!==void 0&&(n.homepage=e.homepage),e.repo!==void 0&&(n.repository={type:`git`,url:r(e.repo),...t.directory?{directory:t.directory}:{}}),e.packageManager!==void 0&&e.packageManagerVersion!==void 0&&(n.packageManager=`${e.packageManager}@${e.packageManagerVersion}`),n}export{o as projectFromPackageJson,s as projectToPackageJson,e as splitPackageName};
@@ -1,8 +1,8 @@
1
1
  import __tsdown_shims_path from 'node:path';
2
2
  import __tsdown_shims_url from 'node:url';
3
- 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 "./config-types.js";
3
+ import { ChangelogVersioning, ChangelogVersioningConfig, ChangelogVersioningTarget, ChangelogWorkflowsConfig, DbxConfigSections, ProjectType, ToolchainBiomeConfig, ToolchainCatalogsConfig, ToolchainChangelogConfig, ToolchainConfigSections, ToolchainLoggerConfig, ToolchainProjectConfig, ToolchainProvidersConfig, ToolchainTemplateKind, ToolchainTemplateSource, ToolchainTemplateSourceType, ToolchainTemplatesConfig, ToolchainTsconfigConfig, ToolchainViteConfig, ToolchainWatchConfig, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig } from "./config-types.js";
4
4
  import { Replacements } from "./template.js";
5
- 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 "./config-schema.js";
5
+ import { CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, biomeConfigSchema, catalogsConfigSchema, changelogConfigSchema, changelogVersioningConfigSchema, changelogVersioningSchema, changelogVersioningTargetSchema, changelogWorkflowsConfigSchema, dbxConfigSchema, loggerConfigSchema, projectConfigSchema, projectTypeSchema, providersConfigSchema, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema } from "./config-schema.js";
6
6
  import { Awaitable } from "./types.js";
7
7
  //#region packages/shared/src/toolchain.d.ts
8
8
  /** A summary of a sync run, handed to {@link ToolchainHooks.afterSync}. */
@@ -168,4 +168,4 @@ export interface SyncTask {
168
168
  run: (ctx: SyncContext) => Awaitable<ManagedFile[] | void>;
169
169
  }
170
170
  //#endregion
171
- export { CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, ChangelogVersioning, ChangelogVersioningConfig, ChangelogVersioningTarget, ChangelogWorkflowsConfig, DbxConfigSections, ProjectType, ToolchainBiomeConfig, ToolchainChangelogConfig, ToolchainConfigSections, ToolchainLoggerConfig, ToolchainProjectConfig, ToolchainProvidersConfig, ToolchainTemplateKind, ToolchainTemplateSource, ToolchainTemplateSourceType, ToolchainTemplatesConfig, ToolchainTsconfigConfig, ToolchainViteConfig, ToolchainWatchConfig, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig, biomeConfigSchema, changelogConfigSchema, changelogVersioningConfigSchema, changelogVersioningSchema, changelogVersioningTargetSchema, changelogWorkflowsConfigSchema, dbxConfigSchema, loggerConfigSchema, projectConfigSchema, projectTypeSchema, providersConfigSchema, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema };
171
+ export { CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, ChangelogVersioning, ChangelogVersioningConfig, ChangelogVersioningTarget, ChangelogWorkflowsConfig, DbxConfigSections, ProjectType, ToolchainBiomeConfig, ToolchainCatalogsConfig, ToolchainChangelogConfig, ToolchainConfigSections, ToolchainLoggerConfig, ToolchainProjectConfig, ToolchainProvidersConfig, ToolchainTemplateKind, ToolchainTemplateSource, ToolchainTemplateSourceType, ToolchainTemplatesConfig, ToolchainTsconfigConfig, ToolchainViteConfig, ToolchainWatchConfig, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig, biomeConfigSchema, catalogsConfigSchema, changelogConfigSchema, changelogVersioningConfigSchema, changelogVersioningSchema, changelogVersioningTargetSchema, changelogWorkflowsConfigSchema, dbxConfigSchema, loggerConfigSchema, projectConfigSchema, projectTypeSchema, providersConfigSchema, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema };
@@ -1 +1 @@
1
- import"node:path";import"node:url";import.meta.url;import{CONFIG_SECTION_DESCRIPTIONS as e,CONFIG_SECTION_SCHEMAS as t,CONFIG_TYPE_SCHEMAS as n,biomeConfigSchema as r,changelogConfigSchema as i,changelogVersioningConfigSchema as a,changelogVersioningSchema as o,changelogVersioningTargetSchema as s,changelogWorkflowsConfigSchema as c,dbxConfigSchema as l,loggerConfigSchema as u,projectConfigSchema as d,projectTypeSchema as f,providersConfigSchema as p,templateKindSchema as m,templateSourceSchema as h,templateSourceTypeSchema as g,templatesConfigSchema as _,toolchainConfigSchema as v,tsconfigConfigSchema as y,viteConfigSchema as b,watchConfigSchema as x,workflowConfigSchema as S,workflowSettingSchema as C,workflowStepSchema as w,workflowStepsConfigSchema as T}from"./config-schema.js";function E(e){return e}function D(e){return e===void 0?!1:typeof e==`boolean`?e:e.enabled!==!1}function O(e){return e!==void 0&&typeof e==`object`?e:void 0}const k=[`dbx.config.ts`,`dbx.config.mts`,`dbx.config.js`,`dbx.config.mjs`,`dbx.config.cjs`,`dbx.config.json`];function A(e){if(!e)return;let t=e.match(/github\.com[/:]([^/]+)\/([^/.]+?)(?:\.git)?$/);return t?.[1]&&t[2]?`${t[1]}/${t[2]}`:void 0}function j(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function M(e){let t=e?.branches??{},n=j(t.main);n.length===0&&n.push(`main`);let r=j(t.dev);return{main:n,dev:r.length>0?r:n}}function N(e={}){let t=e.project??{},n=M(O(e.changelog)??{});return{name:t.name??`app`,scope:t.scope??``,author:t.author??``,license:t.license??`MIT`,homepage:t.homepage??``,repo:t.repo??``,repoSlug:A(t.repo)??``,description:t.description??``,nodeVersion:t.nodeVersion??`22`,packageManager:t.packageManager??`yarn`,yarnVersion:t.packageManagerVersion??`4.17.1`,packageManagerVersion:t.packageManagerVersion??`4.17.1`,mainBranch:n.main[0]??`main`,devBranch:n.dev[0]??`main`}}export{k as CONFIG_FILE_NAMES,e as CONFIG_SECTION_DESCRIPTIONS,t as CONFIG_SECTION_SCHEMAS,n as CONFIG_TYPE_SCHEMAS,r as biomeConfigSchema,i as changelogConfigSchema,a as changelogVersioningConfigSchema,o as changelogVersioningSchema,s as changelogVersioningTargetSchema,c as changelogWorkflowsConfigSchema,l as dbxConfigSchema,E as defineConfig,u as loggerConfigSchema,d as projectConfigSchema,f as projectTypeSchema,p as providersConfigSchema,A as repoSlugFromUrl,M as resolveChangelogBranches,N as resolveTokens,O as sectionConfig,D as sectionEnabled,m as templateKindSchema,h as templateSourceSchema,g as templateSourceTypeSchema,_ as templatesConfigSchema,v as toolchainConfigSchema,y as tsconfigConfigSchema,b as viteConfigSchema,x as watchConfigSchema,S as workflowConfigSchema,C as workflowSettingSchema,w as workflowStepSchema,T as workflowStepsConfigSchema};
1
+ import"node:path";import"node:url";import.meta.url;import{CONFIG_SECTION_DESCRIPTIONS as e,CONFIG_SECTION_SCHEMAS as t,CONFIG_TYPE_SCHEMAS as n,biomeConfigSchema as r,catalogsConfigSchema as i,changelogConfigSchema as a,changelogVersioningConfigSchema as o,changelogVersioningSchema as s,changelogVersioningTargetSchema as c,changelogWorkflowsConfigSchema as l,dbxConfigSchema as u,loggerConfigSchema as d,projectConfigSchema as f,projectTypeSchema as p,providersConfigSchema as m,templateKindSchema as h,templateSourceSchema as g,templateSourceTypeSchema as _,templatesConfigSchema as v,toolchainConfigSchema as y,tsconfigConfigSchema as b,viteConfigSchema as x,watchConfigSchema as S,workflowConfigSchema as C,workflowSettingSchema as w,workflowStepSchema as T,workflowStepsConfigSchema as E}from"./config-schema.js";function D(e){return e}function O(e){return e===void 0?!1:typeof e==`boolean`?e:e.enabled!==!1}function k(e){return e!==void 0&&typeof e==`object`?e:void 0}const A=[`dbx.config.ts`,`dbx.config.mts`,`dbx.config.js`,`dbx.config.mjs`,`dbx.config.cjs`,`dbx.config.json`];function j(e){if(!e)return;let t=e.match(/github\.com[/:]([^/]+)\/([^/.]+?)(?:\.git)?$/);return t?.[1]&&t[2]?`${t[1]}/${t[2]}`:void 0}function M(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function N(e){let t=e?.branches??{},n=M(t.main);n.length===0&&n.push(`main`);let r=M(t.dev);return{main:n,dev:r.length>0?r:n}}function P(e={}){let t=e.project??{},n=N(k(e.changelog)??{});return{name:t.name??`app`,scope:t.scope??``,author:t.author??``,license:t.license??`MIT`,homepage:t.homepage??``,repo:t.repo??``,repoSlug:j(t.repo)??``,description:t.description??``,nodeVersion:t.nodeVersion??`22`,packageManager:t.packageManager??`yarn`,yarnVersion:t.packageManagerVersion??`4.17.1`,packageManagerVersion:t.packageManagerVersion??`4.17.1`,mainBranch:n.main[0]??`main`,devBranch:n.dev[0]??`main`}}export{A as CONFIG_FILE_NAMES,e as CONFIG_SECTION_DESCRIPTIONS,t as CONFIG_SECTION_SCHEMAS,n as CONFIG_TYPE_SCHEMAS,r as biomeConfigSchema,i as catalogsConfigSchema,a as changelogConfigSchema,o as changelogVersioningConfigSchema,s as changelogVersioningSchema,c as changelogVersioningTargetSchema,l as changelogWorkflowsConfigSchema,u as dbxConfigSchema,D as defineConfig,d as loggerConfigSchema,f as projectConfigSchema,p as projectTypeSchema,m as providersConfigSchema,j as repoSlugFromUrl,N as resolveChangelogBranches,P as resolveTokens,k as sectionConfig,O as sectionEnabled,h as templateKindSchema,g as templateSourceSchema,_ as templateSourceTypeSchema,v as templatesConfigSchema,y as toolchainConfigSchema,b as tsconfigConfigSchema,x as viteConfigSchema,S as watchConfigSchema,C as workflowConfigSchema,w as workflowSettingSchema,T as workflowStepSchema,E as workflowStepsConfigSchema};
@@ -40,6 +40,12 @@ export interface ToolchainCommandContext {
40
40
  tokens: Replacements;
41
41
  /** The config file that was loaded, if any. */
42
42
  configPath?: string;
43
+ /**
44
+ * Set when a `dbx.config.*` file failed to import (the CLI loads configs
45
+ * tolerantly so unrelated commands still work). Commands that cannot operate
46
+ * without a valid config (eg. `sync`) fail on it.
47
+ */
48
+ configError?: string;
43
49
  /**
44
50
  * The managed-file sync tasks `dbx sync` runs. Supplied by the CLI (which
45
51
  * aggregates the packages) so a package command such as `migrate` can
@@ -5,6 +5,9 @@ import { Template } from "./types.js";
5
5
  /**
6
6
  * The built-in, offline templates. They map onto the local generators in
7
7
  * `@deltabox/toolchain-project`, so they need no files on disk or network.
8
+ *
9
+ * The Vite+ entries (`vite-plus*`) delegate to `vp create` and need network
10
+ * access; the rest are fully offline.
8
11
  */
9
12
  export declare const BUILTIN_TEMPLATES: Template[];
10
13
  //#endregion
@@ -1 +1 @@
1
- import"node:path";import"node:url";import.meta.url;const e=[{id:`project`,name:`TypeScript project`,description:`A single-package TypeScript project (tsconfig, tsdown, biome).`,kind:`project`,builtin:`single`,source:{type:`builtin`,locate:`project`},tags:[`typescript`,`library`]},{id:`application`,name:`Application`,description:`A runnable application package (tsconfig, tsdown, biome).`,kind:`application`,builtin:`application`,source:{type:`builtin`,locate:`application`},tags:[`application`,`app`]},{id:`folder`,name:`Folder`,description:`A bare folder (a README) to drop files into.`,kind:`folder`,builtin:`folder`,source:{type:`builtin`,locate:`folder`},tags:[`folder`]},{id:`monorepo`,name:`Monorepo`,description:`A monorepo root (workspaces, turbo, monorepo tsconfig) + one example package.`,kind:`project`,builtin:`monorepo-root`,source:{type:`builtin`,locate:`monorepo`},tags:[`monorepo`,`turbo`]},{id:`workspace`,name:`Monorepo workspace`,description:`A workspace package added to an existing monorepo root.`,kind:`workspace`,builtin:`monorepo-workspace`,source:{type:`builtin`,locate:`workspace`},tags:[`monorepo`,`workspace`]},{id:`vite-plus`,name:`Vite+ app`,description:"Create a new project through `vp create` (interactive or templated).",kind:`project`,source:{type:`vite-plus`,locate:``},tags:[`vite`,`vite-plus`],online:!0}];export{e as BUILTIN_TEMPLATES};
1
+ import"node:path";import"node:url";import.meta.url;const e={name:`name`,prompt:`Project name`,default:`app`,required:!0},t=[e,{name:`scope`,prompt:`npm scope (optional)`,default:``},{name:`packageManager`,prompt:`Package manager`,default:`yarn`,options:[`yarn`,`pnpm`,`npm`,`bun`]},{name:`includeConfig`,prompt:`Include a dbx.config.ts?`,default:`yes`,options:[`yes`,`no`]}],n=[{id:`install`,prompt:`Install dependencies?`,default:!1,builtin:`install`}],r=[{id:`project`,name:`TypeScript project`,description:`A single-package TypeScript project (tsconfig, tsdown, biome).`,kind:`project`,builtin:`single`,source:{type:`builtin`,locate:`project`},tags:[`typescript`,`library`],variables:t,actions:n},{id:`application`,name:`Application`,description:`A runnable application package (tsconfig, tsdown, biome).`,kind:`application`,builtin:`application`,source:{type:`builtin`,locate:`application`},tags:[`application`,`app`],variables:t,actions:n},{id:`folder`,name:`Folder`,description:`A bare folder (a README) to drop files into.`,kind:`folder`,builtin:`folder`,source:{type:`builtin`,locate:`folder`},tags:[`folder`],variables:[e]},{id:`monorepo`,name:`Monorepo`,description:`A monorepo root (workspaces + monorepo tsconfig), no example package.`,kind:`project`,builtin:`monorepo-root`,source:{type:`builtin`,locate:`monorepo`},tags:[`monorepo`],variables:t,actions:n},{id:`monorepo-example`,name:`Monorepo (with example)`,description:`A monorepo root plus one example workspace package.`,kind:`project`,builtin:`monorepo-example`,source:{type:`builtin`,locate:`monorepo-example`},tags:[`monorepo`],variables:t,actions:n},{id:`workspace`,name:`Monorepo workspace`,description:`A workspace package added to an existing monorepo root.`,kind:`workspace`,builtin:`monorepo-workspace`,source:{type:`builtin`,locate:`workspace`},tags:[`monorepo`,`workspace`],variables:t,actions:n},{id:`vite-plus`,name:`Vite+ (interactive)`,description:"Create a new project through `vp create` (interactive or templated).",kind:`project`,source:{type:`vite-plus`,locate:``},tags:[`vite`,`vite-plus`],online:!0,variables:[e]},{id:`vite-plus-monorepo`,name:`Vite+ Monorepo`,description:"Create a Vite+ monorepo through `vp create vite:monorepo`.",kind:`project`,source:{type:`vite-plus`,locate:`vite:monorepo`},tags:[`vite`,`vite-plus`,`monorepo`],online:!0,variables:[e]},{id:`vite-plus-application`,name:`Vite+ Application`,description:"Create a Vite+ application through `vp create vite:application`.",kind:`application`,source:{type:`vite-plus`,locate:`vite:application`},tags:[`vite`,`vite-plus`,`application`],online:!0,variables:[e]},{id:`vite-plus-library`,name:`Vite+ Library`,description:"Create a Vite+ library through `vp create vite:library`.",kind:`project`,source:{type:`vite-plus`,locate:`vite:library`},tags:[`vite`,`vite-plus`,`library`],online:!0,variables:[e]},{id:`vite-plus-generator`,name:`Vite+ Generator`,description:"Scaffold a Vite+ code generator (`vp create vite:generator`, monorepo only).",kind:`project`,source:{type:`vite-plus`,locate:`vite:generator`},tags:[`vite`,`vite-plus`,`generator`],online:!0,variables:[e]}];export{r as BUILTIN_TEMPLATES};
@@ -1 +1 @@
1
- import{default as e}from"node:path";import"node:url";import.meta.url;import{logger as t}from"../../../shared/src/logger.js";import"../../../shared/src/index.js";import{TEMPLATE_MANIFEST as n,writeTemplateManifest as r}from"../local.js";import{parseSourceSpec as i}from"../online.js";import{addTemplateSource as a,loadTemplates as o,readTemplateRegistry as s,removeTemplateSource as c}from"../registry.js";import{scaffoldTemplate as l}from"../scaffold.js";import u from"node:fs";import{cancel as d,isCancel as f,select as p,text as m}from"@clack/prompts";const h={flags:`--cwd <dir>`,description:`Project root (default: cwd).`},g={flags:`--kind <kind>`,description:`project | workspace | application | folder | tooling | pipeline.`};function _(e){return{id:e.id,name:e.name,...e.description?{description:e.description}:{},kind:e.kind,type:e.source.type,online:!!e.online,...e.tags?{tags:e.tags}:{},...e.variables?{variables:e.variables}:{}}}function v(e){let t={};for(let n of e??[]){let e=n.indexOf(`=`);e!==-1&&(t[n.slice(0,e)]=n.slice(e+1))}return t}function y(e){return(e??[]).map(e=>{let t=e.indexOf(`:`);return t===-1?{name:e}:{name:e.slice(0,t),default:e.slice(t+1)}})}function b(e){return!!(process.stdin.isTTY&&process.stdout.isTTY)&&e.json!==!0}function x(){d(`Cancelled.`),process.exitCode=1}function S(){return[{name:`template:list`,description:`List templates (builtin + local + opted-in online sources).`,options:[h,{flags:`--online`,description:`Resolve online sources (npm/git).`},{flags:`--offline`,description:`Force offline (skip npm/git).`},g,{flags:`--registry`,description:`List only the .dbx/toolchain/templates.json sources.`},{flags:`--json`,description:`Print the templates as JSON.`}],run:async(e,n)=>{let r=e.cwd??n.cwd;if(e.registry){let n=s(r).sources;if(e.json){t.raw(JSON.stringify(n.map(e=>({key:`${e.type}:${e.locate}`,...e})),null,4));return}if(n.length===0){t.info(`the template registry is empty.`);return}for(let e of n)t.info(` ${`${e.type}:${e.locate}`.padEnd(40)} ${e.name??e.id??``}`);return}let i=!!e.online&&!e.offline,a=await o({cwd:r,config:n.config,online:i}),c=e.kind,l=c?a.filter(e=>e.kind===c):a;if(e.json)t.raw(JSON.stringify(l.map(_),null,4));else if(l.length===0)t.info(`no templates found.`);else for(let e of l){let n=[e.kind,e.source.type,e.online?`online`:`offline`].join(`, `);t.info(` ${e.id.padEnd(24)} ${e.name} [${n}]${e.description?`\n ${e.description}`:``}`)}}},{name:`template:init`,description:`Write a template.json to a directory, making it a local template.`,args:[{name:`dir`,description:`Directory (default: cwd).`,required:!1}],options:[h,g,{flags:`--name <name>`,description:`Display name (default: folder name).`},{flags:`--description <text>`,description:`Description.`},{flags:`--var <pair...>`,description:`Variable name[:default] (repeatable).`},{flags:`--tag <tag...>`,description:`Tag (repeatable).`},{flags:`--force`,description:`Overwrite an existing template.json.`},{flags:`--add`,description:`Also record the folder in .dbx/toolchain/templates.json.`},{flags:`--json`,description:`Print the manifest as JSON.`}],run:(i,o)=>{let s=e.resolve(o.cwd,String(i.dir??`.`)),c=e.join(s,n);if(u.existsSync(c)&&!i.force)throw Error(`template.json already exists at ${c} (use --force).`);let l=y(i.var),d={name:String(i.name??e.basename(s)),kind:i.kind??`folder`,...i.description?{description:String(i.description)}:{},...l.length?{variables:l}:{},...i.tag?{tags:i.tag}:{}};r(s,d),i.add&&a(o.cwd,{type:`local`,locate:s,kind:d.kind}),i.json?t.raw(JSON.stringify(d,null,4)):(t.info(`wrote ${c}`),i.add&&t.info(`registered the folder as a template.`))}},{name:`template:add`,description:`Record a template source in .dbx/toolchain/templates.json.`,args:[{name:`source`,description:`local path | git URL | @scope/create | type:locate`}],options:[h,{flags:`--type <type>`,description:`Force: builtin | local | npm | git | vite-plus.`},{flags:`--name <name>`,description:`Display name.`},g,{flags:`--ref <ref>`,description:`Git branch/tag/commit.`},{flags:`--subdir <dir>`,description:`Subdirectory within the source.`},{flags:`--json`,description:`Print the updated registry as JSON.`}],run:(n,o)=>{let s=i(String(n.source),o.cwd);n.type&&(s.type=n.type),n.name&&(s.name=String(n.name)),n.kind&&(s.kind=n.kind),n.ref&&(s.ref=String(n.ref)),n.subdir&&(s.subdir=String(n.subdir)),s.type===`local`&&!u.existsSync(e.join(s.locate,`template.json`))&&r(s.locate,{name:s.name??e.basename(s.locate),kind:n.kind??`folder`});let c=a(o.cwd,s);n.json?t.raw(JSON.stringify(c,null,4)):t.info(`added ${s.type}:${s.locate} (${c.sources.length} source(s)).`)}},{name:`template:remove`,description:`Remove a source from .dbx/toolchain/templates.json.`,args:[{name:`id`,description:`Source id or type:locate.`}],options:[h,{flags:`--json`,description:`Print the registry as JSON.`}],run:(e,n)=>{let{registry:r,removed:i}=c(n.cwd,String(e.id));e.json?t.raw(JSON.stringify(r,null,4)):i===0?(t.error(`no source matching "${e.id}".`),process.exitCode=1):t.info(`removed ${i} source(s) (${r.sources.length} left).`)}},{name:`template:info`,description:`Show one template by id.`,args:[{name:`id`,description:`The template id.`}],options:[h,{flags:`--online`,description:`Resolve online sources.`}],run:async(e,n)=>{let r=e.cwd??n.cwd,i=(await o({cwd:r,config:n.config,online:!!e.online})).find(t=>t.id===e.id);i?t.raw(JSON.stringify(_(i),null,4)):(t.error(`unknown template "${e.id}".`),process.exitCode=1)}},{name:`create`,description:`Scaffold a project from a template (builtin, local or Vite+).`,options:[{flags:`-t, --template <id>`,description:`Template id (see template:list).`},g,{flags:`-n, --name <name>`,description:`Project / package name.`},{flags:`-s, --scope <scope>`,description:`npm scope, eg. @acme.`},{flags:`-o, --out <dir>`,description:`Output directory (default: cwd).`},h,{flags:`--var <pair...>`,description:`Template variables as key=value (repeatable).`},{flags:`--online`,description:`Resolve online templates too.`},{flags:`--json`,description:`Print the result as JSON.`}],run:async(e,n)=>{let r=e.out??n.cwd,i=e.kind,a=await o({cwd:n.cwd,config:n.config,online:!0}),s=b(e),c=String(e.template??``),u=e.name,d=e.scope;if(s&&!c&&!i){if(a.length===0)throw Error("No templates available. Pass --template <id> (see `dbx template:list`).");let e=await p({message:`Pick a template`,options:a.map(e=>({value:e.id,label:e.name,...e.description?{hint:e.description}:{}}))});if(f(e))return x();c=String(e)}if(s&&!u){let e=await m({message:`Project name`,placeholder:n.config.project?.name??`app`,defaultValue:n.config.project?.name??`app`});if(f(e))return x();u=String(e)}if(s&&!d){let e=await m({message:`npm scope (optional)`,placeholder:n.config.project?.scope??`@${u??`app`}`});if(f(e))return x();d=String(e)||void 0}let h=a.find(e=>e.id===c);if(!h&&!c&&i&&(h=a.find(e=>e.kind===i)),!h&&c&&(h={id:c,name:c,kind:i??`project`,source:{type:`vite-plus`,locate:c},online:!0}),!h)throw Error("No template selected. Pass --template <id> or --kind <kind> (see `dbx template:list`).");let g={...n.config.project,name:u??n.config.project?.name??`app`,...d?{scope:d}:{}},_=v(e.var),y=await l(h,{cwd:r,tokens:g,variables:_});if(e.json)t.raw(JSON.stringify({template:h.id,out:r,...y},null,4));else if(h.source.type===`vite-plus`||h.source.type===`npm`||h.source.type===`git`)y.code&&(process.exitCode=y.code);else for(let e of y.written)t.info(`Created ${e}`)}}]}export{S as templateCommands};
1
+ import{default as e}from"node:path";import"node:url";import.meta.url;import{logger as t}from"../../../shared/src/logger.js";import"../../../shared/src/index.js";import{TEMPLATE_MANIFEST as n,writeTemplateManifest as r}from"../local.js";import{parseSourceSpec as i}from"../online.js";import{addTemplateSource as a,loadTemplates as o,readTemplateRegistry as s,removeTemplateSource as c}from"../registry.js";import{scaffoldTemplate as l}from"../scaffold.js";import u from"node:fs";import{cancel as d,confirm as f,isCancel as p,select as m,text as h}from"@clack/prompts";const g={flags:`--cwd <dir>`,description:`Project root (default: cwd).`},_={flags:`--kind <kind>`,description:`project | workspace | application | folder | tooling | pipeline.`};function v(e){return{id:e.id,name:e.name,...e.description?{description:e.description}:{},kind:e.kind,type:e.source.type,online:!!e.online,...e.tags?{tags:e.tags}:{},...e.variables?{variables:e.variables}:{},...e.actions?{actions:e.actions}:{}}}function y(e){let t={};for(let n of e??[]){let e=n.indexOf(`=`);e!==-1&&(t[n.slice(0,e)]=n.slice(e+1))}return t}function b(e){return(e??[]).map(e=>{let t=e.indexOf(`:`);return t===-1?{name:e}:{name:e.slice(0,t),default:e.slice(t+1)}})}function x(e){return!!(process.stdin.isTTY&&process.stdout.isTTY)&&e.json!==!0}function S(){d(`Cancelled.`),process.exitCode=1}function C(){return[{name:`template:list`,description:`List templates (builtin + local + opted-in online sources).`,options:[g,{flags:`--online`,description:`Resolve online sources (npm/git).`},{flags:`--offline`,description:`Force offline (skip npm/git).`},_,{flags:`--registry`,description:`List only the .dbx/toolchain/templates.json sources.`},{flags:`--json`,description:`Print the templates as JSON.`}],run:async(e,n)=>{let r=e.cwd??n.cwd;if(e.registry){let n=s(r).sources;if(e.json){t.raw(JSON.stringify(n.map(e=>({key:`${e.type}:${e.locate}`,...e})),null,4));return}if(n.length===0){t.info(`the template registry is empty.`);return}for(let e of n)t.info(` ${`${e.type}:${e.locate}`.padEnd(40)} ${e.name??e.id??``}`);return}let i=!!e.online&&!e.offline,a=await o({cwd:r,config:n.config,online:i}),c=e.kind,l=c?a.filter(e=>e.kind===c):a;if(e.json)t.raw(JSON.stringify(l.map(v),null,4));else if(l.length===0)t.info(`no templates found.`);else for(let e of l){let n=[e.kind,e.source.type,e.online?`online`:`offline`].join(`, `);t.info(` ${e.id.padEnd(24)} ${e.name} [${n}]${e.description?`\n ${e.description}`:``}`)}}},{name:`template:init`,description:`Write a template.json to a directory, making it a local template.`,args:[{name:`dir`,description:`Directory (default: cwd).`,required:!1}],options:[g,_,{flags:`--name <name>`,description:`Display name (default: folder name).`},{flags:`--description <text>`,description:`Description.`},{flags:`--var <pair...>`,description:`Variable name[:default] (repeatable).`},{flags:`--tag <tag...>`,description:`Tag (repeatable).`},{flags:`--force`,description:`Overwrite an existing template.json.`},{flags:`--add`,description:`Also record the folder in .dbx/toolchain/templates.json.`},{flags:`--json`,description:`Print the manifest as JSON.`}],run:(i,o)=>{let s=e.resolve(o.cwd,String(i.dir??`.`)),c=e.join(s,n);if(u.existsSync(c)&&!i.force)throw Error(`template.json already exists at ${c} (use --force).`);let l=b(i.var),d={name:String(i.name??e.basename(s)),kind:i.kind??`folder`,...i.description?{description:String(i.description)}:{},...l.length?{variables:l}:{},...i.tag?{tags:i.tag}:{}};r(s,d),i.add&&a(o.cwd,{type:`local`,locate:s,kind:d.kind}),i.json?t.raw(JSON.stringify(d,null,4)):(t.info(`wrote ${c}`),i.add&&t.info(`registered the folder as a template.`))}},{name:`template:add`,description:`Record a template source in .dbx/toolchain/templates.json.`,args:[{name:`source`,description:`local path | git URL | @scope/create | type:locate`}],options:[g,{flags:`--type <type>`,description:`Force: builtin | local | npm | git | vite-plus.`},{flags:`--name <name>`,description:`Display name.`},_,{flags:`--ref <ref>`,description:`Git branch/tag/commit.`},{flags:`--subdir <dir>`,description:`Subdirectory within the source.`},{flags:`--json`,description:`Print the updated registry as JSON.`}],run:(n,o)=>{let s=i(String(n.source),o.cwd);n.type&&(s.type=n.type),n.name&&(s.name=String(n.name)),n.kind&&(s.kind=n.kind),n.ref&&(s.ref=String(n.ref)),n.subdir&&(s.subdir=String(n.subdir)),s.type===`local`&&!u.existsSync(e.join(s.locate,`template.json`))&&r(s.locate,{name:s.name??e.basename(s.locate),kind:n.kind??`folder`});let c=a(o.cwd,s);n.json?t.raw(JSON.stringify(c,null,4)):t.info(`added ${s.type}:${s.locate} (${c.sources.length} source(s)).`)}},{name:`template:remove`,description:`Remove a source from .dbx/toolchain/templates.json.`,args:[{name:`id`,description:`Source id or type:locate.`}],options:[g,{flags:`--json`,description:`Print the registry as JSON.`}],run:(e,n)=>{let{registry:r,removed:i}=c(n.cwd,String(e.id));e.json?t.raw(JSON.stringify(r,null,4)):i===0?(t.error(`no source matching "${e.id}".`),process.exitCode=1):t.info(`removed ${i} source(s) (${r.sources.length} left).`)}},{name:`template:info`,description:`Show one template by id.`,args:[{name:`id`,description:`The template id.`}],options:[g,{flags:`--online`,description:`Resolve online sources.`},{flags:`--json`,description:`Print the template as JSON (the default).`}],run:async(e,n)=>{let r=e.cwd??n.cwd,i=(await o({cwd:r,config:n.config,online:!!e.online})).find(t=>t.id===e.id);i?t.raw(JSON.stringify(v(i),null,4)):(t.error(`unknown template "${e.id}".`),process.exitCode=1)}},{name:`create`,description:`Scaffold a project from a template (builtin, local or Vite+).`,options:[{flags:`-t, --template <id>`,description:`Template id (see template:list).`},_,{flags:`-n, --name <name>`,description:`Project / package name.`},{flags:`-s, --scope <scope>`,description:`npm scope, eg. @acme.`},{flags:`-o, --out <dir>`,description:`Output directory (default: cwd).`},g,{flags:`--var <pair...>`,description:`Template variables as key=value (repeatable).`},{flags:`--action <id...>`,description:`Action id to run after scaffolding (repeatable).`},{flags:`--online`,description:`Resolve online templates too.`},{flags:`--json`,description:`Print the result as JSON.`}],run:async(e,n)=>{let r=e.out??n.cwd,i=e.kind,a=await o({cwd:n.cwd,config:n.config,online:!0}),s=x(e),c=String(e.template??``),u=e.name,d=e.scope;if(s&&!c&&!i){if(a.length===0)throw Error("No templates available. Pass --template <id> (see `dbx template:list`).");let e=await m({message:`Pick a template`,options:a.map(e=>({value:e.id,label:e.name,...e.description?{hint:e.description}:{}}))});if(p(e))return S();c=String(e)}if(s&&!u){let e=await h({message:`Project name`,placeholder:n.config.project?.name??`app`,defaultValue:n.config.project?.name??`app`});if(p(e))return S();u=String(e)}if(s&&!d){let e=await h({message:`npm scope (optional)`,placeholder:n.config.project?.scope??`@${u??`app`}`});if(p(e))return S();d=String(e)||void 0}let g=a.find(e=>e.id===c);if(!g&&!c&&i&&(g=a.find(e=>e.kind===i)),!g&&c&&(g={id:c,name:c,kind:i??`project`,source:{type:`vite-plus`,locate:c},online:!0}),!g)throw Error("No template selected. Pass --template <id> or --kind <kind> (see `dbx template:list`).");let _={...n.config.project,name:u??n.config.project?.name??`app`,...d?{scope:d}:{}},v=y(e.var),b=new Set(e.action??[]);if(s){for(let e of g.variables??[]){if(e.name===`name`||e.name===`scope`||v[e.name]!==void 0)continue;let t=e.prompt??e.name;if(e.options&&e.options.length>0){let n=await m({message:t,options:e.options.map(e=>({value:e,label:e})),...e.default?{initialValue:e.default}:{}});if(p(n))return S();v[e.name]=String(n)}else{let n=await h({message:t,...e.default?{placeholder:e.default,defaultValue:e.default}:{}});if(p(n))return S();let r=String(n??``);v[e.name]=r||(e.default??``)}}for(let e of g.actions??[]){if(b.has(e.id))continue;let t=await f({message:e.prompt??`Run ${e.id}?`,initialValue:e.default??!1});if(p(t))return S();t&&b.add(e.id)}}let C=await l(g,{cwd:r,tokens:_,variables:v,actions:[...b]});if(e.json)t.raw(JSON.stringify({template:g.id,out:r,...C},null,4));else if(g.source.type===`vite-plus`||g.source.type===`npm`||g.source.type===`git`)C.code&&(process.exitCode=C.code);else for(let e of C.written)t.info(`Created ${e}`)}}]}export{C as templateCommands};
@@ -1,10 +1,10 @@
1
1
  import __tsdown_shims_path from 'node:path';
2
2
  import __tsdown_shims_url from 'node:url';
3
- import { Template, TemplateKind, TemplateManifest, TemplateVariable } from "./types.js";
3
+ import { Template, TemplateAction, TemplateActionContext, TemplateKind, TemplateManifest, TemplateVariable } from "./types.js";
4
4
  import { BUILTIN_TEMPLATES } from "./builtin.js";
5
5
  import { templateCommands } from "./cli/index.js";
6
6
  import { TEMPLATE_MANIFEST, isTemplateDir, loadLocalTemplates, readTemplateDir, readTemplateManifest, writeTemplateManifest } from "./local.js";
7
7
  import { gitTemplate, loadNpmTemplates, parseSourceSpec } from "./online.js";
8
8
  import { LoadTemplatesOptions, REGISTRY_DIR, REGISTRY_FILE, TemplateRegistry, addTemplateSource, collectSources, loadTemplates, readTemplateRegistry, removeTemplateSource, writeTemplateRegistry } from "./registry.js";
9
9
  import { ScaffoldOptions, ScaffoldResult, scaffoldTemplate } from "./scaffold.js";
10
- export { BUILTIN_TEMPLATES, LoadTemplatesOptions, REGISTRY_DIR, REGISTRY_FILE, ScaffoldOptions, ScaffoldResult, TEMPLATE_MANIFEST, Template, TemplateKind, TemplateManifest, TemplateRegistry, TemplateVariable, addTemplateSource, collectSources, gitTemplate, isTemplateDir, loadLocalTemplates, loadNpmTemplates, loadTemplates, parseSourceSpec, readTemplateDir, readTemplateManifest, readTemplateRegistry, removeTemplateSource, scaffoldTemplate, templateCommands, writeTemplateManifest, writeTemplateRegistry };
10
+ export { BUILTIN_TEMPLATES, LoadTemplatesOptions, REGISTRY_DIR, REGISTRY_FILE, ScaffoldOptions, ScaffoldResult, TEMPLATE_MANIFEST, Template, TemplateAction, TemplateActionContext, TemplateKind, TemplateManifest, TemplateRegistry, TemplateVariable, addTemplateSource, collectSources, gitTemplate, isTemplateDir, loadLocalTemplates, loadNpmTemplates, loadTemplates, parseSourceSpec, readTemplateDir, readTemplateManifest, readTemplateRegistry, removeTemplateSource, scaffoldTemplate, templateCommands, writeTemplateManifest, writeTemplateRegistry };
@@ -1 +1 @@
1
- import{default as e}from"node:path";import"node:url";import.meta.url;import t from"node:fs";const n=`template.json`;function r(e){try{return JSON.parse(t.readFileSync(e,`utf-8`).replace(/^\uFEFF/,``))}catch{return}}function i(r){return t.existsSync(e.join(r,n))}function a(t){return r(e.join(t,n))}function o(r,i){t.mkdirSync(r,{recursive:!0});let a=e.join(r,n);return t.writeFileSync(a,`${JSON.stringify(i,null,4)}\n`,`utf-8`),a}function s(t,n){let r=a(t);if(!r)return;let i=r.name??e.basename(t);return{id:n??e.basename(t),name:i,...r.description?{description:r.description}:{},kind:r.kind??`project`,source:{type:`local`,locate:t},...r.tags?{tags:r.tags}:{},dir:t,...r.variables?{variables:r.variables}:{},...r.tokens?{tokens:r.tokens}:{}}}function c(n,r){let a=[];if(i(n)){let e=s(n,r);e&&a.push(e)}let o;try{o=t.readdirSync(n,{withFileTypes:!0})}catch{return a}for(let t of o){if(!t.isDirectory()||t.name.startsWith(`.`))continue;let o=e.join(n,t.name);if(!i(o))continue;let c=s(o,r?`${r}/${t.name}`:t.name);c&&a.push(c)}return a}export{n as TEMPLATE_MANIFEST,i as isTemplateDir,c as loadLocalTemplates,s as readTemplateDir,a as readTemplateManifest,o as writeTemplateManifest};
1
+ import{default as e}from"node:path";import"node:url";import.meta.url;import t from"node:fs";const n=`template.json`;function r(e){try{return JSON.parse(t.readFileSync(e,`utf-8`).replace(/^\uFEFF/,``))}catch{return}}function i(r){return t.existsSync(e.join(r,n))}function a(t){return r(e.join(t,n))}function o(r,i){t.mkdirSync(r,{recursive:!0});let a=e.join(r,n);return t.writeFileSync(a,`${JSON.stringify(i,null,4)}\n`,`utf-8`),a}function s(t,n){let r=a(t);if(!r)return;let i=r.name??e.basename(t);return{id:n??e.basename(t),name:i,...r.description?{description:r.description}:{},kind:r.kind??`project`,source:{type:`local`,locate:t},...r.tags?{tags:r.tags}:{},dir:t,...r.variables?{variables:r.variables}:{},...r.actions?{actions:r.actions}:{},...r.tokens?{tokens:r.tokens}:{}}}function c(n,r){let a=[];if(i(n)){let e=s(n,r);e&&a.push(e)}let o;try{o=t.readdirSync(n,{withFileTypes:!0})}catch{return a}for(let t of o){if(!t.isDirectory()||t.name.startsWith(`.`))continue;let o=e.join(n,t.name);if(!i(o))continue;let c=s(o,r?`${r}/${t.name}`:t.name);c&&a.push(c)}return a}export{n as TEMPLATE_MANIFEST,i as isTemplateDir,c as loadLocalTemplates,s as readTemplateDir,a as readTemplateManifest,o as writeTemplateManifest};
@@ -13,12 +13,16 @@ export interface ScaffoldOptions {
13
13
  variables?: Record<string, string>;
14
14
  /** Overwrite existing files (local templates; default true). */
15
15
  overwrite?: boolean;
16
+ /** Action ids to run after writing the files (default: none). */
17
+ actions?: string[];
16
18
  }
17
19
  export interface ScaffoldResult {
18
20
  /** Absolute paths written (empty when delegated to `vp`). */
19
21
  written: string[];
20
22
  /** The `vp` exit code when the template was created through Vite+. */
21
23
  code?: number;
24
+ /** The action ids that were run after scaffolding. */
25
+ ranActions?: string[];
22
26
  }
23
27
  /** Scaffold a project (or tooling) from a template. */
24
28
  export declare function scaffoldTemplate(template: Template, options: ScaffoldOptions): Promise<ScaffoldResult>;
@@ -1 +1 @@
1
- import{default as e}from"node:path";import"node:url";import.meta.url;import{applyReplacements as t}from"../../shared/src/template.js";import"../../shared/src/index.js";import{createMonorepoRootFiles as n,createRootProjectFiles as r,createWorkspaceFiles as i,writeGeneratedFiles as a}from"../../project/src/typescript.js";import"../../project/src/index.js";import{runVp as o}from"../../vite/src/vp.js";import"../../vite/src/index.js";import{readTemplateManifest as s}from"./local.js";import c from"node:fs";const l=/* @__PURE__ */ new Set([`node_modules`,`.git`,`dist`,`.turbo`,`.dbx`,`.DS_Store`,`template.json`]);function u(e){return{...e.tokens,...e.variables}}function d(e,t){let o=u(t),s=String(o.name??`app`),c=o.scope?String(o.scope):void 0,l=[];switch(e.builtin){case`monorepo-root`:{let e=c??`@${s}`;l.push(...n({name:s,scope:e,type:`monorepo-root`,workspaces:[{alias:`core`,dir:`packages/core`}]})),l.push(...i({name:s,scope:e,wsName:`core`,wsDir:`packages/core`,type:`monorepo-workspace`}).map(e=>({...e,path:`packages/core/${e.path}`})));break}case`monorepo-workspace`:{let e=`packages/${s}`;l.push(...i({name:s,...c?{scope:c}:{},wsName:s,wsDir:e,type:`monorepo-workspace`}).map(t=>({...t,path:`${e}/${t.path}`})));break}case`folder`:l.push({path:`README.md`,content:`# ${s}\n`});break;default:l.push(...r({name:s,...c?{scope:c}:{},type:`project`}))}return{written:a(l,t.cwd)}}function f(n,r){let i=n.dir;if(!i)throw Error(`Local template "${n.id}" has no directory.`);let a=s(i),o=/* @__PURE__ */ new Set([...l,...a?.ignore??[]]),d=n.tokens?.open??`{{`,f=n.tokens?.close??`}}`,p=u(r),m=r.overwrite!==!1,h=[],g=n=>{let a=e.join(i,n);for(let s of c.readdirSync(a,{withFileTypes:!0})){if(o.has(s.name))continue;let a=n?`${n}/${s.name}`:s.name;if(s.isDirectory()){g(a);continue}let l=e.join(r.cwd,t(a,p,{open:d,close:f}));if(!m&&c.existsSync(l))continue;c.mkdirSync(e.dirname(l),{recursive:!0});let u=c.readFileSync(e.join(i,a),`utf-8`);c.writeFileSync(l,t(u,p,{open:d,close:f}),`utf-8`),h.push(l)}};return g(``),{written:h}}async function p(e,t){let n=e.source.subdir?`${e.source.locate}/${e.source.subdir}`:e.source.locate,r=[`create`];n&&r.push(n);let i=t.tokens?.name;return i&&r.push(String(i)),{written:[],code:(await o(r,{cwd:t.cwd})).code}}async function m(e,t){if(e.builtin)return d(e,t);switch(e.source.type){case`local`:return f(e,t);case`vite-plus`:case`npm`:case`git`:return p(e,t);default:throw Error(`Template "${e.id}" has no scaffold handler.`)}}export{m as scaffoldTemplate};
1
+ import{default as e}from"node:path";import{pathToFileURL as t}from"node:url";import.meta.url;import{spawnCross as n}from"../../shared/src/run.js";import{applyReplacements as r}from"../../shared/src/template.js";import"../../shared/src/index.js";import{createMonorepoRootFiles as i,createRootProjectFiles as a,createWorkspaceFiles as o,writeGeneratedFiles as s}from"../../project/src/typescript.js";import"../../project/src/index.js";import{runVp as c}from"../../vite/src/vp.js";import"../../vite/src/index.js";import{readTemplateManifest as l}from"./local.js";import u from"node:fs";import{spawn as d}from"node:child_process";const f=/* @__PURE__ */ new Set([`node_modules`,`.git`,`dist`,`.turbo`,`.dbx`,`.DS_Store`,`template.json`]);function p(e){return{...e.tokens,...e.variables}}function m(e,t=!0){return e==null||e===``?t:typeof e==`boolean`?e:![`no`,`false`,`0`,`off`].includes(String(e).toLowerCase())}function h(e,t){let n=p(t),r=String(n.name??`app`),c=n.scope?String(n.scope):void 0,l=m(n.includeConfig),u=n.packageManager?String(n.packageManager):void 0,d=[];switch(e.builtin){case`monorepo-root`:{let e=c??`@${r}`;d.push(...i({name:r,scope:e,type:`monorepo-root`,includeConfig:l,...u?{packageManager:u}:{},workspaces:[]}));break}case`monorepo-example`:{let e=c??`@${r}`;d.push(...i({name:r,scope:e,type:`monorepo-root`,includeConfig:l,...u?{packageManager:u}:{},workspaces:[{alias:`core`,dir:`packages/core`}]})),d.push(...o({name:r,scope:e,wsName:`core`,wsDir:`packages/core`,type:`monorepo-workspace`,includeConfig:l,useCatalog:!0,...u?{packageManager:u}:{}}).map(e=>({...e,path:`packages/core/${e.path}`})));break}case`monorepo-workspace`:{let e=`packages/${r}`;d.push(...o({name:r,...c?{scope:c}:{},wsName:r,wsDir:e,type:`monorepo-workspace`,includeConfig:l,...u?{packageManager:u}:{}}).map(t=>({...t,path:`${e}/${t.path}`})));break}case`folder`:d.push({path:`README.md`,content:`# ${r}\n`});break;default:d.push(...a({name:r,...c?{scope:c}:{},type:`project`,includeConfig:l,...u?{packageManager:u}:{}}))}return{written:s(d,t.cwd)}}function g(t,n){let i=t.dir;if(!i)throw Error(`Local template "${t.id}" has no directory.`);let a=l(i),o=/* @__PURE__ */ new Set([...f,...a?.ignore??[]]);for(let e of t.actions??[])e.module&&o.add(e.module.replace(/\\/g,`/`));let s=t.tokens?.open??`{{`,c=t.tokens?.close??`}}`,d=p(n),m=n.overwrite!==!1,h=[],g=t=>{let a=e.join(i,t);for(let l of u.readdirSync(a,{withFileTypes:!0})){if(o.has(l.name))continue;let a=t?`${t}/${l.name}`:l.name;if(l.isDirectory()){g(a);continue}let f=e.join(n.cwd,r(a,d,{open:s,close:c}));if(!m&&u.existsSync(f))continue;u.mkdirSync(e.dirname(f),{recursive:!0});let p=u.readFileSync(e.join(i,a),`utf-8`);u.writeFileSync(f,r(p,d,{open:s,close:c}),`utf-8`),h.push(f)}};return g(``),{written:h}}async function _(e,t){let n=e.source.subdir?`${e.source.locate}/${e.source.subdir}`:e.source.locate,r=[`create`];n&&r.push(n);let i=t.tokens?.name;return i&&r.push(String(i)),{written:[],code:(await c(r,{cwd:t.cwd})).code}}function v(e,t,r){return new Promise(i=>{let a;try{a=n(e,t,{cwd:r,stdio:`inherit`})}catch{i(1);return}a.on(`error`,()=>i(1)),a.on(`exit`,e=>i(e??0))})}function y(e,t){return new Promise(n=>{let r=d(e,{cwd:t,stdio:`inherit`,shell:!0});r.on(`error`,()=>n(1)),r.on(`exit`,e=>n(e??0))})}function b(e,t){let n=p(t),r={};for(let[e,n]of Object.entries(t.variables??{}))r[e]=n==null?``:String(n);return{cwd:t.cwd,...e.dir?{templateDir:e.dir}:{},tokens:n,variables:r,packageManager:String(n.packageManager??`yarn`),log:e=>console.log(e)}}async function x(n,r,i,a){if(r.builtin===`install`){a.log(`Installing dependencies with ${a.packageManager}…`);let e=await v(a.packageManager,[`install`],i.cwd);if(e!==0)throw Error(`\`${a.packageManager} install\` failed with exit code ${e}.`)}else if(r.module){let o=n.dir??i.cwd,s=e.resolve(o,r.module);if(!u.existsSync(s))throw Error(`template action module not found: ${r.module}`);let c=await import(t(s).href),l=c.default??c.run;if(typeof l!=`function`)throw Error(`template action module "${r.module}" does not export a function.`);await l(a)}else if(r.command){let e=await y(r.command,i.cwd);if(e!==0)throw Error(`template command failed with exit code ${e}: ${r.command}`)}else throw Error(`template action "${r.id}" declares no builtin, module or command.`)}async function S(e,t){let n=new Set(t.actions??[]),r=[];for(let i of e.actions??[])n.has(i.id)&&(await x(e,i,t,b(e,t)),r.push(i.id));return r}async function C(e,t){if(e.builtin){let n=h(e,t),r=await S(e,t);return r.length>0?{...n,ranActions:r}:n}switch(e.source.type){case`local`:{let n=g(e,t),r=await S(e,t);return r.length>0?{...n,ranActions:r}:n}case`vite-plus`:case`npm`:case`git`:return _(e,t);default:throw Error(`Template "${e.id}" has no scaffold handler.`)}}export{C as scaffoldTemplate};
@@ -1,11 +1,49 @@
1
1
  import __tsdown_shims_path from 'node:path';
2
2
  import __tsdown_shims_url from 'node:url';
3
3
  import { ToolchainTemplateKind, ToolchainTemplateSource } from "../../shared/src/config-types.js";
4
+ import { Replacements } from "../../shared/src/template.js";
4
5
  import "../../shared/src/index.js";
5
6
  //#region packages/template/src/types.d.ts
6
7
  /** What a template produces (shared with the registry source model). */
7
8
  export type TemplateKind = ToolchainTemplateKind;
8
- /** A value a local template prompts for / substitutes. */
9
+ /** The context handed to a template action. */
10
+ export interface TemplateActionContext {
11
+ /** The output directory the template was written to. */
12
+ cwd: string;
13
+ /** The template's source directory (local templates only). */
14
+ templateDir?: string;
15
+ /** The resolved replacement tokens. */
16
+ tokens: Replacements;
17
+ /** The resolved variable values. */
18
+ variables: Record<string, string>;
19
+ /** The selected package manager (default `yarn`). */
20
+ packageManager: string;
21
+ /** Log a line. */
22
+ log: (message: string) => void;
23
+ }
24
+ /**
25
+ * A post-scaffold action a template can declare. The built-in templates use it
26
+ * for the opt-in **Install dependencies?** step (`builtin: 'install'`); a local
27
+ * template can run its own logic through a JS `module` or a shell `command`.
28
+ */
29
+ export interface TemplateAction {
30
+ /** Stable id (also the key used by `--action <id>`). */
31
+ id: string;
32
+ /** Prompt text shown when interactive (default: `Run <id>?`). */
33
+ prompt?: string;
34
+ /** Whether the action runs by default (default false — opt-in). */
35
+ default?: boolean;
36
+ /** A builtin action to run (eg. `install`). */
37
+ builtin?: 'install';
38
+ /**
39
+ * Local templates: a JS module path relative to the template directory whose
40
+ * default export is `async (ctx: TemplateActionContext) => void`.
41
+ */
42
+ module?: string;
43
+ /** Local templates: a shell command run in the output directory. */
44
+ command?: string;
45
+ }
46
+ /** A value a template prompts for / substitutes. */
9
47
  export interface TemplateVariable {
10
48
  /** The token name (also the `{{ token }}` used in files). */
11
49
  name: string;
@@ -13,6 +51,13 @@ export interface TemplateVariable {
13
51
  prompt?: string;
14
52
  /** Default value. */
15
53
  default?: string;
54
+ /**
55
+ * A fixed set of choices: when present the value is picked from a select
56
+ * rather than typed, and must be one of these (eg. `['yes', 'no']`).
57
+ */
58
+ options?: string[];
59
+ /** Whether a value is required (default false). */
60
+ required?: boolean;
16
61
  }
17
62
  /** A resolved template (builtin, local directory, or an online source). */
18
63
  export interface Template {
@@ -28,11 +73,13 @@ export interface Template {
28
73
  /** Whether creating from it needs network access. */
29
74
  online?: boolean;
30
75
  /** Builtin templates only: which local generator to run. */
31
- builtin?: 'single' | 'application' | 'folder' | 'monorepo-root' | 'monorepo-workspace';
76
+ builtin?: 'single' | 'application' | 'folder' | 'monorepo-root' | 'monorepo-example' | 'monorepo-workspace';
32
77
  /** Local templates only: the absolute directory holding `template.json`. */
33
78
  dir?: string;
34
79
  /** Variables a local template declares. */
35
80
  variables?: TemplateVariable[];
81
+ /** Post-scaffold actions (install, custom JS/shell steps). */
82
+ actions?: TemplateAction[];
36
83
  /** The token prefix used by a local template's files (default `{{`/`}}`). */
37
84
  tokens?: {
38
85
  open?: string;
@@ -46,6 +93,8 @@ export interface TemplateManifest {
46
93
  kind?: TemplateKind;
47
94
  tags?: string[];
48
95
  variables?: TemplateVariable[];
96
+ /** Post-scaffold actions. */
97
+ actions?: TemplateAction[];
49
98
  /** Globs/paths (relative) never copied. */
50
99
  ignore?: string[];
51
100
  /** Commands to run after scaffolding (documentation only for now). */
@@ -2,9 +2,9 @@ import __tsdown_shims_path from 'node:path';
2
2
  import __tsdown_shims_url from 'node:url';
3
3
  import { VP_COMMANDS, VpCommandInfo, VpGroup, resolveVpCommand, viteCommandName } from "./commands.js";
4
4
  import { runGuard, viteCommands } from "./cli/index.js";
5
- import { DBX_TASKS, DBX_TIMEOUT_MS, DbxPluginOptions, DbxSource, ResolvedDbx, dbx, dbxTaskCommand, resolveDbx, runDbx } from "./plugin.js";
5
+ import { DBX_TASKS, DBX_TIMEOUT_MS, DbxPluginOptions, DbxSource, DbxTask, ResolvedDbx, dbx, dbxTaskCommand, resolveDbx, runDbx } from "./plugin.js";
6
6
  import { viteProvider } from "./provider.js";
7
7
  import { ResolveViteInput, ResolveViteOptions, resolveVite } from "./resolve.js";
8
8
  import { VITE_CONFIG_SHIM, renderViteConfig, viteConfigObject, viteSyncTask } from "./sync.js";
9
9
  import { ResolvedVp, RunVpOptions, VpResult, VpSource, describeVp, hasVp, resolveVp, runVp, vpVersion, which } from "./vp.js";
10
- export { DBX_TASKS, DBX_TIMEOUT_MS, DbxPluginOptions, DbxSource, ResolveViteInput, ResolveViteOptions, ResolvedDbx, ResolvedVp, RunVpOptions, VITE_CONFIG_SHIM, VP_COMMANDS, VpCommandInfo, VpGroup, VpResult, VpSource, dbx, dbxTaskCommand, describeVp, hasVp, renderViteConfig, resolveDbx, resolveVite, resolveVp, resolveVpCommand, runDbx, runGuard, runVp, viteCommandName, viteCommands, viteConfigObject, viteProvider, viteSyncTask, vpVersion, which };
10
+ export { DBX_TASKS, DBX_TIMEOUT_MS, DbxPluginOptions, DbxSource, DbxTask, ResolveViteInput, ResolveViteOptions, ResolvedDbx, ResolvedVp, RunVpOptions, VITE_CONFIG_SHIM, VP_COMMANDS, VpCommandInfo, VpGroup, VpResult, VpSource, dbx, dbxTaskCommand, describeVp, hasVp, renderViteConfig, resolveDbx, resolveVite, resolveVp, resolveVpCommand, runDbx, runGuard, runVp, viteCommandName, viteCommands, viteConfigObject, viteProvider, viteSyncTask, vpVersion, which };