Repository navigation
chore: type-check and run the root README examples under docgen - #210
Merged
Merged
Conversation
scripts/readme-examples.ts now takes README paths (default README.md) and writes one generated module per README, named after its workspace path. packageConfig gains `rootReadme`; payments-stripe sets it, so its docgen task also runs the root README's blocks (they import the core and the Stripe package) and the root README.md joins that task's cache inputs. The root quick start no longer calls Stripe: it builds `createCustomer` and stops short of invoking it, as the package quick starts do. Part of #178. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WC1gJZL1bzFPvz66HKMe6H
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
Part of #178. Extends #205's README check from the package READMEs to the root
README.md, using as little new machinery as possible:scripts/readme-examples.tsnow takes README paths as arguments (defaultREADME.md, so the other packages behave as before). It writes one generated module per README underdocs/readme/src/, named after the README's path from the workspace root (README.tsfor the root README,packages.<dir>.README.tsfor a package README). Errors name that path (README.md:30: …). It is split into small functions (scanReadme,renderBlock,writeReadme).packageConfiggets arootReadme?: boolean | undefinedoption. payments-stripe sets it because the root blocks import the core and the Stripe package, which both resolve from there throughexportstodist/via the existingbuildedge. Itsdocgentask passesREADME.md ../../README.mdto the script, and the second docgen pass runs both modules. With the option set, the rootREADME.mdis added to that task's cache inputs as{ pattern: "README.md", base: "workspace" }. I checked that editing the root README is a cache miss for payments-stripe's docgen.vp run docgenat the root already depends on payments-stripe's docgen, so it covers the root README too.await Effect.runPromise(...)against the live Stripe API. It now buildsconst createCustomer = () => Effect.runPromise(...)and never calls it, the same build-not-run shape as the package quick starts. That was its only block, and nothing else had drifted.docgencommand line, CONTRIBUTING.md and the rootvite.config.tscomment now say the root README is checked too, and where.Drift check: I renamed
Customer.createtoCustomer.createein the root block.vp run --no-cache docgenthen failed withdocs/readme/examples/6-docs-readme-src-README.ts-constant-line24-0.ts(6,26): error TS2551: Property 'createe' does not exist …. I reverted the rename afterwards.Verification
vp check: pass (0 errors, 119 warnings, all in files this PR does not touch)vp run check: passvp run -r test:unit: pass (140 + 121 + 161 + 1368 tests)vp run -r build: passvp run --no-cache docgen: pass (payments-stripe: 6 package README blocks + 1 root block)vp run test:coverage: pass. Thenfallow audit --base origin/trunk: no issues in 7 changed filesChangeset
Notes
If a root README block ever imports a provider other than Stripe, the package that runs the root blocks needs that provider as a dependency, or the block has to move to that provider's README. AGENTS.md says so.
Generated by Claude Code