Let other packages render and export with reader through a public API
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, nodejs
Research direction
Start in package.json: check the name field (self-referencing imports need it) and how tests are currently run, then read src/render.js and src/export.js to confirm the named exports (render, makeRenderer, titleOf, exportHtml) and find the aside writer from #315. Add the exports map with ./render, ./export and ./asides, then add tests that import each through the reader/... package names and one that expects a deep path outside exports to fail with ERR_PACKAGE_PATH_NOT_EXPORTED. Finish by adding the public-API paragraph to CONTRIBUTING.md; done when the suite passes and the checklist's three boxes are satisfied.
Written by the indexing model from the issue text.
Description
Part of #68. Also what reader-margin, a companion server for margin notes on published posts, builds on.
Today
reader is an app, not a package other code can rely on. package.json has no exports, so another package that depends on reader imports whatever paths it finds (reader/src/render.js), and a rename inside reader breaks it with no warning.
What to do
Declare what another package may use, in package.json exports, and keep everything else private:
reader/render:render,makeRendererandtitleOf(src/render.js)reader/export:exportHtml(src/export.js)reader/asides: the aside writer (#315) and what reads asides
A dependent pins a tagged reader from GitHub ("reader": "github:jzheaux/reader#v0.0.6"), so these names are what a tag promises.
Done when
-
exportslists the entry points above, and a test imports each by its package name. - A test checks that a path outside
exportscan't be imported. -
CONTRIBUTING.mdsays these are a public API: changing one is a breaking change, called out in the release notes.
🤖 Generated with Claude Code
- Dominant language
- JavaScript
- Stars
- 0
- Forks
- 1
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 26
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
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.
More from jzheaux/reader
-
accessibility bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 55/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
polish
Difficulty 3/5 1-2 days Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
accessibility
Difficulty 3/5 1-2 days Newbie friendliness 60/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
OWASP/CheatSheetSeries#3018 ·
Maintainers usually reply within 1 day
-
Radix number block generates NaN after switching a negative or decimal number to binary, octal or hexPossibly taken @matthewalberto claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
mit-cml/appinventor-sources#4246 · 1 comment ·
Maintainers usually reply within 1 day
-
marketing
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 83/100
GoogleChrome/modern-web-guidance-src#3675 · 2 comments ·
Maintainers usually reply within 1 day