@deltabox/toolchain 1.5.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -4
- package/dist/changelog.d.ts +2 -1
- package/dist/changelog.js +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +1 -1
- package/dist/package.js +1 -1
- package/dist/packages/changelog/src/cli/index.js +1 -1
- package/dist/packages/changelog/src/index.d.ts +3 -2
- package/dist/packages/changelog/src/index.js +1 -1
- package/dist/packages/changelog/src/run.d.ts +8 -2
- package/dist/packages/changelog/src/run.js +1 -1
- package/dist/packages/changelog/src/utils/versioning.d.ts +78 -0
- package/dist/packages/changelog/src/utils/versioning.js +1 -0
- package/dist/packages/changelog/src/utils/write.js +1 -1
- package/dist/packages/config/src/generators/markdown.d.ts +3 -2
- package/dist/packages/config/src/generators/markdown.js +6 -6
- package/dist/packages/shared/src/bin.d.ts +11 -0
- package/dist/packages/shared/src/bin.js +1 -1
- package/dist/packages/shared/src/config-schema.d.ts +101 -0
- package/dist/packages/shared/src/config-schema.js +1 -1
- package/dist/packages/shared/src/config-types.d.ts +12 -0
- package/dist/packages/shared/src/index.d.ts +6 -6
- package/dist/packages/shared/src/index.js +1 -1
- package/dist/packages/shared/src/run.d.ts +22 -2
- package/dist/packages/shared/src/run.js +1 -1
- package/dist/packages/shared/src/toolchain.d.ts +3 -3
- package/dist/packages/shared/src/toolchain.js +1 -1
- package/dist/packages/vite/src/index.d.ts +2 -2
- package/dist/packages/vite/src/index.js +1 -1
- package/dist/packages/vite/src/plugin.d.ts +26 -5
- package/dist/packages/vite/src/plugin.js +1 -1
- package/dist/packages/vite/src/vp.d.ts +5 -0
- package/dist/packages/vite/src/vp.js +1 -1
- package/dist/shared.d.ts +5 -5
- package/dist/shared.js +1 -1
- package/dist/vite.d.ts +2 -2
- package/dist/vite.js +1 -1
- package/package.json +12 -12
|
@@ -475,6 +475,30 @@ export declare const changelogWorkflowsConfigSchema: z.ZodObject<{
|
|
|
475
475
|
tokens: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
476
476
|
}, z.core.$strip>]>>;
|
|
477
477
|
}, z.core.$strip>;
|
|
478
|
+
/** Which `package.json` versions a changelog run bumps. */
|
|
479
|
+
export declare const changelogVersioningTargetSchema: z.ZodEnum<{
|
|
480
|
+
individual: "individual";
|
|
481
|
+
"root-only": "root-only";
|
|
482
|
+
uniform: "uniform";
|
|
483
|
+
}>;
|
|
484
|
+
/** Options for `changelog.versioning` when configured as an object. */
|
|
485
|
+
export declare const changelogVersioningConfigSchema: z.ZodObject<{
|
|
486
|
+
target: z.ZodOptional<z.ZodEnum<{
|
|
487
|
+
individual: "individual";
|
|
488
|
+
"root-only": "root-only";
|
|
489
|
+
uniform: "uniform";
|
|
490
|
+
}>>;
|
|
491
|
+
workspaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
492
|
+
}, z.core.$strip>;
|
|
493
|
+
/** Automatic version bumping: `true` (default), `false`, or a set of options. */
|
|
494
|
+
export declare const changelogVersioningSchema: z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
495
|
+
target: z.ZodOptional<z.ZodEnum<{
|
|
496
|
+
individual: "individual";
|
|
497
|
+
"root-only": "root-only";
|
|
498
|
+
uniform: "uniform";
|
|
499
|
+
}>>;
|
|
500
|
+
workspaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
501
|
+
}, z.core.$strip>]>;
|
|
478
502
|
/** Conventional-Commits CI, commitlint and the changelog pipeline. */
|
|
479
503
|
export declare const changelogConfigSchema: z.ZodObject<{
|
|
480
504
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -776,6 +800,14 @@ export declare const changelogConfigSchema: z.ZodObject<{
|
|
|
776
800
|
}, z.core.$strip>>;
|
|
777
801
|
types: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
778
802
|
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
803
|
+
versioning: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
804
|
+
target: z.ZodOptional<z.ZodEnum<{
|
|
805
|
+
individual: "individual";
|
|
806
|
+
"root-only": "root-only";
|
|
807
|
+
uniform: "uniform";
|
|
808
|
+
}>>;
|
|
809
|
+
workspaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
810
|
+
}, z.core.$strip>]>>;
|
|
779
811
|
vscode: z.ZodOptional<z.ZodBoolean>;
|
|
780
812
|
}, z.core.$strip>;
|
|
781
813
|
/** Biome config generation (for consumers that still want a `biome.json`). */
|
|
@@ -1219,6 +1251,14 @@ export declare const toolchainConfigSchema: z.ZodObject<{
|
|
|
1219
1251
|
}, z.core.$strip>>;
|
|
1220
1252
|
types: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1221
1253
|
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1254
|
+
versioning: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
1255
|
+
target: z.ZodOptional<z.ZodEnum<{
|
|
1256
|
+
individual: "individual";
|
|
1257
|
+
"root-only": "root-only";
|
|
1258
|
+
uniform: "uniform";
|
|
1259
|
+
}>>;
|
|
1260
|
+
workspaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1261
|
+
}, z.core.$strip>]>>;
|
|
1222
1262
|
vscode: z.ZodOptional<z.ZodBoolean>;
|
|
1223
1263
|
}, z.core.$strip>]>>;
|
|
1224
1264
|
biome: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
@@ -1606,6 +1646,14 @@ export declare const dbxConfigSchema: z.ZodObject<{
|
|
|
1606
1646
|
}, z.core.$strip>>;
|
|
1607
1647
|
types: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1608
1648
|
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1649
|
+
versioning: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
1650
|
+
target: z.ZodOptional<z.ZodEnum<{
|
|
1651
|
+
individual: "individual";
|
|
1652
|
+
"root-only": "root-only";
|
|
1653
|
+
uniform: "uniform";
|
|
1654
|
+
}>>;
|
|
1655
|
+
workspaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1656
|
+
}, z.core.$strip>]>>;
|
|
1609
1657
|
vscode: z.ZodOptional<z.ZodBoolean>;
|
|
1610
1658
|
}, z.core.$strip>]>>;
|
|
1611
1659
|
biome: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
@@ -2146,6 +2194,27 @@ export declare const CONFIG_TYPE_SCHEMAS: {
|
|
|
2146
2194
|
tokens: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
2147
2195
|
}, z.core.$strip>]>>;
|
|
2148
2196
|
}, z.core.$strip>;
|
|
2197
|
+
readonly ChangelogVersioningTarget: z.ZodEnum<{
|
|
2198
|
+
individual: "individual";
|
|
2199
|
+
"root-only": "root-only";
|
|
2200
|
+
uniform: "uniform";
|
|
2201
|
+
}>;
|
|
2202
|
+
readonly ChangelogVersioningConfig: z.ZodObject<{
|
|
2203
|
+
target: z.ZodOptional<z.ZodEnum<{
|
|
2204
|
+
individual: "individual";
|
|
2205
|
+
"root-only": "root-only";
|
|
2206
|
+
uniform: "uniform";
|
|
2207
|
+
}>>;
|
|
2208
|
+
workspaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2209
|
+
}, z.core.$strip>;
|
|
2210
|
+
readonly ChangelogVersioning: z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
2211
|
+
target: z.ZodOptional<z.ZodEnum<{
|
|
2212
|
+
individual: "individual";
|
|
2213
|
+
"root-only": "root-only";
|
|
2214
|
+
uniform: "uniform";
|
|
2215
|
+
}>>;
|
|
2216
|
+
workspaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2217
|
+
}, z.core.$strip>]>;
|
|
2149
2218
|
readonly ToolchainChangelogConfig: z.ZodObject<{
|
|
2150
2219
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
2151
2220
|
workflows: z.ZodOptional<z.ZodObject<{
|
|
@@ -2446,6 +2515,14 @@ export declare const CONFIG_TYPE_SCHEMAS: {
|
|
|
2446
2515
|
}, z.core.$strip>>;
|
|
2447
2516
|
types: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2448
2517
|
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2518
|
+
versioning: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
2519
|
+
target: z.ZodOptional<z.ZodEnum<{
|
|
2520
|
+
individual: "individual";
|
|
2521
|
+
"root-only": "root-only";
|
|
2522
|
+
uniform: "uniform";
|
|
2523
|
+
}>>;
|
|
2524
|
+
workspaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2525
|
+
}, z.core.$strip>]>>;
|
|
2449
2526
|
vscode: z.ZodOptional<z.ZodBoolean>;
|
|
2450
2527
|
}, z.core.$strip>;
|
|
2451
2528
|
readonly ToolchainBiomeConfig: z.ZodObject<{
|
|
@@ -2870,6 +2947,14 @@ export declare const CONFIG_TYPE_SCHEMAS: {
|
|
|
2870
2947
|
}, z.core.$strip>>;
|
|
2871
2948
|
types: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2872
2949
|
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2950
|
+
versioning: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
2951
|
+
target: z.ZodOptional<z.ZodEnum<{
|
|
2952
|
+
individual: "individual";
|
|
2953
|
+
"root-only": "root-only";
|
|
2954
|
+
uniform: "uniform";
|
|
2955
|
+
}>>;
|
|
2956
|
+
workspaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2957
|
+
}, z.core.$strip>]>>;
|
|
2873
2958
|
vscode: z.ZodOptional<z.ZodBoolean>;
|
|
2874
2959
|
}, z.core.$strip>]>>;
|
|
2875
2960
|
biome: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
@@ -3256,6 +3341,14 @@ export declare const CONFIG_TYPE_SCHEMAS: {
|
|
|
3256
3341
|
}, z.core.$strip>>;
|
|
3257
3342
|
types: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3258
3343
|
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3344
|
+
versioning: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
3345
|
+
target: z.ZodOptional<z.ZodEnum<{
|
|
3346
|
+
individual: "individual";
|
|
3347
|
+
"root-only": "root-only";
|
|
3348
|
+
uniform: "uniform";
|
|
3349
|
+
}>>;
|
|
3350
|
+
workspaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3351
|
+
}, z.core.$strip>]>>;
|
|
3259
3352
|
vscode: z.ZodOptional<z.ZodBoolean>;
|
|
3260
3353
|
}, z.core.$strip>]>>;
|
|
3261
3354
|
biome: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
@@ -3644,6 +3737,14 @@ export declare const CONFIG_SECTION_SCHEMAS: {
|
|
|
3644
3737
|
}, z.core.$strip>>;
|
|
3645
3738
|
types: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3646
3739
|
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3740
|
+
versioning: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
3741
|
+
target: z.ZodOptional<z.ZodEnum<{
|
|
3742
|
+
individual: "individual";
|
|
3743
|
+
"root-only": "root-only";
|
|
3744
|
+
uniform: "uniform";
|
|
3745
|
+
}>>;
|
|
3746
|
+
workspaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3747
|
+
}, z.core.$strip>]>>;
|
|
3647
3748
|
vscode: z.ZodOptional<z.ZodBoolean>;
|
|
3648
3749
|
}, z.core.$strip>;
|
|
3649
3750
|
readonly biome: z.ZodObject<{
|
|
@@ -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.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(),vscode:e.boolean().describe(`Write the Conventional-Commits VS Code settings.`).optional()}).meta({id:`ToolchainChangelogConfig`}),
|
|
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};
|
|
@@ -71,6 +71,17 @@ export interface ChangelogWorkflowsConfig {
|
|
|
71
71
|
issues?: WorkflowSetting;
|
|
72
72
|
sync?: WorkflowSetting;
|
|
73
73
|
}
|
|
74
|
+
export type ChangelogVersioningTarget = 'uniform' | 'root-only' | 'individual';
|
|
75
|
+
export interface ChangelogVersioningConfig {
|
|
76
|
+
target?: ChangelogVersioningTarget;
|
|
77
|
+
/**
|
|
78
|
+
* Glob patterns selecting the workspaces to version (relative to the root). Defaults to the root
|
|
79
|
+
* `package.json` `workspaces` field; when there is none the root `package.json` is used on its
|
|
80
|
+
* own.
|
|
81
|
+
*/
|
|
82
|
+
workspaces?: Array<string>;
|
|
83
|
+
}
|
|
84
|
+
export type ChangelogVersioning = boolean | ChangelogVersioningConfig;
|
|
74
85
|
export interface ToolchainChangelogConfig {
|
|
75
86
|
/** Master switch (enabled when the section is defined). */
|
|
76
87
|
enabled?: boolean;
|
|
@@ -83,6 +94,7 @@ export interface ToolchainChangelogConfig {
|
|
|
83
94
|
types?: Array<string>;
|
|
84
95
|
/** Allowed commit scopes (commitlint). */
|
|
85
96
|
scopes?: Array<string>;
|
|
97
|
+
versioning?: ChangelogVersioning;
|
|
86
98
|
/** Write the Conventional-Commits VS Code settings. */
|
|
87
99
|
vscode?: boolean;
|
|
88
100
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
import { TOOLCHAIN_PACKAGE, findOwnCliEntry } from "./bin.js";
|
|
3
|
+
import { TOOLCHAIN_PACKAGE, findOwnCliEntry, localToolchainVersion } from "./bin.js";
|
|
4
4
|
import { mergeJsonAt, readJsonAt, readJsonFile, toJson, writeJsonFile } from "./fs-utils.js";
|
|
5
5
|
import { Colors, LOG_LEVELS, LogChannel, LogLevel, Logger, LoggerConfig, LoggerOptions, configureLogger, createLogger, getLogOverrides, getLogger, isLogLevel, logger, normalizeLogLevel, setLogConfig, setLogOverrides, stripAnsi } from "./logger.js";
|
|
6
6
|
import { Sortable, deepMerge, isPlainObject, mapValues, resolveSort, sort } from "./object-utils.js";
|
|
7
7
|
import { ToolchainProvider, ToolchainProviderAction, ToolchainProviderCommand, providerActions } from "./provider.js";
|
|
8
|
-
import { RunOptions, run, spawnCross } from "./run.js";
|
|
8
|
+
import { RunOptions, SpawnCrossOptions, killProcessTree, run, spawnCross } from "./run.js";
|
|
9
9
|
import { asString, camelCase, camelCaseId, capitalize, constantCase, ensureLeadingSlash, ensureSlashes, ensureTrailingSlash, formatCliFlag, hasText, indent, isLocalhost, kebabCase, pascalCase, removeDoubleSlashes, removeLeadingSlash, removeTrailingSlash, sanitizeSlashes, snakeCase, str, titleCase } from "./string-utils.js";
|
|
10
10
|
import { ReplacementOptions, ReplacementValue, Replacements, Replacer, applyReplacements, applyReplacementsDeep, createReplacer, defineReplacements, extractTokens, hasUnresolvedTokens, tokenPattern } from "./template.js";
|
|
11
|
-
import { ChangelogWorkflowsConfig, DbxConfigSections, ProjectType, ToolchainBiomeConfig, ToolchainChangelogConfig, ToolchainConfigSections, ToolchainLoggerConfig, ToolchainProjectConfig, ToolchainProvidersConfig, ToolchainTemplateKind, ToolchainTemplateSource, ToolchainTemplateSourceType, ToolchainTemplatesConfig, ToolchainTsconfigConfig, ToolchainViteConfig, ToolchainWatchConfig, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig } from "./config-types.js";
|
|
11
|
+
import { ChangelogVersioning, ChangelogVersioningConfig, ChangelogVersioningTarget, ChangelogWorkflowsConfig, DbxConfigSections, ProjectType, ToolchainBiomeConfig, ToolchainChangelogConfig, ToolchainConfigSections, ToolchainLoggerConfig, ToolchainProjectConfig, ToolchainProvidersConfig, ToolchainTemplateKind, ToolchainTemplateSource, ToolchainTemplateSourceType, ToolchainTemplatesConfig, ToolchainTsconfigConfig, ToolchainViteConfig, ToolchainWatchConfig, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig } from "./config-types.js";
|
|
12
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, changelogWorkflowsConfigSchema, dbxConfigSchema, loggerConfigSchema, projectConfigSchema, projectTypeSchema, providersConfigSchema, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema } from "./config-schema.js";
|
|
13
|
+
import { CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, biomeConfigSchema, changelogConfigSchema, changelogVersioningConfigSchema, changelogVersioningSchema, changelogVersioningTargetSchema, changelogWorkflowsConfigSchema, dbxConfigSchema, loggerConfigSchema, projectConfigSchema, projectTypeSchema, providersConfigSchema, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema } from "./config-schema.js";
|
|
14
14
|
import { CONFIG_FILE_NAMES, DbxConfig, ManagedFile, SyncContext, SyncSummary, SyncTask, ToolchainConfig, ToolchainHooks, ToolchainSection, defineConfig, repoSlugFromUrl, resolveTokens, sectionConfig, sectionEnabled } from "./toolchain.js";
|
|
15
15
|
import { YamlValue, toYaml } from "./yaml.js";
|
|
16
16
|
declare namespace index_d_exports {
|
|
17
|
-
export { Awaitable, CONFIG_FILE_NAMES, CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, ChangelogWorkflowsConfig, Colors, DbxConfig, DbxConfigSections, GeneratedFile, JsonValue, LOG_LEVELS, LogChannel, LogLevel, Logger, LoggerConfig, LoggerOptions, ManagedFile, PackageJson, ProjectType, ReplacementOptions, ReplacementValue, Replacements, Replacer, RunOptions, Sortable, 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, changelogWorkflowsConfigSchema, configureLogger, constantCase, createLogger, createReplacer, dbxConfigSchema, deepMerge, defineConfig, defineReplacements, ensureLeadingSlash, ensureSlashes, ensureTrailingSlash, extractTokens, findOwnCliEntry, formatCliFlag, getLogOverrides, getLogger, hasText, hasUnresolvedTokens, indent, isLocalhost, isLogLevel, isPlainObject, kebabCase, logger, loggerConfigSchema, mapValues, mergeJsonAt, normalizeLogLevel, pascalCase, projectConfigSchema, projectTypeSchema, providerActions, providersConfigSchema, readJsonAt, readJsonFile, removeDoubleSlashes, removeLeadingSlash, removeTrailingSlash, repoSlugFromUrl, resolveSort, resolveTokens, run, sanitizeSlashes, sectionConfig, sectionEnabled, setLogConfig, setLogOverrides, snakeCase, sort, spawnCross, str, stripAnsi, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, titleCase, toJson, toYaml, tokenPattern, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema, writeJsonFile };
|
|
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, sectionConfig, sectionEnabled, setLogConfig, setLogOverrides, snakeCase, sort, spawnCross, str, stripAnsi, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, titleCase, toJson, toYaml, tokenPattern, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema, writeJsonFile };
|
|
18
18
|
}
|
|
19
19
|
//#endregion
|
|
20
|
-
export { Awaitable, CONFIG_FILE_NAMES, CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, ChangelogWorkflowsConfig, Colors, DbxConfig, DbxConfigSections, GeneratedFile, JsonValue, LOG_LEVELS, LogChannel, LogLevel, Logger, LoggerConfig, LoggerOptions, ManagedFile, PackageJson, ProjectType, ReplacementOptions, ReplacementValue, Replacements, Replacer, RunOptions, Sortable, 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, 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, logger, loggerConfigSchema, mapValues, mergeJsonAt, normalizeLogLevel, pascalCase, projectConfigSchema, projectTypeSchema, providerActions, providersConfigSchema, readJsonAt, readJsonFile, removeDoubleSlashes, removeLeadingSlash, removeTrailingSlash, repoSlugFromUrl, resolveSort, resolveTokens, run, sanitizeSlashes, sectionConfig, sectionEnabled, setLogConfig, setLogOverrides, snakeCase, sort, spawnCross, str, stripAnsi, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, titleCase, toJson, toYaml, tokenPattern, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema, writeJsonFile };
|
|
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, sectionConfig, sectionEnabled, setLogConfig, setLogOverrides, snakeCase, sort, spawnCross, str, stripAnsi, 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}from"./bin.js";import{deepMerge as
|
|
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{LOG_LEVELS as p,configureLogger as m,createLogger as h,getLogOverrides as g,getLogger as _,isLogLevel as v,logger as y,normalizeLogLevel as b,setLogConfig as x,setLogOverrides as S,stripAnsi as C}from"./logger.js";import{providerActions as w}from"./provider.js";import{killProcessTree as T,run as E,spawnCross as D}from"./run.js";import{asString as O,camelCase as k,camelCaseId as A,capitalize as j,constantCase as M,ensureLeadingSlash as N,ensureSlashes as P,ensureTrailingSlash as F,formatCliFlag as I,hasText as L,indent as R,isLocalhost as z,kebabCase as B,pascalCase as V,removeDoubleSlashes as H,removeLeadingSlash as U,removeTrailingSlash as W,sanitizeSlashes as G,snakeCase as K,str as q,titleCase as te}from"./string-utils.js";import{applyReplacements as J,applyReplacementsDeep as Y,createReplacer as X,defineReplacements as Z,extractTokens as Q,hasUnresolvedTokens as $,tokenPattern as ne}from"./template.js";import{CONFIG_SECTION_DESCRIPTIONS as re,CONFIG_SECTION_SCHEMAS as ie,CONFIG_TYPE_SCHEMAS as ae,biomeConfigSchema as oe,changelogConfigSchema as se,changelogVersioningConfigSchema as ce,changelogVersioningSchema as le,changelogVersioningTargetSchema as ue,changelogWorkflowsConfigSchema as de,dbxConfigSchema as fe,loggerConfigSchema as pe,projectConfigSchema as me,projectTypeSchema as he,providersConfigSchema as ge,templateKindSchema as _e,templateSourceSchema as ve,templateSourceTypeSchema as ye,templatesConfigSchema as be,toolchainConfigSchema as xe,tsconfigConfigSchema as Se,viteConfigSchema as Ce,watchConfigSchema as we,workflowConfigSchema as Te,workflowSettingSchema as Ee,workflowStepSchema as De,workflowStepsConfigSchema as Oe}from"./config-schema.js";import{CONFIG_FILE_NAMES as ke,defineConfig as Ae,repoSlugFromUrl as je,resolveTokens as Me,sectionConfig as Ne,sectionEnabled as Pe}from"./toolchain.js";import{toYaml as Fe}from"./yaml.js";var Ie=/* @__PURE__ */ ee({CONFIG_FILE_NAMES:()=>ke,CONFIG_SECTION_DESCRIPTIONS:()=>re,CONFIG_SECTION_SCHEMAS:()=>ie,CONFIG_TYPE_SCHEMAS:()=>ae,LOG_LEVELS:()=>p,TOOLCHAIN_PACKAGE:()=>e,applyReplacements:()=>J,applyReplacementsDeep:()=>Y,asString:()=>O,biomeConfigSchema:()=>oe,camelCase:()=>k,camelCaseId:()=>A,capitalize:()=>j,changelogConfigSchema:()=>se,changelogVersioningConfigSchema:()=>ce,changelogVersioningSchema:()=>le,changelogVersioningTargetSchema:()=>ue,changelogWorkflowsConfigSchema:()=>de,configureLogger:()=>m,constantCase:()=>M,createLogger:()=>h,createReplacer:()=>X,dbxConfigSchema:()=>fe,deepMerge:()=>r,defineConfig:()=>Ae,defineReplacements:()=>Z,ensureLeadingSlash:()=>N,ensureSlashes:()=>P,ensureTrailingSlash:()=>F,extractTokens:()=>Q,findOwnCliEntry:()=>t,formatCliFlag:()=>I,getLogOverrides:()=>g,getLogger:()=>_,hasText:()=>L,hasUnresolvedTokens:()=>$,indent:()=>R,isLocalhost:()=>z,isLogLevel:()=>v,isPlainObject:()=>i,kebabCase:()=>B,killProcessTree:()=>T,localToolchainVersion:()=>n,logger:()=>y,loggerConfigSchema:()=>pe,mapValues:()=>a,mergeJsonAt:()=>c,normalizeLogLevel:()=>b,pascalCase:()=>V,projectConfigSchema:()=>me,projectTypeSchema:()=>he,providerActions:()=>w,providersConfigSchema:()=>ge,readJsonAt:()=>l,readJsonFile:()=>u,removeDoubleSlashes:()=>H,removeLeadingSlash:()=>U,removeTrailingSlash:()=>W,repoSlugFromUrl:()=>je,resolveSort:()=>o,resolveTokens:()=>Me,run:()=>E,sanitizeSlashes:()=>G,sectionConfig:()=>Ne,sectionEnabled:()=>Pe,setLogConfig:()=>x,setLogOverrides:()=>S,snakeCase:()=>K,sort:()=>s,spawnCross:()=>D,str:()=>q,stripAnsi:()=>C,templateKindSchema:()=>_e,templateSourceSchema:()=>ve,templateSourceTypeSchema:()=>ye,templatesConfigSchema:()=>be,titleCase:()=>te,toJson:()=>d,toYaml:()=>Fe,tokenPattern:()=>ne,toolchainConfigSchema:()=>xe,tsconfigConfigSchema:()=>Se,viteConfigSchema:()=>Ce,watchConfigSchema:()=>we,workflowConfigSchema:()=>Te,workflowSettingSchema:()=>Ee,workflowStepSchema:()=>De,workflowStepsConfigSchema:()=>Oe,writeJsonFile:()=>f});export{ke as CONFIG_FILE_NAMES,re as CONFIG_SECTION_DESCRIPTIONS,ie as CONFIG_SECTION_SCHEMAS,ae as CONFIG_TYPE_SCHEMAS,p as LOG_LEVELS,e as TOOLCHAIN_PACKAGE,J as applyReplacements,Y as applyReplacementsDeep,O as asString,oe as biomeConfigSchema,k as camelCase,A as camelCaseId,j as capitalize,se as changelogConfigSchema,ce as changelogVersioningConfigSchema,le as changelogVersioningSchema,ue as changelogVersioningTargetSchema,de as changelogWorkflowsConfigSchema,m as configureLogger,M as constantCase,h as createLogger,X as createReplacer,fe as dbxConfigSchema,r as deepMerge,Ae as defineConfig,Z as defineReplacements,N as ensureLeadingSlash,P as ensureSlashes,F as ensureTrailingSlash,Q as extractTokens,t as findOwnCliEntry,I as formatCliFlag,g as getLogOverrides,_ as getLogger,L as hasText,$ as hasUnresolvedTokens,R as indent,z as isLocalhost,v as isLogLevel,i as isPlainObject,B as kebabCase,T as killProcessTree,n as localToolchainVersion,y as logger,pe as loggerConfigSchema,a as mapValues,c as mergeJsonAt,b as normalizeLogLevel,V as pascalCase,me as projectConfigSchema,he as projectTypeSchema,w as providerActions,ge as providersConfigSchema,l as readJsonAt,u as readJsonFile,H as removeDoubleSlashes,U as removeLeadingSlash,W as removeTrailingSlash,je as repoSlugFromUrl,o as resolveSort,Me as resolveTokens,E as run,G as sanitizeSlashes,Ne as sectionConfig,Pe as sectionEnabled,x as setLogConfig,S as setLogOverrides,K as snakeCase,s as sort,D as spawnCross,Ie as src_exports,q as str,C as stripAnsi,_e as templateKindSchema,ve as templateSourceSchema,ye as templateSourceTypeSchema,be as templatesConfigSchema,te as titleCase,d as toJson,Fe as toYaml,ne as tokenPattern,xe as toolchainConfigSchema,Se as tsconfigConfigSchema,Ce as viteConfigSchema,we as watchConfigSchema,Te as workflowConfigSchema,Ee as workflowSettingSchema,De as workflowStepSchema,Oe as workflowStepsConfigSchema,f as writeJsonFile};
|
|
@@ -2,7 +2,24 @@ import __tsdown_shims_path from 'node:path';
|
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
3
|
import { ChildProcess, SpawnOptions } from "node:child_process";
|
|
4
4
|
//#region packages/shared/src/run.d.ts
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Kill a child process **and its descendants**. On Windows the child is a
|
|
7
|
+
* `cmd.exe` wrapper, so a plain `child.kill()` would orphan the real command;
|
|
8
|
+
* `taskkill /t` tears down the whole tree. On POSIX the child is killed directly.
|
|
9
|
+
*/
|
|
10
|
+
export declare function killProcessTree(child: ChildProcess, signal?: NodeJS.Signals): void;
|
|
11
|
+
/** {@link spawnCross} options: {@link SpawnOptions} plus an optional deadline. */
|
|
12
|
+
export interface SpawnCrossOptions extends SpawnOptions {
|
|
13
|
+
/**
|
|
14
|
+
* Kill the child (and its tree) after this many ms. Use it for one-shot
|
|
15
|
+
* commands so a hung child can never be left running; omit it for
|
|
16
|
+
* long-running processes (dev servers, watchers).
|
|
17
|
+
*/
|
|
18
|
+
timeoutMs?: number;
|
|
19
|
+
/** Called instead of the default warning when the deadline is hit. */
|
|
20
|
+
onTimeout?: (cmd: string, timeoutMs: number) => void;
|
|
21
|
+
}
|
|
22
|
+
export interface RunOptions extends SpawnCrossOptions {
|
|
6
23
|
/** Exit the main process with the child's exit code (default true). */
|
|
7
24
|
exitWithMainProc?: boolean;
|
|
8
25
|
/** Append a trailing `--` to the args (default true). */
|
|
@@ -15,8 +32,11 @@ export interface RunOptions extends SpawnOptions {
|
|
|
15
32
|
* child process. On Windows the command and every argument are escaped for
|
|
16
33
|
* `cmd.exe` (and a `.cmd`/`.bat` shim is re-escaped) so a caller-supplied argv
|
|
17
34
|
* value can never inject a command. `options.stdio` defaults to `inherit`.
|
|
35
|
+
*
|
|
36
|
+
* When `timeoutMs` is set the child's whole process tree is killed once the
|
|
37
|
+
* deadline passes (with a warning), so a stalled command can't hang forever.
|
|
18
38
|
*/
|
|
19
|
-
export declare function spawnCross(cmd: string, args: string[], options?:
|
|
39
|
+
export declare function spawnCross(cmd: string, args: string[], options?: SpawnCrossOptions): ChildProcess;
|
|
20
40
|
/**
|
|
21
41
|
* Spawn a command without a shell in a cross-platform safe way. On Windows the
|
|
22
42
|
* command and every argument are escaped for `cmd.exe` so a caller-supplied
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as e}from"node:path";import"node:url";import.meta.url;import{logger as t}from"./logger.js";import n from"node:fs";import{spawn as r}from"node:child_process";const
|
|
1
|
+
import{default as e}from"node:path";import"node:url";import.meta.url;import{logger as t}from"./logger.js";import n from"node:fs";import{spawn as r,spawnSync as i}from"node:child_process";const a=process.platform===`win32`;let o=!1;const s=/([()\][%!^"`<>&|;, *?])/g;function c(e){return e.replace(s,`^$1`)}function l(e,t){let n=String(e);return n=n.replace(/(?=(\\+?)?)\1"/g,`$1$1\\"`),n=n.replace(/(?=(\\+?)?)\1$/,`$1$1`),n=`"${n}"`,n=n.replace(s,`^$1`),t&&(n=n.replace(s,`^$1`)),n}function u(t){if(e.extname(t))return n.existsSync(t)?t:void 0;let r=(process.env.PATHEXT??`.COM;.EXE;.BAT;.CMD`).split(`;`),i=(process.env.PATH??``).split(e.delimiter);for(let a of r)for(let r of i){let i=e.join(r,`${t}${a.toLowerCase()}`);if(n.existsSync(i))return i}}function d(e){let t=u(e)??e;return/\.(cmd|bat)$/i.test(t)}function f(e,t=`SIGKILL`){let n=e.pid;if(n!==void 0){if(a)try{i(`taskkill`,[`/pid`,String(n),`/t`,`/f`],{stdio:`ignore`});return}catch{}try{e.kill(t)}catch{}}}function p(e,n,i={}){let{timeoutMs:s,onTimeout:u,...p}=i,m;if(a){let i=d(e),a=[c(e),...n.map(e=>l(e,i))].join(` `),s=process.env.ComSpec;!s&&!o&&(o=!0,t.warn(`ComSpec is not set — falling back to cmd.exe.`)),m=r(s??`cmd.exe`,[`/d`,`/s`,`/c`,`"${a}"`],{stdio:`inherit`,...p,shell:!1,windowsVerbatimArguments:!0})}else m=r(e,n,{stdio:`inherit`,...p,shell:!1});if(s!==void 0&&s>0){let n=setTimeout(()=>{u?u(e,s):t.warn(`\`${e}\` exceeded ${s}ms — terminating it.`),f(m)},s);n.unref?.(),m.once(`exit`,()=>clearTimeout(n))}return m}function m(e,n,r){let{exitWithMainProc:i=!0,argsEndingDashes:a=!0,verbose:o=!0,timeoutMs:s,...c}=r??{},l=[...n,...a?[`--`]:[]];o&&t.info(`$ ${e} ${l.join(` `)}`);let u=p(e,l,{...c,...s===void 0?{}:{timeoutMs:s}});return i&&u.on(`exit`,process.exit),u}export{f as killProcessTree,m as run,p as spawnCross};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
3
|
import { Replacements } from "./template.js";
|
|
4
|
-
import { ChangelogWorkflowsConfig, DbxConfigSections, ProjectType, ToolchainBiomeConfig, ToolchainChangelogConfig, ToolchainConfigSections, ToolchainLoggerConfig, ToolchainProjectConfig, ToolchainProvidersConfig, ToolchainTemplateKind, ToolchainTemplateSource, ToolchainTemplateSourceType, ToolchainTemplatesConfig, ToolchainTsconfigConfig, ToolchainViteConfig, ToolchainWatchConfig, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig } from "./config-types.js";
|
|
4
|
+
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
5
|
import { Awaitable } from "./types.js";
|
|
6
|
-
import { CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, biomeConfigSchema, changelogConfigSchema, changelogWorkflowsConfigSchema, dbxConfigSchema, loggerConfigSchema, projectConfigSchema, projectTypeSchema, providersConfigSchema, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema } from "./config-schema.js";
|
|
6
|
+
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";
|
|
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 {
|
|
@@ -157,4 +157,4 @@ export interface SyncTask {
|
|
|
157
157
|
run: (ctx: SyncContext) => Awaitable<ManagedFile[] | void>;
|
|
158
158
|
}
|
|
159
159
|
//#endregion
|
|
160
|
-
export { CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, ChangelogWorkflowsConfig, DbxConfigSections, ProjectType, ToolchainBiomeConfig, ToolchainChangelogConfig, ToolchainConfigSections, ToolchainLoggerConfig, ToolchainProjectConfig, ToolchainProvidersConfig, ToolchainTemplateKind, ToolchainTemplateSource, ToolchainTemplateSourceType, ToolchainTemplatesConfig, ToolchainTsconfigConfig, ToolchainViteConfig, ToolchainWatchConfig, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig, biomeConfigSchema, changelogConfigSchema, changelogWorkflowsConfigSchema, dbxConfigSchema, loggerConfigSchema, projectConfigSchema, projectTypeSchema, providersConfigSchema, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema };
|
|
160
|
+
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 };
|
|
@@ -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,
|
|
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.branches?.main??`main`,devBranch:n.branches?.dev??`dev`}}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,j 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};
|
|
@@ -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, DbxPluginOptions, DbxSource, ResolvedDbx, dbx, resolveDbx, runDbx } from "./plugin.js";
|
|
5
|
+
import { DBX_TASKS, DBX_TIMEOUT_MS, DbxPluginOptions, DbxSource, ResolvedDbx, dbx, dbxTaskCommand, resolveDbx, runDbx } from "./plugin.js";
|
|
6
6
|
import { viteProvider } from "./provider.js";
|
|
7
7
|
import { 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, DbxPluginOptions, DbxSource, ResolveViteOptions, ResolvedDbx, ResolvedVp, RunVpOptions, VITE_CONFIG_SHIM, VP_COMMANDS, VpCommandInfo, VpGroup, VpResult, VpSource, dbx, 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, 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 };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node:path";import"node:url";import.meta.url;import{VP_COMMANDS as e,resolveVpCommand as t,viteCommandName as n}from"./commands.js";import{describeVp as r,hasVp as i,resolveVp as a,runVp as o,vpVersion as s,which as c}from"./vp.js";import{runGuard as l,viteCommands as u}from"./cli/index.js";import{DBX_TASKS as d,
|
|
1
|
+
import"node:path";import"node:url";import.meta.url;import{VP_COMMANDS as e,resolveVpCommand as t,viteCommandName as n}from"./commands.js";import{describeVp as r,hasVp as i,resolveVp as a,runVp as o,vpVersion as s,which as c}from"./vp.js";import{runGuard as l,viteCommands as u}from"./cli/index.js";import{DBX_TASKS as d,DBX_TIMEOUT_MS as f,dbx as p,dbxTaskCommand as m,resolveDbx as h,runDbx as g}from"./plugin.js";import{viteProvider as _}from"./provider.js";import{VITE_CONFIG_SHIM as v,renderViteConfig as y,viteConfigObject as b,viteSyncTask as x}from"./sync.js";import{resolveVite as S}from"./resolve.js";export{d as DBX_TASKS,f as DBX_TIMEOUT_MS,v as VITE_CONFIG_SHIM,e as VP_COMMANDS,p as dbx,m as dbxTaskCommand,r as describeVp,i as hasVp,y as renderViteConfig,h as resolveDbx,S as resolveVite,a as resolveVp,t as resolveVpCommand,g as runDbx,l as runGuard,o as runVp,n as viteCommandName,u as viteCommands,b as viteConfigObject,_ as viteProvider,x as viteSyncTask,s as vpVersion,c as which};
|
|
@@ -16,20 +16,41 @@ export interface ResolvedDbx {
|
|
|
16
16
|
/**
|
|
17
17
|
* Resolve the `dbx` binary, always preferring the project's own over a global
|
|
18
18
|
* install: `DBX_BIN` override -> project-local shim -> the repo's own
|
|
19
|
-
* `@deltabox/toolchain` bin ->
|
|
19
|
+
* `@deltabox/toolchain` bin -> (only for a project that pins nothing) global
|
|
20
|
+
* `PATH` -> `npx` of the pinned version.
|
|
21
|
+
*
|
|
20
22
|
* A project-local binary is what the project pins, so a stale global `dbx` can
|
|
21
|
-
* never be used by accident
|
|
23
|
+
* never be used by accident: when the project pins the toolchain but has no
|
|
24
|
+
* resolvable local binary, the global install is skipped (with a warning) in
|
|
25
|
+
* favour of `npx @deltabox/toolchain@<pinned>` — a stale global would otherwise
|
|
26
|
+
* write older-format files and silently revert the project's generated ones.
|
|
22
27
|
*/
|
|
23
28
|
export declare function resolveDbx(cwd?: string): ResolvedDbx;
|
|
29
|
+
/**
|
|
30
|
+
* Default deadline for a one-shot `dbx` call (`sync`/`--check`): a stalled run
|
|
31
|
+
* is killed rather than left hanging. Long-running work streams its own output,
|
|
32
|
+
* so this only bounds the plugin's own sync.
|
|
33
|
+
*/
|
|
34
|
+
export declare const DBX_TIMEOUT_MS: number;
|
|
24
35
|
/** Run `dbx <args>` in `cwd`, streaming output. Resolves with the exit code. */
|
|
25
|
-
export declare function runDbx(args: string[], cwd?: string): Promise<number>;
|
|
36
|
+
export declare function runDbx(args: string[], cwd?: string, timeoutMs?: number): Promise<number>;
|
|
37
|
+
/**
|
|
38
|
+
* The shell command Vite Task runs for a `dbx` subcommand. Vite Task runs the
|
|
39
|
+
* `command` string through a shell, so instead of relying on `dbx` being on
|
|
40
|
+
* `PATH` (an env-dependent lookup that can miss or pick a stale global) the
|
|
41
|
+
* command is built from {@link resolveDbx} — the project's own binary, or the
|
|
42
|
+
* pinned `npx` fallback — resolved when the config loads. `resolveDbx` warns
|
|
43
|
+
* when it has to fall back, so a missing environment is visible rather than
|
|
44
|
+
* silent.
|
|
45
|
+
*/
|
|
46
|
+
export declare function dbxTaskCommand(subcommand: string, cwd?: string): string;
|
|
26
47
|
/** The Vite+ tasks the wrapper registers, keyed by task name. */
|
|
27
48
|
export declare const DBX_TASKS: {
|
|
28
49
|
readonly 'dbx:sync': {
|
|
29
|
-
readonly command:
|
|
50
|
+
readonly command: string;
|
|
30
51
|
};
|
|
31
52
|
readonly 'dbx:check': {
|
|
32
|
-
readonly command:
|
|
53
|
+
readonly command: string;
|
|
33
54
|
};
|
|
34
55
|
};
|
|
35
56
|
export interface DbxPluginOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as e}from"node:path";import"node:url";import.meta.url;import{findOwnCliEntry as
|
|
1
|
+
import{default as e}from"node:path";import"node:url";import.meta.url;import{TOOLCHAIN_PACKAGE as t,findOwnCliEntry as n,localToolchainVersion as r}from"../../shared/src/bin.js";import{logger as i}from"../../shared/src/logger.js";import{spawnCross as a}from"../../shared/src/run.js";import"../../shared/src/index.js";import{which as o}from"./vp.js";import s from"node:fs";const c=process.platform===`win32`;let l=!1,u=!1;function d(t){let n=e.join(t,`node_modules`,`.bin`,`dbx`);return c?[`${n}.cmd`,`${n}.exe`,`${n}.ps1`,n]:[n]}function f(e=process.cwd()){let a=process.env.DBX_BIN;if(a){if(s.existsSync(a))return{exe:a,args:[],source:`local`};u||(u=!0,i.warn(`DBX_BIN points at ${a}, which does not exist; ignoring it.`))}for(let t of d(e))if(s.existsSync(t))return{exe:t,args:[],source:`local`};let f=n(e);if(f)return{exe:process.execPath,args:[f],source:`local`};let p=r(e),m=o(`dbx`);if(m){if(p===void 0)return{exe:m,args:[],source:`global`};i.warn(`ignoring the global \`dbx\` at ${m} — this project pins ${t}@${p}.`)}let h=p?`${t}@${p}`:t;return l||(l=!0,i.warn(`no project-local ${t} found — running \`npx --yes ${h}\` (needs network).`)),{exe:c?`npx.cmd`:`npx`,args:[`--yes`,h],source:`npx`}}const p=3e5;function m(e,t=process.cwd(),n=p){let r=f(t);return new Promise(i=>{let o=a(r.exe,[...r.args,...e],{cwd:t,env:process.env,stdio:`inherit`,...n>0?{timeoutMs:n}:{}});o.on(`error`,()=>i(1)),o.on(`exit`,e=>i(e??0))})}function h(e){return/[\s"'&|<>^()]/.test(e)?`"${e.replace(/"/g,`\\"`)}"`:e}function g(e,t=process.cwd()){let n=f(t);return[...[n.exe,...n.args].map(h),e].join(` `)}const _={"dbx:sync":{command:g(`sync`)},"dbx:check":{command:g(`sync --check`)}},v=[/dbx\.config\.[cm]?[jt]s$/,/tsconfig\.(?:default|monorepo)\.json$/];function y(e={}){let t=e.check??!!process.env.CI,n=e.sync??!0,r=e.watch??!0,i=e.debounce??150,a=e.cwd??process.cwd(),o,s=!1,c=async()=>{if(!s){s=!0;try{await m([`sync`],a)}finally{s=!1}}},l=()=>{o&&clearTimeout(o),o=setTimeout(()=>{c()},i)};return{name:`deltabox-toolchain`,enforce:`pre`,configResolved(t){a=e.cwd??t.root},async buildStart(){t?await m([`sync`,`--check`],a)!==0&&this.error("deltabox-toolchain: generated files are out of date — run `dbx sync`."):n&&await c()},watchChange(e){r&&n&&v.some(t=>t.test(e))&&l()}}}export{_ as DBX_TASKS,p as DBX_TIMEOUT_MS,y as dbx,g as dbxTaskCommand,f as resolveDbx,m as runDbx};
|
|
@@ -44,6 +44,11 @@ export interface RunVpOptions {
|
|
|
44
44
|
* `undefined` leaves detection to the child.
|
|
45
45
|
*/
|
|
46
46
|
color?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Kill `vp` (and its tree) after this many ms. Omit for long-running
|
|
49
|
+
* commands (`vp dev`); set it for one-shot ones so a hang can't linger.
|
|
50
|
+
*/
|
|
51
|
+
timeoutMs?: number;
|
|
47
52
|
}
|
|
48
53
|
export interface VpResult {
|
|
49
54
|
code: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as e}from"node:path";import"node:url";import.meta.url;import{
|
|
1
|
+
import{default as e}from"node:path";import"node:url";import.meta.url;import{logger as t}from"../../shared/src/logger.js";import{spawnCross as n}from"../../shared/src/run.js";import"../../shared/src/index.js";import r from"node:fs";const i=process.platform===`win32`;function a(t){let n=e.join(t,`node_modules`,`.bin`,`vp`);return i?[`${n}.cmd`,`${n}.exe`,`${n}.ps1`,n]:[n]}let o=!1;function s(n){let a=i?(process.env.PATHEXT??`.COM;.EXE;.BAT;.CMD`).split(`;`).filter(Boolean):[``],s=(process.env.PATH??``).split(e.delimiter).filter(Boolean);s.length===0&&!o&&(o=!0,t.warn(`PATH is empty — cannot look up binaries on PATH; falling back.`));for(let t of s)for(let i of a){let a=e.join(t,`${n}${i.toLowerCase()}`);try{return r.accessSync(a,r.constants.X_OK),a}catch{}}}function c(e=process.cwd()){for(let t of a(e))if(r.existsSync(t))return{exe:t,args:[],source:`local`};let t=s(`vp`);return t?{exe:t,args:[],source:`global`}:{exe:i?`npx.cmd`:`npx`,args:[`--yes`,`vite-plus`],source:`npx`}}function l(e=process.cwd()){return c(e).source!==`npx`}function u(e,t={}){let r=t.cwd??process.cwd(),i=c(r),a=t.mode===`capture`,o={...process.env,...t.env};return t.color===!1&&(o.NO_COLOR=`1`,o.FORCE_COLOR=`0`),new Promise(s=>{let c=``,l=``,u=n(i.exe,[...i.args,...e],{cwd:r,env:o,stdio:a?`pipe`:`inherit`,...t.timeoutMs===void 0?{}:{timeoutMs:t.timeoutMs}});u.stdout?.on(`data`,e=>{c+=e}),u.stderr?.on(`data`,e=>{l+=e}),u.on(`error`,e=>{s({code:1,stdout:c,stderr:`${l}${String(e)}`,resolved:i})}),u.on(`exit`,e=>{s({code:e??0,stdout:c,stderr:l,resolved:i})})})}async function d(e=process.cwd()){let t=await u([`--version`],{cwd:e,mode:`capture`});if(t.code===0)return t.stdout.trim()||t.stderr.trim()||void 0}function f(e=process.cwd()){let t=c(e);return t.source===`local`?`local (node_modules/.bin/vp)`:t.source===`global`?`global (PATH)`:`npx --yes vite-plus`}export{f as describeVp,l as hasVp,c as resolveVp,u as runVp,d as vpVersion,s as which};
|
package/dist/shared.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
import { TOOLCHAIN_PACKAGE, findOwnCliEntry } from "./packages/shared/src/bin.js";
|
|
3
|
+
import { TOOLCHAIN_PACKAGE, findOwnCliEntry, localToolchainVersion } from "./packages/shared/src/bin.js";
|
|
4
4
|
import { mergeJsonAt, readJsonAt, readJsonFile, toJson, writeJsonFile } from "./packages/shared/src/fs-utils.js";
|
|
5
5
|
import { Colors, LOG_LEVELS, LogChannel, LogLevel, Logger, LoggerConfig, LoggerOptions, configureLogger, createLogger, getLogOverrides, getLogger, isLogLevel, logger, normalizeLogLevel, setLogConfig, setLogOverrides, stripAnsi } from "./packages/shared/src/logger.js";
|
|
6
6
|
import { Sortable, deepMerge, isPlainObject, mapValues, resolveSort, sort } from "./packages/shared/src/object-utils.js";
|
|
7
7
|
import { ToolchainProvider, ToolchainProviderAction, ToolchainProviderCommand, providerActions } from "./packages/shared/src/provider.js";
|
|
8
|
-
import { RunOptions, run, spawnCross } from "./packages/shared/src/run.js";
|
|
8
|
+
import { RunOptions, SpawnCrossOptions, killProcessTree, run, spawnCross } from "./packages/shared/src/run.js";
|
|
9
9
|
import { asString, camelCase, camelCaseId, capitalize, constantCase, ensureLeadingSlash, ensureSlashes, ensureTrailingSlash, formatCliFlag, hasText, indent, isLocalhost, kebabCase, pascalCase, removeDoubleSlashes, removeLeadingSlash, removeTrailingSlash, sanitizeSlashes, snakeCase, str, titleCase } from "./packages/shared/src/string-utils.js";
|
|
10
10
|
import { ReplacementOptions, ReplacementValue, Replacements, Replacer, applyReplacements, applyReplacementsDeep, createReplacer, defineReplacements, extractTokens, hasUnresolvedTokens, tokenPattern } from "./packages/shared/src/template.js";
|
|
11
|
-
import { ChangelogWorkflowsConfig, DbxConfigSections, ProjectType, ToolchainBiomeConfig, ToolchainChangelogConfig, ToolchainConfigSections, ToolchainLoggerConfig, ToolchainProjectConfig, ToolchainProvidersConfig, ToolchainTemplateKind, ToolchainTemplateSource, ToolchainTemplateSourceType, ToolchainTemplatesConfig, ToolchainTsconfigConfig, ToolchainViteConfig, ToolchainWatchConfig, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig } from "./packages/shared/src/config-types.js";
|
|
11
|
+
import { ChangelogVersioning, ChangelogVersioningConfig, ChangelogVersioningTarget, ChangelogWorkflowsConfig, DbxConfigSections, ProjectType, ToolchainBiomeConfig, ToolchainChangelogConfig, ToolchainConfigSections, ToolchainLoggerConfig, ToolchainProjectConfig, ToolchainProvidersConfig, ToolchainTemplateKind, ToolchainTemplateSource, ToolchainTemplateSourceType, ToolchainTemplatesConfig, ToolchainTsconfigConfig, ToolchainViteConfig, ToolchainWatchConfig, WorkflowConfig, WorkflowSetting, WorkflowStep, WorkflowStepsConfig } from "./packages/shared/src/config-types.js";
|
|
12
12
|
import { Awaitable, GeneratedFile, JsonValue, PackageJson, ToolchainArgument, ToolchainCommand, ToolchainCommandContext, ToolchainOption } from "./packages/shared/src/types.js";
|
|
13
|
-
import { CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, biomeConfigSchema, changelogConfigSchema, changelogWorkflowsConfigSchema, dbxConfigSchema, loggerConfigSchema, projectConfigSchema, projectTypeSchema, providersConfigSchema, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema } from "./packages/shared/src/config-schema.js";
|
|
13
|
+
import { CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, biomeConfigSchema, changelogConfigSchema, changelogVersioningConfigSchema, changelogVersioningSchema, changelogVersioningTargetSchema, changelogWorkflowsConfigSchema, dbxConfigSchema, loggerConfigSchema, projectConfigSchema, projectTypeSchema, providersConfigSchema, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema } from "./packages/shared/src/config-schema.js";
|
|
14
14
|
import { CONFIG_FILE_NAMES, DbxConfig, ManagedFile, SyncContext, SyncSummary, SyncTask, ToolchainConfig, ToolchainHooks, ToolchainSection, defineConfig, repoSlugFromUrl, resolveTokens, sectionConfig, sectionEnabled } from "./packages/shared/src/toolchain.js";
|
|
15
15
|
import { YamlValue, toYaml } from "./packages/shared/src/yaml.js";
|
|
16
16
|
import "./packages/shared/src/index.js";
|
|
17
|
-
export { Awaitable, CONFIG_FILE_NAMES, CONFIG_SECTION_DESCRIPTIONS, CONFIG_SECTION_SCHEMAS, CONFIG_TYPE_SCHEMAS, ChangelogWorkflowsConfig, Colors, DbxConfig, DbxConfigSections, GeneratedFile, JsonValue, LOG_LEVELS, LogChannel, LogLevel, Logger, LoggerConfig, LoggerOptions, ManagedFile, PackageJson, ProjectType, ReplacementOptions, ReplacementValue, Replacements, Replacer, RunOptions, Sortable, 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, changelogWorkflowsConfigSchema, configureLogger, constantCase, createLogger, createReplacer, dbxConfigSchema, deepMerge, defineConfig, defineReplacements, ensureLeadingSlash, ensureSlashes, ensureTrailingSlash, extractTokens, findOwnCliEntry, formatCliFlag, getLogOverrides, getLogger, hasText, hasUnresolvedTokens, indent, isLocalhost, isLogLevel, isPlainObject, kebabCase, logger, loggerConfigSchema, mapValues, mergeJsonAt, normalizeLogLevel, pascalCase, projectConfigSchema, projectTypeSchema, providerActions, providersConfigSchema, readJsonAt, readJsonFile, removeDoubleSlashes, removeLeadingSlash, removeTrailingSlash, repoSlugFromUrl, resolveSort, resolveTokens, run, sanitizeSlashes, sectionConfig, sectionEnabled, setLogConfig, setLogOverrides, snakeCase, sort, spawnCross, str, stripAnsi, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, titleCase, toJson, toYaml, tokenPattern, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema, writeJsonFile };
|
|
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, 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, 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, sectionConfig, sectionEnabled, setLogConfig, setLogOverrides, snakeCase, sort, spawnCross, str, stripAnsi, templateKindSchema, templateSourceSchema, templateSourceTypeSchema, templatesConfigSchema, titleCase, toJson, toYaml, tokenPattern, toolchainConfigSchema, tsconfigConfigSchema, viteConfigSchema, watchConfigSchema, workflowConfigSchema, workflowSettingSchema, workflowStepSchema, workflowStepsConfigSchema, writeJsonFile };
|