Skip to content

Commit 308ea14

Browse files
committed
Add turbo build and update proto codegen command
1 parent 36a34bb commit 308ea14

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

lazer/sdk/js/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
}
2222
},
2323
"scripts": {
24-
"proto-codegen": "mkdir -p src/generated && pnpm exec pbjs -t static-module -w es6 -o src/generated/proto.js ../proto/*.proto && pnpm exec pbts -o src/generated/proto.d.ts src/generated/proto.js",
25-
"prebuild": "rm -rf ./src/generated && pnpm run proto-codegen",
24+
"build:proto-codegen": "mkdir -p src/generated && pnpm exec pbjs -t static-module -w es6 -o src/generated/proto.js ../proto/*.proto && pnpm exec pbts -o src/generated/proto.d.ts src/generated/proto.js",
2625
"build:cjs": "tsc --project tsconfig.build.json --verbatimModuleSyntax false --module commonjs --outDir ./dist/cjs && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
2726
"build:esm": "tsc --project tsconfig.build.json --outDir ./dist/esm && echo '{\"type\":\"module\"}' > dist/esm/package.json",
2827
"fix:lint": "eslint --fix . --max-warnings 0",

lazer/sdk/js/turbo.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"$schema": "https://turbo.build/schema.json",
3+
"extends": ["//"],
4+
"tasks": {
5+
"build:proto-codegen": {
6+
"dependsOn": ["//#install:modules"],
7+
"inputs": ["../proto/**"],
8+
"outputs": ["src/generated/**"],
9+
"cache": false
10+
},
11+
"build": {
12+
"dependsOn": ["build:proto-codegen", "^build"],
13+
"outputs": ["dist/**"]
14+
},
15+
"build:cjs": {
16+
"dependsOn": ["build:proto-codegen"],
17+
"outputs": ["dist/cjs/**"]
18+
},
19+
"build:esm": {
20+
"dependsOn": ["build:proto-codegen"],
21+
"outputs": ["dist/esm/**"]
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)