@deltabox/toolchain 1.7.8 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +147 -3
- package/dist/changelog.d.ts +3 -2
- package/dist/changelog.js +1 -1
- package/dist/cli/commands/shared.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/register.js +1 -1
- package/dist/core.d.ts +3 -3
- package/dist/core.js +1 -1
- package/dist/index.d.ts +10 -8
- package/dist/index.js +1 -1
- package/dist/package.js +1 -1
- package/dist/packages/changelog/src/index.d.ts +4 -3
- package/dist/packages/changelog/src/index.js +1 -1
- package/dist/packages/changelog/src/sync.d.ts +6 -2
- package/dist/packages/changelog/src/sync.js +1 -1
- package/dist/packages/changelog/src/utils/git.d.ts +2 -2
- package/dist/packages/changelog/src/utils/git.js +1 -1
- package/dist/packages/changelog/src/utils/graph.d.ts +23 -0
- package/dist/packages/changelog/src/utils/graph.js +1 -0
- package/dist/packages/changelog/src/utils/versioning.js +1 -1
- package/dist/packages/changelog/src/utils/write.js +1 -1
- package/dist/packages/changelog/src/workflows.d.ts +6 -2
- package/dist/packages/changelog/src/workflows.js +4 -4
- package/dist/packages/core/src/gitignore.d.ts +7 -1
- package/dist/packages/core/src/gitignore.js +1 -1
- package/dist/packages/core/src/graph.js +1 -1
- package/dist/packages/core/src/index.d.ts +4 -4
- package/dist/packages/core/src/index.js +1 -1
- package/dist/packages/core/src/loader.d.ts +30 -4
- package/dist/packages/core/src/loader.js +1 -1
- package/dist/packages/core/src/project-type.d.ts +8 -1
- package/dist/packages/core/src/project-type.js +1 -1
- package/dist/packages/core/src/sync.d.ts +1 -1
- package/dist/packages/core/src/sync.js +1 -1
- package/dist/packages/core/src/watch.d.ts +4 -0
- package/dist/packages/core/src/watch.js +1 -1
- package/dist/packages/migrate/src/cli/index.d.ts +4 -0
- package/dist/packages/migrate/src/cli/index.js +1 -1
- package/dist/packages/migrate/src/types.d.ts +11 -0
- package/dist/packages/migrate/src/vite.js +2 -1
- package/dist/packages/project/src/cli/index.js +1 -1
- package/dist/packages/project/src/index.d.ts +3 -2
- package/dist/packages/project/src/index.js +1 -1
- package/dist/packages/project/src/sync.d.ts +14 -0
- package/dist/packages/project/src/sync.js +1 -0
- package/dist/packages/project/src/typescript.js +1 -1
- package/dist/packages/shared/src/config-schema.d.ts +148 -77
- package/dist/packages/shared/src/config-schema.js +1 -1
- package/dist/packages/shared/src/config-types.d.ts +78 -16
- package/dist/packages/shared/src/ignore.d.ts +38 -0
- package/dist/packages/shared/src/ignore.js +1 -0
- package/dist/packages/shared/src/index.d.ts +9 -7
- package/dist/packages/shared/src/index.js +1 -1
- package/dist/packages/shared/src/project.d.ts +25 -0
- package/dist/packages/shared/src/project.js +1 -0
- package/dist/packages/shared/src/toolchain.d.ts +13 -2
- package/dist/packages/shared/src/toolchain.js +1 -1
- package/dist/packages/shared/src/types.d.ts +9 -2
- package/dist/packages/tsconfig/src/cli/generate/index.d.ts +16 -9
- package/dist/packages/tsconfig/src/cli/generate/index.js +1 -1
- package/dist/packages/tsconfig/src/cli/generate/utils.js +1 -1
- package/dist/packages/tsconfig/src/cli/index.d.ts +1 -1
- package/dist/packages/tsconfig/src/cli/index.js +1 -1
- package/dist/packages/tsconfig/src/sync.d.ts +4 -5
- package/dist/packages/tsconfig/src/sync.js +1 -1
- package/dist/packages/tsconfig/src/templates/tsconfig.default.js +1 -1
- package/dist/packages/tsconfig/src/templates.d.ts +1 -1
- package/dist/packages/vite/src/index.d.ts +2 -2
- package/dist/packages/vite/src/resolve.d.ts +8 -3
- package/dist/packages/vite/src/resolve.js +1 -1
- package/dist/packages/vite/src/sync.js +1 -1
- package/dist/project.d.ts +2 -1
- package/dist/project.js +1 -1
- package/dist/shared.d.ts +8 -6
- package/dist/shared.js +1 -1
- package/dist/sync.js +1 -1
- package/dist/vite.d.ts +2 -2
- package/package.json +16 -14
- package/scripts/bootstrap.mjs +55 -0
|
@@ -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.`).optional(),scope:e.string().describe("The npm scope, eg. `@acme`.").optional(),author:e.string().describe(`Package author.`).optional(),license:e.string().describe(`SPDX license id.`).optional(),homepage:e.string().describe(`Project homepage.`).optional(),repo:e.string().describe("Repository URL, eg. `https://github.com/acme/app`.").optional(),nodeVersion:e.string().describe("Node engine range, eg. `>=22`.").optional(),packageManager:e.string().describe("Package manager name (default `yarn`).").optional(),packageManagerVersion:e.string().describe("Package manager version, eg. `4.17.1`.").optional(),description:e.string().describe(`One-line description.`).optional()}).meta({id:`ToolchainProjectConfig`}),r=e.object({name:e.string().optional(),id:e.string().optional(),if:e.string().optional(),uses:e.string().optional(),run:e.string().optional(),shell:e.string().optional(),"working-directory":e.string().optional(),with:e.record(e.string(),e.union([e.string(),e.number(),e.boolean()])).optional(),env:e.record(e.string(),e.string()).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(),a]).meta({id:`WorkflowSetting`}),s=e.object({ci:o.optional(),changelog:o.optional(),release:o.optional(),issues:o.optional(),sync:o.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`.").optional(),branches:e.object({main:e.string().optional(),dev:e.string().optional()}).describe(`Branch names the 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(),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.string().describe("Glob for workspace `tsconfig.default.json` files.").optional(),appGlob:e.string().describe(`Glob for "override" (app) workspaces.`).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 monorepo tsconfig file name (default `tsconfig.monorepo.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()}).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:_,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.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.optional(),changelog:S(d).optional(),biome:S(f).optional(),tsconfig:S(p).optional(),templates:S(b).optional(),vite:S(x).optional(),watch:S(m).optional(),logger:S(h).optional(),providers:S(g).optional()}).meta({id:`ToolchainConfigSections`}),w=e.object({toolchain:C.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 used as replacement tokens across every template.`,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({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};
|
|
@@ -5,36 +5,53 @@ import { ViteUserConfig } from "vite-plus";
|
|
|
5
5
|
export type ProjectType = 'monorepo-root' | 'monorepo-workspace' | 'project';
|
|
6
6
|
export interface ToolchainProjectConfig {
|
|
7
7
|
type?: ProjectType;
|
|
8
|
-
/** The unscoped project name. */
|
|
8
|
+
/** The unscoped project name (written as `<scope>/<name>`). */
|
|
9
9
|
name?: string;
|
|
10
10
|
/** The npm scope, eg. `@acme`. */
|
|
11
11
|
scope?: string;
|
|
12
|
-
/** Package author. */
|
|
12
|
+
/** Package author (`package.json` `author`). */
|
|
13
13
|
author?: string;
|
|
14
|
-
/** SPDX license id. */
|
|
14
|
+
/** SPDX license id (`package.json` `license`). */
|
|
15
15
|
license?: string;
|
|
16
|
-
/** Project homepage. */
|
|
16
|
+
/** Project homepage (`package.json` `homepage`). */
|
|
17
17
|
homepage?: string;
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* Repository URL (`package.json` `repository`). For a workspace it also resolves to the workspace
|
|
20
|
+
* path (`repository.directory`).
|
|
21
|
+
*/
|
|
19
22
|
repo?: string;
|
|
20
|
-
/** Node
|
|
23
|
+
/** Node version for CI/templates, eg. `22` (not `package.json` `engines`). */
|
|
21
24
|
nodeVersion?: string;
|
|
22
|
-
/** Package manager name (default `yarn`). */
|
|
25
|
+
/** Package manager name, written as `<name>@<version>` (default `yarn`). */
|
|
23
26
|
packageManager?: string;
|
|
24
27
|
/** Package manager version, eg. `4.17.1`. */
|
|
25
28
|
packageManagerVersion?: string;
|
|
26
|
-
/** One-line description. */
|
|
29
|
+
/** One-line description (`package.json` `description`). */
|
|
27
30
|
description?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Inherit the parent project metadata (default true). Set false to keep this project entirely
|
|
33
|
+
* independent of the root config.
|
|
34
|
+
*/
|
|
35
|
+
inherit?: boolean;
|
|
28
36
|
}
|
|
29
37
|
export interface WorkflowStep {
|
|
38
|
+
/** Step display name. */
|
|
30
39
|
name?: string;
|
|
40
|
+
/** Step id (for `steps.<id>` outputs). */
|
|
31
41
|
id?: string;
|
|
42
|
+
/** Conditional expression (`if:`). */
|
|
32
43
|
if?: string;
|
|
44
|
+
/** Action to run (`uses:`), eg. `actions/checkout@v4`. */
|
|
33
45
|
uses?: string;
|
|
46
|
+
/** Shell command(s) to run (`run:`). */
|
|
34
47
|
run?: string;
|
|
48
|
+
/** Shell to run `run` in, eg. `bash`. */
|
|
35
49
|
shell?: string;
|
|
50
|
+
/** Directory the step runs in. */
|
|
36
51
|
'working-directory'?: string;
|
|
52
|
+
/** Inputs for a `uses` action. */
|
|
37
53
|
with?: Record<string, string | number | boolean>;
|
|
54
|
+
/** Environment variables for the step. */
|
|
38
55
|
env?: Record<string, string>;
|
|
39
56
|
}
|
|
40
57
|
export interface WorkflowStepsConfig {
|
|
@@ -63,7 +80,7 @@ export interface WorkflowConfig {
|
|
|
63
80
|
/** Per-workflow token overrides (`nodeVersion`, `packageManager`, ...). */
|
|
64
81
|
tokens?: Record<string, string | number | boolean>;
|
|
65
82
|
}
|
|
66
|
-
export type WorkflowSetting = boolean | WorkflowConfig;
|
|
83
|
+
export type WorkflowSetting = boolean | string | WorkflowConfig;
|
|
67
84
|
export interface ChangelogWorkflowsConfig {
|
|
68
85
|
ci?: WorkflowSetting;
|
|
69
86
|
changelog?: WorkflowSetting;
|
|
@@ -87,13 +104,25 @@ export interface ToolchainChangelogConfig {
|
|
|
87
104
|
enabled?: boolean;
|
|
88
105
|
workflows?: ChangelogWorkflowsConfig;
|
|
89
106
|
branches?: {
|
|
90
|
-
main
|
|
91
|
-
|
|
107
|
+
/** Branch glob(s) the CI + release workflows run on, and the release PR base (default `["main"]`). */
|
|
108
|
+
main?: string | Array<string>;
|
|
109
|
+
/**
|
|
110
|
+
* Branch glob(s) the changelog/version workflow runs on. No default: when omitted it reuses
|
|
111
|
+
* `main` (so a single-branch repo needs no `dev`).
|
|
112
|
+
*/
|
|
113
|
+
dev?: string | Array<string>;
|
|
92
114
|
};
|
|
93
115
|
/** Allowed commit types (commitlint). */
|
|
94
116
|
types?: Array<string>;
|
|
95
117
|
/** Allowed commit scopes (commitlint). */
|
|
96
118
|
scopes?: Array<string>;
|
|
119
|
+
commitlint?: {
|
|
120
|
+
/**
|
|
121
|
+
* Directory the generated `commitlint.config.mjs` is written to (default: the project root). The
|
|
122
|
+
* husky hook and CI use `--config` to point at it.
|
|
123
|
+
*/
|
|
124
|
+
dir?: string;
|
|
125
|
+
};
|
|
97
126
|
versioning?: ChangelogVersioning;
|
|
98
127
|
/** Write the Conventional-Commits VS Code settings. */
|
|
99
128
|
vscode?: boolean;
|
|
@@ -109,10 +138,18 @@ export interface ToolchainBiomeConfig {
|
|
|
109
138
|
export interface ToolchainTsconfigConfig {
|
|
110
139
|
/** Master switch (enabled when the section is defined). */
|
|
111
140
|
enabled?: boolean;
|
|
112
|
-
/**
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
141
|
+
/**
|
|
142
|
+
* Glob(s) for the workspace default tsconfig files. Defaults to matching every `defaultFile`
|
|
143
|
+
* recursively.
|
|
144
|
+
*/
|
|
145
|
+
glob?: string | Array<string>;
|
|
146
|
+
/**
|
|
147
|
+
* Glob(s) to exclude from `glob`. Defaults to the common ignored paths (`node_modules`, `.dbx`,
|
|
148
|
+
* `dist`, `build`, ...).
|
|
149
|
+
*/
|
|
150
|
+
exclude?: string | Array<string>;
|
|
151
|
+
/** Also respect `.gitignore` files (root + nested) when matching `glob` (default true). */
|
|
152
|
+
gitignore?: boolean;
|
|
116
153
|
/** Wire project references (default false). */
|
|
117
154
|
refs?: boolean;
|
|
118
155
|
/** Emit `composite: true` (default false). */
|
|
@@ -121,14 +158,31 @@ export interface ToolchainTsconfigConfig {
|
|
|
121
158
|
aliases?: boolean;
|
|
122
159
|
/** JSON indentation (default 4). */
|
|
123
160
|
indent?: number;
|
|
124
|
-
/**
|
|
161
|
+
/**
|
|
162
|
+
* The workspaces tsconfig file name that holds `paths` + `references` (default
|
|
163
|
+
* `tsconfig.workspaces.json`).
|
|
164
|
+
*/
|
|
125
165
|
rootFile?: string;
|
|
166
|
+
/**
|
|
167
|
+
* The workspace default tsconfig file name that the generator expands (default
|
|
168
|
+
* `tsconfig.default.json`).
|
|
169
|
+
*/
|
|
170
|
+
defaultFile?: string;
|
|
171
|
+
/** The workspace build tsconfig file name (default `tsconfig.build.json`). */
|
|
172
|
+
buildFile?: string;
|
|
126
173
|
}
|
|
127
174
|
export interface ToolchainWatchConfig {
|
|
128
175
|
/** Watch by default (enabled when the section is defined). */
|
|
129
176
|
enabled?: boolean;
|
|
130
177
|
/** Debounce window in ms (default 150). */
|
|
131
178
|
debounce?: number;
|
|
179
|
+
/**
|
|
180
|
+
* Glob(s) excluded from watching. Defaults to the common ignored paths (`node_modules`, `.dbx`,
|
|
181
|
+
* `dist`, `build`, ...).
|
|
182
|
+
*/
|
|
183
|
+
exclude?: string | Array<string>;
|
|
184
|
+
/** Also respect `.gitignore` files (root + nested) when watching (default true). */
|
|
185
|
+
gitignore?: boolean;
|
|
132
186
|
}
|
|
133
187
|
export type ToolchainTemplateSourceType = 'builtin' | 'local' | 'npm' | 'git' | 'vite-plus';
|
|
134
188
|
export type ToolchainTemplateKind = 'project' | 'workspace' | 'application' | 'folder' | 'tooling' | 'pipeline';
|
|
@@ -181,13 +235,21 @@ export interface ToolchainProvidersConfig {
|
|
|
181
235
|
}
|
|
182
236
|
export interface ToolchainConfigSections {
|
|
183
237
|
project?: ToolchainProjectConfig;
|
|
238
|
+
/** Conventional-Commits CI, commitlint and the changelog pipeline. */
|
|
184
239
|
changelog?: boolean | ToolchainChangelogConfig;
|
|
240
|
+
/** Biome config generation (for consumers that still want a `biome.json`). */
|
|
185
241
|
biome?: boolean | ToolchainBiomeConfig;
|
|
242
|
+
/** Workspace tsconfig generation (path aliases + project references). */
|
|
186
243
|
tsconfig?: boolean | ToolchainTsconfigConfig;
|
|
244
|
+
/** Template sources / scaffolding. */
|
|
187
245
|
templates?: boolean | ToolchainTemplatesConfig;
|
|
246
|
+
/** The full Vite+ config; `dbx sync` writes the root `vite.config.ts` from it. */
|
|
188
247
|
vite?: boolean | ToolchainViteConfig;
|
|
248
|
+
/** Watch behaviour for `dbx watch`. */
|
|
189
249
|
watch?: boolean | ToolchainWatchConfig;
|
|
250
|
+
/** Logging level, colours and prefix for toolchain output. */
|
|
190
251
|
logger?: boolean | ToolchainLoggerConfig;
|
|
252
|
+
/** Provider command behaviour (eg. colour for the passthrough commands). */
|
|
191
253
|
providers?: boolean | ToolchainProvidersConfig;
|
|
192
254
|
}
|
|
193
255
|
export interface DbxConfigSections {
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
//#region packages/shared/src/ignore.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Path ignoring for the glob-based consumers (`tsconfig`, `watch`).
|
|
6
|
+
*
|
|
7
|
+
* Every ignore list starts from {@link DEFAULT_IGNORE_PATTERNS} (the common
|
|
8
|
+
* build/dependency dirs), the consumer's `exclude` globs are appended, and — when
|
|
9
|
+
* `gitignore` is on (the default) — the repo's `.gitignore` files are folded in
|
|
10
|
+
* (root **and nested**, each scoped to its own directory, like git).
|
|
11
|
+
*/
|
|
12
|
+
/** The common paths always ignored (dependency/build/cache dirs). */
|
|
13
|
+
export declare const DEFAULT_IGNORE_PATTERNS: readonly string[];
|
|
14
|
+
/** Options shared by the `tsconfig` / `watch` ignore resolution. */
|
|
15
|
+
export interface IgnoreOptions {
|
|
16
|
+
/** Extra glob(s) to exclude on top of the defaults. */
|
|
17
|
+
exclude?: string | string[];
|
|
18
|
+
/** Respect `.gitignore` files (default true). */
|
|
19
|
+
gitignore?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Collect the ignore globs from every `.gitignore` in the tree (root + nested),
|
|
23
|
+
* each scoped to its own directory.
|
|
24
|
+
*
|
|
25
|
+
* The walk is manual (not `readdirSync({ recursive: true })`, which **follows
|
|
26
|
+
* symlinks/junctions** and would loop forever on a self-link such as a
|
|
27
|
+
* `portal:.` / `portal:../..` workspace dependency). Symlinks are never followed
|
|
28
|
+
* and ignored directories are never descended into.
|
|
29
|
+
*/
|
|
30
|
+
export declare function collectGitignorePatterns(cwd?: string): string[];
|
|
31
|
+
/**
|
|
32
|
+
* The full ignore list for a consumer: the defaults, plus `exclude`, plus (when
|
|
33
|
+
* `gitignore` is on) the tree's `.gitignore` globs.
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolveIgnorePatterns(cwd?: string, options?: IgnoreOptions): string[];
|
|
36
|
+
/** Whether a repo-relative path matches any of the ignore globs. */
|
|
37
|
+
export declare function isIgnoredPath(relativePath: string, patterns: readonly string[]): boolean;
|
|
38
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{default as e}from"node:path";import"node:url";import.meta.url;import t from"node:fs";const n=[`**/node_modules/**`,`**/.git/**`,`**/.dbx/**`,`**/dist/**`,`**/build/**`,`**/out/**`,`**/coverage/**`,`**/.turbo/**`,`**/.yarn/**`,`**/.next/**`,`**/.cache/**`,`**/.output/**`,`**/.vite/**`,`**/.nyc_output/**`,`**/*.tsbuildinfo`],r=/* @__PURE__ */ new Set([`node_modules`,`.git`,`.dbx`,`dist`,`build`,`out`,`coverage`,`.turbo`,`.yarn`,`.next`,`.cache`,`.output`,`.vite`]);function i(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function a(e,t){let n=e.trim();if(!n||n.startsWith(`#`)||n.startsWith(`!`))return[];n.endsWith(`/`)&&(n=n.replace(/\/+$/,``));let r=n.startsWith(`/`);if(r&&(n=n.slice(1)),!n)return[];let i=t?`${t}/`:``,a=`${r?i:`${i}**/`}${n}`;return a.endsWith(`/**`)?[a]:[a,`${a}/**`]}function o(e,n){let r;try{r=t.readFileSync(e,`utf-8`)}catch{return[]}let i=[];for(let e of r.split(/\r?\n/))i.push(...a(e,n));return i}function s(n=process.cwd()){let i=[],a=e.join(n,`.gitignore`);t.existsSync(a)&&i.push(...o(a,``));let s=a=>{let c;try{c=t.readdirSync(a,{withFileTypes:!0})}catch{return}for(let t of c){if(t.isSymbolicLink())continue;let c=e.join(a,t.name);if(t.isDirectory()){if(r.has(t.name))continue;s(c)}else if(t.isFile()&&t.name===`.gitignore`){let t=e.relative(n,a).replace(/\\/g,`/`);if(t===``)continue;i.push(...o(c,t))}}};return s(n),i}function c(e=process.cwd(),t={}){let r=[...n,...i(t.exclude)];return t.gitignore!==!1&&r.push(...s(e)),r}function l(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];r===`*`?e[n+1]===`*`?e[n+2]===`/`?(t+=`(?:.*/)?`,n+=2):(t+=`.*`,n+=1):t+=`[^/]*`:r===`?`?t+=`[^/]`:".+^${}()|[]\\".includes(r)?t+=`\\${r}`:t+=r}return RegExp(`^${t}$`)}function u(e,t){let n=e.replace(/\\/g,`/`).replace(/^\.\//,``);for(let e of t){let t=l(e);if(t.test(n)||t.test(`${n}/`))return!0}return!1}export{n as DEFAULT_IGNORE_PATTERNS,s as collectGitignorePatterns,u as isIgnoredPath,c as resolveIgnorePatterns};
|
|
@@ -2,19 +2,21 @@ import __tsdown_shims_path from 'node:path';
|
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
3
|
import { TOOLCHAIN_PACKAGE, findOwnCliEntry, localToolchainVersion } from "./bin.js";
|
|
4
4
|
import { mergeJsonAt, readJsonAt, readJsonFile, toJson, writeJsonFile } from "./fs-utils.js";
|
|
5
|
+
import { DEFAULT_IGNORE_PATTERNS, IgnoreOptions, collectGitignorePatterns, isIgnoredPath, resolveIgnorePatterns } from "./ignore.js";
|
|
5
6
|
import { Colors, LOG_LEVELS, LogChannel, LogLevel, Logger, LoggerConfig, LoggerOptions, configureLogger, createLogger, getLogOverrides, getLogger, isLogLevel, logger, normalizeLogLevel, setLogConfig, setLogOverrides, stripAnsi } from "./logger.js";
|
|
6
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";
|
|
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";
|
|
11
|
+
import { CONFIG_FILE_NAMES, DbxConfig, ManagedFile, SyncContext, SyncSummary, SyncTask, ToolchainConfig, ToolchainHooks, ToolchainSection, defineConfig, repoSlugFromUrl, resolveChangelogBranches, resolveTokens, sectionConfig, sectionEnabled } from "./toolchain.js";
|
|
12
|
+
import { Awaitable, GeneratedFile, JsonValue, PackageJson, ToolchainArgument, ToolchainCommand, ToolchainCommandContext, ToolchainOption } from "./types.js";
|
|
13
|
+
import { projectFromPackageJson, projectToPackageJson, splitPackageName } from "./project.js";
|
|
7
14
|
import { ToolchainProvider, ToolchainProviderAction, ToolchainProviderCommand, providerActions } from "./provider.js";
|
|
8
15
|
import { RunOptions, SpawnCrossOptions, killProcessTree, run, spawnCross } from "./run.js";
|
|
9
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";
|
|
10
|
-
import { ReplacementOptions, ReplacementValue, Replacements, Replacer, applyReplacements, applyReplacementsDeep, createReplacer, defineReplacements, extractTokens, hasUnresolvedTokens, tokenPattern } from "./template.js";
|
|
11
|
-
import { ChangelogVersioning, ChangelogVersioningConfig, ChangelogVersioningTarget, ChangelogWorkflowsConfig, DbxConfigSections, ProjectType, ToolchainBiomeConfig, ToolchainChangelogConfig, ToolchainConfigSections, ToolchainLoggerConfig, ToolchainProjectConfig, ToolchainProvidersConfig, ToolchainTemplateKind, ToolchainTemplateSource, ToolchainTemplateSourceType, ToolchainTemplatesConfig, ToolchainTsconfigConfig, ToolchainViteConfig, ToolchainWatchConfig, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig } from "./config-types.js";
|
|
12
|
-
import { Awaitable, GeneratedFile, JsonValue, PackageJson, ToolchainArgument, ToolchainCommand, ToolchainCommandContext, ToolchainOption } from "./types.js";
|
|
13
|
-
import { CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, biomeConfigSchema, changelogConfigSchema, changelogVersioningConfigSchema, changelogVersioningSchema, changelogVersioningTargetSchema, changelogWorkflowsConfigSchema, dbxConfigSchema, loggerConfigSchema, projectConfigSchema, projectTypeSchema, providersConfigSchema, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema } from "./config-schema.js";
|
|
14
|
-
import { CONFIG_FILE_NAMES, DbxConfig, ManagedFile, SyncContext, SyncSummary, SyncTask, ToolchainConfig, ToolchainHooks, ToolchainSection, defineConfig, repoSlugFromUrl, resolveTokens, sectionConfig, sectionEnabled } from "./toolchain.js";
|
|
15
17
|
import { YamlValue, toYaml } from "./yaml.js";
|
|
16
18
|
declare namespace index_d_exports {
|
|
17
|
-
export { Awaitable, CONFIG_FILE_NAMES, CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, ChangelogVersioning, ChangelogVersioningConfig, ChangelogVersioningTarget, ChangelogWorkflowsConfig, Colors, DbxConfig, DbxConfigSections, GeneratedFile, 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, configureLogger, constantCase, createLogger, createReplacer, dbxConfigSchema, deepMerge, defineConfig, defineReplacements, ensureLeadingSlash, ensureSlashes, ensureTrailingSlash, extractTokens, findOwnCliEntry, formatCliFlag, getLogOverrides, getLogger, hasText, hasUnresolvedTokens, indent, isLocalhost, isLogLevel, isPlainObject, kebabCase, killProcessTree, localToolchainVersion, logger, loggerConfigSchema, mapValues, mergeJsonAt, normalizeLogLevel, pascalCase, projectConfigSchema, projectTypeSchema, providerActions, providersConfigSchema, readJsonAt, readJsonFile, removeDoubleSlashes, removeLeadingSlash, removeTrailingSlash, repoSlugFromUrl, resolveSort, resolveTokens, run, sanitizeSlashes, sanitizeText, sectionConfig, sectionEnabled, setLogConfig, setLogOverrides, snakeCase, sort, spawnCross, 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, 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 };
|
|
18
20
|
}
|
|
19
21
|
//#endregion
|
|
20
|
-
export { Awaitable, CONFIG_FILE_NAMES, CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, ChangelogVersioning, ChangelogVersioningConfig, ChangelogVersioningTarget, ChangelogWorkflowsConfig, Colors, DbxConfig, DbxConfigSections, GeneratedFile, 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, configureLogger, constantCase, createLogger, createReplacer, dbxConfigSchema, deepMerge, defineConfig, defineReplacements, ensureLeadingSlash, ensureSlashes, ensureTrailingSlash, extractTokens, findOwnCliEntry, formatCliFlag, getLogOverrides, getLogger, hasText, hasUnresolvedTokens, indent, index_d_exports, isLocalhost, isLogLevel, isPlainObject, kebabCase, killProcessTree, localToolchainVersion, logger, loggerConfigSchema, mapValues, mergeJsonAt, normalizeLogLevel, pascalCase, projectConfigSchema, projectTypeSchema, providerActions, providersConfigSchema, readJsonAt, readJsonFile, removeDoubleSlashes, removeLeadingSlash, removeTrailingSlash, repoSlugFromUrl, resolveSort, resolveTokens, run, sanitizeSlashes, sanitizeText, sectionConfig, sectionEnabled, setLogConfig, setLogOverrides, snakeCase, sort, spawnCross, 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, 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 };
|
|
@@ -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{
|
|
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};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { ToolchainProjectConfig } from "./config-types.js";
|
|
4
|
+
import { PackageJson } from "./types.js";
|
|
5
|
+
//#region packages/shared/src/project.d.ts
|
|
6
|
+
/** Split a package name into its unscoped name + scope (`@acme/app` -> `app`/`@acme`). */
|
|
7
|
+
export declare function splitPackageName(pkgName: string | undefined): {
|
|
8
|
+
name?: string;
|
|
9
|
+
scope?: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Derive the project metadata from a `package.json`. Used as the fallback when a
|
|
13
|
+
* `dbx.config.project` field is not defined (and to seed a generated config).
|
|
14
|
+
*/
|
|
15
|
+
export declare function projectFromPackageJson(pkg: PackageJson): ToolchainProjectConfig;
|
|
16
|
+
/**
|
|
17
|
+
* Map the fields a `dbx.config.project` **defines** onto `package.json` fields.
|
|
18
|
+
* Only the defined fields are returned, so a sync never clears a field the
|
|
19
|
+
* config does not mention. `directory` (a workspace path relative to the repo
|
|
20
|
+
* root) is written as `repository.directory`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function projectToPackageJson(project: ToolchainProjectConfig, options?: {
|
|
23
|
+
directory?: string;
|
|
24
|
+
}): Partial<PackageJson>;
|
|
25
|
+
//#endregion
|
|
@@ -0,0 +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,9 +1,9 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
import { Replacements } from "./template.js";
|
|
4
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";
|
|
5
|
-
import {
|
|
4
|
+
import { Replacements } from "./template.js";
|
|
6
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";
|
|
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}. */
|
|
9
9
|
export interface SyncSummary {
|
|
@@ -97,6 +97,15 @@ export declare function sectionConfig<T extends object>(section: ToolchainSectio
|
|
|
97
97
|
export declare const CONFIG_FILE_NAMES: readonly ['dbx.config.ts', 'dbx.config.mts', 'dbx.config.js', 'dbx.config.mjs', 'dbx.config.cjs', 'dbx.config.json'];
|
|
98
98
|
/** Derive the `owner/name` slug from a repository URL. */
|
|
99
99
|
export declare function repoSlugFromUrl(repo: string | undefined): string | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* The resolved changelog branches. `main` defaults to `['main']`; `dev` has **no
|
|
102
|
+
* default** and reuses `main` when omitted, so a single-branch repo needs no
|
|
103
|
+
* `dev`. Each side accepts a glob or an array of globs.
|
|
104
|
+
*/
|
|
105
|
+
export declare function resolveChangelogBranches(changelog?: ToolchainChangelogConfig): {
|
|
106
|
+
main: string[];
|
|
107
|
+
dev: string[];
|
|
108
|
+
};
|
|
100
109
|
/**
|
|
101
110
|
* Flatten a {@link ToolchainConfig} into the `{{ token }}` replacements every
|
|
102
111
|
* template understands. Defaults are chosen so a bare config still renders.
|
|
@@ -126,6 +135,8 @@ export interface SyncContext {
|
|
|
126
135
|
tokens: Replacements;
|
|
127
136
|
/** Log a line (respects `--quiet`). */
|
|
128
137
|
log: (message: string) => void;
|
|
138
|
+
/** Emit a warning (respects `--quiet`, which suppresses warnings too). */
|
|
139
|
+
warn: (message: string) => void;
|
|
129
140
|
}
|
|
130
141
|
/** A unit of sync work exposed by a package. */
|
|
131
142
|
export interface SyncTask {
|
|
@@ -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={}){let t=e.project??{},n=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.
|
|
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,8 +1,8 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
import { Replacements } from "./template.js";
|
|
4
3
|
import { ProjectType } from "./config-types.js";
|
|
5
|
-
import {
|
|
4
|
+
import { Replacements } from "./template.js";
|
|
5
|
+
import { SyncTask, ToolchainConfig } from "./toolchain.js";
|
|
6
6
|
//#region packages/shared/src/types.d.ts
|
|
7
7
|
/** A value that may or may not be awaited. */
|
|
8
8
|
export type Awaitable<T> = T | Promise<T>;
|
|
@@ -40,6 +40,13 @@ export interface ToolchainCommandContext {
|
|
|
40
40
|
tokens: Replacements;
|
|
41
41
|
/** The config file that was loaded, if any. */
|
|
42
42
|
configPath?: string;
|
|
43
|
+
/**
|
|
44
|
+
* The managed-file sync tasks `dbx sync` runs. Supplied by the CLI (which
|
|
45
|
+
* aggregates the packages) so a package command such as `migrate` can
|
|
46
|
+
* regenerate managed files without depending on every sync package. Absent
|
|
47
|
+
* when a command is driven programmatically.
|
|
48
|
+
*/
|
|
49
|
+
syncTasks?: SyncTask[];
|
|
43
50
|
}
|
|
44
51
|
/** A positional argument a command accepts. */
|
|
45
52
|
export interface ToolchainArgument {
|
|
@@ -5,7 +5,7 @@ import { GeneratedTsconfigResult } from "./utils.js";
|
|
|
5
5
|
export interface GenerateTsconfigsOptions {
|
|
6
6
|
/** The repo root to scan (default `process.cwd()`). */
|
|
7
7
|
cwd?: string;
|
|
8
|
-
/** Inject path aliases from the
|
|
8
|
+
/** Inject path aliases from the workspaces config (default true). */
|
|
9
9
|
aliases?: boolean;
|
|
10
10
|
/** Emit `composite: true` + project references (default false). */
|
|
11
11
|
composite?: boolean;
|
|
@@ -13,11 +13,17 @@ export interface GenerateTsconfigsOptions {
|
|
|
13
13
|
refs?: boolean;
|
|
14
14
|
/** JSON indentation (default 4). */
|
|
15
15
|
indent?: number;
|
|
16
|
-
/** The glob for the workspace
|
|
17
|
-
glob?: string;
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
/**
|
|
16
|
+
/** The glob(s) for the workspace default tsconfig files. */
|
|
17
|
+
glob?: string | string[];
|
|
18
|
+
/** Extra glob(s) to exclude from `glob` (on top of the common ignored paths). */
|
|
19
|
+
exclude?: string | string[];
|
|
20
|
+
/** Respect `.gitignore` files (default true). */
|
|
21
|
+
gitignore?: boolean;
|
|
22
|
+
/** The workspace default tsconfig file name (default `tsconfig.default.json`). */
|
|
23
|
+
defaultFile?: string;
|
|
24
|
+
/** The workspace build tsconfig file name (default `tsconfig.build.json`). */
|
|
25
|
+
buildFile?: string;
|
|
26
|
+
/** The workspaces tsconfig file name (default `tsconfig.workspaces.json`). */
|
|
21
27
|
monorepoTsconfigFilename?: string;
|
|
22
28
|
/** Log progress (default true). */
|
|
23
29
|
log?: boolean;
|
|
@@ -25,9 +31,10 @@ export interface GenerateTsconfigsOptions {
|
|
|
25
31
|
write?: boolean;
|
|
26
32
|
}
|
|
27
33
|
/**
|
|
28
|
-
* Extend every workspace `tsconfig.default.json` into a
|
|
29
|
-
* `tsconfig.json
|
|
30
|
-
*
|
|
34
|
+
* Extend every workspace default tsconfig (`tsconfig.default.json`) into a
|
|
35
|
+
* generated `tsconfig.json`, optionally wiring path aliases + project references
|
|
36
|
+
* from the workspaces tsconfig (`tsconfig.workspaces.json`). Both the workspaces
|
|
37
|
+
* tsconfig and each workspace's `tsconfig.build.json` are optional.
|
|
31
38
|
*/
|
|
32
39
|
export declare function generateTsconfigs(options?: GenerateTsconfigsOptions): GeneratedTsconfigResult[];
|
|
33
40
|
/** CLI entry (used by the `tsconfig` command). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as e}from"node:path";import{fileURLToPath as t,pathToFileURL as n}from"node:url";import.meta.url;import{
|
|
1
|
+
import{default as e}from"node:path";import{fileURLToPath as t,pathToFileURL as n}from"node:url";import.meta.url;import{resolveIgnorePatterns as r}from"../../../../shared/src/ignore.js";import{logger as i}from"../../../../shared/src/logger.js";import"../../../../shared/src/index.js";import{generateTsconfig as a}from"./utils.js";import o from"node:fs";import{parseArgs as s}from"node:util";import{Glob as c}from"glob";function l(t={}){let{aliases:n=!0,composite:s=!1,refs:l=!1,indent:u=4,gitignore:d=!0,defaultFile:f=`tsconfig.default.json`,buildFile:p=`tsconfig.build.json`,monorepoTsconfigFilename:m=`tsconfig.workspaces.json`,log:h=!0,write:g=!0}=t,_=t.glob??`**/${f}`,v=t.cwd??process.cwd(),y=e=>{h&&i.info(e)};n||y(`Ignoring path aliases for all tsconfigs...`),s||y(`Disabling compilerOptions.composite for all tsconfigs...`),l||y(`Ignoring project references for all tsconfigs...`);let b=e.resolve(v,m),x=e.relative(v,b),S=o.existsSync(b),C=Array.isArray(_)?_:[_],w=C.filter(e=>!e.startsWith(`!`)),T=[...C.filter(e=>e.startsWith(`!`)).map(e=>e.slice(1)),...r(v,{...t.exclude===void 0?{}:{exclude:t.exclude},gitignore:d})],E=new c(w.length?w:[`**/${f}`],{cwd:v,withFileTypes:!0,ignore:T}).walkSync();y(S?`Extending ${E.length} tsconfigs with ${x}...`:`Extending ${E.length} tsconfigs (no ${x})...`);let D=[];for(let t of E){let r=t.fullpath(),i=e.dirname(r);D.push(a({cwd:v,dirname:i,tsconfigPath:r,monorepoTsconfigPath:b,tsconfigBuildPath:e.resolve(i,p),targetTsconfigPath:e.resolve(i,`tsconfig.json`),targetTsconfigBuildPath:e.resolve(i,p),indent:u,disableComposite:!s,ignoreAliases:!n,ignoreReferences:!l,write:g}))}if(!l)return D;y(`Checking for additional tsconfig changes...`);for(let t of D){let{dirname:n,dirnameRelative:r,targetTsconfigPath:i,config:a}=t;y(` - ${r}`),a.references?.length&&(a.references=a.references.filter(t=>{let r=e.resolve(n,t.path);if(!o.existsSync(r))return y(` tsconfig not found for ${t.path}, skipping.`),!1;let i=JSON.parse(o.readFileSync(r,`utf-8`));return i.compilerOptions?.composite!=null&&i.compilerOptions?.composite!==!1})),g&&o.writeFileSync(i,`${JSON.stringify(a,null,u)}\n`)}return D}function u(e=process.argv.slice(2)){let{values:t}=s({args:e,options:{aliases:{type:`boolean`,short:`a`,default:!0},composite:{type:`boolean`,short:`c`,default:!1},refs:{type:`boolean`,short:`r`,default:!1},indent:{type:`string`,short:`i`,default:`4`},glob:{type:`string`,multiple:!0},exclude:{type:`string`,multiple:!0},gitignore:{type:`boolean`,default:!0},"default-file":{type:`string`},"build-file":{type:`string`},"root-file":{type:`string`}}});l({aliases:t.aliases,composite:t.composite,refs:t.refs,indent:Number.parseInt(t.indent,10),...t.glob?{glob:t.glob}:{},...t.exclude?{exclude:t.exclude}:{},gitignore:t.gitignore,...t[`default-file`]?{defaultFile:t[`default-file`]}:{},...t[`build-file`]?{buildFile:t[`build-file`]}:{},...t[`root-file`]?{monorepoTsconfigFilename:t[`root-file`]}:{}})}if(/[\\/]generate[\\/]index\.[cm]?[jt]s$/.test(t(import.meta.url))&&import.meta.url===n(process.argv[1]??``).href)try{u()}catch(e){i.error(`Failed to generate tsconfigs due to: ${e}`),process.exit(1)}export{l as generateTsconfigs,u as runTsconfigCli};
|
|
@@ -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 n from"node:fs";function r(r){let{cwd:a,dirname:o,tsconfigPath:s,monorepoTsconfigPath:c,tsconfigBuildPath:l,targetTsconfigPath:u,targetTsconfigBuildPath:d,indent:f=4,disableComposite:p,ignoreAliases:m,ignoreReferences:h,write:g=!0}=r,_=e.relative(a,o).replace(/\\/g,`/`)||`.`;try{if(!n.existsSync(s))throw Error(`Source tsconfig not found: ${s}`);if(!c)throw Error(`options.monorepoTsconfigPath not set for ${s}`);
|
|
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 n from"node:fs";function r(r){let{cwd:a,dirname:o,tsconfigPath:s,monorepoTsconfigPath:c,tsconfigBuildPath:l,targetTsconfigPath:u,targetTsconfigBuildPath:d,indent:f=4,disableComposite:p,ignoreAliases:m,ignoreReferences:h,write:g=!0}=r,_=e.relative(a,o).replace(/\\/g,`/`)||`.`;try{if(!n.existsSync(s))throw Error(`Source tsconfig not found: ${s}`);if(!c)throw Error(`options.monorepoTsconfigPath not set for ${s}`);t.info(` - ${_}`);let d=e.basename(s),v=n.existsSync(l),y=n.existsSync(c)?JSON.parse(n.readFileSync(c,`utf-8`)):{},b=JSON.parse(n.readFileSync(s,`utf-8`)),x=v?JSON.parse(n.readFileSync(l,`utf-8`)):void 0,S=p?[]:[.../* @__PURE__ */ new Set([...b.compilerOptions?.types??[],...p?[]:y.compilerOptions?.types??[]])],C={...p?{}:y,extends:`./${d}`,compilerOptions:{...p?{composite:!1}:y.compilerOptions,...S.length?{types:S}:{},...m?{}:{paths:{...b.compilerOptions?.paths,...y.compilerOptions?.paths?Object.fromEntries(Object.entries(y.compilerOptions.paths).reduce((e,t)=>{let[n,r]=t,s=!0,c=r.map(e=>i(e,o,a)),l=[];for(let{newPath:e,isRoot:t,inRootDir:n}of c)(!t&&!n||/^.$/.test(_))&&(s=!1,l.push(e));return s?e:e.concat([[n,l]])},[])):{}}}},...h?{}:{references:(b.references??[]).concat(y.references??[]).reduce((e,t)=>{if(e.find(e=>e.path===t.path))return e;let{newPath:n,isRoot:r,inRootDir:s}=i(t.path,o,a);return(r||s)&&!/^.$/.test(_)?e:e.concat([{...t,path:n}])},[])}},w=v?{...x,extends:`./${d}`}:void 0;return g&&n.writeFileSync(u,`${JSON.stringify(C,null,f)}\n`),{...r,dirnameRelative:_,tsconfigFilename:d,config:C,newTsconfig:C,newTsconfigBuild:w,originalConfig:b,tsconfigMonorepo:y,tsconfigBuild:x}}catch(e){t.error(` Failed to extend tsconfig for ${_} due to: ${e}`),process.exit(1)}}function i(t,n,r){let i=e.resolve(r,t),a=e.basename(i),o=e.dirname(i),s=e.join(e.relative(n,o),a).replace(/\\/g,`/`);s=s.startsWith(`.`)?s:`./${s}`;let c=e.dirname(e.resolve(n,s));return{isRoot:n===c,inRootDir:c.startsWith(n),newPath:s,newPathDirname:c}}export{r as generateTsconfig};
|
|
@@ -4,7 +4,7 @@ import { ToolchainCommand } from "../../../shared/src/types.js";
|
|
|
4
4
|
import "../../../shared/src/index.js";
|
|
5
5
|
//#region packages/tsconfig/src/cli/index.d.ts
|
|
6
6
|
/**
|
|
7
|
-
* The `tsconfig` command. Defaults come from `dbx.config.tsconfig
|
|
7
|
+
* The `tsconfig` command. Defaults come from `dbx.config.tsconfig.*`
|
|
8
8
|
* (via the command context); any CLI flag overrides them.
|
|
9
9
|
*/
|
|
10
10
|
export declare function tsconfigCommands(): ToolchainCommand[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node:path";import"node:url";import.meta.url;import{sectionConfig as e}from"../../../shared/src/toolchain.js";import"../../../shared/src/index.js";import{generateTsconfigs as t}from"./generate/index.js";function n(){return[{name:`tsconfig`,description:`Generate workspace tsconfig.json files from
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;import{sectionConfig as e}from"../../../shared/src/toolchain.js";import"../../../shared/src/index.js";import{generateTsconfigs as t}from"./generate/index.js";function n(){return[{name:`tsconfig`,description:`Generate workspace tsconfig.json files from the default tsconfig (aliases + references).`,options:[{flags:`--cwd <dir>`,description:`Repo root to scan (default: cwd).`},{flags:`--no-aliases`,description:`Skip path aliases.`},{flags:`--composite`,description:`Emit composite + references.`},{flags:`--refs`,description:`Wire project references.`},{flags:`-i, --indent <n>`,description:`JSON indentation.`},{flags:`--glob <glob...>`,description:`Glob(s) for the default tsconfig files.`},{flags:`--exclude <glob...>`,description:`Glob(s) to exclude (on top of the common ignored paths).`},{flags:`--no-gitignore`,description:`Do not respect .gitignore files.`},{flags:`--default-file <file>`,description:`Default tsconfig file name.`},{flags:`--build-file <file>`,description:`Build tsconfig file name.`},{flags:`--root-file <file>`,description:`Workspaces tsconfig file name.`}],run:(n,r)=>{let i=e(r.config.tsconfig)??{},a=n.glob;t({cwd:r.cwd,aliases:n.aliases??i.aliases??!0,composite:n.composite??i.composite??!1,refs:n.refs??i.refs??!1,indent:n.indent===void 0?i.indent:Number.parseInt(String(n.indent),10),glob:a??i.glob??`**/tsconfig.default.json`,exclude:n.exclude??i.exclude,gitignore:n.gitignore??i.gitignore,defaultFile:n.defaultFile??i.defaultFile??`tsconfig.default.json`,buildFile:n.buildFile??i.buildFile??`tsconfig.build.json`,monorepoTsconfigFilename:n.rootFile??i.rootFile??`tsconfig.workspaces.json`})}}]}export{n as tsconfigCommands};
|