Skip to content

Commit ea36ae5

Browse files
committed
Fix script
1 parent 042dc8e commit ea36ae5

File tree

6 files changed

+15
-46
lines changed

6 files changed

+15
-46
lines changed

build.js

Lines changed: 7 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,21 @@
1-
import { spawn } from 'node:child_process'
1+
import { spawnSync } from 'node:child_process'
22

3-
async function buildPython() {
4-
await spawn('maturin', ['build', '--release', '--out', 'dist'], {
3+
function buildPython() {
4+
spawnSync('maturin', ['build', '--release', '--out', 'dist'], {
55
cwd: './libs/python/router',
66
stdio: 'inherit',
77
})
8-
await spawn('maturin', ['build', '--release', '--out', 'dist'], {
8+
spawnSync('maturin', ['build', '--release', '--out', 'dist'], {
99
cwd: './libs/python/model',
1010
stdio: 'inherit',
1111
})
12-
await spawn('uv', ['sync', '--reinstall'], {
12+
spawnSync('uv', ['sync', '--reinstall'], {
1313
cwd: './libs/python/fastapi',
1414
stdio: 'inherit',
1515
})
16-
await spawn('uv', ['build'], {
16+
spawnSync('uv', ['build'], {
1717
cwd: './libs/python/fastapi',
1818
stdio: 'inherit',
1919
})
2020
}
21-
await buildPython()
22-
23-
async function buildNodeSql() {
24-
await spawn('cargo', ['clean'], {
25-
cwd: './sql/libs/node/sqlite',
26-
stdio: 'inherit',
27-
})
28-
await spawn('pnpm', ['build'], {
29-
cwd: './sql/libs/node/sqlite',
30-
stdio: 'inherit',
31-
shell: true,
32-
})
33-
await spawn('cargo', ['clean'], {
34-
cwd: './sql/libs/node/postgres',
35-
stdio: 'inherit',
36-
})
37-
await spawn('pnpm', ['build'], {
38-
cwd: './sql/libs/node/postgres',
39-
stdio: 'inherit',
40-
shell: true,
41-
})
42-
await spawn('cargo', ['clean'], {
43-
cwd: './sql/libs/node/mysql',
44-
stdio: 'inherit',
45-
})
46-
await spawn('pnpm', ['build'], {
47-
cwd: './sql/libs/node/mysql',
48-
stdio: 'inherit',
49-
shell: true,
50-
})
51-
}
52-
await buildNodeSql()
21+
buildPython()

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"type": "module",
33
"name": "devup-api",
44
"scripts": {
5-
"build": "node build.js && pnpm -r build",
6-
"build:debug": "node build.js",
5+
"build": "node build.js && pnpm -r --workspace-concurrency 1 build",
6+
"build:debug": "node build.js && pnpm -r --workspace-concurrency 1 build:debug",
77
"project:fastapi": "cd project/python/fastapi && uvicorn main:app --reload",
88
"test": "cargo test && node test.js",
99
"test:vitest": "vitest --run"

sql/libs/node/mysql/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
},
2121
"scripts": {
2222
"artifacts": "napi artifacts",
23-
"build": "napi build --platform --release",
24-
"build:debug": "napi build --platform",
23+
"build": "cargo clean && napi build --platform --release",
24+
"build:debug": "cargo clean && napi build --platform",
2525
"prepublishOnly": "napi prepublish -t npm",
2626
"test": "echo 'test'",
2727
"universal": "napi universal",

sql/libs/node/postgres/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
},
2121
"scripts": {
2222
"artifacts": "napi artifacts",
23-
"build": "napi build --platform --release",
24-
"build:debug": "napi build --platform",
23+
"build": "cargo clean && napi build --platform --release",
24+
"build:debug": "cargo clean && napi build --platform",
2525
"prepublishOnly": "napi prepublish -t npm",
2626
"test": "echo 'test'",
2727
"universal": "napi universal",

sql/libs/node/sqlite/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
},
2121
"scripts": {
2222
"artifacts": "napi artifacts",
23-
"build": "napi build --platform --release",
24-
"build:debug": "napi build --platform",
23+
"build": "cargo clean && napi build --platform --release",
24+
"build:debug": "cargo clean && napi build --platform",
2525
"prepublishOnly": "napi prepublish -t npm",
2626
"test": "echo 'test'",
2727
"universal": "napi universal",

test.db

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)