Skip to content

Commit 9d08ecb

Browse files
razor-xseambot
andauthored
Write json to temp in blueprint example (#184)
* Write json to temp in blueprint example * ci: Generate code --------- Co-authored-by: Seam Bot <seambot@getseam.com>
1 parent 0a0d49a commit 9d08ecb

File tree

5 files changed

+449
-14
lines changed

5 files changed

+449
-14
lines changed

examples/blueprint.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
import { writeFile } from 'node:fs/promises'
2+
import { join } from 'node:path'
3+
14
import type { Builder, Command, Describe, Handler } from 'landlubber'
5+
import { mkdirp } from 'mkdirp'
26

37
import { createBlueprint, TypesModuleSchema } from '@seamapi/blueprint'
48

@@ -22,4 +26,9 @@ export const handler: Handler<Options> = async ({ moduleName, logger }) => {
2226
const types = TypesModuleSchema.parse(await import(moduleName))
2327
const blueprint = await createBlueprint(types)
2428
logger.info({ blueprint }, 'blueprint')
29+
await mkdirp('tmp')
30+
await writeFile(
31+
join('tmp', 'seam-api-blueprint.json'),
32+
JSON.stringify(blueprint),
33+
)
2534
}

package-lock.json

Lines changed: 26 additions & 8 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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"zod": "^3.23.8"
7474
},
7575
"devDependencies": {
76-
"@seamapi/types": "1.386.2",
76+
"@seamapi/types": "1.392.1",
7777
"@types/node": "^20.8.10",
7878
"ava": "^6.0.1",
7979
"c8": "^10.1.2",
@@ -85,6 +85,7 @@
8585
"eslint-plugin-simple-import-sort": "^12.0.0",
8686
"eslint-plugin-unused-imports": "^3.0.0",
8787
"landlubber": "^2.0.0",
88+
"mkdirp": "^3.0.1",
8889
"prettier": "^3.0.0",
8990
"tsc-alias": "^1.8.2",
9091
"tsup": "^8.0.1",

0 commit comments

Comments
 (0)