From eedfd27d39d87a96c5f70a25ba94370f777393f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=BE=E3=81=A3=E3=81=A1=E3=82=83=E3=81=A8=E3=83=BC?= =?UTF-8?q?=E3=81=AB=E3=82=85?= <17376330+u1-liquid@users.noreply.github.com> Date: Sun, 28 Apr 2024 17:35:53 +0900 Subject: [PATCH] =?UTF-8?q?Revert=20"fix:=20misskey-js=E3=80=81bubble-game?= =?UTF-8?q?=E3=80=81reversi=E3=81=AE=E3=83=93=E3=83=AB=E3=83=89=E3=82=92es?= =?UTF-8?q?build=E3=81=AB=E7=B5=B1=E5=90=88=E3=81=99=E3=82=8B=20(#13600)"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2a851437ffcd8778d157a6841875f03330c994b5. --- .github/workflows/lint.yml | 2 +- package.json | 4 +- packages/backend/.swcrc | 3 +- packages/misskey-bubble-game/.eslintignore | 1 - packages/misskey-bubble-game/build.js | 114 +++---------- packages/misskey-bubble-game/package.json | 26 +-- packages/misskey-bubble-game/src/index.ts | 6 +- packages/misskey-bubble-game/tsconfig.json | 2 +- packages/misskey-js/.eslintignore | 1 - packages/misskey-js/api-extractor.json | 2 +- packages/misskey-js/build.js | 105 ------------ packages/misskey-js/package.json | 29 ++-- packages/misskey-js/src/api.ts | 2 +- packages/misskey-js/src/index.ts | 15 +- packages/misskey-js/tsconfig.json | 2 +- packages/misskey-reversi/.eslintignore | 1 - packages/misskey-reversi/build.js | 114 +++---------- packages/misskey-reversi/package.json | 26 +-- packages/misskey-reversi/tsconfig.json | 2 +- pnpm-lock.yaml | 188 +++++++++++++++++---- scripts/dev.mjs | 57 +++---- 21 files changed, 281 insertions(+), 421 deletions(-) delete mode 100644 packages/misskey-js/build.js diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9b3f85fe1..31e974eda 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -92,6 +92,6 @@ jobs: - run: pnpm i --frozen-lockfile - run: pnpm --filter misskey-js run build if: ${{ matrix.workspace == 'backend' }} - - run: pnpm --filter misskey-reversi run build + - run: pnpm --filter misskey-reversi run build:tsc if: ${{ matrix.workspace == 'backend' }} - run: pnpm --filter ${{ matrix.workspace }} run typecheck diff --git a/package.json b/package.json index 84d6db512..8f5ab0b12 100644 --- a/package.json +++ b/package.json @@ -56,9 +56,7 @@ "postcss": "8.4.35", "tar": "6.2.0", "terser": "5.28.1", - "typescript": "5.3.3", - "esbuild": "0.19.11", - "glob": "10.3.10" + "typescript": "5.3.3" }, "devDependencies": { "@types/node": "^20.11.28", diff --git a/packages/backend/.swcrc b/packages/backend/.swcrc index 845190b5f..0504a2d38 100644 --- a/packages/backend/.swcrc +++ b/packages/backend/.swcrc @@ -19,6 +19,5 @@ }, "target": "es2022" }, - "minify": false, - "sourceMaps": "inline" + "minify": false } diff --git a/packages/misskey-bubble-game/.eslintignore b/packages/misskey-bubble-game/.eslintignore index 52ea8b336..f22128f04 100644 --- a/packages/misskey-bubble-game/.eslintignore +++ b/packages/misskey-bubble-game/.eslintignore @@ -5,4 +5,3 @@ node_modules /jest.config.ts /test /test-d -build.js diff --git a/packages/misskey-bubble-game/build.js b/packages/misskey-bubble-game/build.js index 0b79f4b91..4744dfaf7 100644 --- a/packages/misskey-bubble-game/build.js +++ b/packages/misskey-bubble-game/build.js @@ -1,105 +1,31 @@ -import * as esbuild from "esbuild"; import { build } from "esbuild"; import { globSync } from "glob"; -import { execa } from "execa"; -import fs from "node:fs"; -import { fileURLToPath } from "node:url"; -import { dirname } from "node:path"; - -const _filename = fileURLToPath(import.meta.url); -const _dirname = dirname(_filename); -const _package = JSON.parse(fs.readFileSync(_dirname + '/package.json', 'utf-8')); const entryPoints = globSync("./src/**/**.{ts,tsx}"); /** @type {import('esbuild').BuildOptions} */ const options = { - entryPoints, - minify: process.env.NODE_ENV === 'production', - outdir: "./built", - target: "es2022", - platform: "browser", - format: "esm", - sourcemap: 'linked', + entryPoints, + minify: true, + outdir: "./built/esm", + target: "es2022", + platform: "browser", + format: "esm", }; -// built配下をすべて削除する -fs.rmSync('./built', { recursive: true, force: true }); - -if (process.argv.map(arg => arg.toLowerCase()).includes("--watch")) { - await watchSrc(); -} else { - await buildSrc(); +if (process.env.WATCH === "true") { + options.watch = { + onRebuild(error, result) { + if (error) { + console.error("watch build failed:", error); + } else { + console.log("watch build succeeded:", result); + } + }, + }; } -async function buildSrc() { - console.log(`[${_package.name}] start building...`); - - await build(options) - .then(it => { - console.log(`[${_package.name}] build succeeded.`); - }) - .catch((err) => { - process.stderr.write(err.stderr); - process.exit(1); - }); - - if (process.env.NODE_ENV === 'production') { - console.log(`[${_package.name}] skip building d.ts because NODE_ENV is production.`); - } else { - await buildDts(); - } - - console.log(`[${_package.name}] finish building.`); -} - -function buildDts() { - return execa( - 'tsc', - [ - '--project', 'tsconfig.json', - '--outDir', 'built', - '--declaration', 'true', - '--emitDeclarationOnly', 'true', - ], - { - stdout: process.stdout, - stderr: process.stderr, - } - ); -} - -async function watchSrc() { - const plugins = [{ - name: 'gen-dts', - setup(build) { - build.onStart(() => { - console.log(`[${_package.name}] detect changed...`); - }); - build.onEnd(async result => { - if (result.errors.length > 0) { - console.error(`[${_package.name}] watch build failed:`, result); - return; - } - await buildDts(); - }); - }, - }]; - - console.log(`[${_package.name}] start watching...`) - - const context = await esbuild.context({ ...options, plugins }); - await context.watch(); - - await new Promise((resolve, reject) => { - process.on('SIGHUP', resolve); - process.on('SIGINT', resolve); - process.on('SIGTERM', resolve); - process.on('SIGKILL', resolve); - process.on('uncaughtException', reject); - process.on('exit', resolve); - }).finally(async () => { - await context.dispose(); - console.log(`[${_package.name}] finish watching.`); - }); -} +build(options).catch((err) => { + process.stderr.write(err.stderr); + process.exit(1); +}); diff --git a/packages/misskey-bubble-game/package.json b/packages/misskey-bubble-game/package.json index a3aad147a..ddc4c2134 100644 --- a/packages/misskey-bubble-game/package.json +++ b/packages/misskey-bubble-game/package.json @@ -2,21 +2,24 @@ "type": "module", "name": "misskey-bubble-game", "version": "0.0.1", - "main": "./built/index.js", - "types": "./built/index.d.ts", + "types": "./built/dts/index.d.ts", "exports": { ".": { - "import": "./built/index.js", - "types": "./built/index.d.ts" + "import": "./built/esm/index.js", + "types": "./built/dts/index.d.ts" }, "./*": { - "import": "./built/*", - "types": "./built/*" + "import": "./built/esm/*", + "types": "./built/dts/*" } }, "scripts": { "build": "node ./build.js", - "watch": "nodemon -w package.json -e json --exec \"node ./build.js --watch\"", + "build:tsc": "npm run tsc", + "tsc": "npm run tsc-esm && npm run tsc-dts", + "tsc-esm": "tsc --outDir built/esm", + "tsc-dts": "tsc --outDir built/dts --declaration true --emitDeclarationOnly true --declarationMap true", + "watch": "nodemon -w src -e ts,js,cjs,mjs,json --exec \"pnpm run build:tsc\"", "eslint": "eslint . --ext .js,.jsx,.ts,.tsx", "typecheck": "tsc --noEmit", "lint": "pnpm typecheck && pnpm eslint" @@ -24,22 +27,21 @@ "devDependencies": { "@misskey-dev/eslint-plugin": "1.0.0", "@types/matter-js": "0.19.6", - "@types/seedrandom": "3.0.8", "@types/node": "20.11.5", + "@types/seedrandom": "3.0.8", "@typescript-eslint/eslint-plugin": "7.1.0", "@typescript-eslint/parser": "7.1.0", "eslint": "8.57.0", "nodemon": "3.0.2", - "execa": "8.0.1", - "typescript": "5.3.3", - "esbuild": "0.19.11", - "glob": "10.3.10" + "typescript": "5.3.3" }, "files": [ "built" ], "dependencies": { + "esbuild": "0.19.11", "eventemitter3": "5.0.1", + "glob": "^10.3.10", "matter-js": "0.19.0", "seedrandom": "3.0.5" } diff --git a/packages/misskey-bubble-game/src/index.ts b/packages/misskey-bubble-game/src/index.ts index c5f1f6806..004a7d008 100644 --- a/packages/misskey-bubble-game/src/index.ts +++ b/packages/misskey-bubble-game/src/index.ts @@ -6,9 +6,5 @@ import { DropAndFusionGame, Mono } from './game.js'; export { - DropAndFusionGame, -}; - -export type { - Mono, + DropAndFusionGame, Mono, }; diff --git a/packages/misskey-bubble-game/tsconfig.json b/packages/misskey-bubble-game/tsconfig.json index 6e34e332e..f56b65e86 100644 --- a/packages/misskey-bubble-game/tsconfig.json +++ b/packages/misskey-bubble-game/tsconfig.json @@ -6,7 +6,7 @@ "moduleResolution": "nodenext", "declaration": true, "declarationMap": true, - "sourceMap": false, + "sourceMap": true, "outDir": "./built/", "removeComments": true, "strict": true, diff --git a/packages/misskey-js/.eslintignore b/packages/misskey-js/.eslintignore index 52ea8b336..f22128f04 100644 --- a/packages/misskey-js/.eslintignore +++ b/packages/misskey-js/.eslintignore @@ -5,4 +5,3 @@ node_modules /jest.config.ts /test /test-d -build.js diff --git a/packages/misskey-js/api-extractor.json b/packages/misskey-js/api-extractor.json index a95281a6d..f80d0f20a 100644 --- a/packages/misskey-js/api-extractor.json +++ b/packages/misskey-js/api-extractor.json @@ -45,7 +45,7 @@ * * SUPPORTED TOKENS: , , */ - "mainEntryPointFilePath": "/built/index.d.ts", + "mainEntryPointFilePath": "/built/dts/index.d.ts", /** * A list of NPM package names whose exports should be treated as part of this package. diff --git a/packages/misskey-js/build.js b/packages/misskey-js/build.js deleted file mode 100644 index 0b79f4b91..000000000 --- a/packages/misskey-js/build.js +++ /dev/null @@ -1,105 +0,0 @@ -import * as esbuild from "esbuild"; -import { build } from "esbuild"; -import { globSync } from "glob"; -import { execa } from "execa"; -import fs from "node:fs"; -import { fileURLToPath } from "node:url"; -import { dirname } from "node:path"; - -const _filename = fileURLToPath(import.meta.url); -const _dirname = dirname(_filename); -const _package = JSON.parse(fs.readFileSync(_dirname + '/package.json', 'utf-8')); - -const entryPoints = globSync("./src/**/**.{ts,tsx}"); - -/** @type {import('esbuild').BuildOptions} */ -const options = { - entryPoints, - minify: process.env.NODE_ENV === 'production', - outdir: "./built", - target: "es2022", - platform: "browser", - format: "esm", - sourcemap: 'linked', -}; - -// built配下をすべて削除する -fs.rmSync('./built', { recursive: true, force: true }); - -if (process.argv.map(arg => arg.toLowerCase()).includes("--watch")) { - await watchSrc(); -} else { - await buildSrc(); -} - -async function buildSrc() { - console.log(`[${_package.name}] start building...`); - - await build(options) - .then(it => { - console.log(`[${_package.name}] build succeeded.`); - }) - .catch((err) => { - process.stderr.write(err.stderr); - process.exit(1); - }); - - if (process.env.NODE_ENV === 'production') { - console.log(`[${_package.name}] skip building d.ts because NODE_ENV is production.`); - } else { - await buildDts(); - } - - console.log(`[${_package.name}] finish building.`); -} - -function buildDts() { - return execa( - 'tsc', - [ - '--project', 'tsconfig.json', - '--outDir', 'built', - '--declaration', 'true', - '--emitDeclarationOnly', 'true', - ], - { - stdout: process.stdout, - stderr: process.stderr, - } - ); -} - -async function watchSrc() { - const plugins = [{ - name: 'gen-dts', - setup(build) { - build.onStart(() => { - console.log(`[${_package.name}] detect changed...`); - }); - build.onEnd(async result => { - if (result.errors.length > 0) { - console.error(`[${_package.name}] watch build failed:`, result); - return; - } - await buildDts(); - }); - }, - }]; - - console.log(`[${_package.name}] start watching...`) - - const context = await esbuild.context({ ...options, plugins }); - await context.watch(); - - await new Promise((resolve, reject) => { - process.on('SIGHUP', resolve); - process.on('SIGINT', resolve); - process.on('SIGTERM', resolve); - process.on('SIGKILL', resolve); - process.on('uncaughtException', reject); - process.on('exit', resolve); - }).finally(async () => { - await context.dispose(); - console.log(`[${_package.name}] finish watching.`); - }); -} diff --git a/packages/misskey-js/package.json b/packages/misskey-js/package.json index a9c75c95c..772f001c0 100644 --- a/packages/misskey-js/package.json +++ b/packages/misskey-js/package.json @@ -3,21 +3,23 @@ "name": "misskey-js", "version": "2024.3.1", "description": "Misskey SDK for JavaScript", - "main": "./built/index.js", - "types": "./built/index.d.ts", + "types": "./built/dts/index.d.ts", "exports": { ".": { - "import": "./built/index.js", - "types": "./built/index.d.ts" + "import": "./built/esm/index.js", + "types": "./built/dts/index.d.ts" }, "./*": { - "import": "./built/*", - "types": "./built/*" + "import": "./built/esm/*", + "types": "./built/dts/*" } }, "scripts": { - "build": "node ./build.js", - "watch": "nodemon -w package.json -e json --exec \"node ./build.js --watch\"", + "build": "npm run ts", + "ts": "npm run ts-esm && npm run ts-dts", + "ts-esm": "tsc --outDir built/esm", + "ts-dts": "tsc --outDir built/dts --declaration true --emitDeclarationOnly true --declarationMap true", + "watch": "nodemon -w src -e ts,js,cjs,mjs,json --exec \"pnpm run ts\"", "tsd": "tsd", "api": "pnpm api-extractor run --local --verbose", "api-prod": "pnpm api-extractor run --verbose", @@ -47,16 +49,17 @@ "mock-socket": "9.3.1", "ncp": "2.0.0", "nodemon": "3.1.0", - "execa": "8.0.1", "tsd": "0.30.7", - "typescript": "5.3.3", - "esbuild": "0.19.11", - "glob": "10.3.10" + "typescript": "5.3.3" }, "files": [ - "built" + "built", + "built/esm", + "built/dts" ], "dependencies": { + "@swc/cli": "0.1.63", + "@swc/core": "1.3.105", "eventemitter3": "5.0.1", "reconnecting-websocket": "4.4.0" } diff --git a/packages/misskey-js/src/api.ts b/packages/misskey-js/src/api.ts index 959a634a7..134ead0d7 100644 --- a/packages/misskey-js/src/api.ts +++ b/packages/misskey-js/src/api.ts @@ -3,7 +3,7 @@ import './autogen/apiClientJSDoc.js'; import { SwitchCaseResponseType } from './api.types.js'; import type { Endpoints } from './api.types.js'; -export type { +export { SwitchCaseResponseType, } from './api.types.js'; diff --git a/packages/misskey-js/src/index.ts b/packages/misskey-js/src/index.ts index 28007a8ad..54cae8ec0 100644 --- a/packages/misskey-js/src/index.ts +++ b/packages/misskey-js/src/index.ts @@ -1,18 +1,15 @@ -import { type Endpoints } from './api.types.js'; +import { Endpoints } from './api.types.js'; import Stream, { Connection } from './streaming.js'; -import { type Channels } from './streaming.types.js'; -import { type Acct } from './acct.js'; +import { Channels } from './streaming.types.js'; +import { Acct } from './acct.js'; import * as consts from './consts.js'; -export type { - Endpoints, - Channels, - Acct, -}; - export { + Endpoints, Stream, Connection as ChannelConnection, + Channels, + Acct, }; export const permissions = consts.permissions; diff --git a/packages/misskey-js/tsconfig.json b/packages/misskey-js/tsconfig.json index 6e34e332e..f56b65e86 100644 --- a/packages/misskey-js/tsconfig.json +++ b/packages/misskey-js/tsconfig.json @@ -6,7 +6,7 @@ "moduleResolution": "nodenext", "declaration": true, "declarationMap": true, - "sourceMap": false, + "sourceMap": true, "outDir": "./built/", "removeComments": true, "strict": true, diff --git a/packages/misskey-reversi/.eslintignore b/packages/misskey-reversi/.eslintignore index 52ea8b336..f22128f04 100644 --- a/packages/misskey-reversi/.eslintignore +++ b/packages/misskey-reversi/.eslintignore @@ -5,4 +5,3 @@ node_modules /jest.config.ts /test /test-d -build.js diff --git a/packages/misskey-reversi/build.js b/packages/misskey-reversi/build.js index 0b79f4b91..4744dfaf7 100644 --- a/packages/misskey-reversi/build.js +++ b/packages/misskey-reversi/build.js @@ -1,105 +1,31 @@ -import * as esbuild from "esbuild"; import { build } from "esbuild"; import { globSync } from "glob"; -import { execa } from "execa"; -import fs from "node:fs"; -import { fileURLToPath } from "node:url"; -import { dirname } from "node:path"; - -const _filename = fileURLToPath(import.meta.url); -const _dirname = dirname(_filename); -const _package = JSON.parse(fs.readFileSync(_dirname + '/package.json', 'utf-8')); const entryPoints = globSync("./src/**/**.{ts,tsx}"); /** @type {import('esbuild').BuildOptions} */ const options = { - entryPoints, - minify: process.env.NODE_ENV === 'production', - outdir: "./built", - target: "es2022", - platform: "browser", - format: "esm", - sourcemap: 'linked', + entryPoints, + minify: true, + outdir: "./built/esm", + target: "es2022", + platform: "browser", + format: "esm", }; -// built配下をすべて削除する -fs.rmSync('./built', { recursive: true, force: true }); - -if (process.argv.map(arg => arg.toLowerCase()).includes("--watch")) { - await watchSrc(); -} else { - await buildSrc(); +if (process.env.WATCH === "true") { + options.watch = { + onRebuild(error, result) { + if (error) { + console.error("watch build failed:", error); + } else { + console.log("watch build succeeded:", result); + } + }, + }; } -async function buildSrc() { - console.log(`[${_package.name}] start building...`); - - await build(options) - .then(it => { - console.log(`[${_package.name}] build succeeded.`); - }) - .catch((err) => { - process.stderr.write(err.stderr); - process.exit(1); - }); - - if (process.env.NODE_ENV === 'production') { - console.log(`[${_package.name}] skip building d.ts because NODE_ENV is production.`); - } else { - await buildDts(); - } - - console.log(`[${_package.name}] finish building.`); -} - -function buildDts() { - return execa( - 'tsc', - [ - '--project', 'tsconfig.json', - '--outDir', 'built', - '--declaration', 'true', - '--emitDeclarationOnly', 'true', - ], - { - stdout: process.stdout, - stderr: process.stderr, - } - ); -} - -async function watchSrc() { - const plugins = [{ - name: 'gen-dts', - setup(build) { - build.onStart(() => { - console.log(`[${_package.name}] detect changed...`); - }); - build.onEnd(async result => { - if (result.errors.length > 0) { - console.error(`[${_package.name}] watch build failed:`, result); - return; - } - await buildDts(); - }); - }, - }]; - - console.log(`[${_package.name}] start watching...`) - - const context = await esbuild.context({ ...options, plugins }); - await context.watch(); - - await new Promise((resolve, reject) => { - process.on('SIGHUP', resolve); - process.on('SIGINT', resolve); - process.on('SIGTERM', resolve); - process.on('SIGKILL', resolve); - process.on('uncaughtException', reject); - process.on('exit', resolve); - }).finally(async () => { - await context.dispose(); - console.log(`[${_package.name}] finish watching.`); - }); -} +build(options).catch((err) => { + process.stderr.write(err.stderr); + process.exit(1); +}); diff --git a/packages/misskey-reversi/package.json b/packages/misskey-reversi/package.json index 45a612086..7bfc890fe 100644 --- a/packages/misskey-reversi/package.json +++ b/packages/misskey-reversi/package.json @@ -2,21 +2,24 @@ "type": "module", "name": "misskey-reversi", "version": "0.0.1", - "main": "./built/index.js", - "types": "./built/index.d.ts", + "types": "./built/dts/index.d.ts", "exports": { ".": { - "import": "./built/index.js", - "types": "./built/index.d.ts" + "import": "./built/esm/index.js", + "types": "./built/dts/index.d.ts" }, "./*": { - "import": "./built/*", - "types": "./built/*" + "import": "./built/esm/*", + "types": "./built/dts/*" } }, "scripts": { "build": "node ./build.js", - "watch": "nodemon -w package.json -e json --exec \"node ./build.js --watch\"", + "build:tsc": "npm run tsc", + "tsc": "npm run tsc-esm && npm run tsc-dts", + "tsc-esm": "tsc --outDir built/esm", + "tsc-dts": "tsc --outDir built/dts --declaration true --emitDeclarationOnly true --declarationMap true", + "watch": "nodemon -w src -e ts,js,cjs,mjs,json --exec \"pnpm run build:tsc\"", "eslint": "eslint . --ext .js,.jsx,.ts,.tsx", "typecheck": "tsc --noEmit", "lint": "pnpm typecheck && pnpm eslint" @@ -27,16 +30,15 @@ "@typescript-eslint/eslint-plugin": "7.1.0", "@typescript-eslint/parser": "7.1.0", "eslint": "8.57.0", - "execa": "8.0.1", "nodemon": "3.0.2", - "typescript": "5.3.3", - "esbuild": "0.19.11", - "glob": "10.3.10" + "typescript": "5.3.3" }, "files": [ "built" ], "dependencies": { - "crc-32": "1.2.2" + "crc-32": "1.2.2", + "esbuild": "0.19.11", + "glob": "10.3.10" } } diff --git a/packages/misskey-reversi/tsconfig.json b/packages/misskey-reversi/tsconfig.json index 6e34e332e..f56b65e86 100644 --- a/packages/misskey-reversi/tsconfig.json +++ b/packages/misskey-reversi/tsconfig.json @@ -6,7 +6,7 @@ "moduleResolution": "nodenext", "declaration": true, "declarationMap": true, - "sourceMap": false, + "sourceMap": true, "outDir": "./built/", "removeComments": true, "strict": true, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c7625fd89..6fe219e6c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,18 +15,12 @@ importers: cssnano: specifier: 6.0.5 version: 6.0.5(postcss@8.4.35) - esbuild: - specifier: 0.19.11 - version: 0.19.11 execa: specifier: 8.0.1 version: 8.0.1 fast-glob: specifier: 3.3.2 version: 3.3.2 - glob: - specifier: 10.3.10 - version: 10.3.10 ignore-walk: specifier: 6.0.4 version: 6.0.4 @@ -1043,9 +1037,15 @@ importers: packages/misskey-bubble-game: dependencies: + esbuild: + specifier: 0.19.11 + version: 0.19.11 eventemitter3: specifier: 5.0.1 version: 5.0.1 + glob: + specifier: ^10.3.10 + version: 10.3.10 matter-js: specifier: 0.19.0 version: 0.19.0 @@ -1071,18 +1071,9 @@ importers: '@typescript-eslint/parser': specifier: 7.1.0 version: 7.1.0(eslint@8.57.0)(typescript@5.3.3) - esbuild: - specifier: 0.19.11 - version: 0.19.11 eslint: specifier: 8.57.0 version: 8.57.0 - execa: - specifier: 8.0.1 - version: 8.0.1 - glob: - specifier: 10.3.10 - version: 10.3.10 nodemon: specifier: 3.0.2 version: 3.0.2 @@ -1092,6 +1083,12 @@ importers: packages/misskey-js: dependencies: + '@swc/cli': + specifier: 0.1.63 + version: 0.1.63(@swc/core@1.3.105) + '@swc/core': + specifier: 1.3.105 + version: 1.3.105 eventemitter3: specifier: 5.0.1 version: 5.0.1 @@ -1107,7 +1104,7 @@ importers: version: 1.0.0(@typescript-eslint/eslint-plugin@7.1.0)(@typescript-eslint/parser@7.1.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0) '@swc/jest': specifier: 0.2.31 - version: 0.2.31(@swc/core@1.3.107) + version: 0.2.31(@swc/core@1.3.105) '@types/jest': specifier: 29.5.12 version: 29.5.12 @@ -1120,18 +1117,9 @@ importers: '@typescript-eslint/parser': specifier: 7.1.0 version: 7.1.0(eslint@8.57.0)(typescript@5.3.3) - esbuild: - specifier: 0.19.11 - version: 0.19.11 eslint: specifier: 8.57.0 version: 8.57.0 - execa: - specifier: 8.0.1 - version: 8.0.1 - glob: - specifier: 10.3.10 - version: 10.3.10 jest: specifier: 29.7.0 version: 29.7.0(@types/node@20.11.22) @@ -1198,6 +1186,12 @@ importers: crc-32: specifier: 1.2.2 version: 1.2.2 + esbuild: + specifier: 0.19.11 + version: 0.19.11 + glob: + specifier: 10.3.10 + version: 10.3.10 devDependencies: '@misskey-dev/eslint-plugin': specifier: 1.0.0 @@ -1211,18 +1205,9 @@ importers: '@typescript-eslint/parser': specifier: 7.1.0 version: 7.1.0(eslint@8.57.0)(typescript@5.3.3) - esbuild: - specifier: 0.19.11 - version: 0.19.11 eslint: specifier: 8.57.0 version: 8.57.0 - execa: - specifier: 8.0.1 - version: 8.0.1 - glob: - specifier: 10.3.10 - version: 10.3.10 nodemon: specifier: 3.0.2 version: 3.0.2 @@ -6684,6 +6669,26 @@ packages: - supports-color dev: true + /@swc/cli@0.1.63(@swc/core@1.3.105): + resolution: {integrity: sha512-EM9oxxHzmmsprYRbGqsS2M4M/Gr5Gkcl0ROYYIdlUyTkhOiX822EQiRCpPCwdutdnzH2GyaTN7wc6i0Y+CKd3A==} + engines: {node: '>= 12.13'} + hasBin: true + peerDependencies: + '@swc/core': ^1.2.66 + chokidar: 3.5.3 + peerDependenciesMeta: + chokidar: + optional: true + dependencies: + '@mole-inc/bin-wrapper': 8.0.1 + '@swc/core': 1.3.105 + commander: 7.2.0 + fast-glob: 3.3.2 + semver: 7.5.4 + slash: 3.0.0 + source-map: 0.7.4 + dev: false + /@swc/cli@0.1.63(@swc/core@1.3.107)(chokidar@3.5.3): resolution: {integrity: sha512-EM9oxxHzmmsprYRbGqsS2M4M/Gr5Gkcl0ROYYIdlUyTkhOiX822EQiRCpPCwdutdnzH2GyaTN7wc6i0Y+CKd3A==} engines: {node: '>= 12.13'} @@ -6716,6 +6721,14 @@ packages: dev: false optional: true + /@swc/core-darwin-arm64@1.3.105: + resolution: {integrity: sha512-buWeweLVDXXmcnfIemH4PGnpjwsDTUGitnPchdftb0u1FU8zSSP/lw/pUCBDG/XvWAp7c/aFxgN4CyG0j7eayA==} + engines: {node: '>=10'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + optional: true + /@swc/core-darwin-arm64@1.3.107: resolution: {integrity: sha512-47tD/5vSXWxPd0j/ZllyQUg4bqalbQTsmqSw0J4dDdS82MWqCAwUErUrAZPRjBkjNQ6Kmrf5rpCWaGTtPw+ngw==} engines: {node: '>=10'} @@ -6733,6 +6746,14 @@ packages: dev: false optional: true + /@swc/core-darwin-x64@1.3.105: + resolution: {integrity: sha512-hFmXPApqjA/8sy/9NpljHVaKi1OvL9QkJ2MbbTCCbJERuHMpMUeMBUWipHRfepGHFhU+9B9zkEup/qJaJR4XIg==} + engines: {node: '>=10'} + cpu: [x64] + os: [darwin] + requiresBuild: true + optional: true + /@swc/core-darwin-x64@1.3.107: resolution: {integrity: sha512-hwiLJ2ulNkBGAh1m1eTfeY1417OAYbRGcb/iGsJ+LuVLvKAhU/itzsl535CvcwAlt2LayeCFfcI8gdeOLeZa9A==} engines: {node: '>=10'} @@ -6761,6 +6782,14 @@ packages: dev: false optional: true + /@swc/core-linux-arm-gnueabihf@1.3.105: + resolution: {integrity: sha512-mwXyMC41oMKkKrPpL8uJpOxw7fyfQoVtIw3Y5p0Blabk+espNYqix0E8VymHdRKuLmM//z5wVmMsuHdGBHvZeg==} + engines: {node: '>=10'} + cpu: [arm] + os: [linux] + requiresBuild: true + optional: true + /@swc/core-linux-arm-gnueabihf@1.3.107: resolution: {integrity: sha512-I2wzcC0KXqh0OwymCmYwNRgZ9nxX7DWnOOStJXV3pS0uB83TXAkmqd7wvMBuIl9qu4Hfomi9aDM7IlEEn9tumQ==} engines: {node: '>=10'} @@ -6778,6 +6807,14 @@ packages: dev: false optional: true + /@swc/core-linux-arm64-gnu@1.3.105: + resolution: {integrity: sha512-H7yEIVydnUtqBSUxwmO6vpIQn7j+Rr0DF6ZOORPyd/SFzQJK9cJRtmJQ3ZMzlJ1Bb+1gr3MvjgLEnmyCYEm2Hg==} + engines: {node: '>=10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + optional: true + /@swc/core-linux-arm64-gnu@1.3.107: resolution: {integrity: sha512-HWgnn7JORYlOYnGsdunpSF8A+BCZKPLzLtEUA27/M/ZuANcMZabKL9Zurt7XQXq888uJFAt98Gy+59PU90aHKg==} engines: {node: '>=10'} @@ -6795,6 +6832,14 @@ packages: dev: false optional: true + /@swc/core-linux-arm64-musl@1.3.105: + resolution: {integrity: sha512-Jg7RTFT3pGFdGt5elPV6oDkinRy7q9cXpenjXnJnM2uvx3jOwnsAhexPyCDHom8SHL0j+9kaLLC66T3Gz1E4UA==} + engines: {node: '>=10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + optional: true + /@swc/core-linux-arm64-musl@1.3.107: resolution: {integrity: sha512-vfPF74cWfAm8hyhS8yvYI94ucMHIo8xIYU+oFOW9uvDlGQRgnUf/6DEVbLyt/3yfX5723Ln57U8uiMALbX5Pyw==} engines: {node: '>=10'} @@ -6812,6 +6857,14 @@ packages: dev: false optional: true + /@swc/core-linux-x64-gnu@1.3.105: + resolution: {integrity: sha512-DJghplpyusAmp1X5pW/y93MmS/u83Sx5GrpJxI6KLPa82+NItTgMcl8KBQmW5GYAJpVKZyaIvBanS5TdR8aN2w==} + engines: {node: '>=10'} + cpu: [x64] + os: [linux] + requiresBuild: true + optional: true + /@swc/core-linux-x64-gnu@1.3.107: resolution: {integrity: sha512-uBVNhIg0ip8rH9OnOsCARUFZ3Mq3tbPHxtmWk9uAa5u8jQwGWeBx5+nTHpDOVd3YxKb6+5xDEI/edeeLpha/9g==} engines: {node: '>=10'} @@ -6829,6 +6882,14 @@ packages: dev: false optional: true + /@swc/core-linux-x64-musl@1.3.105: + resolution: {integrity: sha512-wD5jL2dZH/5nPNssBo6jhOvkI0lmWnVR4vnOXWjuXgjq1S0AJpO5jdre/6pYLmf26hft3M42bteDnjR4AAZ38w==} + engines: {node: '>=10'} + cpu: [x64] + os: [linux] + requiresBuild: true + optional: true + /@swc/core-linux-x64-musl@1.3.107: resolution: {integrity: sha512-mvACkUvzSIB12q1H5JtabWATbk3AG+pQgXEN95AmEX2ZA5gbP9+B+mijsg7Sd/3tboHr7ZHLz/q3SHTvdFJrEw==} engines: {node: '>=10'} @@ -6846,6 +6907,14 @@ packages: dev: false optional: true + /@swc/core-win32-arm64-msvc@1.3.105: + resolution: {integrity: sha512-UqJtwILUHRw2+3UTPnRkZrzM/bGdQtbR4UFdp79mZQYfryeOUVNg7aJj/bWUTkKtLiZ3o+FBNrM/x2X1mJX5bA==} + engines: {node: '>=10'} + cpu: [arm64] + os: [win32] + requiresBuild: true + optional: true + /@swc/core-win32-arm64-msvc@1.3.107: resolution: {integrity: sha512-J3P14Ngy/1qtapzbguEH41kY109t6DFxfbK4Ntz9dOWNuVY3o9/RTB841ctnJk0ZHEG+BjfCJjsD2n8H5HcaOA==} engines: {node: '>=10'} @@ -6863,6 +6932,14 @@ packages: dev: false optional: true + /@swc/core-win32-ia32-msvc@1.3.105: + resolution: {integrity: sha512-Z95C6vZgBEJ1snidYyjVKnVWiy/ZpPiIFIXGWkDr4ZyBgL3eZX12M6LzZ+NApHKffrbO4enbFyFomueBQgS2oA==} + engines: {node: '>=10'} + cpu: [ia32] + os: [win32] + requiresBuild: true + optional: true + /@swc/core-win32-ia32-msvc@1.3.107: resolution: {integrity: sha512-ZBUtgyjTHlz8TPJh7kfwwwFma+ktr6OccB1oXC8fMSopD0AxVnQasgun3l3099wIsAB9eEsJDQ/3lDkOLs1gBA==} engines: {node: '>=10'} @@ -6880,6 +6957,14 @@ packages: dev: false optional: true + /@swc/core-win32-x64-msvc@1.3.105: + resolution: {integrity: sha512-3J8fkyDPFsS3mszuYUY4Wfk7/B2oio9qXUwF3DzOs2MK+XgdyMLIptIxL7gdfitXJBH8k39uVjrIw1JGJDjyFA==} + engines: {node: '>=10'} + cpu: [x64] + os: [win32] + requiresBuild: true + optional: true + /@swc/core-win32-x64-msvc@1.3.107: resolution: {integrity: sha512-Eyzo2XRqWOxqhE1gk9h7LWmUf4Bp4Xn2Ttb0ayAXFp6YSTxQIThXcT9kipXZqcpxcmDwoq8iWbbf2P8XL743EA==} engines: {node: '>=10'} @@ -6897,6 +6982,30 @@ packages: dev: false optional: true + /@swc/core@1.3.105: + resolution: {integrity: sha512-me2VZyr3OjqRpFrYQJJYy7x/zbFSl9nt+MAGnIcBtjDsN00iTVqEaKxBjPBFQV9BDAgPz2SRWes/DhhVm5SmMw==} + engines: {node: '>=10'} + requiresBuild: true + peerDependencies: + '@swc/helpers': ^0.5.0 + peerDependenciesMeta: + '@swc/helpers': + optional: true + dependencies: + '@swc/counter': 0.1.1 + '@swc/types': 0.1.5 + optionalDependencies: + '@swc/core-darwin-arm64': 1.3.105 + '@swc/core-darwin-x64': 1.3.105 + '@swc/core-linux-arm-gnueabihf': 1.3.105 + '@swc/core-linux-arm64-gnu': 1.3.105 + '@swc/core-linux-arm64-musl': 1.3.105 + '@swc/core-linux-x64-gnu': 1.3.105 + '@swc/core-linux-x64-musl': 1.3.105 + '@swc/core-win32-arm64-msvc': 1.3.105 + '@swc/core-win32-ia32-msvc': 1.3.105 + '@swc/core-win32-x64-msvc': 1.3.105 + /@swc/core@1.3.107: resolution: {integrity: sha512-zKhqDyFcTsyLIYK1iEmavljZnf4CCor5pF52UzLAz4B6Nu/4GLU+2LQVAf+oRHjusG39PTPjd2AlRT3f3QWfsQ==} engines: {node: '>=10'} @@ -6924,6 +7033,17 @@ packages: /@swc/counter@0.1.1: resolution: {integrity: sha512-xVRaR4u9hcYjFvcSg71Lz5Bo4//CyjAAfMxa7UsaDSYxAshflUkVJWiyVWrfxC59z2kP1IzI4/1BEpnhI9o3Mw==} + /@swc/jest@0.2.31(@swc/core@1.3.105): + resolution: {integrity: sha512-Gh0Ste380O8KUY1IqsKr+aOvqqs2Loa+WcWWVNwl+lhXqOWK1iTFAP1K0IDfLqAuFP68+D/PxcpBJn21e6Quvw==} + engines: {npm: '>= 7.0.0'} + peerDependencies: + '@swc/core': '*' + dependencies: + '@jest/create-cache-key-function': 29.7.0 + '@swc/core': 1.3.105 + jsonc-parser: 3.2.0 + dev: true + /@swc/jest@0.2.31(@swc/core@1.3.107): resolution: {integrity: sha512-Gh0Ste380O8KUY1IqsKr+aOvqqs2Loa+WcWWVNwl+lhXqOWK1iTFAP1K0IDfLqAuFP68+D/PxcpBJn21e6Quvw==} engines: {npm: '>= 7.0.0'} diff --git a/scripts/dev.mjs b/scripts/dev.mjs index bbb254775..1ca2c6c2e 100644 --- a/scripts/dev.mjs +++ b/scripts/dev.mjs @@ -16,36 +16,35 @@ await execa('pnpm', ['clean'], { stderr: process.stderr, }); -await Promise.all([ - execa('pnpm', ['build-pre'], { - cwd: _dirname + '/../', - stdout: process.stdout, - stderr: process.stderr, - }), - execa('pnpm', ['build-assets'], { - cwd: _dirname + '/../', - stdout: process.stdout, - stderr: process.stderr, - }), - execa('pnpm', ['--filter', 'misskey-js', 'build'], { - cwd: _dirname + '/../', - stdout: process.stdout, - stderr: process.stderr, - }), -]); +await execa('pnpm', ['build-pre'], { + cwd: _dirname + '/../', + stdout: process.stdout, + stderr: process.stderr, +}); -await Promise.all([ - execa('pnpm', ['--filter', 'misskey-reversi', 'build'], { - cwd: _dirname + '/../', - stdout: process.stdout, - stderr: process.stderr, - }), - execa('pnpm', ['--filter', 'misskey-bubble-game', 'build'], { - cwd: _dirname + '/../', - stdout: process.stdout, - stderr: process.stderr, - }), -]); +await execa('pnpm', ['build-assets'], { + cwd: _dirname + '/../', + stdout: process.stdout, + stderr: process.stderr, +}); + +await execa('pnpm', ['--filter', 'misskey-js', 'ts'], { + cwd: _dirname + '/../', + stdout: process.stdout, + stderr: process.stderr, +}); + +await execa('pnpm', ['--filter', 'misskey-reversi', 'build:tsc'], { + cwd: _dirname + '/../', + stdout: process.stdout, + stderr: process.stderr, +}); + +await execa('pnpm', ['--filter', 'misskey-bubble-game', 'build:tsc'], { + cwd: _dirname + '/../', + stdout: process.stdout, + stderr: process.stderr, +}); execa('pnpm', ['build-pre', '--watch'], { cwd: _dirname + '/../',