Ver código fonte

feat: update pkg description & readme

Sv443 1 ano atrás
pai
commit
47d15f3fe0
4 arquivos alterados com 26 adições e 20 exclusões
  1. 12 8
      README.md
  2. 2 2
      dist/BetterYTM.user.js
  3. 4 3
      package.json
  4. 8 7
      src/tools/post-build.ts

+ 12 - 8
README.md

@@ -4,17 +4,21 @@ Userscript that improves [YouTube Music](https://music.youtube.com/)
 <br>
 
 ## Features:
-- Use arrow keys to skip forward or backward by 10 seconds
-- Quickly open song lyrics on genius.com<!-- (powered by [geniURL](https://api.sv443.net/geniurl))-->
-- Switch between YouTube and YouTube Music on a video by pressing a hotkey (F9 by default)
-- Remove the "Upgrade to YT Music Premium" tab in the title bar
+- Input:
+    - Use arrow keys to skip forward or backward by 10 seconds
+    - Switch between YouTube and YouTube Music on a video by pressing a hotkey (F9 by default)
+    - TODO: Automatically dismiss "are you still there" popup
+- Layout:
+    - Remove the "Upgrade to YT Music Premium" tab in the title bar
+    - Set a custom size and step resolution for the volume slider
+    - Quickly open any song's lyrics on genius.com
+  
+... and more!
 
 <br>
 
-To toggle features on or off, install the userscript, then edit it and look for the big "Settings" banner.  
-Below it you will find an object with properties that can be set to `true` or `false` accordingly.  
-  
-Once this script is more finished, I might add a menu to toggle these more easily.
+To toggle features on or off, install the userscript, then click the "BetterYTM" text under the logo to open the settings menu.  
+Note that the page needs to be reloaded for the changes to take effect.
 
 <br><br>
 

+ 2 - 2
dist/BetterYTM.user.js

@@ -3,8 +3,8 @@
 // @homepageURL     https://github.com/Sv443/BetterYTM#readme
 // @namespace       https://github.com/Sv443/BetterYTM
 // @version         1.0.0
-// @description     Improvements for YouTube Music
-// @description:de  Verbesserungen für YouTube Music
+// @description     Configurable Layout and UX improvements for YouTube Music
+// @description:de  Konfigurierbare Layout- und UX-Verbesserungen für YouTube Music
 // @license         MIT
 // @author          Sv443
 // @copyright       Sv443 (https://github.com/Sv443)

+ 4 - 3
package.json

@@ -1,14 +1,15 @@
 {
   "name": "betterytm",
   "version": "1.0.0",
-  "description": "Userscript that improves YouTube Music",
+  "description": "Configurable Layout and UX improvements for YouTube Music",
+  "description:de": "Konfigurierbare Layout- und UX-Verbesserungen für YouTube Music",
   "homepage": "https://github.com/Sv443/BetterYTM",
   "main": "./src/BetterYTM.user.ts",
   "type": "module",
   "scripts": {
-    "test": "node --loader ts-node/esm ./test.ts",
+    "test": "node --no-warnings=ExperimentalWarning --enable-source-maps --loader ts-node/esm ./test.ts",
     "build": "webpack",
-    "post-build": "node --loader ts-node/esm ./src/tools/post-build.ts",
+    "post-build": "node --no-warnings=ExperimentalWarning --enable-source-maps --loader ts-node/esm ./src/tools/post-build.ts",
     "serve": "http-server -s -c 5 -p 8710 .",
     "watch": "nodemon --exec \"npm run build && npm run serve\"",
     "lint": "eslint ."

+ 8 - 7
src/tools/post-build.ts

@@ -4,8 +4,9 @@ import { fileURLToPath } from "url";
 import pkg from "../../package.json" assert { type: "json" };
 
 const repo = "Sv443/BetterYTM";
-const userscriptName = "BetterYTM.user.js";
-const scriptUrl = `https://raw.githubusercontent.com/${repo}/main/dist/${userscriptName}`;
+const userscriptDistFile = "BetterYTM.user.js";
+const userscriptDistPath = `dist/${userscriptDistFile}`;
+const scriptUrl = `https://raw.githubusercontent.com/${repo}/main/dist/${userscriptDistFile}`;
 
 const header = `\
 // ==UserScript==
@@ -13,8 +14,8 @@ const header = `\
 // @homepageURL     ${pkg.homepage}#readme
 // @namespace       ${pkg.homepage}
 // @version         ${pkg.version}
-// @description     Improvements for YouTube Music
-// @description:de  Verbesserungen für YouTube Music
+// @description     ${pkg.description}
+// @description:de  ${pkg["description:de"]}
 // @license         ${pkg.license}
 // @author          ${pkg.author.name}
 // @copyright       ${pkg.author.name} (${pkg.author.url})
@@ -46,11 +47,11 @@ const header = `\
 
 (async () => {
   try {
-    const path = join(dirname(fileURLToPath(import.meta.url)), `../../dist/${userscriptName}`);
+    const path = join(dirname(fileURLToPath(import.meta.url)), `../../${userscriptDistPath}`);
     const input = String(await readFile(path));
     await writeFile(path, `${header}\n${input}${input.endsWith("\n") ? "" : "\n"}`);
-    console.info("Successfully added the userscript header");
-    console.info(`\nFinal size is ${((await stat(path)).size / 1024).toFixed(2)} KiB\n`);
+    console.info("Successfully added the userscript header.");
+    console.info(`Final size is \x1b[32m${((await stat(path)).size / 1024).toFixed(2)} KiB\x1b[0m\n`);
   }
   catch(err) {
     console.error("Error while adding userscript header:");