@dbx-tools/projen 0.9.122 → 0.9.124
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/index.ts +2 -2
- package/package.json +5 -5
- package/src/bun-workflow.ts +6 -0
- package/src/project-js.ts +50 -2
package/index.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Hand edits are overwritten on the next watch; this file is read-only.
|
|
4
4
|
|
|
5
5
|
export const PACKAGE_IDENTIFIER = "@dbx-tools/projen";
|
|
6
|
-
export const PACKAGE_VERSION = "0.9.
|
|
6
|
+
export const PACKAGE_VERSION = "0.9.124";
|
|
7
7
|
export * as barrels from "./src/barrels.ts";
|
|
8
8
|
export * as bunApp from "./src/bun-app.ts";
|
|
9
9
|
export * as bunWorkflow from "./src/bun-workflow.ts";
|
|
@@ -38,7 +38,7 @@ export * as watch from "./src/watch.ts";
|
|
|
38
38
|
export * as workspaceLock from "./src/workspace-lock.ts";
|
|
39
39
|
export * as workspaceVersion from "./src/workspace-version.ts";
|
|
40
40
|
export { BUN_DEV_OVERRIDE, BUN_BUILD_OVERRIDE, BUN_APP_OVERRIDES, RootBunfigFile, BunfigFile, BunDevServerFile, BunBuildFile } from "./src/bun-app.ts";
|
|
41
|
-
export { BUN_VERSION } from "./src/bun-workflow.ts";
|
|
41
|
+
export { BUN_VERSION, MINIMUM_BUN_VERSION, BUN_VERSION_CHECK_SCRIPT } from "./src/bun-workflow.ts";
|
|
42
42
|
export { DBXToolsConfigDataSchema, DBXToolsConfig } from "./src/dbx-tools-config.ts";
|
|
43
43
|
export type { DBXToolsConfigOptions, DBXToolsConfigData } from "./src/dbx-tools-config.ts";
|
|
44
44
|
export { DEV_WATCH_TASK, DEV_WATCH_SCRIPT, DEV_RESTART_DEBOUNCE_MS, DEV_RESTART_KEY } from "./src/dev-watch.ts";
|
package/package.json
CHANGED
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@clack/prompts": "^1.7.0",
|
|
33
|
-
"@dbx-tools/cli-args": "^0.9.
|
|
34
|
-
"@dbx-tools/core": "^0.9.
|
|
35
|
-
"@dbx-tools/path": "^0.9.
|
|
36
|
-
"@dbx-tools/shared-core": "^0.9.
|
|
33
|
+
"@dbx-tools/cli-args": "^0.9.124",
|
|
34
|
+
"@dbx-tools/core": "^0.9.124",
|
|
35
|
+
"@dbx-tools/path": "^0.9.124",
|
|
36
|
+
"@dbx-tools/shared-core": "^0.9.124",
|
|
37
37
|
"commander": "^15.0.0",
|
|
38
38
|
"concurrently": "^10.0.3",
|
|
39
39
|
"constructs": "^10.6.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"main": "index.ts",
|
|
57
57
|
"license": "Apache-2.0",
|
|
58
|
-
"version": "0.9.
|
|
58
|
+
"version": "0.9.124",
|
|
59
59
|
"types": "index.ts",
|
|
60
60
|
"type": "module",
|
|
61
61
|
"exports": {
|
package/src/bun-workflow.ts
CHANGED
|
@@ -2,3 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
/** Bun version used by package manifests, generated workflows, and CLI services. */
|
|
4
4
|
export const BUN_VERSION = "1.4.2";
|
|
5
|
+
|
|
6
|
+
/** Oldest Bun release allowed to run generated project tasks. */
|
|
7
|
+
export const MINIMUM_BUN_VERSION = BUN_VERSION;
|
|
8
|
+
|
|
9
|
+
/** Generated runtime-version guard executed before dependency installation. */
|
|
10
|
+
export const BUN_VERSION_CHECK_SCRIPT = "scripts/check-bun.ts";
|
package/src/project-js.ts
CHANGED
|
@@ -12,13 +12,17 @@ import * as projectUtils from "@dbx-tools/core/project-utils";
|
|
|
12
12
|
import { ignore, match } from "@dbx-tools/path";
|
|
13
13
|
import { object, stringUtils, type OneOrMany } from "@dbx-tools/shared-core";
|
|
14
14
|
import { type IConstruct } from "constructs";
|
|
15
|
-
import { Component, LogLevel, Project, type Task, javascript, typescript } from "projen";
|
|
15
|
+
import { Component, LogLevel, Project, type Task, TextFile, javascript, typescript } from "projen";
|
|
16
16
|
import { JobPermission, type JobStep } from "projen/lib/github/workflows-model";
|
|
17
17
|
import type { ReleaseProjectOptions } from "projen/lib/release";
|
|
18
18
|
import { generateBarrels, isGeneratedBarrel } from "./barrels.ts";
|
|
19
19
|
|
|
20
20
|
import { BUN_APP_OVERRIDES, RootBunfigFile } from "./bun-app.ts";
|
|
21
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
BUN_VERSION,
|
|
23
|
+
BUN_VERSION_CHECK_SCRIPT,
|
|
24
|
+
MINIMUM_BUN_VERSION,
|
|
25
|
+
} from "./bun-workflow.ts";
|
|
22
26
|
import { codegenModulePaths, generateCodegen } from "./codegen.ts";
|
|
23
27
|
import { DBXToolsConfig, type DBXToolsConfigOptions } from "./dbx-tools-config.ts";
|
|
24
28
|
import { DEV_WATCH_SCRIPT, DEV_WATCH_TASK } from "./dev-watch.ts";
|
|
@@ -503,10 +507,53 @@ function defaultTypeScriptProjectOptions(options: DBXToolsTypeScriptProjectOptio
|
|
|
503
507
|
// Pinned to match the subproject defaults so bun resolves one TypeScript and
|
|
504
508
|
// one runtime-compatible set of Bun globals across the workspace.
|
|
505
509
|
const DEV_DEPS_ROOT: string[] = [
|
|
510
|
+
`bun@${BUN_VERSION}`,
|
|
506
511
|
"typescript@^5.9.3",
|
|
507
512
|
`@types/bun@${BUN_VERSION}`,
|
|
508
513
|
"@types/node@^24.6.0",
|
|
509
514
|
];
|
|
515
|
+
|
|
516
|
+
function configureRootBunRuntime(project: DBXToolsJavaScriptProject): void {
|
|
517
|
+
new TextFile(project, BUN_VERSION_CHECK_SCRIPT, {
|
|
518
|
+
lines: stringUtils
|
|
519
|
+
.dedent(
|
|
520
|
+
// ============================================================================
|
|
521
|
+
/*ts*/`
|
|
522
|
+
/** Minimum Bun version accepted by this workspace. */
|
|
523
|
+
const MINIMUM_VERSION = ${JSON.stringify(MINIMUM_BUN_VERSION)};
|
|
524
|
+
|
|
525
|
+
/** Convert one Bun version into a three-part numeric tuple. */
|
|
526
|
+
function versionTuple(version: string): [number, number, number] {
|
|
527
|
+
const parts = version.split("-", 1)[0]!.split(".");
|
|
528
|
+
return [0, 1, 2].map((index) => Number.parseInt(parts[index] ?? "0", 10)) as [
|
|
529
|
+
number,
|
|
530
|
+
number,
|
|
531
|
+
number,
|
|
532
|
+
];
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
const current = versionTuple(Bun.version);
|
|
536
|
+
const minimum = versionTuple(MINIMUM_VERSION);
|
|
537
|
+
const isTooOld = current.some(
|
|
538
|
+
(part, index) =>
|
|
539
|
+
part < minimum[index]! &&
|
|
540
|
+
current.slice(0, index).every((value, prefix) => value === minimum[prefix]),
|
|
541
|
+
);
|
|
542
|
+
|
|
543
|
+
if (isTooOld) {
|
|
544
|
+
throw new Error(
|
|
545
|
+
\`Bun \${MINIMUM_VERSION} or newer is required; running \${Bun.version}. Use "bun run bun" to select the workspace-local Bun binary.\`,
|
|
546
|
+
);
|
|
547
|
+
}
|
|
548
|
+
`,
|
|
549
|
+
// ============================================================================
|
|
550
|
+
)
|
|
551
|
+
.split("\n"),
|
|
552
|
+
});
|
|
553
|
+
const check = `bun ${BUN_VERSION_CHECK_SCRIPT}`;
|
|
554
|
+
project.package.installTask.prependExec(check);
|
|
555
|
+
project.package.installCiTask.prependExec(check);
|
|
556
|
+
}
|
|
510
557
|
function validateReleaseOptions(options: DBXToolsJavaScriptProjectOptions): void {
|
|
511
558
|
if (
|
|
512
559
|
options.releaseMode === "disabled" &&
|
|
@@ -1209,6 +1256,7 @@ function initProject(
|
|
|
1209
1256
|
// Workspaces generated by this engine intentionally do not track local-registry
|
|
1210
1257
|
// lockfiles, so the CI-named install task must resolve from manifests as well.
|
|
1211
1258
|
project.package.installCiTask.reset("bun install");
|
|
1259
|
+
configureRootBunRuntime(project);
|
|
1212
1260
|
const roots = options.packageRoots ?? DEFAULT_PACKAGE_ROOTS;
|
|
1213
1261
|
project.dbxToolsConfig.packageRoots = [...roots];
|
|
1214
1262
|
if (options.syncResynthPaths?.length) {
|