@afokapu/atdd-bun 0.10.72 → 0.10.73

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/integrity.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.10.72",
2
+ "version": "0.10.73",
3
3
  "files": {
4
4
  "HOOK_AUDIT.md": "5329d840db37671b1918f688ead26865473b87db73dbc75f7c8b2a8bbe8d6d43",
5
5
  "PLANNER_PORT.md": "fb5935bac8b7ac18994de21e43ace3a5ef8cd55f85b0e3349fca261280054f11",
@@ -1257,7 +1257,7 @@
1257
1257
  "planner-schemas/wmbt.schema.json": "7a3a5693bfcf01340667c2be4a3c48e74f34b1af7e8dc13372c0de06b7f4fe12",
1258
1258
  "relationships.yaml": "5860a308ebc3ee7fa8172fc2c6633984000ab3003f0ae4b6fa28db48879eda22",
1259
1259
  "src/agent.ts": "6d6c6e75908af8fbab13432f0001b0374bb25cf3dee46ba218dfd67e0090cb56",
1260
- "src/ci.ts": "c4bc0a92e30da3db384e5bc968c45dae7b9de567dcee0e6493eb45cbd8f85652",
1260
+ "src/ci.ts": "2a5e5052c4b99eb5c7282c7db2af3846ad6f3ca7d1eaefe924441116f765f37b",
1261
1261
  "src/cli.ts": "995e41b3cb44c04f65f4d599f0fc51b93b17b7558b7c7dcfabed64de3d455250",
1262
1262
  "src/docs-capability.ts": "bdeeb414649049b1cd4fa8008cada3a576318be51c43bec91bfa46a8e250c270",
1263
1263
  "src/enforce.ts": "7e6b3a1fc7c90f8e1836ab3e4655778fb569a63be5e7c199de44024fc003e6be",
@@ -1279,6 +1279,6 @@
1279
1279
  "templates/agents/atdd-bun.integrity.test.ts": "dec6f6e5f65a08d9512fc703b367c163f8c9da1f6aa7fd466835c1ec30348a41",
1280
1280
  "templates/docs/site.css": "482b3427e3a3cb02a85dc85cfbeac80592dfd53abf42fc92d6ea7071f22afc95",
1281
1281
  "templates/github/atdd-bun-release.yml": "d9547e9e6ef3ae010d53d55314f6a54567f88bd900f7e50d994cd308601d2684",
1282
- "templates/github/atdd-bun.yml": "e67121bc42481906ceb298dd87c9ec70bce55dd59b31a79c1010e53053eec272"
1282
+ "templates/github/atdd-bun.yml": "53d77e2d0dc8fa7f8700ac1d4d5c7522f960b423e894d78e1d8bfc63d68b95c7"
1283
1283
  }
1284
1284
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afokapu/atdd-bun",
3
- "version": "0.10.72",
3
+ "version": "0.10.73",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/afokapu/atdd-bun.git"
package/src/ci.ts CHANGED
@@ -6,6 +6,17 @@ import { policy } from "./hooks";
6
6
  const root = resolve(import.meta.dir, "..");
7
7
  const template = join(root, "templates/github/atdd-bun.yml");
8
8
  const version = (await Bun.file(join(root, "package.json")).json() as { version: string }).version;
9
+ /** A repository that depends on Playwright needs its browser binary on the runner, or `bun test` fails with a missing
10
+ * executable. The step is emitted only for a direct dependency; an unreadable package.json yields no step. */
11
+ async function usesPlaywright(repo: string) {
12
+ const path = join(repo, "package.json");
13
+ if (!existsSync(path)) return false;
14
+ try {
15
+ const manifest = JSON.parse(await readFile(path, "utf8")) as { dependencies?: unknown; devDependencies?: unknown } | null;
16
+ return [manifest?.dependencies, manifest?.devDependencies].some(group => group !== null && typeof group === "object" && ["@playwright/test", "playwright"].some(name => Object.hasOwn(group, name)));
17
+ } catch { return false; }
18
+ }
19
+ const playwrightStep = " - run: ./node_modules/.bin/playwright install --with-deps chromium\n";
9
20
  /** The workflow for this repository: pushes to its protected branches run the post-merge checks, so a repository
10
21
  * whose base branch is not main or master is covered too. The integrity check compares against this same rendering.
11
22
  * Each branch is written as a JSON string, a YAML scalar a branch name can never break out of. */
@@ -16,7 +27,7 @@ export async function renderWorkflow(repo = process.cwd()) {
16
27
  const config = Bun.YAML.parse(await readFile(configPath, "utf8"));
17
28
  rejectNew = Boolean(config && typeof config === "object" && !Array.isArray(config) && (config as { ratchet?: { mode?: unknown } }).ratchet?.mode === "reject-new");
18
29
  } catch { /* policy(repo) below gives its existing parse diagnostic */ }
19
- return (await readFile(template, "utf8")).replace("{{VERSION}}", version).replace("{{PROTECTED_BRANCHES}}", (await policy(repo)).protected_branches.map(branch => JSON.stringify(branch)).join(", ")).replace("{{ENFORCEMENT}}", rejectNew ? 'bun run atdd-bun all --ratchet --base "$ATDD_BASE_REF" --ratchet-activate-profiles' : "bun run atdd-bun all");
30
+ return (await readFile(template, "utf8")).replace("{{PLAYWRIGHT}}\n", await usesPlaywright(repo) ? playwrightStep : "").replace("{{VERSION}}", version).replace("{{PROTECTED_BRANCHES}}", (await policy(repo)).protected_branches.map(branch => JSON.stringify(branch)).join(", ")).replace("{{ENFORCEMENT}}", rejectNew ? 'bun run atdd-bun all --ratchet --base "$ATDD_BASE_REF" --ratchet-activate-profiles' : "bun run atdd-bun all");
20
31
  }
21
32
  const githubPackagesRegistry = /^\s*@[\w.-]+:registry\s*=\s*https:\/\/npm\.pkg\.github\.com\/?\s*$/im;
22
33
  const githubPackagesAuth = /^\s*\/\/npm\.pkg\.github\.com\/:_authToken\s*=\s*(.*?)\s*$/gim;
@@ -29,6 +29,7 @@ jobs:
29
29
  - run: bun install --frozen-lockfile
30
30
  env:
31
31
  NODE_AUTH_TOKEN: ${{ github.token }}
32
+ {{PLAYWRIGHT}}
32
33
  - run: bun run atdd-bun integrity
33
34
  - run: {{ENFORCEMENT}}
34
35
  - run: bun test