diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-03-30 13:46:25 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2023-03-30 13:46:25 +0900 |
| commit | ea6f9f1e7db2ea2fff679f783fe96a22a03a4afd (patch) | |
| tree | b202b69c0703beacc1a0c1a947b0bef24d1da533 /packages | |
| parent | enhance(client): ノートのリアクションを大きく表示するオプ... (diff) | |
| download | misskey-ea6f9f1e7db2ea2fff679f783fe96a22a03a4afd.tar.gz misskey-ea6f9f1e7db2ea2fff679f783fe96a22a03a4afd.tar.bz2 misskey-ea6f9f1e7db2ea2fff679f783fe96a22a03a4afd.zip | |
tweak misskey-js config
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/misskey-js/.swcrc | 23 | ||||
| -rw-r--r-- | packages/misskey-js/jest.config.cjs (renamed from packages/misskey-js/jest.config.ts) | 4 | ||||
| -rw-r--r-- | packages/misskey-js/package.json | 28 |
3 files changed, 39 insertions, 16 deletions
diff --git a/packages/misskey-js/.swcrc b/packages/misskey-js/.swcrc new file mode 100644 index 0000000000..0504a2d389 --- /dev/null +++ b/packages/misskey-js/.swcrc @@ -0,0 +1,23 @@ +{ + "$schema": "https://json.schemastore.org/swcrc", + "jsc": { + "parser": { + "syntax": "typescript", + "dynamicImport": true, + "decorators": true + }, + "transform": { + "legacyDecorator": true, + "decoratorMetadata": true + }, + "experimental": { + "keepImportAssertions": true + }, + "baseUrl": "src", + "paths": { + "@/*": ["*"] + }, + "target": "es2022" + }, + "minify": false +} diff --git a/packages/misskey-js/jest.config.ts b/packages/misskey-js/jest.config.cjs index 6d7eeddfea..e5a74170ea 100644 --- a/packages/misskey-js/jest.config.ts +++ b/packages/misskey-js/jest.config.cjs @@ -3,7 +3,7 @@ * https://jestjs.io/docs/en/configuration.html */ -export default { +module.exports = { // All imported modules in your tests should be mocked automatically // automock: false, @@ -174,7 +174,7 @@ export default { // A map from regular expressions to paths to transformers transform: { - "^.+\\.(ts|tsx)$": "ts-jest" + "^.+\\.(t|j)sx?$": ["@swc/jest"], }, // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation diff --git a/packages/misskey-js/package.json b/packages/misskey-js/package.json index 89472bf85b..a4b835a4d8 100644 --- a/packages/misskey-js/package.json +++ b/packages/misskey-js/package.json @@ -5,43 +5,43 @@ "main": "./built/index.js", "types": "./built/index.d.ts", "scripts": { - "build": "tsc", - "tsc": "tsc", + "build": "swc src -d built -D", "tsd": "tsd", "api": "pnpm api-extractor run --local --verbose", "api-prod": "pnpm api-extractor run --verbose", - "lint": "eslint . --ext .js,.jsx,.ts,.tsx", + "eslint": "eslint . --ext .js,.jsx,.ts,.tsx", + "typecheck": "tsc --noEmit", + "lint": "pnpm typecheck && pnpm eslint", "jest": "jest --coverage --detectOpenHandles", - "test": "pnpm jest && pnpm tsd", - "eslint": "pnpm lint", - "typecheck": "tsc --noEmit" + "test": "pnpm jest && pnpm tsd" }, "repository": { "type": "git", "url": "git+https://github.com/misskey-dev/misskey.js.git" }, "devDependencies": { - "@microsoft/api-extractor": "^7.19.3", - "@types/jest": "^29.5.0", + "@microsoft/api-extractor": "7.34.4", + "@types/jest": "29.5.0", "@types/node": "18.15.11", "@typescript-eslint/eslint-plugin": "5.57.0", "@typescript-eslint/parser": "5.57.0", + "@swc/jest": "0.2.24", "eslint": "8.37.0", "jest": "^29.5.0", "jest-fetch-mock": "^3.0.3", - "jest-websocket-mock": "^2.2.1", - "mock-socket": "^9.0.8", - "ts-jest": "^29.0.5", - "ts-node": "10.4.0", - "tsd": "^0.19.1", + "jest-websocket-mock": "2.4.0", + "mock-socket": "9.2.1", + "tsd": "0.28.1", "typescript": "5.0.2" }, "files": [ "built" ], "dependencies": { + "@swc/cli": "0.1.62", + "@swc/core": "1.3.42", "autobind-decorator": "^2.4.0", - "eventemitter3": "^4.0.7", + "eventemitter3": "5.0.0", "reconnecting-websocket": "^4.4.0" } } |