1
0
Эх сурвалжийг харах

fix: add ts debugger & some tsconfig stuff

Sven 2 жил өмнө
parent
commit
d97e1f375d

+ 10 - 12
.vscode/launch.json

@@ -5,24 +5,22 @@
     "version": "0.2.0",
     "configurations": [
         {
-            "type": "pwa-node",
+            "type": "node",
             "request": "launch",
             "name": "Launch",
-            "skipFiles": [
-                "<node_internals>/**"
-            ],
-            "program": "${workspaceFolder}\\src\\index.js",
+            "program": "${workspaceFolder}/out/src/index.js",
+            "preLaunchTask": "prelaunch",
+            "outFiles": ["${workspaceFolder}/out/**/*.js"],
             "console": "integratedTerminal"
         },
         {
-            "type": "pwa-node",
+            "type": "node",
             "request": "launch",
-            "name": "test.js",
-            "skipFiles": [
-                "<node_internals>/**"
-            ],
-            "program": "${workspaceFolder}\\test.js",
+            "name": "test.ts",
+            "program": "${workspaceFolder}/src/test.ts",
+            "preLaunchTask": "prelaunch",
+            "outFiles": ["${workspaceFolder}/out/**/*.js"],
             "console": "integratedTerminal"
-        }
+        },
     ]
 }

+ 10 - 0
.vscode/tasks.json

@@ -0,0 +1,10 @@
+{
+    "version": "2.0.0",
+    "tasks": [
+        {
+            "label": "prelaunch",
+            "type": "shell",
+            "command": "tsc"
+        }
+    ]
+}

+ 14 - 1
package-lock.json

@@ -29,7 +29,8 @@
         "@types/tcp-port-used": "^1.0.1",
         "dotenv": "^16.0.0",
         "eslint": "^8.9.0",
-        "nodemon": "^2.0.20"
+        "nodemon": "^2.0.20",
+        "tslib": "^2.4.0"
       }
     },
     "node_modules/@eslint/eslintrc": {
@@ -2110,6 +2111,12 @@
         "nodetouch": "bin/nodetouch.js"
       }
     },
+    "node_modules/tslib": {
+      "version": "2.4.0",
+      "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz",
+      "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==",
+      "dev": true
+    },
     "node_modules/type-check": {
       "version": "0.4.0",
       "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
@@ -3845,6 +3852,12 @@
         "nopt": "~1.0.10"
       }
     },
+    "tslib": {
+      "version": "2.4.0",
+      "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz",
+      "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==",
+      "dev": true
+    },
     "type-check": {
       "version": "0.4.0",
       "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",

+ 2 - 1
package.json

@@ -48,6 +48,7 @@
     "@types/tcp-port-used": "^1.0.1",
     "dotenv": "^16.0.0",
     "eslint": "^8.9.0",
-    "nodemon": "^2.0.20"
+    "nodemon": "^2.0.20",
+    "tslib": "^2.4.0"
   }
 }

+ 1 - 0
tsconfig.json

@@ -8,6 +8,7 @@
     "moduleResolution": "node",
     "useDefineForClassFields": true,
     "allowJs": false,
+    "importHelpers": true,
     "skipLibCheck": true,
     "esModuleInterop": true,
     "allowSyntheticDefaultImports": true,