From fd6b655a7ce218989b4587c968df673dae4db41a Mon Sep 17 00:00:00 2001 From: Namekuji Date: Sat, 24 Jun 2023 03:59:27 -0400 Subject: [PATCH] fix compile error --- packages/backend/.swcrc | 26 +++++++++++----------- packages/backend/native-utils/package.json | 2 +- packages/calckey-js/.swcrc | 20 +++++++++++++++++ packages/calckey-js/package.json | 4 ++-- scripts/clean-all.js | 8 +++++++ scripts/clean.js | 5 +++++ 6 files changed, 49 insertions(+), 16 deletions(-) create mode 100644 packages/calckey-js/.swcrc diff --git a/packages/backend/.swcrc b/packages/backend/.swcrc index 39e112ff7c..272d9f698c 100644 --- a/packages/backend/.swcrc +++ b/packages/backend/.swcrc @@ -1,15 +1,15 @@ { - "$schema": "https://json.schemastore.org/swcrc", - "jsc": { - "parser": { - "syntax": "typescript", - "dynamicImport": true, - "decorators": true - }, - "transform": { - "legacyDecorator": true, - "decoratorMetadata": true - }, + "$schema": "https://json.schemastore.org/swcrc", + "jsc": { + "parser": { + "syntax": "typescript", + "dynamicImport": true, + "decorators": true + }, + "transform": { + "legacyDecorator": true, + "decoratorMetadata": true + }, "experimental": { "keepImportAssertions": true }, @@ -20,6 +20,6 @@ ] }, "target": "es2022" - }, - "minify": false + }, + "minify": false } diff --git a/packages/backend/native-utils/package.json b/packages/backend/native-utils/package.json index 432074f251..385330d776 100644 --- a/packages/backend/native-utils/package.json +++ b/packages/backend/native-utils/package.json @@ -36,7 +36,7 @@ "artifacts": "napi artifacts", "build": "pnpm run build:napi && pnpm run build:migration", "build:napi": "napi build --features napi --platform --release ./built/", - "build:migration": "cargo build --locked --release --manifest-path ./migration/Cargo.toml && cp -v ./target/release/migration ./built/migration", + "build:migration": "cargo build --locked --release --manifest-path ./migration/Cargo.toml && cp ./target/release/migration ./built/migration", "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:napi && ava", diff --git a/packages/calckey-js/.swcrc b/packages/calckey-js/.swcrc new file mode 100644 index 0000000000..508e597b5c --- /dev/null +++ b/packages/calckey-js/.swcrc @@ -0,0 +1,20 @@ +{ + "$schema": "https://json.schemastore.org/swcrc", + "jsc": { + "parser": { + "syntax": "typescript", + "dynamicImport": true, + "decorators": true + }, + "transform": { + "legacyDecorator": true, + "decoratorMetadata": true + }, + "target": "es2022" + }, + "minify": false, + "module": { + "type": "commonjs", + "strict": true + } +} diff --git a/packages/calckey-js/package.json b/packages/calckey-js/package.json index 78d28ff085..fdb253f454 100644 --- a/packages/calckey-js/package.json +++ b/packages/calckey-js/package.json @@ -5,9 +5,9 @@ "main": "./built/index.js", "types": "./built/index.d.ts", "scripts": { - "build": "pnpm swc src -d built -D && pnpm tsd", + "build": "pnpm swc src -d built -D", "render": "pnpm run build && pnpm run api && pnpm run api-prod && cp temp/calckey-js.api.json etc/ && pnpm run api-doc", - "tsd": "tsd", + "tsd": "tsc && tsd", "api": "pnpm api-extractor run --local --verbose", "api-prod": "pnpm api-extractor run --verbose", "api-doc": "pnpm api-documenter markdown -i ./etc/", diff --git a/scripts/clean-all.js b/scripts/clean-all.js index 8c1032e338..c5fc658499 100644 --- a/scripts/clean-all.js +++ b/scripts/clean-all.js @@ -38,6 +38,14 @@ const { join } = require("node:path"); recursive: true, force: true, }); + fs.rmSync(join(__dirname, "/../packages/calckey-js/built"), { + recursive: true, + force: true, + }); + fs.rmSync(join(__dirname, "/../packages/calckey-js/node_modules"), { + recursive: true, + force: true, + }); fs.rmSync(join(__dirname, "/../built"), { recursive: true, force: true }); fs.rmSync(join(__dirname, "/../node_modules"), { diff --git a/scripts/clean.js b/scripts/clean.js index 76a7873b51..39cbc77b90 100644 --- a/scripts/clean.js +++ b/scripts/clean.js @@ -1,4 +1,5 @@ const fs = require("node:fs"); +const execa = require("execa"); const { join } = require("node:path"); (async () => { @@ -18,5 +19,9 @@ const { join } = require("node:path"); recursive: true, force: true, }); + fs.rmSync(join(__dirname, "/../packages/calckey-js/built"), { + recursive: true, + force: true, + }); fs.rmSync(join(__dirname, "/../built"), { recursive: true, force: true }); })();