Skip to content

feat(pack): ship the card pack as a browser module, faf-cli/pack - #128

Merged
Wolfe-Jam merged 1 commit into
mainfrom
feat/pack-browser-export
Sep 15, 2026
Merged

Wolfe-Jam merged 1 commit into
mainfrom
feat/pack-browser-export

Conversation

@Wolfe-Jam

Copy link
Copy Markdown
Owner

Summary

Ships the card pack from #127 as a browser module. The build writes src/interop/pack.ts as dist/pack.js for the browser (yaml included, no Node built-ins), and package.json exports it as faf-cli/pack, with its types at dist/interop/pack.d.ts.

import { buildPack } from 'faf-cli' still works in Node; a web page imports faf-cli/pack.

Stacked on #127: this PR's diff is only the export and its tests.

Changes

  • package.json: exports["./pack"] (types + default), and the build step for dist/pack.js.
  • tests/wjttc/build-resilience.test.ts: L12 checks dist/pack.js reaches for no Node built-in, both export targets exist, and the module loads with buildPack and answersToFafa. L1 now also scans dist/pack.js for build-machine paths.
  • tests/interop/pack.test.ts: keeps pack.ts importing nothing but yaml.

Test plan

  • bun run build: writes dist/pack.js (58 KB) and dist/interop/pack.d.ts.
  • bun test tests/wjttc/build-resilience.test.ts tests/interop/pack.test.ts: 33 pass, 0 fail.

Assisted by Claude · Approved by James Wolfe

https://claude.ai/code/session_01VLTqakAFF1Ajfmm1gEc6J1

The build writes src/interop/pack.ts as dist/pack.js for the browser (yaml
included, no Node built-ins), and package.json exports it as faf-cli/pack
with its types at dist/interop/pack.d.ts. import { buildPack } from 'faf-cli'
still works in Node; a web page imports 'faf-cli/pack'.

Tests: build-resilience L12 checks dist/pack.js reaches for no Node
built-in, both export targets exist and the module loads with buildPack and
answersToFafa; L1 now also scans dist/pack.js for build-machine paths; a pack
test keeps pack.ts importing nothing but yaml.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VLTqakAFF1Ajfmm1gEc6J1
@vercel

vercel Bot commented Sep 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
faf-cli Ready Ready Preview Sep 15, 2026 9:53pm UTC

Base automatically changed from feat/front-door-pack to main September 15, 2026 23:41
@Wolfe-Jam
Wolfe-Jam merged commit 93b6b7e into main Sep 15, 2026
3 checks passed
@Wolfe-Jam
Wolfe-Jam deleted the feat/pack-browser-export branch September 15, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant