diff --git a/package.json b/package.json index a6de546ff..42a18a33c 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,7 @@ "private": true, "scripts": { "rebuild": "pnpm run clean && pnpm -r run build && pnpm run gulp", - "build": "pnpm -r run build:cargo && pnpm -r run build:recursive && pnpm run gulp", - "build:recursive": "pnpm -r run build", - "build:cargo": "pnpm --filter backend run build:cargo", + "build": "pnpm -r run build && pnpm run gulp", "start": "pnpm --filter backend run start", "start:test": "pnpm --filter backend run start:test", "init": "pnpm run migrate", diff --git a/packages/backend/native-utils/package.json b/packages/backend/native-utils/package.json index 2e6a721f4..e326a2d3f 100644 --- a/packages/backend/native-utils/package.json +++ b/packages/backend/native-utils/package.json @@ -34,8 +34,8 @@ }, "scripts": { "artifacts": "napi artifacts", - "build": "napi build --features napi --platform --release ./built/", - "build:debug": "napi build --platform", + "build": "napi build --features napi --platform --release ./built/ && cargo build --locked --release --manifest-path ./migration/Cargo.toml", + "build:debug": "napi build --platform ./built/ && cargo build --manifest-path ./migration/Cargo.toml", "prepublishOnly": "napi prepublish -t npm", "test": "pnpm run cargo:test && pnpm run build && ava", "universal": "napi universal", diff --git a/scripts/clean-all.js b/scripts/clean-all.js index c3d85bf3a..c5f682988 100644 --- a/scripts/clean-all.js +++ b/scripts/clean-all.js @@ -1,26 +1,30 @@ -const fs = require('fs'); +const fs = require('node:fs'); const execa = require('execa'); +const { join } = require('node:path'); (async () => { - fs.rmSync(__dirname + '/../packages/backend/built', { recursive: true, force: true }); - fs.rmSync(__dirname + '/../packages/backend/node_modules', { recursive: true, force: true }); + fs.rmSync(join(__dirname, '/../packages/backend/built'), { recursive: true, force: true }); + fs.rmSync(join(__dirname, '/../packages/backend/node_modules'), { recursive: true, force: true }); - fs.rmSync(__dirname + '/../packages/client/built', { recursive: true, force: true }); - fs.rmSync(__dirname + '/../packages/client/node_modules', { recursive: true, force: true }); + fs.rmSync(join(__dirname, '/../packages/backend/native-utils/built'), { recursive: true, force: true }); + fs.rmSync(join(__dirname, '/../packages/backend/native-utils/node_modules'), { recursive: true, force: true }); - fs.rmSync(__dirname + '/../packages/sw/built', { recursive: true, force: true }); - fs.rmSync(__dirname + '/../packages/sw/node_modules', { recursive: true, force: true }); + fs.rmSync(join(__dirname, '/../packages/client/built'), { recursive: true, force: true }); + fs.rmSync(join(__dirname, '/../packages/client/node_modules'), { recursive: true, force: true }); - fs.rmSync(__dirname + '/../built', { recursive: true, force: true }); - fs.rmSync(__dirname + '/../node_modules', { recursive: true, force: true }); + fs.rmSync(join(__dirname, '/../packages/sw/built'), { recursive: true, force: true }); + fs.rmSync(join(__dirname, '/../packages/sw/node_modules'), { recursive: true, force: true }); + + fs.rmSync(join(__dirname, '/../built'), { recursive: true, force: true }); + fs.rmSync(join(__dirname, '/../node_modules'), { recursive: true, force: true }); execa('pnpm', ['store', 'prune'], { - cwd: __dirname + '/../', + cwd: join(__dirname, '/../'), stdio: 'inherit' }); execa('cargo', ['clean'], { - cwd: __dirname + '/../packages/backend/native-utils', + cwd: join(__dirname, '/../packages/backend/native-utils'), stdio: 'inherit' }); })(); diff --git a/scripts/clean.js b/scripts/clean.js index 70b9d882b..cf8ee9bc5 100644 --- a/scripts/clean.js +++ b/scripts/clean.js @@ -1,8 +1,10 @@ -const fs = require('fs'); +const fs = require('node:fs'); +const { join } = require('node:path'); (async () => { - fs.rmSync(__dirname + '/../packages/backend/built', { recursive: true, force: true }); - fs.rmSync(__dirname + '/../packages/client/built', { recursive: true, force: true }); - fs.rmSync(__dirname + '/../packages/sw/built', { recursive: true, force: true }); - fs.rmSync(__dirname + '/../built', { recursive: true, force: true }); + fs.rmSync(join(__dirname, '/../packages/backend/built'), { recursive: true, force: true }); + fs.rmSync(join(__dirname, '/../packages/backend/native-utils/built'), { recursive: true, force: true }); + fs.rmSync(join(__dirname, '/../packages/client/built'), { recursive: true, force: true }); + fs.rmSync(join(__dirname, '/../packages/sw/built'), { recursive: true, force: true }); + fs.rmSync(join(__dirname, '/../built'), { recursive: true, force: true }); })();