feat(pack): ship the card pack as a browser module, faf-cli/pack - #128
Merged
Merged
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ships the card pack from #127 as a browser module. The build writes
src/interop/pack.tsasdist/pack.jsfor the browser (yaml included, no Node built-ins), andpackage.jsonexports it asfaf-cli/pack, with its types atdist/interop/pack.d.ts.import { buildPack } from 'faf-cli'still works in Node; a web page importsfaf-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 fordist/pack.js.tests/wjttc/build-resilience.test.ts: L12 checksdist/pack.jsreaches for no Node built-in, both export targets exist, and the module loads withbuildPackandanswersToFafa. L1 now also scansdist/pack.jsfor build-machine paths.tests/interop/pack.test.ts: keepspack.tsimporting nothing butyaml.Test plan
bun run build: writesdist/pack.js(58 KB) anddist/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