Merge pull request '[PR]: fix (calckey-js): compile error' (#10356) from nmkj/calckey:fix-build-calckey-js into develop

Reviewed-on: https://codeberg.org/calckey/calckey/pulls/10356
This commit is contained in:
Kainoa Kanter 2023-06-24 08:34:40 +00:00
commit 9712299065
6 changed files with 49 additions and 16 deletions

View File

@ -1,15 +1,15 @@
{ {
"$schema": "https://json.schemastore.org/swcrc", "$schema": "https://json.schemastore.org/swcrc",
"jsc": { "jsc": {
"parser": { "parser": {
"syntax": "typescript", "syntax": "typescript",
"dynamicImport": true, "dynamicImport": true,
"decorators": true "decorators": true
}, },
"transform": { "transform": {
"legacyDecorator": true, "legacyDecorator": true,
"decoratorMetadata": true "decoratorMetadata": true
}, },
"experimental": { "experimental": {
"keepImportAssertions": true "keepImportAssertions": true
}, },
@ -20,6 +20,6 @@
] ]
}, },
"target": "es2022" "target": "es2022"
}, },
"minify": false "minify": false
} }

View File

@ -36,7 +36,7 @@
"artifacts": "napi artifacts", "artifacts": "napi artifacts",
"build": "pnpm run build:napi && pnpm run build:migration", "build": "pnpm run build:napi && pnpm run build:migration",
"build:napi": "napi build --features napi --platform --release ./built/", "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", "build:debug": "napi build --platform ./built/ && cargo build --manifest-path ./migration/Cargo.toml",
"prepublishOnly": "napi prepublish -t npm", "prepublishOnly": "napi prepublish -t npm",
"test": "pnpm run cargo:test && pnpm run build:napi && ava", "test": "pnpm run cargo:test && pnpm run build:napi && ava",

View File

@ -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
}
}

View File

@ -5,9 +5,9 @@
"main": "./built/index.js", "main": "./built/index.js",
"types": "./built/index.d.ts", "types": "./built/index.d.ts",
"scripts": { "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", "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": "pnpm api-extractor run --local --verbose",
"api-prod": "pnpm api-extractor run --verbose", "api-prod": "pnpm api-extractor run --verbose",
"api-doc": "pnpm api-documenter markdown -i ./etc/", "api-doc": "pnpm api-documenter markdown -i ./etc/",

View File

@ -38,6 +38,14 @@ const { join } = require("node:path");
recursive: true, recursive: true,
force: 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, "/../built"), { recursive: true, force: true });
fs.rmSync(join(__dirname, "/../node_modules"), { fs.rmSync(join(__dirname, "/../node_modules"), {

View File

@ -1,4 +1,5 @@
const fs = require("node:fs"); const fs = require("node:fs");
const execa = require("execa");
const { join } = require("node:path"); const { join } = require("node:path");
(async () => { (async () => {
@ -18,5 +19,9 @@ const { join } = require("node:path");
recursive: true, recursive: true,
force: true, force: true,
}); });
fs.rmSync(join(__dirname, "/../packages/calckey-js/built"), {
recursive: true,
force: true,
});
fs.rmSync(join(__dirname, "/../built"), { recursive: true, force: true }); fs.rmSync(join(__dirname, "/../built"), { recursive: true, force: true });
})(); })();