Skip to content

Commit 8aa65e2

Browse files
committed
feat: add nest cli builder
1 parent 2125e69 commit 8aa65e2

File tree

4 files changed

+21
-1
lines changed

4 files changed

+21
-1
lines changed

packages/nest/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
"exports": {
2020
".": "./dist/index.js"
2121
},
22+
"bin": {
23+
"workflow-nest-build": "./dist/bin/build.js"
24+
},
2225
"scripts": {
2326
"build": "tsc",
2427
"dev": "tsc --watch",

packages/nest/src/bin/build.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env node
2+
3+
import { LocalBuilder, VercelBuilder } from '../builder.js';
4+
5+
if (process.env.VERCEL_DEPLOYMENT_ID) {
6+
console.log('Building workflows for Vercel...');
7+
await new VercelBuilder().build();
8+
console.log('Vercel workflow build complete.');
9+
} else {
10+
console.log('Building workflows for local...');
11+
await new LocalBuilder().build();
12+
console.log('Local workflow build complete.');
13+
}

pnpm-lock.yaml

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

workbench/nest/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"generate:workflows": "node ../scripts/generate-workflows-registry.js src/workflows src/lib/_workflow.ts",
77
"predev": "pnpm generate:workflows",
8-
"prebuild": "pnpm generate:workflows",
8+
"prebuild": "pnpm generate:workflows && workflow-nest-build",
99
"dev": "nest start --watch",
1010
"build": "nest build",
1111
"start": "node dist/main"
@@ -27,6 +27,7 @@
2727
"workflow": "workspace:*"
2828
},
2929
"devDependencies": {
30+
"@workflow/nest": "workspace:*",
3031
"@ai-sdk/react": "2.0.76",
3132
"@nestjs/cli": "^11.0.0",
3233
"@nestjs/schematics": "^11.0.0",

0 commit comments

Comments
 (0)