Sv443 1 год назад
Родитель
Сommit
f17c343f85
3 измененных файлов с 747 добавлено и 8 удалено
  1. 12 0
      README.md
  2. 718 6
      package-lock.json
  3. 17 2
      package.json

+ 12 - 0
README.md

@@ -31,6 +31,18 @@ Once you have the extension, click this button to install the userscript:
 <!-- <a href="https://github.com/Sv443/BetterYTM/raw/main/BetterYTM.user.js" target="_blank"><img src="https://img.shields.io/badge/Install-%E2%96%BA-039e10" height="24"></a> -->
 <a href="https://github.com/Sv443/BetterYTM/raw/main/BetterYTM.user.js" target="_blank"><img src="https://img.shields.io/badge/Install-%E2%96%BC-039e10" height="24"></a>
 
+<br><br>
+
+### Development:
+| Command | Description |
+| --- | --- |
+| `npm run lint` | Lints the userscript with ESLint |
+| `npm run build` | Builds the userscript |
+| `npm run watch` | Watches, rebuilds and serves the userscript on port 8710, so it can be updated live if set up correctly in the userscript manager |
+
+When using ViolentMonkey, after running the command `npm run watch`, open [`http://localhost:8710/BetterYTM.user.js`](http://localhost:8710/BetterYTM.user.js) and select the `Track local file` option.  
+This makes it so the userscript automatically updates itself when the code changes.
+
 
 <br><br>
 

Разница между файлами не показана из-за своего большого размера
+ 718 - 6
package-lock.json


+ 17 - 2
package.json

@@ -6,7 +6,8 @@
   "scripts": {
     "test": "echo \"Error: no test specified\" && exit 1",
     "build": "webpack",
-    "start": "webpack serve --progress --mode development",
+    "serve": "http-server -s -c 5 -p 8710 .",
+    "watch": "nodemon --exec \"npm run build && npm run serve\"",
     "lint": "eslint ."
   },
   "repository": {
@@ -29,7 +30,10 @@
     "@typescript-eslint/eslint-plugin": "^5.59.7",
     "@typescript-eslint/parser": "^5.59.7",
     "eslint": "^7.32.0",
+    "http-server": "^14.1.1",
+    "nodemon": "^2.0.22",
     "ts-loader": "^9.4.3",
+    "ts-node": "^10.9.1",
     "tslib": "^2.5.2",
     "typescript": "^5.0.4",
     "webpack-cli": "^5.1.1"
@@ -38,5 +42,16 @@
     "last 1 version",
     "> 1%",
     "not dead"
-  ]
+  ],
+  "nodemonConfig": {
+    "watch": [
+      "src/*",
+      "tools/*"
+    ],
+    "ext": "ts,js,json",
+    "ignore": [
+      "BetterYTM.user.js",
+      "dev/*"
+    ]
+  }
 }

Некоторые файлы не были показаны из-за большого количества измененных файлов