From 32fac53e8d950d60e7cb0effa33846e75131b6e7 Mon Sep 17 00:00:00 2001 From: Namekuji Date: Sun, 30 Jul 2023 16:27:13 -0400 Subject: [PATCH] feat: backend debug in vscode --- .gitignore | 1 + .vscode/launch.json | 20 ++++++++++++++++++++ package.json | 2 ++ packages/backend/native-utils/package.json | 2 +- packages/backend/package.json | 1 + packages/client/package.json | 1 + packages/firefish-js/package.json | 1 + packages/megalodon/package.json | 1 + packages/sw/package.json | 1 + 9 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 .vscode/launch.json diff --git a/.gitignore b/.gitignore index ad887b7e2a..0185b4e495 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # Visual Studio Code /.vscode !/.vscode/extensions.json +!/.vscode/launch.json # Intelij-IDEA /.idea diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000000..84ce98609a --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,20 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Launch PNPM Debug Script", + "skipFiles": [ + "/**" + ], + "runtimeExecutable": "pnpm", + "runtimeArgs": [ + "run", "debug" + ] + } + ] +} diff --git a/package.json b/package.json index 1d20b1f392..7e5073be58 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,8 @@ "dev": "pnpm node ./scripts/dev.js", "dev:staging": "NODE_OPTIONS=--max_old_space_size=3072 NODE_ENV=development pnpm run build && pnpm run start", "lint": "pnpm -r --parallel run lint", + "debug": "pnpm run build:debug && pnpm run start", + "build:debug": "pnpm -r --parallel run build:debug && pnpm run gulp", "cy:open": "cypress open --browser --e2e --config-file=cypress.config.ts", "cy:run": "cypress run", "e2e": "start-server-and-test start:test http://localhost:61812 cy:run", diff --git a/packages/backend/native-utils/package.json b/packages/backend/native-utils/package.json index 962b4bc4c4..93a6497f53 100644 --- a/packages/backend/native-utils/package.json +++ b/packages/backend/native-utils/package.json @@ -37,7 +37,7 @@ "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 ./target/release/migration ./built/migration", - "build:debug": "napi build --platform ./built/ && cargo build --manifest-path ./migration/Cargo.toml", + "build:debug": "napi build --features napi --platform ./built/ && cargo build --locked --manifest-path ./migration/Cargo.toml && cp -v ./target/debug/migration ./built/migration", "prepublishOnly": "napi prepublish -t npm", "test": "pnpm run cargo:test && pnpm run build:napi && ava", "universal": "napi universal", diff --git a/packages/backend/package.json b/packages/backend/package.json index cc8f4747ec..9288ed92f5 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -14,6 +14,7 @@ "revertmigration:cargo": "./native-utils/built/migration down", "check:connect": "node ./check_connect.js", "build": "pnpm swc src -d built -D", + "build:debug": "pnpm swc src -d built -s -D", "watch": "pnpm swc src -d built -D -w", "lint": "pnpm rome check --apply *", "mocha": "cross-env NODE_ENV=test TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=\"./test/tsconfig.json\" mocha", diff --git a/packages/client/package.json b/packages/client/package.json index 43983c460a..a2ee694d70 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -4,6 +4,7 @@ "scripts": { "watch": "pnpm vite build --watch --mode development", "build": "pnpm vite build", + "build:debug": "pnpm run build", "lint": "pnpm rome check **/*.ts --apply && pnpm run lint:vue", "lint:vue": "pnpm paralint --ext .vue --fix '**/*.vue' --cache", "format": "pnpm rome format * --write && pnpm prettier --write '**/*.{scss,vue}' --cache --cache-strategy metadata" diff --git a/packages/firefish-js/package.json b/packages/firefish-js/package.json index bcee951765..7cdd419ec7 100644 --- a/packages/firefish-js/package.json +++ b/packages/firefish-js/package.json @@ -6,6 +6,7 @@ "types": "./built/index.d.ts", "scripts": { "build": "pnpm swc src -d built -D", + "build:debug": "pnpm swc src -d built -s -D", "render": "pnpm run build && pnpm run api && pnpm run api-prod && cp temp/firefish-js.api.json etc/ && pnpm run api-doc", "tsd": "tsc && tsd", "api": "pnpm api-extractor run --local --verbose", diff --git a/packages/megalodon/package.json b/packages/megalodon/package.json index dea59b5790..e9e30abe12 100644 --- a/packages/megalodon/package.json +++ b/packages/megalodon/package.json @@ -5,6 +5,7 @@ "typings": "./lib/src/index.d.ts", "scripts": { "build": "tsc -p ./", + "build:debug": "pnpm run build", "lint": "pnpm rome check **/*.ts --apply", "format": "pnpm rome format --write src/**/*.ts", "doc": "typedoc --out ../docs ./src", diff --git a/packages/sw/package.json b/packages/sw/package.json index c86c15eadc..6118e249a2 100644 --- a/packages/sw/package.json +++ b/packages/sw/package.json @@ -3,6 +3,7 @@ "private": true, "scripts": { "build": "webpack", + "build:debug": "pnpm run build", "watch": "pnpm swc src -d built -D -w", "lint": "pnpm rome check **/*.ts --apply", "format": "pnpm rome format * --write"