Thinkmill / Thinkmill/keystatic
Why does the built code for `@keystatic/core/reader` import unrelated frontend dependencies?
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.4k
- Forks
- 159
- Avg merge
- 21h 41m
- Merged PRs (30d)
- 2
Description
This affects @keystatic/core@0.6.5:
See https://npmx.dev/package-code/@keystatic/core/v/0.6.5/dist%2Fkeystatic-core-reader.js or alternatively view raw file on jsDelivr.
Why are unrelated frontend modules (e.g. @keystar/ui) imported into the reader?
Reading the package.json exports declarations for the 0.6.5 release, the keystatic-core-reader.js module will only be used as a fallback, while most Node.js environments will resolve the much smaller module //dist/keystatic-core-reader.node.js which does not include the unrelated @keystar/ui imports.
This seems like an error with the package build process. The effect might be that the reader API could be much slower than it needs to be when executed in non-Node.js runtimes. Though I have not tested this with for example Deno or Bun - I just think this looks weird and wanted to report it.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the package.json exports declarations with dist/keystatic-core-reader.js and dist/keystatic-core-reader.node.js for @keystatic/core@0.6.5. Trace why the reader bundle includes @keystar/ui and other frontend imports, then check resolution in Node.js, Deno, and Bun. Done means the cause is identified and the reader entry point avoids unrelated frontend dependencies where appropriate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bun, deno, node.js, typescript
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100