docs: make service pages usable and fix config examples that silently no-op - #193
Open
IKatsuba wants to merge 1 commit into
Open
docs: make service pages usable and fix config examples that silently no-op#193IKatsuba wants to merge 1 commit into
IKatsuba wants to merge 1 commit into
Conversation
… no-op Service doc pages were endpoint catalogues: 12 of 14 had no start command and Stripe, Resend and MongoDB Atlas said nothing about how to connect an SDK. Every page now opens with Start, a working SDK snippet, and a seed config block before the endpoint list. Also fixes documented config keys that do not exist in the schemas. Since seed config is never validated, these produced an empty store with no error: - Stripe `product:` -> `product_name:`, dropped the non-existent `recurring:` - Okta `firstName`/`lastName` -> `first_name`/`last_name`, added required `authorization_servers[].id` - Resend `api_keys:` -> `contacts:` - GitHub App `private_key` PKCS#1 -> PKCS#8, with the openssl conversion command Documents the port rule (base + index over the *enabled* set, not a fixed number per service) and corrects ports in six skills, the landing page and the authentication page. Documents `seed` nesting for `createEmulator`, the 5000/hr rate limiter that returns 403, and the permissive token check. Adds the missing Clerk docs (page, package README, skill), Okta and MongoDB Atlas skills, a Troubleshooting page, a Connecting page, and an examples index. Converts markdown tables to HTML. This MDX setup has no remark-gfm, so pipe tables render as a paragraph of text; the tables on the Linear and Twilio pages were already broken this way.
Contributor
|
@IKatsuba is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
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.
Why
I tried to use emulate from the docs and kept getting stuck. Two things kept happening:
Service pages tell you nothing about how to use the service. You click Stripe in the sidebar and get a list of endpoints. No start command, no port, nothing about how to point the Stripe SDK at it. I checked all 14 pages: 12 had no start command at all, and Stripe, Resend and MongoDB Atlas had no connection information of any kind.
Copying a config example from the docs can leave you with an empty store and no error. Seed config is never validated (
start.tspasses the parsed YAML straight toseedFromConfig), so a key that doesn't exist in the schema is dropped silently. Several documented keys don't exist.The clearest example: the Stripe seed block in
docs/configurationand in the Stripe package README both saybut
StripeSeedConfigdeclaresproduct_name, and the matcher atpackages/@emulators/stripe/src/index.ts:89filters onpr.product_name === p.name. Copy the documented example and you get zero seeded prices, no warning, and checkout fails later withNo such price. The correct key is already used inskills/stripe/SKILL.mdand in theemulate inittemplate inregistry.ts— soemulate initgenerates a config that contradicts the docs, on the same "Pro Plan" example.I verified every claim in this PR against the source rather than against other docs.
What changed
Service pages are now usable
Every service page opens with the same three sections before the endpoint list:
new Octokit({ baseUrl }), Slack'sslackApiUrlwith its required trailing/api/, AWS needingendpointandforcePathStyle: true, Stripe'shost/port/protocol, Resend'sRESEND_BASE_URL, Okta'sorgUrl, OIDC discovery for Apple/Microsoft/GoogleLinear and Twilio already had this shape, so they are largely unchanged — the other 12 were brought up to match them.
Config keys corrected
All of these silently seed nothing today:
product:,recurring:product_name:;recurringremoved (the emulator hardcodestype: "one_time")firstName,lastNamefirst_name,last_nameauthorization_serverswithoutididdocumented as required — it becomesserver_id, which the OAuth routes look upapi_keys:contacts:(api_keysis not inResendSeedConfig)-----BEGIN RSA PRIVATE KEY----------BEGIN PRIVATE KEY-----+ theopenssl pkcs8 -topk8commandThe PKCS#1 one is worth calling out:
auth.ts:85usesimportPKCS8, which cannot read PKCS#1, and the exception is swallowed by an emptycatch. GitHub hands out App keys in PKCS#1, so following the docs gives you a JWT that is silently treated as unauthenticated. This was documented in five places.The port rule is now written down
A port is
--port(default 4000) plus the service's index in the enabled set — not a fixed number per service.--service githubbinds 4000, not 4001. This was not stated anywhere, and it had broken several skills, which showed a start command producing one port and then used a different one throughout:skills/awsusedlocalhost:4006in 45 places, which is Okta — with a full fleet running, those requests silently hit the wrong emulator instead of failingskills/apple,skills/microsoft,skills/slack,skills/github,skills/googlehad the same mismatchhero-terminal.tsxhad AWS and Okta swapped and was missing three services; the landing page said "11 services" and used the wrong Stripe portFixed by pinning
--portin each skill's start command, so the examples are valid both standalone and under a barenpx emulate. Also documents the<service>.portseed key, which is the only way to pin a port and was not mentioned anywhere.Undocumented runtime behaviour
createEmulatorseed nesting.api.ts:45readsseed[service], so the seed object must repeat the service name even thoughserviceis passed separately. The adapters take the opposite shape. Both had one line of docs — "same shape as YAML config" — and no example. Now both are shown, with the wrong version marked./rate_limitreports static values that don't reflect it.Authorizationheader gives 401. Two skills stated this backwards. A test asserting "invalid token → 401" passes against the real API and fails here.--service.npx emulate init --service stripethennpx emulatestarts Stripe alone on 4000, not all 14.Missing docs added
DEBUG=1/EMULATE_DEBUG=1,EADDRINUSE, and--portless/--base-urlbeing mutually exclusive.examples/README.md— the seven examples weren't linked from any human-facing doc.Examples
Six of seven examples don't start by following their README. They import
@emulators/*fromdist/, which is gitignored with nopostinstall, sopnpm buildis required first — documented in only one of them. Also:examples/oauthtold you to runnpx emulate --seed emulate.config.yaml, but that file has never existed in the repo history (git log --all), and the CLI exits 1 when a seed file is missing. The app works fine with a barenpx emulate, which is what the README now says. Four READMEs pointed athttp://localhost:3000for apps served through portless on a random port.Docs contributor notes
AGENTS.mdhad no build, test, lint or type-check commands, and its "adding a service" checklist pointed atpackages/emulate/src/index.ts, which has no service list — registration is inregistry.ts. The checklist also omitted the four separate navigation files, which is why/docs/twilioshipped with no nav entry and Clerk shipped with nothing.Note on tables
This MDX setup calls
createMDX()with no plugins, so there's noremark-gfmand pipe tables render as a paragraph of run-together text. All tables here are HTML, matching the existing pages. The tables on the Linear and Twilio pages were already broken this way and are fixed in this PR.The root cause is still there — the next markdown table will fail the same way, and the build won't complain. A one-line
createMDX({ options: { remarkPlugins: [remarkGfm] } })plus the dependency would fix it, but that's a build change rather than a docs change, so I left it out. Happy to add it if you want.Testing
pnpm --filter web buildpasses; all 30 routes generate, including the three new pagespnpm --filter web lintcleanregistry.tswith a scriptOne pre-existing failure is unrelated and untouched:
pnpm lintfails onexamples/nuxt-embedded, which reproduces on a clean checkout ofmain.Not included
No source or build changes — this is documentation only. Two structural fixes from the same investigation are deliberately left out, and without them this class of drift will come back:
start.tsandapi.tswould turn the whole class into a loud error.docs-nav.tsx,docs-mobile-nav.tsxandlib/docs-navigation.ts. Twilio was in one of the three, which is why its page was reachable by search but not by the sidebar.Happy to follow up with either.