Commit b768d1d
Port Python SDK route generation from nextlove to Metalsmith (#581)
* feat: Replace nextlove sdk generator with metalsmith codegen
Replace the @seamapi/nextlove-sdk-generator based route generation with
the metalsmith + handlebars + @seamapi/blueprint architecture used by
seamapi/javascript-http. The generated output under seam/routes/ is
byte-identical.
The blueprint drives the route, endpoint, and namespace structure. The
raw OpenAPI spec is still consulted wherever the nextlove generator
derived output from data the blueprint normalizes differently (integer
vs number types, resource schema set and order, parameter flattening);
each of those spots carries a TODO to migrate to the blueprint once
output is allowed to change.
- Add codegen/ with the Metalsmith pipeline, plugin, context builders,
and Handlebars layouts and partials
- Remove generate-routes.js
- Pin @seamapi/types at 1.910.0 for output parity and use
@seamapi/blueprint 0.55.0
- Bump del to ^8 to satisfy the @seamapi/smith peer range
- Ignore *.hbs and CODEGEN.md in a new .prettierignore since the
glimmer parser mangles Python-flavored templates
- Re-include codegen/lib/ in .gitignore (the Python template ignores
lib/) and ignore the generated CODEGEN.md seed
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019iX1vWXfXKzUyRJTVm8D7s
* docs: Mark all deferred codegen workarounds with TODO
Every comment describing behavior to address later now leads with TODO
so the deferred work is greppable: the parameter comparator precedence
quirk and the unwired deeply nested namespaces.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019iX1vWXfXKzUyRJTVm8D7s
* refactor: Simplify codegen setup to match seamapi/docs conventions
- Trim devDependencies to direct imports only: metalsmith,
@metalsmith/layouts, jstransformer-handlebars, del, tsx, typescript,
eslint, jiti, and mkdirp are @seamapi/smith peers that npm installs
automatically, matching how seamapi/docs consumes smith
- Add tsconfig.json extending @seamapi/smith/tsconfig.base.json with a
typecheck script and codegen/index.ts stub, mirroring seamapi/docs
and seamapi/javascript-http
- Widen response type properties for exactOptionalPropertyTypes
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019iX1vWXfXKzUyRJTVm8D7s
* refactor: Align codegen scripts and imports with seamapi/docs
- Add lint, postlint, and preformat scripts using
@seamapi/smith/eslint-config via a one-line eslint.config.ts,
matching seamapi/docs
- Replace relative parent imports with lib/* path imports (tsconfig
baseUrl and paths), satisfying import/no-relative-parent-imports and
matching the smith import sort convention
- Mark every file and function that exists only for output parity with
a TEMPORARY banner and a TODO to delete it once generated output is
allowed to change, so temp code is skippable in review
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019iX1vWXfXKzUyRJTVm8D7s
* refactor: Drop tsconfig paths in favor of relative imports
Match how seamapi/docs consumes @seamapi/smith: extend the base
tsconfig with no compiler option overrides and use plain relative
imports in codegen.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019iX1vWXfXKzUyRJTVm8D7s
* fix: Move codegen gitignore rules to conventional positions
CODEGEN.md moves to the top of the file. The codegen/lib/ negation
moves next to the lib/ pattern it negates, since a gitignore negation
only takes effect after the pattern it overrides.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019iX1vWXfXKzUyRJTVm8D7s
* fix: Track the codegen content seed
The CODEGEN.md gitignore rule matches any depth, so the Metalsmith
source seed codegen/content/CODEGEN.md was never committed and CI
failed to generate with ENOENT on the missing directory. Force-add the
seed exactly as seamapi/javascript-http does; the ignore rule still
covers the generated CODEGEN.md at the repository root.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019iX1vWXfXKzUyRJTVm8D7s
* fix: Remove gitignore comment per review
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019iX1vWXfXKzUyRJTVm8D7s
* Update .gitignore to include codegen/lib exception
Add exception for codegen/lib in .gitignore
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent d41bc9e commit b768d1d
34 files changed
Lines changed: 7058 additions & 973 deletions
File tree
- codegen
- content
- layouts
- partials
- lib
- layouts
- openapi
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| |||
325 | 328 | | |
326 | 329 | | |
327 | 330 | | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
0 commit comments