Skip to content

Commit f709965

Browse files
committed
bootstrap: vendor submodules opt-in via --forks
Nothing imports from vendor/ at runtime — the forks are consumed as published npm packages (vendor/README.md is explicit). Forcing the submodule init in bootstrap taught every fresh worktree a false dependency. --forks remains for deliberately developing a fork.
1 parent f907cd3 commit f709965

2 files changed

Lines changed: 18 additions & 9 deletions

File tree

AGENTS.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
## Fresh Checkout / Worktree Setup
44

55
Run `bun run bootstrap` first in any fresh checkout or worktree. It is
6-
idempotent: inits the vendor submodules (`vendor/emulate`, `vendor/mcporter`
7-
the e2e suite needs both), runs `bun install` (whose prepare hook builds the
8-
internal packages dev servers fail without), and installs Playwright chromium.
6+
idempotent: runs `bun install` (whose prepare hook builds the internal
7+
packages dev servers fail without) and installs Playwright chromium.
98
Skipping it is why fresh worktrees die with "Failed to resolve entry for
10-
package '@executor-js/vite-plugin'".
9+
package '@executor-js/vite-plugin'". The `vendor/` submodules are NOT
10+
needed — nothing imports from `vendor/` at runtime; those forks are consumed
11+
from npm (see `vendor/README.md`). `bun run bootstrap --forks` inits them
12+
only when you're deliberately developing a fork.
1113

1214
## Environment Gotchas (learned the hard way)
1315

scripts/bootstrap.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
// One-command setup for a fresh checkout or agent worktree: submodules,
2-
// dependencies (whose prepare hook builds the internal packages dev servers
3-
// need), and the Playwright browser the e2e suite drives. Idempotent and
4-
// safe to re-run; each step prints what it is doing.
1+
// One-command setup for a fresh checkout or agent worktree: dependencies
2+
// (whose prepare hook builds the internal packages dev servers need) and the
3+
// Playwright browser the e2e suite drives. Idempotent and safe to re-run;
4+
// each step prints what it is doing.
5+
//
6+
// The vendor/ submodules are intentionally NOT initialized: nothing imports
7+
// from vendor/ at runtime — those forks are consumed as published npm
8+
// packages (see vendor/README.md). Pass --forks only when deliberately
9+
// developing a fork.
510
import { execFileSync } from "node:child_process";
611
import { existsSync } from "node:fs";
712
import { resolve } from "node:path";
@@ -14,7 +19,9 @@ const run = (label: string, cmd: string, args: ReadonlyArray<string>) => {
1419
execFileSync(cmd, [...args], { cwd: repoRoot, stdio: "inherit" });
1520
};
1621

17-
run("vendor submodules", "git", ["submodule", "update", "--init", "--recursive"]);
22+
if (process.argv.includes("--forks")) {
23+
run("vendor fork submodules", "git", ["submodule", "update", "--init", "--recursive"]);
24+
}
1825

1926
// `bun install` runs the workspace prepare hook, which builds
2027
// @executor-js/vite-plugin and @executor-js/react — the two artifacts the

0 commit comments

Comments
 (0)