@dbx-tools/projen 0.9.121 → 0.9.123
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/README.md +1 -1
- 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/src/vscode.ts +5 -0
- package/tasks/dev-watch.ts +4 -14
- package/tasks/release.ts +7 -8
package/README.md
CHANGED
|
@@ -625,7 +625,7 @@ release [options]
|
|
|
625
625
|
| `--release-notes-instructions <value>` | Append instructions to the Genie release-note prompt (env: PROJEN_RELEASE_RELEASE_NOTES_INSTRUCTIONS) |
|
|
626
626
|
| `--demo-deploy` | Deploy the AppKit demo after tagging and local publication (env: PROJEN_RELEASE_DEMO_DEPLOY) |
|
|
627
627
|
| `--no-demo-deploy` | Disable deploy the appkit demo after tagging and local publication |
|
|
628
|
-
| `--profile <value>` | Databricks CLI profile
|
|
628
|
+
| `--profile <value>` | Optional Databricks CLI profile passed to the demo deployment (env: PROJEN_RELEASE_PROFILE) |
|
|
629
629
|
| `--local-publish` | Publish to configured local registries (default: true, env: PROJEN_RELEASE_LOCAL_PUBLISH) |
|
|
630
630
|
| `--no-local-publish` | Disable publish to configured local registries |
|
|
631
631
|
| `--local-registry <value>` | Local npm registry selection: auto, false, or URL (default: "auto", env: PROJEN_RELEASE_LOCAL_REGISTRY) |
|
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.123";
|
|
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.123",
|
|
34
|
+
"@dbx-tools/core": "^0.9.123",
|
|
35
|
+
"@dbx-tools/path": "^0.9.123",
|
|
36
|
+
"@dbx-tools/shared-core": "^0.9.123",
|
|
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.123",
|
|
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) {
|
package/src/vscode.ts
CHANGED
|
@@ -33,6 +33,11 @@ export function configureVsCode(scope: javascript.NodeProject): void {
|
|
|
33
33
|
"**/node_modules/**": true,
|
|
34
34
|
"**/dist/**": true,
|
|
35
35
|
},
|
|
36
|
+
"search.exclude": {
|
|
37
|
+
"**/.prettierrc.json": true,
|
|
38
|
+
"**/eslintrc.json": true,
|
|
39
|
+
"docs/**/archived/**": true,
|
|
40
|
+
},
|
|
36
41
|
});
|
|
37
42
|
editor.extensions.addRecommendations(
|
|
38
43
|
"esbenp.prettier-vscode",
|
package/tasks/dev-watch.ts
CHANGED
|
@@ -265,24 +265,14 @@ export async function main(args: string[] = process.argv.slice(2)): Promise<void
|
|
|
265
265
|
},
|
|
266
266
|
});
|
|
267
267
|
|
|
268
|
-
function interruptChild(): void {
|
|
269
|
-
const current = child;
|
|
270
|
-
if (!current?.pid) return;
|
|
271
|
-
try {
|
|
272
|
-
current.kill("SIGINT");
|
|
273
|
-
} catch {
|
|
274
|
-
// The command already exited.
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
|
|
278
268
|
async function stopChild(): Promise<void> {
|
|
279
269
|
const current = child;
|
|
280
270
|
if (!current) return;
|
|
281
271
|
child = undefined;
|
|
282
272
|
try {
|
|
283
|
-
await
|
|
284
|
-
|
|
285
|
-
|
|
273
|
+
await current.shutdown({
|
|
274
|
+
terminateTimeout: SHUTDOWN_TIMEOUT_MS,
|
|
275
|
+
killTimeout: SHUTDOWN_TIMEOUT_MS,
|
|
286
276
|
});
|
|
287
277
|
} catch (err) {
|
|
288
278
|
logger.error("failed to stop command process tree", {
|
|
@@ -300,6 +290,7 @@ export async function main(args: string[] = process.argv.slice(2)): Promise<void
|
|
|
300
290
|
stdout: "inherit",
|
|
301
291
|
stderr: "inherit",
|
|
302
292
|
check: false,
|
|
293
|
+
forwardTerminationSignals: false,
|
|
303
294
|
});
|
|
304
295
|
child = current;
|
|
305
296
|
void current
|
|
@@ -387,7 +378,6 @@ export async function main(args: string[] = process.argv.slice(2)): Promise<void
|
|
|
387
378
|
clearTimeout(timer);
|
|
388
379
|
restartReason = undefined;
|
|
389
380
|
restoreStdin();
|
|
390
|
-
interruptChild();
|
|
391
381
|
await Promise.race([
|
|
392
382
|
Promise.allSettled([watcher.close(), stopChild()]),
|
|
393
383
|
asyncUtils.sleep(SHUTDOWN_TIMEOUT_MS),
|
package/tasks/release.ts
CHANGED
|
@@ -233,7 +233,7 @@ export async function runRelease(
|
|
|
233
233
|
readonly validationTasks?: readonly string[];
|
|
234
234
|
/** After tagging, stage and deploy the AppKit demo app. Off by default. */
|
|
235
235
|
readonly demoDeploy?: boolean;
|
|
236
|
-
/** Databricks CLI profile
|
|
236
|
+
/** Optional Databricks CLI profile passed to the local demo deployment. */
|
|
237
237
|
readonly demoProfile?: string;
|
|
238
238
|
/** Write `docs/releases/vX.Y.Z.md` via Genie, with a git-log fallback. On by default. */
|
|
239
239
|
readonly releaseNotes?: boolean;
|
|
@@ -361,12 +361,11 @@ export async function runRelease(
|
|
|
361
361
|
}
|
|
362
362
|
|
|
363
363
|
if (options.demoDeploy) {
|
|
364
|
-
runTaskCommand(root, "bun", [
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
});
|
|
364
|
+
runTaskCommand(root, "bun", [
|
|
365
|
+
"run",
|
|
366
|
+
"demo:deploy",
|
|
367
|
+
...(options.demoProfile ? ["--", "--profile", options.demoProfile] : []),
|
|
368
|
+
]);
|
|
370
369
|
}
|
|
371
370
|
|
|
372
371
|
return tag;
|
|
@@ -421,7 +420,7 @@ export const ReleaseOptionsSchema = z.object({
|
|
|
421
420
|
.trim()
|
|
422
421
|
.min(1)
|
|
423
422
|
.optional()
|
|
424
|
-
.describe("Databricks CLI profile
|
|
423
|
+
.describe("Optional Databricks CLI profile passed to the demo deployment"),
|
|
425
424
|
localPublish: z.boolean().default(true).describe("Publish to configured local registries"),
|
|
426
425
|
localRegistry: z
|
|
427
426
|
.string()
|