Skip to content

Commit ef755b1

Browse files
committed
refactor: Use smith blueprint plugin omitUndocumented option
@seamapi/smith v1 forwards omitUndocumented to the Blueprint, so drop the direct createBlueprint workaround and pass the option through the smith blueprint plugin. Bump @seamapi/smith and @seamapi/blueprint to ^1.0.0. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ASErrFWD4qfnmhzYZNuwYb
1 parent aac3133 commit ef755b1

3 files changed

Lines changed: 22 additions & 36 deletions

File tree

codegen/smith.ts

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import { dirname } from 'node:path'
22
import { fileURLToPath } from 'node:url'
33

44
import layouts from '@metalsmith/layouts'
5-
import { createBlueprint, type TypesModuleInput } from '@seamapi/blueprint'
6-
import { getHandlebarsPartials } from '@seamapi/smith'
5+
import { blueprint, getHandlebarsPartials } from '@seamapi/smith'
76
import * as types from '@seamapi/types/connect'
87
import { deleteAsync } from 'del'
98
import Metalsmith from 'metalsmith'
@@ -16,24 +15,11 @@ await Promise.all([deleteAsync('./seam/routes')])
1615

1716
const partials = await getHandlebarsPartials(`${rootDir}/layouts/partials`)
1817

19-
// Build the Blueprint with omitUndocumented so undocumented routes,
20-
// namespaces, endpoints, parameters, resources, events, action attempts, and
21-
// properties are stripped out before codegen runs.
22-
const setBlueprint = async (
23-
_files: Metalsmith.Files,
24-
metalsmith: Metalsmith,
25-
): Promise<void> => {
26-
const blueprint = await createBlueprint(types as TypesModuleInput, {
27-
omitUndocumented: true,
28-
})
29-
Object.assign(metalsmith.metadata(), { blueprint })
30-
}
31-
3218
Metalsmith(rootDir)
3319
.source('./content')
3420
.destination('../')
3521
.clean(false)
36-
.use(setBlueprint)
22+
.use(blueprint({ types, omitUndocumented: true }))
3723
.use(routes)
3824
.use(
3925
layouts({

package-lock.json

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
"start": "fake-seam-connect --seed"
1515
},
1616
"devDependencies": {
17-
"@seamapi/blueprint": "^0.61.0",
17+
"@seamapi/blueprint": "^1.0.0",
1818
"@seamapi/fake-seam-connect": "1.86.0",
19-
"@seamapi/smith": "^0.5.2",
19+
"@seamapi/smith": "^1.0.0",
2020
"@seamapi/types": "1.975.0",
2121
"change-case": "^5.4.4",
2222
"prettier": "^3.2.5"

0 commit comments

Comments
 (0)