@dbx-tools/projen 0.6.52 → 0.6.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +4 -4
  2. package/src/scaffold.ts +10 -2
package/package.json CHANGED
@@ -26,9 +26,9 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@clack/prompts": "^1.7.0",
29
- "@dbx-tools/core": "0.6.52",
30
- "@dbx-tools/path": "0.6.52",
31
- "@dbx-tools/shared-core": "0.6.52",
29
+ "@dbx-tools/core": "0.6.53",
30
+ "@dbx-tools/path": "0.6.53",
31
+ "@dbx-tools/shared-core": "0.6.53",
32
32
  "commander": "^15.0.0",
33
33
  "concurrently": "^10.0.3",
34
34
  "constructs": "^10.6.0",
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "main": "index.ts",
49
49
  "license": "Apache-2.0",
50
- "version": "0.6.52",
50
+ "version": "0.6.53",
51
51
  "types": "index.ts",
52
52
  "type": "module",
53
53
  "exports": {
package/src/scaffold.ts CHANGED
@@ -6,9 +6,15 @@ import { exec } from "@dbx-tools/core";
6
6
  import { repoRoot } from "./packages.ts";
7
7
 
8
8
  /**
9
- * Re-run projen synth by executing `.projenrc.ts` with `node --import tsx` (no
9
+ * Re-run projen synth by executing `.projenrc.ts` with the CURRENT runtime (no
10
10
  * projen network re-exec).
11
11
  *
12
+ * The TypeScript loader is chosen by which runtime is running: bun executes
13
+ * `.ts` natively, while node needs `--import tsx`. Passing `--import tsx` to bun
14
+ * fails outright (`Cannot find module './cjs/index.cjs'`), which is what broke
15
+ * `sync` once the repo moved onto bun - `process.execPath` is bun here, so the
16
+ * flag was aimed at the one runtime that cannot take it.
17
+ *
12
18
  * `post: true` runs the full flow - projen's post-synth `bun install` AND the
13
19
  * post-synth barrels component - which is what the one-shot `sync` task
14
20
  * wants. The default (`post: false`) sets `PROJEN_DISABLE_POST`, skipping both so
@@ -26,7 +32,9 @@ export function runSynth(options: { post?: boolean } = {}): void {
26
32
  const env = { ...process.env };
27
33
  if (options.post) delete env.PROJEN_DISABLE_POST;
28
34
  else env.PROJEN_DISABLE_POST = "true";
29
- exec.spawnSync(process.execPath, ["--import", "tsx", join(repoRoot, ".projenrc.ts")], {
35
+ const projenrc = join(repoRoot, ".projenrc.ts");
36
+ const args = process.versions.bun ? [projenrc] : ["--import", "tsx", projenrc];
37
+ exec.spawnSync(process.execPath, args, {
30
38
  cwd: repoRoot,
31
39
  env,
32
40
  check: true,