From 6d3ac1a086d756ff0e239435a66d8a98a7b67481 Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Mon, 6 Nov 2023 23:06:38 +0900 Subject: [PATCH 01/11] feat: electron-vite PoC --- .eslintignore | 4 +- electron.vite.config.ts | 57 ++ package.json | 18 +- pnpm-lock.yaml | 891 +++++++++++++++++++++++- src/index.ts | 8 +- src/plugins/adblocker/inject.d.ts | 4 +- src/plugins/adblocker/inject.js | 2 +- src/plugins/adblocker/preload.ts | 2 +- src/plugins/captions-selector/front.ts | 2 +- src/plugins/downloader/front.ts | 2 +- src/plugins/navigation/front.ts | 4 +- src/plugins/picture-in-picture/front.ts | 2 +- src/plugins/playback-speed/front.ts | 2 +- src/plugins/quality-changer/front.ts | 2 +- src/plugins/video-toggle/front.ts | 2 +- src/youtube-music.d.ts | 25 +- tsconfig.json | 1 + 17 files changed, 986 insertions(+), 42 deletions(-) create mode 100644 electron.vite.config.ts diff --git a/.eslintignore b/.eslintignore index c91110d8ae..82b6ba855e 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,4 +1,2 @@ .eslintrc.js -rollup.main.config.ts -rollup.preload.config.ts -rollup.renderer.config.ts +electron.vite.config.ts diff --git a/electron.vite.config.ts b/electron.vite.config.ts new file mode 100644 index 0000000000..8aa7b9b50a --- /dev/null +++ b/electron.vite.config.ts @@ -0,0 +1,57 @@ +import { defineConfig } from 'electron-vite'; +import builtinModules from 'builtin-modules'; +import { importChunkUrl } from '@lightningjs/vite-plugin-import-chunk-url'; + +export default defineConfig({ + main: { + plugins: [ + importChunkUrl() + ], + build: { + lib: { + entry: 'src/index.ts', + formats: ['cjs'], + }, + outDir: 'dist/main', + commonjsOptions: { + ignoreDynamicRequires: true, + }, + rollupOptions: { + external: ['electron', 'custom-electron-prompt', ...builtinModules], + input: './src/index.ts', + }, + }, + }, + preload: { + build: { + lib: { + entry: 'src/preload.ts', + formats: ['cjs'], + }, + outDir: 'dist/preload', + commonjsOptions: { + ignoreDynamicRequires: true, + }, + rollupOptions: { + external: ['electron', 'custom-electron-prompt', ...builtinModules], + input: './src/preload.ts', + } + }, + }, + renderer: { + build: { + lib: { + entry: 'src/renderer.ts', + formats: ['cjs'], + }, + outDir: 'dist/renderer', + commonjsOptions: { + ignoreDynamicRequires: true, + }, + rollupOptions: { + external: ['electron', ...builtinModules], + input: './src/renderer.ts', + }, + }, + }, +}); diff --git a/package.json b/package.json index 59a90f8f11..75d1b14465 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "productName": "YouTube Music", "version": "2.2.0", "description": "YouTube Music Desktop App - including custom plugins", - "main": "./dist/index.js", + "main": "./dist/main/index.js", "license": "MIT", "repository": "th-ch/youtube-music", "author": { @@ -89,12 +89,11 @@ "scripts": { "test": "playwright test", "test:debug": "cross-env DEBUG=pw:*,-pw:test:protocol playwright test", - "rollup:renderer": "rollup -c rollup.renderer.config.ts --configPlugin @rollup/plugin-typescript --bundleConfigAsCjs", - "rollup:preload": "rollup -c rollup.preload.config.ts --configPlugin @rollup/plugin-typescript --bundleConfigAsCjs", - "rollup:main": "rollup -c rollup.main.config.ts --configPlugin @rollup/plugin-typescript --bundleConfigAsCjs", - "build": "yarpm-pnpm run rollup:renderer && yarpm-pnpm run rollup:preload && yarpm-pnpm run rollup:main", - "start": "yarpm-pnpm run build && electron ./dist/index.js", + "build": "electron-vite build", + "start": "electron-vite preview", "start:debug": "cross-env ELECTRON_ENABLE_LOGGING=1 yarpm-pnpm run start", + "dev": "electron-vite dev", + "dev:debug": "cross-env ELECTRON_ENABLE_LOGGING=1 yarpm-pnpm run dev", "clean": "del-cli dist && del-cli pack", "dist": "yarpm-pnpm run clean && yarpm-pnpm run build && electron-builder --win --mac --linux -p never", "dist:linux": "yarpm-pnpm run clean && yarpm-pnpm run build && electron-builder --linux -p never", @@ -164,6 +163,7 @@ "youtubei.js": "7.0.0" }, "devDependencies": { + "@lightningjs/vite-plugin-import-chunk-url": "0.3.0", "@playwright/test": "1.39.0", "@rollup/plugin-commonjs": "25.0.7", "@rollup/plugin-image": "3.0.3", @@ -177,12 +177,14 @@ "@types/howler": "2.2.10", "@types/html-to-text": "9.0.3", "@typescript-eslint/eslint-plugin": "6.9.1", + "bufferutil": "4.0.8", "builtin-modules": "^3.3.0", "cross-env": "7.0.3", "del-cli": "5.1.0", "electron": "27.0.3", "electron-builder": "24.6.4", "electron-devtools-installer": "3.2.0", + "electron-vite": "1.0.28", "eslint": "8.53.0", "eslint-plugin-import": "2.29.0", "eslint-plugin-prettier": "5.0.1", @@ -193,6 +195,10 @@ "rollup-plugin-import-css": "3.3.5", "rollup-plugin-string": "3.0.0", "typescript": "5.2.2", + "utf-8-validate": "6.0.3", + "vite": "4.5.0", + "vite-plugin-string": "1.2.2", + "ws": "8.14.2", "yarpm": "1.2.0" }, "auto-changelog": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7a58067689..de740339f3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -39,7 +39,7 @@ dependencies: version: 2.1.4 '@xhayper/discord-rpc': specifier: 1.0.24 - version: 1.0.24 + version: 1.0.24(bufferutil@4.0.8)(utf-8-validate@6.0.3) async-mutex: specifier: 0.4.0 version: 0.4.0 @@ -108,6 +108,9 @@ dependencies: version: 7.0.0 devDependencies: + '@lightningjs/vite-plugin-import-chunk-url': + specifier: 0.3.0 + version: 0.3.0(vite@4.5.0) '@playwright/test': specifier: 1.39.0 version: 1.39.0 @@ -147,6 +150,9 @@ devDependencies: '@typescript-eslint/eslint-plugin': specifier: 6.9.1 version: 6.9.1(@typescript-eslint/parser@6.7.5)(eslint@8.53.0)(typescript@5.2.2) + bufferutil: + specifier: 4.0.8 + version: 4.0.8 builtin-modules: specifier: ^3.3.0 version: 3.3.0 @@ -165,6 +171,9 @@ devDependencies: electron-devtools-installer: specifier: 3.2.0 version: 3.2.0 + electron-vite: + specifier: 1.0.28 + version: 1.0.28(vite@4.5.0) eslint: specifier: 8.53.0 version: 8.53.0 @@ -195,6 +204,18 @@ devDependencies: typescript: specifier: 5.2.2 version: 5.2.2 + utf-8-validate: + specifier: 6.0.3 + version: 6.0.3 + vite: + specifier: 4.5.0 + version: 4.5.0 + vite-plugin-string: + specifier: 1.2.2 + version: 1.2.2 + ws: + specifier: 8.14.2 + version: 8.14.2(bufferutil@4.0.8)(utf-8-validate@6.0.3) yarpm: specifier: 1.2.0 version: 1.2.0 @@ -210,6 +231,14 @@ packages: engines: {node: '>=0.10.0'} dev: true + /@ampproject/remapping@2.2.1: + resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/gen-mapping': 0.3.3 + '@jridgewell/trace-mapping': 0.3.19 + dev: true + /@assemblyscript/loader@0.17.14: resolution: {integrity: sha512-+PVTOfla/0XMLRTQLJFPg4u40XcdTfon6GGea70hBGi8Pd7ZymIXyVUR+vK8wt5Jb4MVKTKPIz43Myyebw5mZA==} dev: false @@ -222,11 +251,141 @@ packages: chalk: 2.4.2 dev: true + /@babel/compat-data@7.23.2: + resolution: {integrity: sha512-0S9TQMmDHlqAZ2ITT95irXKfxN9bncq8ZCoJhun3nHL/lLUxd2NKBJYoNGWH7S0hz6fRQwWlAWn/ILM0C70KZQ==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/core@7.23.2: + resolution: {integrity: sha512-n7s51eWdaWZ3vGT2tD4T7J6eJs3QoBXydv7vkUM06Bf1cbVD2Kc2UrkzhiQwobfV7NwOnQXYL7UBJ5VPU+RGoQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@ampproject/remapping': 2.2.1 + '@babel/code-frame': 7.22.13 + '@babel/generator': 7.23.0 + '@babel/helper-compilation-targets': 7.22.15 + '@babel/helper-module-transforms': 7.23.0(@babel/core@7.23.2) + '@babel/helpers': 7.23.2 + '@babel/parser': 7.23.0 + '@babel/template': 7.22.15 + '@babel/traverse': 7.23.2 + '@babel/types': 7.23.0 + convert-source-map: 2.0.0 + debug: 4.3.4 + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/generator@7.23.0: + resolution: {integrity: sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.23.0 + '@jridgewell/gen-mapping': 0.3.3 + '@jridgewell/trace-mapping': 0.3.19 + jsesc: 2.5.2 + dev: true + + /@babel/helper-compilation-targets@7.22.15: + resolution: {integrity: sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/compat-data': 7.23.2 + '@babel/helper-validator-option': 7.22.15 + browserslist: 4.22.1 + lru-cache: 5.1.1 + semver: 6.3.1 + dev: true + + /@babel/helper-environment-visitor@7.22.20: + resolution: {integrity: sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helper-function-name@7.23.0: + resolution: {integrity: sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.22.15 + '@babel/types': 7.23.0 + dev: true + + /@babel/helper-hoist-variables@7.22.5: + resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.23.0 + dev: true + + /@babel/helper-module-imports@7.22.15: + resolution: {integrity: sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.23.0 + dev: true + + /@babel/helper-module-transforms@7.23.0(@babel/core@7.23.2): + resolution: {integrity: sha512-WhDWw1tdrlT0gMgUJSlX0IQvoO1eN279zrAUbVB+KpV2c3Tylz8+GnKOLllCS6Z/iZQEyVYxhZVUdPTqs2YYPw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.23.2 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-module-imports': 7.22.15 + '@babel/helper-simple-access': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/helper-validator-identifier': 7.22.20 + dev: true + + /@babel/helper-plugin-utils@7.22.5: + resolution: {integrity: sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helper-simple-access@7.22.5: + resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.23.0 + dev: true + + /@babel/helper-split-export-declaration@7.22.6: + resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.23.0 + dev: true + + /@babel/helper-string-parser@7.22.5: + resolution: {integrity: sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==} + engines: {node: '>=6.9.0'} + dev: true + /@babel/helper-validator-identifier@7.22.20: resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} engines: {node: '>=6.9.0'} dev: true + /@babel/helper-validator-option@7.22.15: + resolution: {integrity: sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helpers@7.23.2: + resolution: {integrity: sha512-lzchcp8SjTSVe/fPmLwtWVBFC7+Tbn8LGHDVfDp9JGxpAY5opSaEFgt8UQvrnECWOTdji2mOWMz1rOhkHscmGQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.22.15 + '@babel/traverse': 7.23.2 + '@babel/types': 7.23.0 + transitivePeerDependencies: + - supports-color + dev: true + /@babel/highlight@7.22.20: resolution: {integrity: sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==} engines: {node: '>=6.9.0'} @@ -236,6 +395,24 @@ packages: js-tokens: 4.0.0 dev: true + /@babel/parser@7.23.0: + resolution: {integrity: sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==} + engines: {node: '>=6.0.0'} + hasBin: true + dependencies: + '@babel/types': 7.23.0 + dev: true + + /@babel/plugin-transform-arrow-functions@7.22.5(@babel/core@7.23.2): + resolution: {integrity: sha512-26lTNXoVRdAnsaDXPpvCNUq+OVWEVC6bx7Vvz9rC53F2bagUWW4u4ii2+h8Fejfh7RYqPxn+libeFBBck9muEw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.2 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + /@babel/runtime@7.23.2: resolution: {integrity: sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg==} engines: {node: '>=6.9.0'} @@ -243,6 +420,42 @@ packages: regenerator-runtime: 0.14.0 dev: false + /@babel/template@7.22.15: + resolution: {integrity: sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.22.13 + '@babel/parser': 7.23.0 + '@babel/types': 7.23.0 + dev: true + + /@babel/traverse@7.23.2: + resolution: {integrity: sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.22.13 + '@babel/generator': 7.23.0 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-function-name': 7.23.0 + '@babel/helper-hoist-variables': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/parser': 7.23.0 + '@babel/types': 7.23.0 + debug: 4.3.4 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/types@7.23.0: + resolution: {integrity: sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-string-parser': 7.22.5 + '@babel/helper-validator-identifier': 7.22.20 + to-fast-properties: 2.0.0 + dev: true + /@cliqz/adblocker-content@1.26.11: resolution: {integrity: sha512-2p4lDiyoadVjUQDe5Pao4C0agFE5HHjXvsWzXEMG9sDP37Ji3krxsBEUzTkQPC8CuWmOjbzsrUu9rYjKOGupaA==} dependencies: @@ -361,6 +574,213 @@ packages: - supports-color dev: true + /@esbuild/android-arm64@0.18.20: + resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-arm@0.18.20: + resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-x64@0.18.20: + resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-arm64@0.18.20: + resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-x64@0.18.20: + resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-arm64@0.18.20: + resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-x64@0.18.20: + resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm64@0.18.20: + resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm@0.18.20: + resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ia32@0.18.20: + resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-loong64@0.14.54: + resolution: {integrity: sha512-bZBrLAIX1kpWelV0XemxBZllyRmM6vgFQQG2GdNb+r3Fkp0FOh1NJSvekXDs7jq70k4euu1cryLMfU+mTXlEpw==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-loong64@0.18.20: + resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-mips64el@0.18.20: + resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ppc64@0.18.20: + resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-riscv64@0.18.20: + resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-s390x@0.18.20: + resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-x64@0.18.20: + resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/netbsd-x64@0.18.20: + resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/openbsd-x64@0.18.20: + resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/sunos-x64@0.18.20: + resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-arm64@0.18.20: + resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-ia32@0.18.20: + resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-x64@0.18.20: + resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@eslint-community/eslint-utils@4.4.0(eslint@8.53.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -509,6 +929,14 @@ packages: '@jridgewell/sourcemap-codec': 1.4.15 dev: true + /@lightningjs/vite-plugin-import-chunk-url@0.3.0(vite@4.5.0): + resolution: {integrity: sha512-cozdB9gcPrnITWTymo525Vb+98EfsBOBQnrbzXI6rOFveshxc754eco0ffnuqyFUkN8pds+DwJrJ5saJDmJz/g==} + peerDependencies: + vite: ^4.4.9 + dependencies: + vite: 4.5.0 + dev: true + /@malept/cross-spawn-promise@1.1.1: resolution: {integrity: sha512-RTBGWL5FWQcg9orDOCcp4LvItNzUPcyEU9bwaeJX0rJ1IQxzucC48Y0/sQLp/g6t99IQgAlGIaesJS+gTn7tVQ==} engines: {node: '>= 10'} @@ -737,6 +1165,14 @@ packages: rollup: 4.3.0 dev: true + /@rollup/pluginutils@4.2.1: + resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} + engines: {node: '>= 8.0.0'} + dependencies: + estree-walker: 2.0.2 + picomatch: 2.3.1 + dev: true + /@rollup/pluginutils@5.0.5(rollup@4.3.0): resolution: {integrity: sha512-6aEYR910NyP73oHiJglti74iRyOwgFU4x3meH/H8OJx6Ry0j6cOVZ5X/wTvub7G7Ao6qaHBEaNsV3GLJkSsF+Q==} engines: {node: '>=14.0.0'} @@ -1204,12 +1640,12 @@ packages: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: true - /@xhayper/discord-rpc@1.0.24: + /@xhayper/discord-rpc@1.0.24(bufferutil@4.0.8)(utf-8-validate@6.0.3): resolution: {integrity: sha512-gzC8OaOSz7cGALSHyyq6nANQvBfyfntbSq+Qh+cNanoKX8ybOj+jWKmDP6PbLVDWoBftTU3JYsWXrLml2df2Hw==} engines: {node: '>=14.18.0'} dependencies: axios: 1.5.1 - ws: 8.14.2 + ws: 8.14.2(bufferutil@4.0.8)(utf-8-validate@6.0.3) transitivePeerDependencies: - bufferutil - debug @@ -1571,6 +2007,17 @@ packages: fancy-regex: 0.5.4 dev: false + /browserslist@4.22.1: + resolution: {integrity: sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + dependencies: + caniuse-lite: 1.0.30001561 + electron-to-chromium: 1.4.576 + node-releases: 2.0.13 + update-browserslist-db: 1.0.13(browserslist@4.22.1) + dev: true + /buffer-crc32@0.2.13: resolution: {integrity: sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==} @@ -1591,6 +2038,13 @@ packages: dev: true optional: true + /bufferutil@4.0.8: + resolution: {integrity: sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==} + engines: {node: '>=6.14.2'} + requiresBuild: true + dependencies: + node-gyp-build: 4.6.1 + /builder-util-runtime@9.2.1: resolution: {integrity: sha512-2rLv/uQD2x+dJ0J3xtsmI12AlRyk7p45TEbE/6o/fbb633e/S3pPgm+ct+JHsoY7r39dKHnGEFk/AASRFdnXmA==} engines: {node: '>=12.0.0'} @@ -1650,6 +2104,11 @@ packages: eel-wasm: 0.0.15 dev: false + /cac@6.7.14: + resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} + engines: {node: '>=8'} + dev: true + /cacache@18.0.0: resolution: {integrity: sha512-I7mVOPl3PUCeRub1U8YoGz2Lqv9WOBpobZ8RyWFXmReuILz+3OAyTa5oH3QPdtKZD7N0Yk00aLfzn0qvp8dZ1w==} engines: {node: ^16.14.0 || >=18.0.0} @@ -1709,6 +2168,10 @@ packages: engines: {node: '>=10'} dev: true + /caniuse-lite@1.0.30001561: + resolution: {integrity: sha512-NTt0DNoKe958Q0BE0j0c1V9jbUzhBxHIEJy7asmGrpE0yG63KTV7PLHPnK2E1O9RsQrQ081I3NLuXGS6zht3cw==} + dev: true + /chalk@2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} @@ -1854,6 +2317,10 @@ packages: typescript: 4.9.5 dev: true + /convert-source-map@2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + dev: true + /core-util-is@1.0.2: resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==} requiresBuild: true @@ -2296,6 +2763,10 @@ packages: type-fest: 2.19.0 dev: false + /electron-to-chromium@1.4.576: + resolution: {integrity: sha512-yXsZyXJfAqzWk1WKryr0Wl0MN2D47xodPvEEwlVePBnhU5E7raevLQR+E6b9JAD3GfL/7MbAL9ZtWQQPcLx7wA==} + dev: true + /electron-unhandled@4.0.1: resolution: {integrity: sha512-6BsLnBg+i96eUnbaIFZyYdyfNX3f80/Nlfqy34YEMxXT9JP3ddNsNnUeiOF8ezN4+et4t4D37gjghKTP0V3jyw==} dependencies: @@ -2321,6 +2792,28 @@ packages: - supports-color dev: false + /electron-vite@1.0.28(vite@4.5.0): + resolution: {integrity: sha512-cp7nBi6do/jn5SHdL2V71WjxqZ+NXitVqn5bW+TsTEYgAfSUuYYp6INJN854kcgoOj4UrjMqA9cGRTSl79xx0Q==} + engines: {node: ^14.18.0 || >=16.0.0} + hasBin: true + peerDependencies: + '@swc/core': ^1.0.0 + vite: ^3.0.0 || ^4.0.0 + peerDependenciesMeta: + '@swc/core': + optional: true + dependencies: + '@babel/core': 7.23.2 + '@babel/plugin-transform-arrow-functions': 7.22.5(@babel/core@7.23.2) + cac: 6.7.14 + esbuild: 0.18.20 + magic-string: 0.30.5 + picocolors: 1.0.0 + vite: 4.5.0 + transitivePeerDependencies: + - supports-color + dev: true + /electron@27.0.3: resolution: {integrity: sha512-VaB9cI1se+mUtz366NP+zxFVnkHLbCBNO4wwouw3FuGyX/m7/Bv1I89JhWOBv78tC+n11ZYMrVD23Jf6EZgVcg==} engines: {node: '>= 12.20.55'} @@ -2462,6 +2955,245 @@ packages: requiresBuild: true optional: true + /esbuild-android-64@0.14.54: + resolution: {integrity: sha512-Tz2++Aqqz0rJ7kYBfz+iqyE3QMycD4vk7LBRyWaAVFgFtQ/O8EJOnVmTOiDWYZ/uYzB4kvP+bqejYdVKzE5lAQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /esbuild-android-arm64@0.14.54: + resolution: {integrity: sha512-F9E+/QDi9sSkLaClO8SOV6etqPd+5DgJje1F9lOWoNncDdOBL2YF59IhsWATSt0TLZbYCf3pNlTHvVV5VfHdvg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /esbuild-darwin-64@0.14.54: + resolution: {integrity: sha512-jtdKWV3nBviOd5v4hOpkVmpxsBy90CGzebpbO9beiqUYVMBtSc0AL9zGftFuBon7PNDcdvNCEuQqw2x0wP9yug==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /esbuild-darwin-arm64@0.14.54: + resolution: {integrity: sha512-OPafJHD2oUPyvJMrsCvDGkRrVCar5aVyHfWGQzY1dWnzErjrDuSETxwA2HSsyg2jORLY8yBfzc1MIpUkXlctmw==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /esbuild-freebsd-64@0.14.54: + resolution: {integrity: sha512-OKwd4gmwHqOTp4mOGZKe/XUlbDJ4Q9TjX0hMPIDBUWWu/kwhBAudJdBoxnjNf9ocIB6GN6CPowYpR/hRCbSYAg==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-freebsd-arm64@0.14.54: + resolution: {integrity: sha512-sFwueGr7OvIFiQT6WeG0jRLjkjdqWWSrfbVwZp8iMP+8UHEHRBvlaxL6IuKNDwAozNUmbb8nIMXa7oAOARGs1Q==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-32@0.14.54: + resolution: {integrity: sha512-1ZuY+JDI//WmklKlBgJnglpUL1owm2OX+8E1syCD6UAxcMM/XoWd76OHSjl/0MR0LisSAXDqgjT3uJqT67O3qw==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-64@0.14.54: + resolution: {integrity: sha512-EgjAgH5HwTbtNsTqQOXWApBaPVdDn7XcK+/PtJwZLT1UmpLoznPd8c5CxqsH2dQK3j05YsB3L17T8vE7cp4cCg==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-arm64@0.14.54: + resolution: {integrity: sha512-WL71L+0Rwv+Gv/HTmxTEmpv0UgmxYa5ftZILVi2QmZBgX3q7+tDeOQNqGtdXSdsL8TQi1vIaVFHUPDe0O0kdig==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-arm@0.14.54: + resolution: {integrity: sha512-qqz/SjemQhVMTnvcLGoLOdFpCYbz4v4fUo+TfsWG+1aOu70/80RV6bgNpR2JCrppV2moUQkww+6bWxXRL9YMGw==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-mips64le@0.14.54: + resolution: {integrity: sha512-qTHGQB8D1etd0u1+sB6p0ikLKRVuCWhYQhAHRPkO+OF3I/iSlTKNNS0Lh2Oc0g0UFGguaFZZiPJdJey3AGpAlw==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-ppc64le@0.14.54: + resolution: {integrity: sha512-j3OMlzHiqwZBDPRCDFKcx595XVfOfOnv68Ax3U4UKZ3MTYQB5Yz3X1mn5GnodEVYzhtZgxEBidLWeIs8FDSfrQ==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-riscv64@0.14.54: + resolution: {integrity: sha512-y7Vt7Wl9dkOGZjxQZnDAqqn+XOqFD7IMWiewY5SPlNlzMX39ocPQlOaoxvT4FllA5viyV26/QzHtvTjVNOxHZg==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-s390x@0.14.54: + resolution: {integrity: sha512-zaHpW9dziAsi7lRcyV4r8dhfG1qBidQWUXweUjnw+lliChJqQr+6XD71K41oEIC3Mx1KStovEmlzm+MkGZHnHA==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-netbsd-64@0.14.54: + resolution: {integrity: sha512-PR01lmIMnfJTgeU9VJTDY9ZerDWVFIUzAtJuDHwwceppW7cQWjBBqP48NdeRtoP04/AtO9a7w3viI+PIDr6d+w==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-openbsd-64@0.14.54: + resolution: {integrity: sha512-Qyk7ikT2o7Wu76UsvvDS5q0amJvmRzDyVlL0qf5VLsLchjCa1+IAvd8kTBgUxD7VBUUVgItLkk609ZHUc1oCaw==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-sunos-64@0.14.54: + resolution: {integrity: sha512-28GZ24KmMSeKi5ueWzMcco6EBHStL3B6ubM7M51RmPwXQGLe0teBGJocmWhgwccA1GeFXqxzILIxXpHbl9Q/Kw==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + + /esbuild-windows-32@0.14.54: + resolution: {integrity: sha512-T+rdZW19ql9MjS7pixmZYVObd9G7kcaZo+sETqNH4RCkuuYSuv9AGHUVnPoP9hhuE1WM1ZimHz1CIBHBboLU7w==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /esbuild-windows-64@0.14.54: + resolution: {integrity: sha512-AoHTRBUuYwXtZhjXZbA1pGfTo8cJo3vZIcWGLiUcTNgHpJJMC1rVA44ZereBHMJtotyN71S8Qw0npiCIkW96cQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /esbuild-windows-arm64@0.14.54: + resolution: {integrity: sha512-M0kuUvXhot1zOISQGXwWn6YtS+Y/1RT9WrVIOywZnJHo3jCDyewAc79aKNQWFCQm+xNHVTq9h8dZKvygoXQQRg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /esbuild@0.14.54: + resolution: {integrity: sha512-Cy9llcy8DvET5uznocPyqL3BFRrFXSVqbgpMJ9Wz8oVjZlh/zUSNbPRbov0VX7VxN2JH1Oa0uNxZ7eLRb62pJA==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/linux-loong64': 0.14.54 + esbuild-android-64: 0.14.54 + esbuild-android-arm64: 0.14.54 + esbuild-darwin-64: 0.14.54 + esbuild-darwin-arm64: 0.14.54 + esbuild-freebsd-64: 0.14.54 + esbuild-freebsd-arm64: 0.14.54 + esbuild-linux-32: 0.14.54 + esbuild-linux-64: 0.14.54 + esbuild-linux-arm: 0.14.54 + esbuild-linux-arm64: 0.14.54 + esbuild-linux-mips64le: 0.14.54 + esbuild-linux-ppc64le: 0.14.54 + esbuild-linux-riscv64: 0.14.54 + esbuild-linux-s390x: 0.14.54 + esbuild-netbsd-64: 0.14.54 + esbuild-openbsd-64: 0.14.54 + esbuild-sunos-64: 0.14.54 + esbuild-windows-32: 0.14.54 + esbuild-windows-64: 0.14.54 + esbuild-windows-arm64: 0.14.54 + dev: true + + /esbuild@0.18.20: + resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/android-arm': 0.18.20 + '@esbuild/android-arm64': 0.18.20 + '@esbuild/android-x64': 0.18.20 + '@esbuild/darwin-arm64': 0.18.20 + '@esbuild/darwin-x64': 0.18.20 + '@esbuild/freebsd-arm64': 0.18.20 + '@esbuild/freebsd-x64': 0.18.20 + '@esbuild/linux-arm': 0.18.20 + '@esbuild/linux-arm64': 0.18.20 + '@esbuild/linux-ia32': 0.18.20 + '@esbuild/linux-loong64': 0.18.20 + '@esbuild/linux-mips64el': 0.18.20 + '@esbuild/linux-ppc64': 0.18.20 + '@esbuild/linux-riscv64': 0.18.20 + '@esbuild/linux-s390x': 0.18.20 + '@esbuild/linux-x64': 0.18.20 + '@esbuild/netbsd-x64': 0.18.20 + '@esbuild/openbsd-x64': 0.18.20 + '@esbuild/sunos-x64': 0.18.20 + '@esbuild/win32-arm64': 0.18.20 + '@esbuild/win32-ia32': 0.18.20 + '@esbuild/win32-x64': 0.18.20 + dev: true + /escalade@3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} engines: {node: '>=6'} @@ -2976,6 +3708,11 @@ packages: /functions-have-names@1.2.3: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} + /gensync@1.0.0-beta.2: + resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} + engines: {node: '>=6.9.0'} + dev: true + /get-caller-file@2.0.5: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} @@ -3068,6 +3805,11 @@ packages: serialize-error: 7.0.1 optional: true + /globals@11.12.0: + resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} + engines: {node: '>=4'} + dev: true + /globals@13.23.0: resolution: {integrity: sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==} engines: {node: '>=8'} @@ -3672,6 +4414,12 @@ packages: resolution: {integrity: sha512-TzO/62Hxeb26QMb4IGlI/5X+QLr9Uqp1FPkwp2+KOICW+Q+vSuFj61c8pkT6wAns4WcK56X7CmSHhJeDGWOqxQ==} dev: false + /jsesc@2.5.2: + resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} + engines: {node: '>=4'} + hasBin: true + dev: true + /json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} @@ -3824,6 +4572,12 @@ packages: resolution: {integrity: sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==} engines: {node: 14 || >=16.14} + /lru-cache@5.1.1: + resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + dependencies: + yallist: 3.1.1 + dev: true + /lru-cache@6.0.0: resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} engines: {node: '>=10'} @@ -4072,6 +4826,12 @@ packages: dev: false optional: true + /nanoid@3.3.7: + resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + dev: true + /natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} dev: true @@ -4100,6 +4860,10 @@ packages: formdata-polyfill: 4.0.10 dev: false + /node-gyp-build@4.6.1: + resolution: {integrity: sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ==} + hasBin: true + /node-gyp@10.0.1: resolution: {integrity: sha512-gg3/bHehQfZivQVfqIyy8wTdSymF9yTyP4CJifK73imyNMU8AIGQE2pUa7dNWfmMeG9cDVF2eehiRMv0LC1iAg==} engines: {node: ^16.14.0 || >=18.0.0} @@ -4124,6 +4888,10 @@ packages: iconv-lite: 0.6.2 dev: false + /node-releases@2.0.13: + resolution: {integrity: sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==} + dev: true + /nopt@7.2.0: resolution: {integrity: sha512-CVDtwCdhYIvnAzFoJ6NJ6dX3oga9/HyciQDnG1vQDjSLMeKLJ4A93ZqYKDrgYSr1FBY5/hMYC+2VCi24pgpkGA==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -4427,6 +5195,15 @@ packages: xmlbuilder: 15.1.1 dev: true + /postcss@8.4.31: + resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.3.7 + picocolors: 1.0.0 + source-map-js: 1.0.2 + dev: true + /prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} @@ -4861,6 +5638,11 @@ packages: ip: 2.0.0 smart-buffer: 4.2.0 + /source-map-js@1.0.2: + resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} + engines: {node: '>=0.10.0'} + dev: true + /source-map-support@0.5.21: resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} dependencies: @@ -5118,6 +5900,11 @@ packages: rimraf: 3.0.2 dev: true + /to-fast-properties@2.0.0: + resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} + engines: {node: '>=4'} + dev: true + /to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} @@ -5287,6 +6074,17 @@ packages: yaku: 0.16.7 dev: true + /update-browserslist-db@1.0.13(browserslist@4.22.1): + resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + dependencies: + browserslist: 4.22.1 + escalade: 3.1.1 + picocolors: 1.0.0 + dev: true + /uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} dependencies: @@ -5304,6 +6102,13 @@ packages: dev: false optional: true + /utf-8-validate@6.0.3: + resolution: {integrity: sha512-uIuGf9TWQ/y+0Lp+KGZCMuJWc3N9BHA+l/UmHd/oUHwJJDeysyTRxNQVkbzsIWfGFbRe3OcgML/i0mvVRPOyDA==} + engines: {node: '>=6.14.2'} + requiresBuild: true + dependencies: + node-gyp-build: 4.6.1 + /utf8-byte-length@1.0.4: resolution: {integrity: sha512-4+wkEYLBbWxqTahEsWrhxepcoVOJ+1z5PGIjPZxRkytcdSUaNjIjBM7Xn8E+pdSuV7SzvWovBFA54FO0JSoqhA==} dev: true @@ -5335,6 +6140,76 @@ packages: dev: true optional: true + /vite-plugin-string@1.2.2: + resolution: {integrity: sha512-AqK6aJJdOKTh/8FH4tSK29/PmbSaST8A8v93N1IjrKck0zOSa0n7kDHTw9fQ/tZxG/IwWrz1pqQtwKA+kWRxpA==} + dependencies: + '@rollup/pluginutils': 4.2.1 + vite: 2.9.16 + transitivePeerDependencies: + - less + - sass + - stylus + dev: true + + /vite@2.9.16: + resolution: {integrity: sha512-X+6q8KPyeuBvTQV8AVSnKDvXoBMnTx8zxh54sOwmmuOdxkjMmEJXH2UEchA+vTMps1xw9vL64uwJOWryULg7nA==} + engines: {node: '>=12.2.0'} + hasBin: true + peerDependencies: + less: '*' + sass: '*' + stylus: '*' + peerDependenciesMeta: + less: + optional: true + sass: + optional: true + stylus: + optional: true + dependencies: + esbuild: 0.14.54 + postcss: 8.4.31 + resolve: 1.22.8 + rollup: 4.3.0 + optionalDependencies: + fsevents: 2.3.3 + dev: true + + /vite@4.5.0: + resolution: {integrity: sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==} + engines: {node: ^14.18.0 || >=16.0.0} + hasBin: true + peerDependencies: + '@types/node': '>= 14' + less: '*' + lightningcss: ^1.21.0 + sass: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + dependencies: + esbuild: 0.18.20 + postcss: 8.4.31 + rollup: 4.3.0 + optionalDependencies: + fsevents: 2.3.3 + dev: true + /vudio@2.1.1: resolution: {integrity: sha512-VkFQcFt/b/kpF5Eg5Sq+oXUo1Zp5aRFF4BSmIrOzau5o+5WMWwX9ae/EGJZstCyZFiCTU5iw1Y+u2BCGW6Y6Jw==} dev: false @@ -5405,7 +6280,7 @@ packages: /wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - /ws@8.14.2: + /ws@8.14.2(bufferutil@4.0.8)(utf-8-validate@6.0.3): resolution: {integrity: sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==} engines: {node: '>=10.0.0'} peerDependencies: @@ -5416,7 +6291,9 @@ packages: optional: true utf-8-validate: optional: true - dev: false + dependencies: + bufferutil: 4.0.8 + utf-8-validate: 6.0.3 /x11@2.3.0: resolution: {integrity: sha512-Ep4DbqZkVHvZNVht+vvELcfdpGKnfh2kZuKdXqyZdtJx3UdvgUGrMQ9lwPNV33tDs86MF4YagC6+E2fZXikF6A==} @@ -5452,6 +6329,10 @@ packages: resolution: {integrity: sha512-Syu3IB3rZvKvYk7yTiyl1bo/jiEFaaStrgv1V2TIJTqYPStSMQVO8EQjg/z+DRzLq/4LIIharNT3iH1hylEIRw==} dev: true + /yallist@3.1.1: + resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + dev: true + /yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} diff --git a/src/index.ts b/src/index.ts index ab88b559d1..51c60e56d2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -44,6 +44,7 @@ import tunaObs from './plugins/tuna-obs/back'; import videoToggle from './plugins/video-toggle/back'; import visualizer from './plugins/visualizer/back'; +import rendererScriptUrl from './renderer.ts?importChunkUrl'; import youtubeMusicCSS from './youtube-music.css'; // Catch errors and log them @@ -335,10 +336,13 @@ async function createMainWindow() { removeContentSecurityPolicy(); win.webContents.on('dom-ready', () => { - const rendererScriptPath = path.join(__dirname, 'renderer.js'); + const filePath = new URL(rendererScriptUrl).pathname; + // On Windows, URL paths start with a leading slash if they're absolute. Strip it off. + const isWindows = process.platform === 'win32'; + const rendererScriptPath = isWindows ? filePath.substring(1) : filePath; win.webContents.executeJavaScriptInIsolatedWorld(0, [{ code: fs.readFileSync(rendererScriptPath, 'utf-8') + ';0', - url: url.pathToFileURL(rendererScriptPath).toString(), + url: rendererScriptUrl, }], true); }); diff --git a/src/plugins/adblocker/inject.d.ts b/src/plugins/adblocker/inject.d.ts index cda88ca4b5..435d23f7e0 100644 --- a/src/plugins/adblocker/inject.d.ts +++ b/src/plugins/adblocker/inject.d.ts @@ -1,3 +1 @@ -const inject: () => void; - -export default inject; +export const inject: () => void; diff --git a/src/plugins/adblocker/inject.js b/src/plugins/adblocker/inject.js index ccc9ea83c6..edc8b03b91 100644 --- a/src/plugins/adblocker/inject.js +++ b/src/plugins/adblocker/inject.js @@ -7,7 +7,7 @@ Parts of this code is derived from set-constant.js: https://github.com/gorhill/uBlock/blob/5de0ce975753b7565759ac40983d31978d1f84ca/assets/resources/scriptlets.js#L704 */ -module.exports = () => { +export const inject = () => { { const pruner = function (o) { delete o.playerAds; diff --git a/src/plugins/adblocker/preload.ts b/src/plugins/adblocker/preload.ts index c0facb2bb5..57ab024750 100644 --- a/src/plugins/adblocker/preload.ts +++ b/src/plugins/adblocker/preload.ts @@ -1,5 +1,5 @@ import config, { shouldUseBlocklists } from './config'; -import inject from './inject'; +import { inject } from './inject'; import injectCliqzPreload from './inject-cliqz-preload'; import { blockers } from './blocker-types'; diff --git a/src/plugins/captions-selector/front.ts b/src/plugins/captions-selector/front.ts index 95d973ba6f..492ac2c4a7 100644 --- a/src/plugins/captions-selector/front.ts +++ b/src/plugins/captions-selector/front.ts @@ -1,6 +1,6 @@ import configProvider from './config-renderer'; -import CaptionsSettingsButtonHTML from './templates/captions-settings-template.html'; +import CaptionsSettingsButtonHTML from './templates/captions-settings-template.html?raw'; import { ElementFromHtml } from '../utils-renderer'; import { YoutubePlayer } from '../../types/youtube-player'; diff --git a/src/plugins/downloader/front.ts b/src/plugins/downloader/front.ts index ef29862a1e..1b450819cd 100644 --- a/src/plugins/downloader/front.ts +++ b/src/plugins/downloader/front.ts @@ -1,4 +1,4 @@ -import downloadHTML from './templates/download.html'; +import downloadHTML from './templates/download.html?raw'; import defaultConfig from '../../config/defaults'; import { getSongMenu } from '../../providers/dom-elements'; diff --git a/src/plugins/navigation/front.ts b/src/plugins/navigation/front.ts index cc03a98be5..cc5c86b111 100644 --- a/src/plugins/navigation/front.ts +++ b/src/plugins/navigation/front.ts @@ -1,5 +1,5 @@ -import forwardHTML from './templates/forward.html'; -import backHTML from './templates/back.html'; +import forwardHTML from './templates/forward.html?raw'; +import backHTML from './templates/back.html?raw'; import { ElementFromHtml } from '../utils-renderer'; diff --git a/src/plugins/picture-in-picture/front.ts b/src/plugins/picture-in-picture/front.ts index 406137a332..b152dd5161 100644 --- a/src/plugins/picture-in-picture/front.ts +++ b/src/plugins/picture-in-picture/front.ts @@ -1,7 +1,7 @@ import { toKeyEvent } from 'keyboardevent-from-electron-accelerator'; import keyEventAreEqual from 'keyboardevents-areequal'; -import pipHTML from './templates/picture-in-picture.html'; +import pipHTML from './templates/picture-in-picture.html?raw'; import { getSongMenu } from '../../providers/dom-elements'; diff --git a/src/plugins/playback-speed/front.ts b/src/plugins/playback-speed/front.ts index b8a0864e06..7ff6a8f8ec 100644 --- a/src/plugins/playback-speed/front.ts +++ b/src/plugins/playback-speed/front.ts @@ -1,4 +1,4 @@ -import sliderHTML from './templates/slider.html'; +import sliderHTML from './templates/slider.html?raw'; import { getSongMenu } from '../../providers/dom-elements'; import { ElementFromHtml } from '../utils-renderer'; diff --git a/src/plugins/quality-changer/front.ts b/src/plugins/quality-changer/front.ts index 404447dc2a..a936ae37fb 100644 --- a/src/plugins/quality-changer/front.ts +++ b/src/plugins/quality-changer/front.ts @@ -1,4 +1,4 @@ -import qualitySettingsTemplate from './templates/qualitySettingsTemplate.html'; +import qualitySettingsTemplate from './templates/qualitySettingsTemplate.html?raw'; import { ElementFromHtml } from '../utils-renderer'; import { YoutubePlayer } from '../../types/youtube-player'; diff --git a/src/plugins/video-toggle/front.ts b/src/plugins/video-toggle/front.ts index 6dd3a381b0..033fb1de35 100644 --- a/src/plugins/video-toggle/front.ts +++ b/src/plugins/video-toggle/front.ts @@ -1,4 +1,4 @@ -import buttonTemplate from './templates/button_template.html'; +import buttonTemplate from './templates/button_template.html?raw'; import { ElementFromHtml } from '../utils-renderer'; diff --git a/src/youtube-music.d.ts b/src/youtube-music.d.ts index 6a921443f6..c61765e395 100644 --- a/src/youtube-music.d.ts +++ b/src/youtube-music.d.ts @@ -1,8 +1,20 @@ +/// + declare module '*.html' { const html: string; export default html; } +declare module '*.html?raw' { + const html: string; + + export default html; +} +declare module '*?importChunkUrl' { + const source: string; + + export default source; +} declare module '*.svg' { const element: SVGAElement; @@ -15,7 +27,6 @@ declare module '*.png' { } declare module '*.jpg' { const element: HTMLImageElement; - export default element; } declare module '*.css' { @@ -23,15 +34,3 @@ declare module '*.css' { export default css; } - -declare module 'rollup-plugin-string' { - import type { Plugin } from 'rollup'; - - interface PluginOptions { - include?: string[] | string; - exclude?: string[] | string; - minifier?: unknown; - } - - export function string(options?: PluginOptions): Plugin; -} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 766ea7c067..fbb24d0219 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,6 +3,7 @@ "target": "ESNext", "lib": ["dom", "dom.iterable", "es2022"], "module": "CommonJS", + "types": ["electron-vite/node"], "allowSyntheticDefaultImports": true, "esModuleInterop": true, "resolveJsonModule": true, From 873afbb0189a1ec7ca6ef551a36b5022336afba7 Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Mon, 6 Nov 2023 23:34:12 +0900 Subject: [PATCH 02/11] fix: fix preload path --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 51c60e56d2..8820b6950c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -199,7 +199,7 @@ async function createMainWindow() { show: false, webPreferences: { contextIsolation: true, - preload: path.join(__dirname, 'preload.js'), + preload: path.join(__dirname, '..', 'preload', 'preload.js'), ...(isTesting() ? undefined : { From c787a1e9e6d72cdbeaf9ff7e01744855f4503da9 Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Mon, 6 Nov 2023 23:38:54 +0900 Subject: [PATCH 03/11] remove rollup deps and config --- package.json | 10 -- pnpm-lock.yaml | 317 +------------------------------------- rollup.main.config.ts | 60 -------- rollup.preload.config.ts | 54 ------- rollup.renderer.config.ts | 57 ------- 5 files changed, 2 insertions(+), 496 deletions(-) delete mode 100644 rollup.main.config.ts delete mode 100644 rollup.preload.config.ts delete mode 100644 rollup.renderer.config.ts diff --git a/package.json b/package.json index 75d1b14465..e1c78da7ae 100644 --- a/package.json +++ b/package.json @@ -165,13 +165,6 @@ "devDependencies": { "@lightningjs/vite-plugin-import-chunk-url": "0.3.0", "@playwright/test": "1.39.0", - "@rollup/plugin-commonjs": "25.0.7", - "@rollup/plugin-image": "3.0.3", - "@rollup/plugin-json": "6.0.1", - "@rollup/plugin-node-resolve": "15.2.3", - "@rollup/plugin-terser": "0.4.4", - "@rollup/plugin-typescript": "11.1.5", - "@rollup/plugin-wasm": "6.2.2", "@total-typescript/ts-reset": "0.5.1", "@types/electron-localshortcut": "3.1.2", "@types/howler": "2.2.10", @@ -191,9 +184,6 @@ "node-gyp": "10.0.1", "playwright": "1.39.0", "rollup": "4.3.0", - "rollup-plugin-copy": "3.5.0", - "rollup-plugin-import-css": "3.3.5", - "rollup-plugin-string": "3.0.0", "typescript": "5.2.2", "utf-8-validate": "6.0.3", "vite": "4.5.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index de740339f3..aed370b743 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -114,27 +114,6 @@ devDependencies: '@playwright/test': specifier: 1.39.0 version: 1.39.0 - '@rollup/plugin-commonjs': - specifier: 25.0.7 - version: 25.0.7(rollup@4.3.0) - '@rollup/plugin-image': - specifier: 3.0.3 - version: 3.0.3(rollup@4.3.0) - '@rollup/plugin-json': - specifier: 6.0.1 - version: 6.0.1(rollup@4.3.0) - '@rollup/plugin-node-resolve': - specifier: 15.2.3 - version: 15.2.3(rollup@4.3.0) - '@rollup/plugin-terser': - specifier: 0.4.4 - version: 0.4.4(rollup@4.3.0) - '@rollup/plugin-typescript': - specifier: 11.1.5 - version: 11.1.5(rollup@4.3.0)(typescript@5.2.2) - '@rollup/plugin-wasm': - specifier: 6.2.2 - version: 6.2.2(rollup@4.3.0) '@total-typescript/ts-reset': specifier: 0.5.1 version: 0.5.1 @@ -192,15 +171,6 @@ devDependencies: rollup: specifier: 4.3.0 version: 4.3.0 - rollup-plugin-copy: - specifier: 3.5.0 - version: 3.5.0 - rollup-plugin-import-css: - specifier: 3.3.5 - version: 3.3.5(rollup@4.3.0) - rollup-plugin-string: - specifier: 3.0.0 - version: 3.0.0 typescript: specifier: 5.2.2 version: 5.2.2 @@ -911,13 +881,6 @@ packages: engines: {node: '>=6.0.0'} dev: true - /@jridgewell/source-map@0.3.5: - resolution: {integrity: sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==} - dependencies: - '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.19 - dev: true - /@jridgewell/sourcemap-codec@1.4.15: resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} dev: true @@ -1055,116 +1018,6 @@ packages: resolution: {integrity: sha512-yvwa+aCyYI/UjeD39BnpMypG8N06l86wIDW1/PAc6ihBRnodIfZDwccxQN3n1t74wduzaz74m4ZMHZnB06567Q==} dev: false - /@rollup/plugin-commonjs@25.0.7(rollup@4.3.0): - resolution: {integrity: sha512-nEvcR+LRjEjsaSsc4x3XZfCCvZIaSMenZu/OiwOKGN2UhQpAYI7ru7czFvyWbErlpoGjnSX3D5Ch5FcMA3kRWQ==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: 4.3.0 - peerDependenciesMeta: - rollup: - optional: true - dependencies: - '@rollup/pluginutils': 5.0.5(rollup@4.3.0) - commondir: 1.0.1 - estree-walker: 2.0.2 - glob: 8.1.0 - is-reference: 1.2.1 - magic-string: 0.30.5 - rollup: 4.3.0 - dev: true - - /@rollup/plugin-image@3.0.3(rollup@4.3.0): - resolution: {integrity: sha512-qXWQwsXpvD4trSb8PeFPFajp8JLpRtqqOeNYRUKnEQNHm7e5UP7fuSRcbjQAJ7wDZBbnJvSdY5ujNBQd9B1iFg==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: 4.3.0 - peerDependenciesMeta: - rollup: - optional: true - dependencies: - '@rollup/pluginutils': 5.0.5(rollup@4.3.0) - mini-svg-data-uri: 1.4.4 - rollup: 4.3.0 - dev: true - - /@rollup/plugin-json@6.0.1(rollup@4.3.0): - resolution: {integrity: sha512-RgVfl5hWMkxN1h/uZj8FVESvPuBJ/uf6ly6GTj0GONnkfoBN5KC0MSz+PN2OLDgYXMhtG0mWpTrkiOjoxAIevw==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: 4.3.0 - peerDependenciesMeta: - rollup: - optional: true - dependencies: - '@rollup/pluginutils': 5.0.5(rollup@4.3.0) - rollup: 4.3.0 - dev: true - - /@rollup/plugin-node-resolve@15.2.3(rollup@4.3.0): - resolution: {integrity: sha512-j/lym8nf5E21LwBT4Df1VD6hRO2L2iwUeUmP7litikRsVp1H6NWx20NEp0Y7su+7XGc476GnXXc4kFeZNGmaSQ==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: 4.3.0 - peerDependenciesMeta: - rollup: - optional: true - dependencies: - '@rollup/pluginutils': 5.0.5(rollup@4.3.0) - '@types/resolve': 1.20.2 - deepmerge: 4.3.1 - is-builtin-module: 3.2.1 - is-module: 1.0.0 - resolve: 1.22.8 - rollup: 4.3.0 - dev: true - - /@rollup/plugin-terser@0.4.4(rollup@4.3.0): - resolution: {integrity: sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: 4.3.0 - peerDependenciesMeta: - rollup: - optional: true - dependencies: - rollup: 4.3.0 - serialize-javascript: 6.0.1 - smob: 1.4.1 - terser: 5.21.0 - dev: true - - /@rollup/plugin-typescript@11.1.5(rollup@4.3.0)(typescript@5.2.2): - resolution: {integrity: sha512-rnMHrGBB0IUEv69Q8/JGRD/n4/n6b3nfpufUu26axhUcboUzv/twfZU8fIBbTOphRAe0v8EyxzeDpKXqGHfyDA==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: 4.3.0 - tslib: '*' - typescript: '>=3.7.0' - peerDependenciesMeta: - rollup: - optional: true - tslib: - optional: true - dependencies: - '@rollup/pluginutils': 5.0.5(rollup@4.3.0) - resolve: 1.22.8 - rollup: 4.3.0 - typescript: 5.2.2 - dev: true - - /@rollup/plugin-wasm@6.2.2(rollup@4.3.0): - resolution: {integrity: sha512-gpC4R1G9Ni92ZIRTexqbhX7U+9estZrbhP+9SRb0DW9xpB9g7j34r+J2hqrcW/lRI7dJaU84MxZM0Rt82tqYPQ==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: 4.3.0 - peerDependenciesMeta: - rollup: - optional: true - dependencies: - '@rollup/pluginutils': 5.0.5(rollup@4.3.0) - rollup: 4.3.0 - dev: true - /@rollup/pluginutils@4.2.1: resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} engines: {node: '>= 8.0.0'} @@ -1173,21 +1026,6 @@ packages: picomatch: 2.3.1 dev: true - /@rollup/pluginutils@5.0.5(rollup@4.3.0): - resolution: {integrity: sha512-6aEYR910NyP73oHiJglti74iRyOwgFU4x3meH/H8OJx6Ry0j6cOVZ5X/wTvub7G7Ao6qaHBEaNsV3GLJkSsF+Q==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: 4.3.0 - peerDependenciesMeta: - rollup: - optional: true - dependencies: - '@types/estree': 1.0.2 - estree-walker: 2.0.2 - picomatch: 2.3.1 - rollup: 4.3.0 - dev: true - /@rollup/rollup-android-arm-eabi@4.3.0: resolution: {integrity: sha512-/4pns6BYi8MXdwnXM44yoGAcFYVHL/BYlB2q1HXZ6AzH++LaiEVWFpBWQ/glXhbMbv3E3o09igrHFbP/snhAvA==} cpu: [arm] @@ -1339,10 +1177,6 @@ packages: - supports-color dev: true - /@types/estree@1.0.2: - resolution: {integrity: sha512-VeiPZ9MMwXjO32/Xu7+OwflfmeoRwkE/qzndw42gGtgJwZopBnzy2gD//NN1+go1mADzkDcqf/KnFRSjTJ8xJA==} - dev: true - /@types/filesystem@0.0.33: resolution: {integrity: sha512-2KedRPzwu2K528vFkoXnnWdsG0MtUwPjuA7pRy4vKxlxHEe8qUDZibYHXJKZZr2Cl/ELdCWYqyb/MKwsUuzBWw==} dependencies: @@ -1357,25 +1191,12 @@ packages: resolution: {integrity: sha512-NS7izfYOnQI/Opf3YdZSKkI5Ox89SqEffJHK2zfGY2BYEVuWuM6pSwDRglGl4W0SM84oUQfvLyYH4X6EQZAJ2w==} dev: false - /@types/fs-extra@8.1.3: - resolution: {integrity: sha512-7IdV01N0u/CaVO0fuY1YmEg14HQN3+EW8mpNgg6NEfxEl/lzCa5OxlBu3iFsCAdamnYOcTQ7oEi43Xc/67Rgzw==} - dependencies: - '@types/node': 20.8.6 - dev: true - /@types/fs-extra@9.0.13: resolution: {integrity: sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==} dependencies: '@types/node': 20.8.6 dev: true - /@types/glob@7.2.0: - resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} - dependencies: - '@types/minimatch': 5.1.2 - '@types/node': 20.8.6 - dev: true - /@types/har-format@1.2.13: resolution: {integrity: sha512-PwBsCBD3lDODn4xpje3Y1di0aDJp4Ww7aSfMRVw6ysnxD4I7Wmq2mBkSKaDtN403hqH5sp6c9xQUvFYY3+lkBg==} dev: false @@ -1404,10 +1225,6 @@ packages: dependencies: '@types/node': 20.8.6 - /@types/minimatch@5.1.2: - resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==} - dev: true - /@types/minimist@1.2.3: resolution: {integrity: sha512-ZYFzrvyWUNhaPomn80dsMNgMeXxNWZBdkuG/hWlUvXvbdUH8ZERNBGXnU87McuGcWDsyzX2aChCv/SVN348k3A==} dev: true @@ -1437,10 +1254,6 @@ packages: dev: true optional: true - /@types/resolve@1.20.2: - resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} - dev: true - /@types/responselike@1.0.1: resolution: {integrity: sha512-TiGnitEDxj2X0j+98Eqk5lv/Cij8oHd32bU4D/Yw6AOq7vvTk0gSD2GPj0G/HkvhMoVsdlhYF4yqqlyPBTM6Sg==} dependencies: @@ -2258,10 +2071,6 @@ packages: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} requiresBuild: true - /colorette@1.4.0: - resolution: {integrity: sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==} - dev: true - /combined-stream@1.0.8: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} engines: {node: '>= 0.8'} @@ -2272,19 +2081,11 @@ packages: resolution: {integrity: sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==} dev: true - /commander@2.20.3: - resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} - dev: true - /commander@5.1.0: resolution: {integrity: sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==} engines: {node: '>= 6'} dev: true - /commondir@1.0.1: - resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} - dev: true - /compare-version@0.1.2: resolution: {integrity: sha512-pJDh5/4wrEnXX/VWRZvruAGHkzKdr46z11OlTPN+VrATlWWhSKewNCJ1futCO5C7eJB3nPMFZA1LeYtcFboZ2A==} engines: {node: '>=0.10.0'} @@ -2467,6 +2268,7 @@ packages: /deepmerge@4.3.1: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} + dev: false /default-browser-id@3.0.0: resolution: {integrity: sha512-OZ1y3y0SqSICtE8DE4S8YOE9UZOJ8wO16fKWVP5J1Qz42kV9jcnMVFrEE/noXb/ss3Q4pZIH79kxofzyNNtUNA==} @@ -3395,10 +3197,6 @@ packages: engines: {node: '>=4.0'} dev: true - /estree-walker@0.6.1: - resolution: {integrity: sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==} - dev: true - /estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} dev: true @@ -3781,17 +3579,6 @@ packages: path-is-absolute: 1.0.1 dev: true - /glob@8.1.0: - resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} - engines: {node: '>=12'} - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 5.1.6 - once: 1.4.0 - dev: true - /global-agent@3.0.0: resolution: {integrity: sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==} engines: {node: '>=10.0'} @@ -3823,20 +3610,6 @@ packages: dependencies: define-properties: 1.2.1 - /globby@10.0.1: - resolution: {integrity: sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A==} - engines: {node: '>=8'} - dependencies: - '@types/glob': 7.2.0 - array-union: 2.1.0 - dir-glob: 3.0.1 - fast-glob: 3.3.1 - glob: 7.2.3 - ignore: 5.2.4 - merge2: 1.4.1 - slash: 3.0.0 - dev: true - /globby@11.1.0: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} engines: {node: '>=10'} @@ -4144,13 +3917,6 @@ packages: call-bind: 1.0.2 has-tostringtag: 1.0.0 - /is-builtin-module@3.2.1: - resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} - engines: {node: '>=6'} - dependencies: - builtin-modules: 3.3.0 - dev: true - /is-callable@1.2.7: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} @@ -4223,10 +3989,6 @@ packages: resolution: {integrity: sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==} dev: false - /is-module@1.0.0: - resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} - dev: true - /is-negative-zero@2.0.2: resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} engines: {node: '>= 0.4'} @@ -4268,17 +4030,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /is-plain-object@3.0.1: - resolution: {integrity: sha512-Xnpx182SBMrr/aBik8y+GuR4U1L9FqMSojwDQwPMmxyC6bvEqly9UBCxhauBF5vNh2gwWJNX6oDV7O+OM4z34g==} - engines: {node: '>=0.10.0'} - dev: true - - /is-reference@1.2.1: - resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==} - dependencies: - '@types/estree': 1.0.2 - dev: true - /is-regex@1.1.4: resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} engines: {node: '>= 0.4'} @@ -4709,11 +4460,6 @@ packages: engines: {node: '>=4'} dev: true - /mini-svg-data-uri@1.4.4: - resolution: {integrity: sha512-r9deDe9p5FJUPZAk3A59wGH7Ii9YrjjWw0jmw/liSbHl2CHiyXj6FcDXDu2K3TjVAXqiJdaw3xxwlZZr9E6nHg==} - hasBin: true - dev: true - /minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: @@ -5263,12 +5009,6 @@ packages: resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==} engines: {node: '>=10'} - /randombytes@2.1.0: - resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} - dependencies: - safe-buffer: 5.2.1 - dev: true - /read-config-file@6.3.2: resolution: {integrity: sha512-M80lpCjnE6Wt6zb98DoW8WHR09nzMSpu8XHtPkiTHrJ5Az9CybfeQhTJ8D7saeBHpGhLPIVyA8lcL6ZmdKwY6Q==} engines: {node: '>=12.0.0'} @@ -5397,39 +5137,6 @@ packages: sprintf-js: 1.1.3 optional: true - /rollup-plugin-copy@3.5.0: - resolution: {integrity: sha512-wI8D5dvYovRMx/YYKtUNt3Yxaw4ORC9xo6Gt9t22kveWz1enG9QrhVlagzwrxSC455xD1dHMKhIJkbsQ7d48BA==} - engines: {node: '>=8.3'} - dependencies: - '@types/fs-extra': 8.1.3 - colorette: 1.4.0 - fs-extra: 8.1.0 - globby: 10.0.1 - is-plain-object: 3.0.1 - dev: true - - /rollup-plugin-import-css@3.3.5(rollup@4.3.0): - resolution: {integrity: sha512-wSfzveEzvUDlVevo70kmVD5Mk785UN55NG4C7VVnrmdE0qZ8apcVVFajyCPfFYSNxq5YkccOcrGUT2T/2HnEcQ==} - engines: {node: '>=16'} - peerDependencies: - rollup: 4.3.0 - dependencies: - '@rollup/pluginutils': 5.0.5(rollup@4.3.0) - rollup: 4.3.0 - dev: true - - /rollup-plugin-string@3.0.0: - resolution: {integrity: sha512-vqyzgn9QefAgeKi+Y4A7jETeIAU1zQmS6VotH6bzm/zmUQEnYkpIGRaOBPY41oiWYV4JyBoGAaBjYMYuv+6wVw==} - dependencies: - rollup-pluginutils: 2.8.2 - dev: true - - /rollup-pluginutils@2.8.2: - resolution: {integrity: sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==} - dependencies: - estree-walker: 0.6.1 - dev: true - /rollup@4.3.0: resolution: {integrity: sha512-scIi1NrKLDIYSPK66jjECtII7vIgdAMFmFo8h6qm++I6nN9qDSV35Ku6erzGVqYjx+lj+j5wkusRMr++8SyDZg==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} @@ -5479,6 +5186,7 @@ packages: /safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + dev: false /safe-regex-test@1.0.0: resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} @@ -5542,12 +5250,6 @@ packages: type-fest: 0.20.2 dev: false - /serialize-javascript@6.0.1: - resolution: {integrity: sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==} - dependencies: - randombytes: 2.1.0 - dev: true - /set-function-name@2.0.1: resolution: {integrity: sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==} engines: {node: '>= 0.4'} @@ -5617,10 +5319,6 @@ packages: resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==} engines: {node: '>= 6.0.0', npm: '>= 3.0.0'} - /smob@1.4.1: - resolution: {integrity: sha512-9LK+E7Hv5R9u4g4C3p+jjLstaLe11MDsL21UpYaCNmapvMkYhqCV4A/f/3gyH8QjMyh6l68q9xC85vihY9ahMQ==} - dev: true - /socks-proxy-agent@8.0.2: resolution: {integrity: sha512-8zuqoLv1aP/66PHF5TqwJ7Czm3Yv32urJQHrVyhD7mmA6d61Zv8cIXQYPTWwmg6qlupnPvs/QKDmfa4P/qct2g==} engines: {node: '>= 14'} @@ -5849,17 +5547,6 @@ packages: fs-extra: 10.1.0 dev: true - /terser@5.21.0: - resolution: {integrity: sha512-WtnFKrxu9kaoXuiZFSGrcAvvBqAdmKx0SFNmVNYdJamMu9yyN3I/QF0FbH4QcqJQ+y1CJnzxGIKH0cSj+FGYRw==} - engines: {node: '>=10'} - hasBin: true - dependencies: - '@jridgewell/source-map': 0.3.5 - acorn: 8.10.0 - commander: 2.20.3 - source-map-support: 0.5.21 - dev: true - /text-table@0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} dev: true diff --git a/rollup.main.config.ts b/rollup.main.config.ts deleted file mode 100644 index 9836449c56..0000000000 --- a/rollup.main.config.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { defineConfig } from 'rollup'; -import builtinModules from 'builtin-modules'; -import typescript from '@rollup/plugin-typescript'; -import commonjs from '@rollup/plugin-commonjs'; -import nodeResolvePlugin from '@rollup/plugin-node-resolve'; -import json from '@rollup/plugin-json'; -import terser from '@rollup/plugin-terser'; -import { string } from 'rollup-plugin-string'; -import css from 'rollup-plugin-import-css'; -import wasmPlugin from '@rollup/plugin-wasm'; -import copy from 'rollup-plugin-copy'; - -export default defineConfig({ - plugins: [ - typescript({ - module: 'ESNext', - }), - nodeResolvePlugin({ - browser: false, - preferBuiltins: true, - exportConditions: ['node', 'default', 'module', 'import'], - }), - commonjs({ - ignoreDynamicRequires: true, - }), - wasmPlugin({ - maxFileSize: 0, - targetEnv: 'browser', - }), - json(), - string({ - include: '**/*.html', - }), - css(), - copy({ - targets: [ - { src: 'src/error.html', dest: 'dist/' }, - { src: 'assets', dest: 'dist/' }, - ], - }), - terser({ - ecma: 2020, - }), - { - closeBundle() { - if (!process.env.ROLLUP_WATCH) { - setTimeout(() => process.exit(0)); - } - }, - name: 'force-close', - }, - ], - input: './src/index.ts', - output: { - format: 'cjs', - name: '[name].js', - dir: './dist', - }, - external: ['electron', 'custom-electron-prompt', ...builtinModules], -}); diff --git a/rollup.preload.config.ts b/rollup.preload.config.ts deleted file mode 100644 index 0d55a91e89..0000000000 --- a/rollup.preload.config.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { defineConfig } from 'rollup'; -import builtinModules from 'builtin-modules'; -import typescript from '@rollup/plugin-typescript'; -import commonjs from '@rollup/plugin-commonjs'; -import nodeResolvePlugin from '@rollup/plugin-node-resolve'; -import json from '@rollup/plugin-json'; -import terser from '@rollup/plugin-terser'; -import { string } from 'rollup-plugin-string'; -import css from 'rollup-plugin-import-css'; -import wasmPlugin from '@rollup/plugin-wasm'; -import image from '@rollup/plugin-image'; - -export default defineConfig({ - plugins: [ - typescript({ - module: 'ESNext', - }), - nodeResolvePlugin({ - browser: false, - preferBuiltins: true, - }), - commonjs({ - ignoreDynamicRequires: true, - }), - json(), - string({ - include: '**/*.html', - }), - css(), - wasmPlugin({ - maxFileSize: 0, - targetEnv: 'browser', - }), - image({ dom: true }), - terser({ - ecma: 2020, - }), - { - closeBundle() { - if (!process.env.ROLLUP_WATCH) { - setTimeout(() => process.exit(0)); - } - }, - name: 'force-close', - }, - ], - input: './src/preload.ts', - output: { - format: 'cjs', - name: '[name].js', - dir: './dist', - }, - external: ['electron', 'custom-electron-prompt', ...builtinModules], -}); diff --git a/rollup.renderer.config.ts b/rollup.renderer.config.ts deleted file mode 100644 index c363a17e9f..0000000000 --- a/rollup.renderer.config.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { defineConfig } from 'rollup'; -import builtinModules from 'builtin-modules'; -import typescript from '@rollup/plugin-typescript'; -import commonjs from '@rollup/plugin-commonjs'; -import nodeResolvePlugin from '@rollup/plugin-node-resolve'; -import json from '@rollup/plugin-json'; -import terser from '@rollup/plugin-terser'; -import { string } from 'rollup-plugin-string'; -import css from 'rollup-plugin-import-css'; -import wasmPlugin from '@rollup/plugin-wasm'; -import image from '@rollup/plugin-image'; - -export default defineConfig({ - plugins: [ - typescript({ - module: 'ESNext', - }), - nodeResolvePlugin({ - browser: false, - preferBuiltins: true, - }), - commonjs({ - ignoreDynamicRequires: true, - }), - json(), - string({ - include: '**/*.html', - }), - css(), - wasmPlugin({ - maxFileSize: 0, - targetEnv: 'browser', - }), - image({ dom: true }), - terser({ - ecma: 2020, - }), - { - closeBundle() { - if (!process.env.ROLLUP_WATCH) { - setTimeout(() => process.exit(0)); - } - }, - name: 'force-close' - }, - ], - input: './src/renderer.ts', - output: { - format: 'cjs', - name: '[name].js', - dir: './dist', - }, - external: [ - 'electron', - ...builtinModules, - ], -}); From b393f819ce4db8de1bdf013899554f13b7cd90bd Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Tue, 7 Nov 2023 11:33:13 +0900 Subject: [PATCH 04/11] fix: debug mode --- electron.vite.config.ts | 16 +++-- package.json | 1 + pnpm-lock.yaml | 117 ++++++++++++++++++++++++++++++- src/index.html | 1 + src/index.ts | 31 +++++--- src/plugins/discord/back.ts | 6 +- src/plugins/in-app-menu/front.ts | 16 +++-- src/renderer.ts | 3 +- src/youtube-music.d.ts | 2 +- 9 files changed, 166 insertions(+), 27 deletions(-) create mode 100644 src/index.html diff --git a/electron.vite.config.ts b/electron.vite.config.ts index 8aa7b9b50a..8e90134773 100644 --- a/electron.vite.config.ts +++ b/electron.vite.config.ts @@ -1,11 +1,12 @@ import { defineConfig } from 'electron-vite'; import builtinModules from 'builtin-modules'; import { importChunkUrl } from '@lightningjs/vite-plugin-import-chunk-url'; +import magicalSvg from 'vite-plugin-magical-svg'; export default defineConfig({ main: { plugins: [ - importChunkUrl() + importChunkUrl(), ], build: { lib: { @@ -39,18 +40,21 @@ export default defineConfig({ }, }, renderer: { + plugins: [ + // HACK: electron-vite doesn't enable 'allowSyntheticDefaultImports' + (magicalSvg as unknown as { + default: typeof magicalSvg + }).default({}), + ], + root: './src/', build: { - lib: { - entry: 'src/renderer.ts', - formats: ['cjs'], - }, outDir: 'dist/renderer', commonjsOptions: { ignoreDynamicRequires: true, }, rollupOptions: { external: ['electron', ...builtinModules], - input: './src/renderer.ts', + input: './src/index.html', }, }, }, diff --git a/package.json b/package.json index e1c78da7ae..0ca626d9cc 100644 --- a/package.json +++ b/package.json @@ -187,6 +187,7 @@ "typescript": "5.2.2", "utf-8-validate": "6.0.3", "vite": "4.5.0", + "vite-plugin-magical-svg": "1.0.3", "vite-plugin-string": "1.2.2", "ws": "8.14.2", "yarpm": "1.2.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index aed370b743..8148cd9e4a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -180,6 +180,9 @@ devDependencies: vite: specifier: 4.5.0 version: 4.5.0 + vite-plugin-magical-svg: + specifier: 1.0.3 + version: 1.0.3(vite@4.5.0) vite-plugin-string: specifier: 1.2.2 version: 1.2.2 @@ -1148,6 +1151,11 @@ packages: resolution: {integrity: sha512-AqlrT8YA1o7Ff5wPfMOL0pvL+1X+sw60NN6CcOCqs658emD6RfiXhF7Gu9QcfKBH7ELY2nInLhKSCWVoNL70MQ==} dev: true + /@trysound/sax@0.2.0: + resolution: {integrity: sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==} + engines: {node: '>=10.13.0'} + dev: true + /@types/cacheable-request@6.0.3: resolution: {integrity: sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==} dependencies: @@ -1783,6 +1791,10 @@ packages: resolution: {integrity: sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==} dev: true + /boolbase@1.0.0: + resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} + dev: true + /boolean@3.2.0: resolution: {integrity: sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==} requiresBuild: true @@ -2086,6 +2098,11 @@ packages: engines: {node: '>= 6'} dev: true + /commander@7.2.0: + resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==} + engines: {node: '>= 10'} + dev: true + /compare-version@0.1.2: resolution: {integrity: sha512-pJDh5/4wrEnXX/VWRZvruAGHkzKdr46z11OlTPN+VrATlWWhSKewNCJ1futCO5C7eJB3nPMFZA1LeYtcFboZ2A==} engines: {node: '>=0.10.0'} @@ -2156,6 +2173,36 @@ packages: shebang-command: 2.0.0 which: 2.0.2 + /css-select@4.3.0: + resolution: {integrity: sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==} + dependencies: + boolbase: 1.0.0 + css-what: 6.1.0 + domhandler: 4.3.1 + domutils: 2.8.0 + nth-check: 2.1.1 + dev: true + + /css-tree@1.1.3: + resolution: {integrity: sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==} + engines: {node: '>=8.0.0'} + dependencies: + mdn-data: 2.0.14 + source-map: 0.6.1 + dev: true + + /css-what@6.1.0: + resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==} + engines: {node: '>= 6'} + dev: true + + /csso@4.2.0: + resolution: {integrity: sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==} + engines: {node: '>=8.0.0'} + dependencies: + css-tree: 1.1.3 + dev: true + /custom-electron-prompt@1.5.7(electron@27.0.3): resolution: {integrity: sha512-ptRPJr6CpT06GWLMtg3GD2Lr7gWfXdWI+hR1S39eq+m/mUa2E118YmX6mPCbHdg5QB/W9UVhSpRqBM8FUh1G8w==} peerDependencies: @@ -2406,6 +2453,14 @@ packages: esutils: 2.0.3 dev: true + /dom-serializer@1.4.1: + resolution: {integrity: sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==} + dependencies: + domelementtype: 2.3.0 + domhandler: 4.3.1 + entities: 2.2.0 + dev: true + /dom-serializer@2.0.0: resolution: {integrity: sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==} dependencies: @@ -2416,7 +2471,13 @@ packages: /domelementtype@2.3.0: resolution: {integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==} - dev: false + + /domhandler@4.3.1: + resolution: {integrity: sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==} + engines: {node: '>= 4'} + dependencies: + domelementtype: 2.3.0 + dev: true /domhandler@5.0.3: resolution: {integrity: sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==} @@ -2425,6 +2486,14 @@ packages: domelementtype: 2.3.0 dev: false + /domutils@2.8.0: + resolution: {integrity: sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==} + dependencies: + dom-serializer: 1.4.1 + domelementtype: 2.3.0 + domhandler: 4.3.1 + dev: true + /domutils@3.1.0: resolution: {integrity: sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==} dependencies: @@ -2651,6 +2720,10 @@ packages: engines: {node: '>=8'} dev: false + /entities@2.2.0: + resolution: {integrity: sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==} + dev: true + /entities@4.5.0: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} engines: {node: '>=0.12'} @@ -4382,6 +4455,10 @@ packages: escape-string-regexp: 4.0.0 optional: true + /mdn-data@2.0.14: + resolution: {integrity: sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==} + dev: true + /meow@10.1.5: resolution: {integrity: sha512-/d+PQ4GKmGvM9Bee/DPa8z3mXs/pkvJE2KEThngVNOqtmljC6K7NMPxtc2JeZYTmpWb9k/TmxjeL18ez3h7vCw==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -4673,6 +4750,12 @@ packages: path-key: 4.0.0 dev: true + /nth-check@2.1.1: + resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} + dependencies: + boolbase: 1.0.0 + dev: true + /object-inspect@1.12.3: resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} @@ -5390,6 +5473,11 @@ packages: dependencies: minipass: 7.0.4 + /stable@0.1.8: + resolution: {integrity: sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==} + deprecated: 'Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility' + dev: true + /stat-mode@1.0.0: resolution: {integrity: sha512-jH9EhtKIjuXZ2cWxmXS8ZP80XyC3iasQxMDV8jzhNJpfDb7VbQLVW4Wvsxz9QZvzV+G4YoSfBUVKDOyxLzi/sg==} engines: {node: '>= 6'} @@ -5521,6 +5609,20 @@ packages: engines: {node: '>= 0.4'} dev: true + /svgo@2.8.0: + resolution: {integrity: sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg==} + engines: {node: '>=10.13.0'} + hasBin: true + dependencies: + '@trysound/sax': 0.2.0 + commander: 7.2.0 + css-select: 4.3.0 + css-tree: 1.1.3 + csso: 4.2.0 + picocolors: 1.0.0 + stable: 0.1.8 + dev: true + /synckit@0.8.5: resolution: {integrity: sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q==} engines: {node: ^14.18.0 || >=16.0.0} @@ -5827,6 +5929,17 @@ packages: dev: true optional: true + /vite-plugin-magical-svg@1.0.3(vite@4.5.0): + resolution: {integrity: sha512-OpQ5EH7/rLzK5ZxaviPmYx8dFF9s9EiZXQV+6D1nOZZjCO6qC7Wie3ZninlTiK6TuH38gK9TIs6C5STJjr021A==} + peerDependencies: + vite: '>= 3.0.0' + dependencies: + magic-string: 0.30.5 + svgo: 2.8.0 + vite: 4.5.0 + xml2js: 0.6.2 + dev: true + /vite-plugin-string@1.2.2: resolution: {integrity: sha512-AqK6aJJdOKTh/8FH4tSK29/PmbSaST8A8v93N1IjrKck0zOSa0n7kDHTw9fQ/tZxG/IwWrz1pqQtwKA+kWRxpA==} dependencies: @@ -5994,12 +6107,10 @@ packages: dependencies: sax: 1.3.0 xmlbuilder: 11.0.1 - dev: false /xmlbuilder@11.0.1: resolution: {integrity: sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==} engines: {node: '>=4.0'} - dev: false /xmlbuilder@15.1.1: resolution: {integrity: sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==} diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000000..319d51be88 --- /dev/null +++ b/src/index.html @@ -0,0 +1 @@ + diff --git a/src/index.ts b/src/index.ts index 8820b6950c..76fbdfed21 100644 --- a/src/index.ts +++ b/src/index.ts @@ -44,7 +44,6 @@ import tunaObs from './plugins/tuna-obs/back'; import videoToggle from './plugins/video-toggle/back'; import visualizer from './plugins/visualizer/back'; -import rendererScriptUrl from './renderer.ts?importChunkUrl'; import youtubeMusicCSS from './youtube-music.css'; // Catch errors and log them @@ -336,14 +335,28 @@ async function createMainWindow() { removeContentSecurityPolicy(); win.webContents.on('dom-ready', () => { - const filePath = new URL(rendererScriptUrl).pathname; - // On Windows, URL paths start with a leading slash if they're absolute. Strip it off. - const isWindows = process.platform === 'win32'; - const rendererScriptPath = isWindows ? filePath.substring(1) : filePath; - win.webContents.executeJavaScriptInIsolatedWorld(0, [{ - code: fs.readFileSync(rendererScriptPath, 'utf-8') + ';0', - url: rendererScriptUrl, - }], true); + // Inject index.html file as string using insertAdjacentHTML + // In dev mode, get string from process.env.VITE_DEV_SERVER_URL, else use fs.readFileSync + if (is.dev()) { + // HACK: to make vite work with electron renderer (supports hot reload) + win.webContents.executeJavaScript(` + console.log('Loading vite from dev server'); + const viteScript = document.createElement('script'); + viteScript.type = 'module'; + viteScript.src = '${process.env.ELECTRON_RENDERER_URL}/@vite/client'; + const rendererScript = document.createElement('script'); + rendererScript.type = 'module'; + rendererScript.src = '${process.env.ELECTRON_RENDERER_URL}/renderer.ts'; + document.body.appendChild(viteScript); + document.body.appendChild(rendererScript); + 0 + `); + } else { + const indexHTML = fs.readFileSync(path.join(__dirname, '..', 'renderer', 'index.html'), 'utf-8'); + win.webContents.executeJavaScript(` + document.documentElement.insertAdjacentHTML('beforeend', '${indexHTML}'); + `); + } }); win.webContents.loadURL(urlToLoad); diff --git a/src/plugins/discord/back.ts b/src/plugins/discord/back.ts index ff1258d1e9..5fdd1565ea 100644 --- a/src/plugins/discord/back.ts +++ b/src/plugins/discord/back.ts @@ -208,8 +208,10 @@ export default ( // if lastSent is more than 5 seconds ago, send the new time if (currentTime - lastSent > 5000) { lastSent = currentTime; - lastSongInfo.elapsedSeconds = t; - updateActivity(lastSongInfo); + if (lastSongInfo) { + lastSongInfo.elapsedSeconds = t; + updateActivity(lastSongInfo); + } } }); }); diff --git a/src/plugins/in-app-menu/front.ts b/src/plugins/in-app-menu/front.ts index 885ff4096f..f8cb0bbc7e 100644 --- a/src/plugins/in-app-menu/front.ts +++ b/src/plugins/in-app-menu/front.ts @@ -1,10 +1,10 @@ import { createPanel } from './menu/panel'; -import logo from './assets/menu.svg'; -import close from './assets/close.svg'; -import minimize from './assets/minimize.svg'; -import maximize from './assets/maximize.svg'; -import unmaximize from './assets/unmaximize.svg'; +import logoFn from './assets/menu.svg'; +import closeFn from './assets/close.svg'; +import minimizeFn from './assets/minimize.svg'; +import maximizeFn from './assets/maximize.svg'; +import unmaximizeFn from './assets/unmaximize.svg'; import type { Menu } from 'electron'; @@ -23,6 +23,12 @@ export default async () => { let maximizeButton: HTMLButtonElement; if (isMacOS) titleBar.style.setProperty('--offset-left', '70px'); + const logo = logoFn(); + const close = closeFn(); + const minimize = minimizeFn(); + const maximize = maximizeFn(); + const unmaximize = unmaximizeFn(); + logo.classList.add('title-bar-icon'); const logoClick = () => { hideMenu = !hideMenu; diff --git a/src/renderer.ts b/src/renderer.ts index 030662258c..809d33eaa8 100644 --- a/src/renderer.ts +++ b/src/renderer.ts @@ -145,7 +145,8 @@ function onApiLoaded() { try { await handler?.(options as never); } catch (error) { - console.error(`Error in plugin "${pluginName}": ${String(error)}`); + console.error(`Error in plugin "${pluginName}"`); + console.trace(error); } } }); diff --git a/src/youtube-music.d.ts b/src/youtube-music.d.ts index c61765e395..ad44772da0 100644 --- a/src/youtube-music.d.ts +++ b/src/youtube-music.d.ts @@ -18,7 +18,7 @@ declare module '*?importChunkUrl' { declare module '*.svg' { const element: SVGAElement; - export default element; + export default () => element; } declare module '*.png' { const element: HTMLImageElement; From bb74c1dffcbbf6bce88da0b0557632a7da8befff Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Tue, 7 Nov 2023 14:05:25 +0900 Subject: [PATCH 05/11] fix: build mode, asset path --- electron.vite.config.ts | 13 +++++------ package.json | 2 ++ pnpm-lock.yaml | 28 +++++++++++++++++++++--- src/index.ts | 30 ++++++++++++++++++------- src/plugins/in-app-menu/front.ts | 35 +++++++++++++++++++++--------- src/plugins/notifications/utils.ts | 12 +++++----- src/plugins/utils.ts | 3 +-- src/preload.ts | 1 + src/providers/prompt-options.ts | 8 ++----- src/reset.d.ts | 1 + src/tray.ts | 7 ++---- src/youtube-music.d.ts | 6 ++--- 12 files changed, 97 insertions(+), 49 deletions(-) diff --git a/electron.vite.config.ts b/electron.vite.config.ts index 8e90134773..74784756b7 100644 --- a/electron.vite.config.ts +++ b/electron.vite.config.ts @@ -1,13 +1,13 @@ import { defineConfig } from 'electron-vite'; import builtinModules from 'builtin-modules'; import { importChunkUrl } from '@lightningjs/vite-plugin-import-chunk-url'; -import magicalSvg from 'vite-plugin-magical-svg'; export default defineConfig({ main: { plugins: [ importChunkUrl(), ], + publicDir: 'assets', build: { lib: { entry: 'src/index.ts', @@ -40,14 +40,13 @@ export default defineConfig({ }, }, renderer: { - plugins: [ - // HACK: electron-vite doesn't enable 'allowSyntheticDefaultImports' - (magicalSvg as unknown as { - default: typeof magicalSvg - }).default({}), - ], root: './src/', build: { + lib: { + entry: 'src/index.html', + formats: ['iife'], + name: 'renderer', + }, outDir: 'dist/renderer', commonjsOptions: { ignoreDynamicRequires: true, diff --git a/package.json b/package.json index 0ca626d9cc..f5c0711ba4 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "build": { "appId": "com.github.th-ch.youtube-music", "productName": "YouTube Music", + "extraResources": ["assets"], "files": [ "!*", "dist", @@ -156,6 +157,7 @@ "html-to-text": "9.0.5", "keyboardevent-from-electron-accelerator": "2.0.0", "keyboardevents-areequal": "0.2.2", + "node-html-parser": "6.1.11", "node-id3": "0.2.6", "simple-youtube-age-restriction-bypass": "git+https://github.com/organization/Simple-YouTube-Age-Restriction-Bypass.git#v2.5.8", "vudio": "2.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8148cd9e4a..06c7259edd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -91,6 +91,9 @@ dependencies: keyboardevents-areequal: specifier: 0.2.2 version: 0.2.2 + node-html-parser: + specifier: 6.1.11 + version: 6.1.11 node-id3: specifier: 0.2.6 version: 0.2.6 @@ -1793,7 +1796,6 @@ packages: /boolbase@1.0.0: resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} - dev: true /boolean@3.2.0: resolution: {integrity: sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==} @@ -2183,6 +2185,16 @@ packages: nth-check: 2.1.1 dev: true + /css-select@5.1.0: + resolution: {integrity: sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==} + dependencies: + boolbase: 1.0.0 + css-what: 6.1.0 + domhandler: 5.0.3 + domutils: 3.1.0 + nth-check: 2.1.1 + dev: false + /css-tree@1.1.3: resolution: {integrity: sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==} engines: {node: '>=8.0.0'} @@ -2194,7 +2206,6 @@ packages: /css-what@6.1.0: resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==} engines: {node: '>= 6'} - dev: true /csso@4.2.0: resolution: {integrity: sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==} @@ -3782,6 +3793,11 @@ packages: function-bind: 1.1.2 dev: true + /he@1.2.0: + resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} + hasBin: true + dev: false + /hexy@0.2.11: resolution: {integrity: sha512-ciq6hFsSG/Bpt2DmrZJtv+56zpPdnq+NQ4ijEFrveKN0ZG1mhl/LdT1NQZ9se6ty1fACcI4d4vYqC9v8EYpH2A==} hasBin: true @@ -4705,6 +4721,13 @@ packages: transitivePeerDependencies: - supports-color + /node-html-parser@6.1.11: + resolution: {integrity: sha512-FAgwwZ6h0DSDWxfD0Iq1tsDcBCxdJB1nXpLPPxX8YyVWzbfCjKWEzaynF4gZZ/8hziUmp7ZSaKylcn0iKhufUQ==} + dependencies: + css-select: 5.1.0 + he: 1.2.0 + dev: false + /node-id3@0.2.6: resolution: {integrity: sha512-w8GuKXLlPpDjTxLowCt/uYMhRQzED3cg2GdSG1i6RSGKeDzPvxlXeLQuQInKljahPZ0aDnmyX7FX8BbJOM7REg==} dependencies: @@ -4754,7 +4777,6 @@ packages: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} dependencies: boolbase: 1.0.0 - dev: true /object-inspect@1.12.3: resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} diff --git a/src/index.ts b/src/index.ts index 76fbdfed21..0e634272ee 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,4 @@ import path from 'node:path'; -import url from 'node:url'; import fs from 'node:fs'; import { BrowserWindow, app, screen, globalShortcut, session, shell, dialog, ipcMain } from 'electron'; @@ -8,6 +7,7 @@ import is from 'electron-is'; import unhandled from 'electron-unhandled'; import { autoUpdater } from 'electron-updater'; import electronDebug from 'electron-debug'; +import { parse } from 'node-html-parser'; import config from './config'; import { refreshMenu, setApplicationMenu } from './menu'; @@ -334,12 +334,25 @@ async function createMainWindow() { removeContentSecurityPolicy(); - win.webContents.on('dom-ready', () => { + const escapeXml = (unsafe: string) => { + return unsafe.replace(/[<>&'"]/g, (c) => { + switch (c) { + case '<': return '<'; + case '>': return '>'; + case '&': return '&'; + case '\'': return '''; + case '"': return '"'; + default: return c; + } + }); + }; + + win.webContents.on('dom-ready', async () => { // Inject index.html file as string using insertAdjacentHTML // In dev mode, get string from process.env.VITE_DEV_SERVER_URL, else use fs.readFileSync - if (is.dev()) { + if (is.dev() && process.env.ELECTRON_RENDERER_URL) { // HACK: to make vite work with electron renderer (supports hot reload) - win.webContents.executeJavaScript(` + await win.webContents.executeJavaScript(` console.log('Loading vite from dev server'); const viteScript = document.createElement('script'); viteScript.type = 'module'; @@ -352,10 +365,11 @@ async function createMainWindow() { 0 `); } else { - const indexHTML = fs.readFileSync(path.join(__dirname, '..', 'renderer', 'index.html'), 'utf-8'); - win.webContents.executeJavaScript(` - document.documentElement.insertAdjacentHTML('beforeend', '${indexHTML}'); - `); + const rendererPath = path.join(__dirname, '..', 'renderer'); + const indexHTML = parse(fs.readFileSync(path.join(rendererPath, 'index.html'), 'utf-8')); + const scriptSrc = indexHTML.querySelector('script')!; + const scriptString = fs.readFileSync(path.join(rendererPath, scriptSrc.getAttribute('src')!), 'utf-8'); + await win.webContents.executeJavaScript(scriptString + `;0`); } }); diff --git a/src/plugins/in-app-menu/front.ts b/src/plugins/in-app-menu/front.ts index f8cb0bbc7e..afe9ca0f80 100644 --- a/src/plugins/in-app-menu/front.ts +++ b/src/plugins/in-app-menu/front.ts @@ -1,12 +1,13 @@ import { createPanel } from './menu/panel'; -import logoFn from './assets/menu.svg'; -import closeFn from './assets/close.svg'; -import minimizeFn from './assets/minimize.svg'; -import maximizeFn from './assets/maximize.svg'; -import unmaximizeFn from './assets/unmaximize.svg'; +import logoRaw from './assets/menu.svg?inline'; +import closeRaw from './assets/close.svg?inline'; +import minimizeRaw from './assets/minimize.svg?inline'; +import maximizeRaw from './assets/maximize.svg?inline'; +import unmaximizeRaw from './assets/unmaximize.svg?inline'; import type { Menu } from 'electron'; +import * as electron from 'electron'; function $(selector: string) { return document.querySelector(selector); @@ -23,11 +24,25 @@ export default async () => { let maximizeButton: HTMLButtonElement; if (isMacOS) titleBar.style.setProperty('--offset-left', '70px'); - const logo = logoFn(); - const close = closeFn(); - const minimize = minimizeFn(); - const maximize = maximizeFn(); - const unmaximize = unmaximizeFn(); + const logo = document.createElement('img'); + const close = document.createElement('img'); + const minimize = document.createElement('img'); + const maximize = document.createElement('img'); + const unmaximize = document.createElement('img'); + + if (window.ELECTRON_RENDERER_URL) { + logo.src = window.ELECTRON_RENDERER_URL + '/' + logoRaw; + close.src = window.ELECTRON_RENDERER_URL + '/' + closeRaw; + minimize.src = window.ELECTRON_RENDERER_URL + '/' + minimizeRaw; + maximize.src = window.ELECTRON_RENDERER_URL + '/' + maximizeRaw; + unmaximize.src = window.ELECTRON_RENDERER_URL + '/' + unmaximizeRaw; + } else { + logo.src = logoRaw; + close.src = closeRaw; + minimize.src = minimizeRaw; + maximize.src = maximizeRaw; + unmaximize.src = unmaximizeRaw; + } logo.classList.add('title-bar-icon'); const logoClick = () => { diff --git a/src/plugins/notifications/utils.ts b/src/plugins/notifications/utils.ts index d25017c056..a6b3d4b9bb 100644 --- a/src/plugins/notifications/utils.ts +++ b/src/plugins/notifications/utils.ts @@ -7,9 +7,10 @@ import config from './config'; import { cache } from '../../providers/decorators'; import { SongInfo } from '../../providers/song-info'; -import { getAssetsDirectoryLocation } from '../utils'; -const defaultIcon = path.join(getAssetsDirectoryLocation(), 'youtube-music.png'); +import youtubeMusicIcon from '../../../assets/youtube-music.png?asset'; + + const userData = app.getPath('userData'); const temporaryIcon = path.join(userData, 'tempIcon.png'); const temporaryBanner = path.join(userData, 'tempBanner.png'); @@ -45,7 +46,7 @@ const nativeImageToLogo = cache((nativeImage: NativeImage) => { export const notificationImage = (songInfo: SongInfo) => { if (!songInfo.image) { - return defaultIcon; + return youtubeMusicIcon; } if (!config.get('interactive')) { @@ -68,8 +69,9 @@ export const saveImage = cache((img: NativeImage, savePath: string) => { try { fs.writeFileSync(savePath, img.toPNG()); } catch (error: unknown) { - console.log(`Error writing song icon to disk:\n${String(error)}`); - return defaultIcon; + console.error('Error writing song icon to disk:'); + console.trace(error); + return youtubeMusicIcon; } return savePath; diff --git a/src/plugins/utils.ts b/src/plugins/utils.ts index 26659fcadc..e9d9faa5f8 100644 --- a/src/plugins/utils.ts +++ b/src/plugins/utils.ts @@ -4,10 +4,9 @@ import path from 'node:path'; import { app } from 'electron'; import is from 'electron-is'; -import { ValueOf } from '../utils/type-utils'; import defaultConfig from '../config/defaults'; -export const getAssetsDirectoryLocation = () => path.resolve(__dirname, 'assets'); +export const getAssetsDirectoryLocation = () => path.resolve(__dirname, '..', 'assets'); export const getMediaIconLocation = () => app.isPackaged diff --git a/src/preload.ts b/src/preload.ts index 6b19f88432..a2dd466b45 100644 --- a/src/preload.ts +++ b/src/preload.ts @@ -48,3 +48,4 @@ contextBridge.exposeInMainWorld('ipcRenderer', { sendToHost: (channel: string, ...args: unknown[]) => ipcRenderer.sendToHost(channel, ...args), }); contextBridge.exposeInMainWorld('reload', () => ipcRenderer.send('reload')); +contextBridge.exposeInMainWorld('ELECTRON_RENDERER_URL', process.env.ELECTRON_RENDERER_URL); diff --git a/src/providers/prompt-options.ts b/src/providers/prompt-options.ts index 895531f3c0..7086c4699c 100644 --- a/src/providers/prompt-options.ts +++ b/src/providers/prompt-options.ts @@ -1,12 +1,8 @@ -import path from 'node:path'; - -import { getAssetsDirectoryLocation } from '../plugins/utils'; - -const iconPath = path.join(getAssetsDirectoryLocation(), 'youtube-music-tray.png'); +import youtubeMusicTrayIcon from '../../assets/youtube-music-tray.png?asset'; const promptOptions = { customStylesheet: 'dark', - icon: iconPath, + icon: youtubeMusicTrayIcon, }; export default () => promptOptions; diff --git a/src/reset.d.ts b/src/reset.d.ts index ae20968bf5..a6af36781a 100644 --- a/src/reset.d.ts +++ b/src/reset.d.ts @@ -21,6 +21,7 @@ declare global { ipcRenderer: typeof electronIpcRenderer; mainConfig: typeof config; electronIs: typeof is; + ELECTRON_RENDERER_URL: string | undefined; /** * YouTube Music internal variable (Last interaction time) */ diff --git a/src/tray.ts b/src/tray.ts index eedad40056..64d39cef27 100644 --- a/src/tray.ts +++ b/src/tray.ts @@ -1,12 +1,10 @@ -import path from 'node:path'; - import { Menu, nativeImage, Tray } from 'electron'; import { restart } from './providers/app-controls'; import config from './config'; import getSongControls from './providers/song-controls'; -import { getAssetsDirectoryLocation } from './plugins/utils'; +import youtubeMusicTrayIcon from '../assets/youtube-music-tray.png?asset'; import type { MenuTemplate } from './menu'; @@ -41,9 +39,8 @@ export const setUpTray = (app: Electron.App, win: Electron.BrowserWindow) => { } const { playPause, next, previous } = getSongControls(win); - const iconPath = path.join(getAssetsDirectoryLocation(), 'youtube-music-tray.png'); - const trayIcon = nativeImage.createFromPath(iconPath).resize({ + const trayIcon = nativeImage.createFromPath(youtubeMusicTrayIcon).resize({ width: 16, height: 16, }); diff --git a/src/youtube-music.d.ts b/src/youtube-music.d.ts index ad44772da0..571d3b3772 100644 --- a/src/youtube-music.d.ts +++ b/src/youtube-music.d.ts @@ -15,10 +15,10 @@ declare module '*?importChunkUrl' { export default source; } -declare module '*.svg' { - const element: SVGAElement; +declare module '*.svg?inline' { + const base64: string; - export default () => element; + export default base64; } declare module '*.png' { const element: HTMLImageElement; From ba8164ea28ddbf5f5162d1dfc368b87625711543 Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Tue, 7 Nov 2023 14:09:07 +0900 Subject: [PATCH 06/11] fix: remove unused dependencies --- electron.vite.config.ts | 4 - package.json | 3 - pnpm-lock.yaml | 384 +--------------------------------------- src/youtube-music.d.ts | 5 - 4 files changed, 6 insertions(+), 390 deletions(-) diff --git a/electron.vite.config.ts b/electron.vite.config.ts index 74784756b7..1023854b36 100644 --- a/electron.vite.config.ts +++ b/electron.vite.config.ts @@ -1,12 +1,8 @@ import { defineConfig } from 'electron-vite'; import builtinModules from 'builtin-modules'; -import { importChunkUrl } from '@lightningjs/vite-plugin-import-chunk-url'; export default defineConfig({ main: { - plugins: [ - importChunkUrl(), - ], publicDir: 'assets', build: { lib: { diff --git a/package.json b/package.json index f5c0711ba4..4cfe27ef03 100644 --- a/package.json +++ b/package.json @@ -165,7 +165,6 @@ "youtubei.js": "7.0.0" }, "devDependencies": { - "@lightningjs/vite-plugin-import-chunk-url": "0.3.0", "@playwright/test": "1.39.0", "@total-typescript/ts-reset": "0.5.1", "@types/electron-localshortcut": "3.1.2", @@ -189,8 +188,6 @@ "typescript": "5.2.2", "utf-8-validate": "6.0.3", "vite": "4.5.0", - "vite-plugin-magical-svg": "1.0.3", - "vite-plugin-string": "1.2.2", "ws": "8.14.2", "yarpm": "1.2.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 06c7259edd..17b7678009 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -111,9 +111,6 @@ dependencies: version: 7.0.0 devDependencies: - '@lightningjs/vite-plugin-import-chunk-url': - specifier: 0.3.0 - version: 0.3.0(vite@4.5.0) '@playwright/test': specifier: 1.39.0 version: 1.39.0 @@ -183,12 +180,6 @@ devDependencies: vite: specifier: 4.5.0 version: 4.5.0 - vite-plugin-magical-svg: - specifier: 1.0.3 - version: 1.0.3(vite@4.5.0) - vite-plugin-string: - specifier: 1.2.2 - version: 1.2.2 ws: specifier: 8.14.2 version: 8.14.2(bufferutil@4.0.8)(utf-8-validate@6.0.3) @@ -640,15 +631,6 @@ packages: dev: true optional: true - /@esbuild/linux-loong64@0.14.54: - resolution: {integrity: sha512-bZBrLAIX1kpWelV0XemxBZllyRmM6vgFQQG2GdNb+r3Fkp0FOh1NJSvekXDs7jq70k4euu1cryLMfU+mTXlEpw==} - engines: {node: '>=12'} - cpu: [loong64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-loong64@0.18.20: resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==} engines: {node: '>=12'} @@ -898,14 +880,6 @@ packages: '@jridgewell/sourcemap-codec': 1.4.15 dev: true - /@lightningjs/vite-plugin-import-chunk-url@0.3.0(vite@4.5.0): - resolution: {integrity: sha512-cozdB9gcPrnITWTymo525Vb+98EfsBOBQnrbzXI6rOFveshxc754eco0ffnuqyFUkN8pds+DwJrJ5saJDmJz/g==} - peerDependencies: - vite: ^4.4.9 - dependencies: - vite: 4.5.0 - dev: true - /@malept/cross-spawn-promise@1.1.1: resolution: {integrity: sha512-RTBGWL5FWQcg9orDOCcp4LvItNzUPcyEU9bwaeJX0rJ1IQxzucC48Y0/sQLp/g6t99IQgAlGIaesJS+gTn7tVQ==} engines: {node: '>= 10'} @@ -1024,14 +998,6 @@ packages: resolution: {integrity: sha512-yvwa+aCyYI/UjeD39BnpMypG8N06l86wIDW1/PAc6ihBRnodIfZDwccxQN3n1t74wduzaz74m4ZMHZnB06567Q==} dev: false - /@rollup/pluginutils@4.2.1: - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - dev: true - /@rollup/rollup-android-arm-eabi@4.3.0: resolution: {integrity: sha512-/4pns6BYi8MXdwnXM44yoGAcFYVHL/BYlB2q1HXZ6AzH++LaiEVWFpBWQ/glXhbMbv3E3o09igrHFbP/snhAvA==} cpu: [arm] @@ -1154,11 +1120,6 @@ packages: resolution: {integrity: sha512-AqlrT8YA1o7Ff5wPfMOL0pvL+1X+sw60NN6CcOCqs658emD6RfiXhF7Gu9QcfKBH7ELY2nInLhKSCWVoNL70MQ==} dev: true - /@trysound/sax@0.2.0: - resolution: {integrity: sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==} - engines: {node: '>=10.13.0'} - dev: true - /@types/cacheable-request@6.0.3: resolution: {integrity: sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==} dependencies: @@ -1796,6 +1757,7 @@ packages: /boolbase@1.0.0: resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} + dev: false /boolean@3.2.0: resolution: {integrity: sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==} @@ -2100,11 +2062,6 @@ packages: engines: {node: '>= 6'} dev: true - /commander@7.2.0: - resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==} - engines: {node: '>= 10'} - dev: true - /compare-version@0.1.2: resolution: {integrity: sha512-pJDh5/4wrEnXX/VWRZvruAGHkzKdr46z11OlTPN+VrATlWWhSKewNCJ1futCO5C7eJB3nPMFZA1LeYtcFboZ2A==} engines: {node: '>=0.10.0'} @@ -2175,16 +2132,6 @@ packages: shebang-command: 2.0.0 which: 2.0.2 - /css-select@4.3.0: - resolution: {integrity: sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==} - dependencies: - boolbase: 1.0.0 - css-what: 6.1.0 - domhandler: 4.3.1 - domutils: 2.8.0 - nth-check: 2.1.1 - dev: true - /css-select@5.1.0: resolution: {integrity: sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==} dependencies: @@ -2195,24 +2142,10 @@ packages: nth-check: 2.1.1 dev: false - /css-tree@1.1.3: - resolution: {integrity: sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==} - engines: {node: '>=8.0.0'} - dependencies: - mdn-data: 2.0.14 - source-map: 0.6.1 - dev: true - /css-what@6.1.0: resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==} engines: {node: '>= 6'} - - /csso@4.2.0: - resolution: {integrity: sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==} - engines: {node: '>=8.0.0'} - dependencies: - css-tree: 1.1.3 - dev: true + dev: false /custom-electron-prompt@1.5.7(electron@27.0.3): resolution: {integrity: sha512-ptRPJr6CpT06GWLMtg3GD2Lr7gWfXdWI+hR1S39eq+m/mUa2E118YmX6mPCbHdg5QB/W9UVhSpRqBM8FUh1G8w==} @@ -2464,14 +2397,6 @@ packages: esutils: 2.0.3 dev: true - /dom-serializer@1.4.1: - resolution: {integrity: sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==} - dependencies: - domelementtype: 2.3.0 - domhandler: 4.3.1 - entities: 2.2.0 - dev: true - /dom-serializer@2.0.0: resolution: {integrity: sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==} dependencies: @@ -2482,13 +2407,7 @@ packages: /domelementtype@2.3.0: resolution: {integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==} - - /domhandler@4.3.1: - resolution: {integrity: sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==} - engines: {node: '>= 4'} - dependencies: - domelementtype: 2.3.0 - dev: true + dev: false /domhandler@5.0.3: resolution: {integrity: sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==} @@ -2497,14 +2416,6 @@ packages: domelementtype: 2.3.0 dev: false - /domutils@2.8.0: - resolution: {integrity: sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==} - dependencies: - dom-serializer: 1.4.1 - domelementtype: 2.3.0 - domhandler: 4.3.1 - dev: true - /domutils@3.1.0: resolution: {integrity: sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==} dependencies: @@ -2731,10 +2642,6 @@ packages: engines: {node: '>=8'} dev: false - /entities@2.2.0: - resolution: {integrity: sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==} - dev: true - /entities@4.5.0: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} engines: {node: '>=0.12'} @@ -2841,215 +2748,6 @@ packages: requiresBuild: true optional: true - /esbuild-android-64@0.14.54: - resolution: {integrity: sha512-Tz2++Aqqz0rJ7kYBfz+iqyE3QMycD4vk7LBRyWaAVFgFtQ/O8EJOnVmTOiDWYZ/uYzB4kvP+bqejYdVKzE5lAQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [android] - requiresBuild: true - dev: true - optional: true - - /esbuild-android-arm64@0.14.54: - resolution: {integrity: sha512-F9E+/QDi9sSkLaClO8SOV6etqPd+5DgJje1F9lOWoNncDdOBL2YF59IhsWATSt0TLZbYCf3pNlTHvVV5VfHdvg==} - engines: {node: '>=12'} - cpu: [arm64] - os: [android] - requiresBuild: true - dev: true - optional: true - - /esbuild-darwin-64@0.14.54: - resolution: {integrity: sha512-jtdKWV3nBviOd5v4hOpkVmpxsBy90CGzebpbO9beiqUYVMBtSc0AL9zGftFuBon7PNDcdvNCEuQqw2x0wP9yug==} - engines: {node: '>=12'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /esbuild-darwin-arm64@0.14.54: - resolution: {integrity: sha512-OPafJHD2oUPyvJMrsCvDGkRrVCar5aVyHfWGQzY1dWnzErjrDuSETxwA2HSsyg2jORLY8yBfzc1MIpUkXlctmw==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /esbuild-freebsd-64@0.14.54: - resolution: {integrity: sha512-OKwd4gmwHqOTp4mOGZKe/XUlbDJ4Q9TjX0hMPIDBUWWu/kwhBAudJdBoxnjNf9ocIB6GN6CPowYpR/hRCbSYAg==} - engines: {node: '>=12'} - cpu: [x64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - - /esbuild-freebsd-arm64@0.14.54: - resolution: {integrity: sha512-sFwueGr7OvIFiQT6WeG0jRLjkjdqWWSrfbVwZp8iMP+8UHEHRBvlaxL6IuKNDwAozNUmbb8nIMXa7oAOARGs1Q==} - engines: {node: '>=12'} - cpu: [arm64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-32@0.14.54: - resolution: {integrity: sha512-1ZuY+JDI//WmklKlBgJnglpUL1owm2OX+8E1syCD6UAxcMM/XoWd76OHSjl/0MR0LisSAXDqgjT3uJqT67O3qw==} - engines: {node: '>=12'} - cpu: [ia32] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-64@0.14.54: - resolution: {integrity: sha512-EgjAgH5HwTbtNsTqQOXWApBaPVdDn7XcK+/PtJwZLT1UmpLoznPd8c5CxqsH2dQK3j05YsB3L17T8vE7cp4cCg==} - engines: {node: '>=12'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-arm64@0.14.54: - resolution: {integrity: sha512-WL71L+0Rwv+Gv/HTmxTEmpv0UgmxYa5ftZILVi2QmZBgX3q7+tDeOQNqGtdXSdsL8TQi1vIaVFHUPDe0O0kdig==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-arm@0.14.54: - resolution: {integrity: sha512-qqz/SjemQhVMTnvcLGoLOdFpCYbz4v4fUo+TfsWG+1aOu70/80RV6bgNpR2JCrppV2moUQkww+6bWxXRL9YMGw==} - engines: {node: '>=12'} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-mips64le@0.14.54: - resolution: {integrity: sha512-qTHGQB8D1etd0u1+sB6p0ikLKRVuCWhYQhAHRPkO+OF3I/iSlTKNNS0Lh2Oc0g0UFGguaFZZiPJdJey3AGpAlw==} - engines: {node: '>=12'} - cpu: [mips64el] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-ppc64le@0.14.54: - resolution: {integrity: sha512-j3OMlzHiqwZBDPRCDFKcx595XVfOfOnv68Ax3U4UKZ3MTYQB5Yz3X1mn5GnodEVYzhtZgxEBidLWeIs8FDSfrQ==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-riscv64@0.14.54: - resolution: {integrity: sha512-y7Vt7Wl9dkOGZjxQZnDAqqn+XOqFD7IMWiewY5SPlNlzMX39ocPQlOaoxvT4FllA5viyV26/QzHtvTjVNOxHZg==} - engines: {node: '>=12'} - cpu: [riscv64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-s390x@0.14.54: - resolution: {integrity: sha512-zaHpW9dziAsi7lRcyV4r8dhfG1qBidQWUXweUjnw+lliChJqQr+6XD71K41oEIC3Mx1KStovEmlzm+MkGZHnHA==} - engines: {node: '>=12'} - cpu: [s390x] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-netbsd-64@0.14.54: - resolution: {integrity: sha512-PR01lmIMnfJTgeU9VJTDY9ZerDWVFIUzAtJuDHwwceppW7cQWjBBqP48NdeRtoP04/AtO9a7w3viI+PIDr6d+w==} - engines: {node: '>=12'} - cpu: [x64] - os: [netbsd] - requiresBuild: true - dev: true - optional: true - - /esbuild-openbsd-64@0.14.54: - resolution: {integrity: sha512-Qyk7ikT2o7Wu76UsvvDS5q0amJvmRzDyVlL0qf5VLsLchjCa1+IAvd8kTBgUxD7VBUUVgItLkk609ZHUc1oCaw==} - engines: {node: '>=12'} - cpu: [x64] - os: [openbsd] - requiresBuild: true - dev: true - optional: true - - /esbuild-sunos-64@0.14.54: - resolution: {integrity: sha512-28GZ24KmMSeKi5ueWzMcco6EBHStL3B6ubM7M51RmPwXQGLe0teBGJocmWhgwccA1GeFXqxzILIxXpHbl9Q/Kw==} - engines: {node: '>=12'} - cpu: [x64] - os: [sunos] - requiresBuild: true - dev: true - optional: true - - /esbuild-windows-32@0.14.54: - resolution: {integrity: sha512-T+rdZW19ql9MjS7pixmZYVObd9G7kcaZo+sETqNH4RCkuuYSuv9AGHUVnPoP9hhuE1WM1ZimHz1CIBHBboLU7w==} - engines: {node: '>=12'} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /esbuild-windows-64@0.14.54: - resolution: {integrity: sha512-AoHTRBUuYwXtZhjXZbA1pGfTo8cJo3vZIcWGLiUcTNgHpJJMC1rVA44ZereBHMJtotyN71S8Qw0npiCIkW96cQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /esbuild-windows-arm64@0.14.54: - resolution: {integrity: sha512-M0kuUvXhot1zOISQGXwWn6YtS+Y/1RT9WrVIOywZnJHo3jCDyewAc79aKNQWFCQm+xNHVTq9h8dZKvygoXQQRg==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /esbuild@0.14.54: - resolution: {integrity: sha512-Cy9llcy8DvET5uznocPyqL3BFRrFXSVqbgpMJ9Wz8oVjZlh/zUSNbPRbov0VX7VxN2JH1Oa0uNxZ7eLRb62pJA==} - engines: {node: '>=12'} - hasBin: true - requiresBuild: true - optionalDependencies: - '@esbuild/linux-loong64': 0.14.54 - esbuild-android-64: 0.14.54 - esbuild-android-arm64: 0.14.54 - esbuild-darwin-64: 0.14.54 - esbuild-darwin-arm64: 0.14.54 - esbuild-freebsd-64: 0.14.54 - esbuild-freebsd-arm64: 0.14.54 - esbuild-linux-32: 0.14.54 - esbuild-linux-64: 0.14.54 - esbuild-linux-arm: 0.14.54 - esbuild-linux-arm64: 0.14.54 - esbuild-linux-mips64le: 0.14.54 - esbuild-linux-ppc64le: 0.14.54 - esbuild-linux-riscv64: 0.14.54 - esbuild-linux-s390x: 0.14.54 - esbuild-netbsd-64: 0.14.54 - esbuild-openbsd-64: 0.14.54 - esbuild-sunos-64: 0.14.54 - esbuild-windows-32: 0.14.54 - esbuild-windows-64: 0.14.54 - esbuild-windows-arm64: 0.14.54 - dev: true - /esbuild@0.18.20: resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==} engines: {node: '>=12'} @@ -3281,10 +2979,6 @@ packages: engines: {node: '>=4.0'} dev: true - /estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - dev: true - /esutils@2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} @@ -4471,10 +4165,6 @@ packages: escape-string-regexp: 4.0.0 optional: true - /mdn-data@2.0.14: - resolution: {integrity: sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==} - dev: true - /meow@10.1.5: resolution: {integrity: sha512-/d+PQ4GKmGvM9Bee/DPa8z3mXs/pkvJE2KEThngVNOqtmljC6K7NMPxtc2JeZYTmpWb9k/TmxjeL18ez3h7vCw==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -4777,6 +4467,7 @@ packages: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} dependencies: boolbase: 1.0.0 + dev: false /object-inspect@1.12.3: resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} @@ -5495,11 +5186,6 @@ packages: dependencies: minipass: 7.0.4 - /stable@0.1.8: - resolution: {integrity: sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==} - deprecated: 'Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility' - dev: true - /stat-mode@1.0.0: resolution: {integrity: sha512-jH9EhtKIjuXZ2cWxmXS8ZP80XyC3iasQxMDV8jzhNJpfDb7VbQLVW4Wvsxz9QZvzV+G4YoSfBUVKDOyxLzi/sg==} engines: {node: '>= 6'} @@ -5631,20 +5317,6 @@ packages: engines: {node: '>= 0.4'} dev: true - /svgo@2.8.0: - resolution: {integrity: sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg==} - engines: {node: '>=10.13.0'} - hasBin: true - dependencies: - '@trysound/sax': 0.2.0 - commander: 7.2.0 - css-select: 4.3.0 - css-tree: 1.1.3 - csso: 4.2.0 - picocolors: 1.0.0 - stable: 0.1.8 - dev: true - /synckit@0.8.5: resolution: {integrity: sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q==} engines: {node: ^14.18.0 || >=16.0.0} @@ -5951,52 +5623,6 @@ packages: dev: true optional: true - /vite-plugin-magical-svg@1.0.3(vite@4.5.0): - resolution: {integrity: sha512-OpQ5EH7/rLzK5ZxaviPmYx8dFF9s9EiZXQV+6D1nOZZjCO6qC7Wie3ZninlTiK6TuH38gK9TIs6C5STJjr021A==} - peerDependencies: - vite: '>= 3.0.0' - dependencies: - magic-string: 0.30.5 - svgo: 2.8.0 - vite: 4.5.0 - xml2js: 0.6.2 - dev: true - - /vite-plugin-string@1.2.2: - resolution: {integrity: sha512-AqK6aJJdOKTh/8FH4tSK29/PmbSaST8A8v93N1IjrKck0zOSa0n7kDHTw9fQ/tZxG/IwWrz1pqQtwKA+kWRxpA==} - dependencies: - '@rollup/pluginutils': 4.2.1 - vite: 2.9.16 - transitivePeerDependencies: - - less - - sass - - stylus - dev: true - - /vite@2.9.16: - resolution: {integrity: sha512-X+6q8KPyeuBvTQV8AVSnKDvXoBMnTx8zxh54sOwmmuOdxkjMmEJXH2UEchA+vTMps1xw9vL64uwJOWryULg7nA==} - engines: {node: '>=12.2.0'} - hasBin: true - peerDependencies: - less: '*' - sass: '*' - stylus: '*' - peerDependenciesMeta: - less: - optional: true - sass: - optional: true - stylus: - optional: true - dependencies: - esbuild: 0.14.54 - postcss: 8.4.31 - resolve: 1.22.8 - rollup: 4.3.0 - optionalDependencies: - fsevents: 2.3.3 - dev: true - /vite@4.5.0: resolution: {integrity: sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==} engines: {node: ^14.18.0 || >=16.0.0} @@ -6129,10 +5755,12 @@ packages: dependencies: sax: 1.3.0 xmlbuilder: 11.0.1 + dev: false /xmlbuilder@11.0.1: resolution: {integrity: sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==} engines: {node: '>=4.0'} + dev: false /xmlbuilder@15.1.1: resolution: {integrity: sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==} diff --git a/src/youtube-music.d.ts b/src/youtube-music.d.ts index 571d3b3772..3eb6e491c2 100644 --- a/src/youtube-music.d.ts +++ b/src/youtube-music.d.ts @@ -10,11 +10,6 @@ declare module '*.html?raw' { export default html; } -declare module '*?importChunkUrl' { - const source: string; - - export default source; -} declare module '*.svg?inline' { const base64: string; From 64908d019a7c979b54a9f7c9f275f504ed88231d Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Tue, 7 Nov 2023 14:12:19 +0900 Subject: [PATCH 07/11] feat: use `executeJavaScriptInIsolatedWorld` instead of `executeJavaScript` --- src/index.ts | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/index.ts b/src/index.ts index 0e634272ee..5ca5f29055 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,5 @@ import path from 'node:path'; +import url from 'node:url'; import fs from 'node:fs'; import { BrowserWindow, app, screen, globalShortcut, session, shell, dialog, ipcMain } from 'electron'; @@ -334,19 +335,6 @@ async function createMainWindow() { removeContentSecurityPolicy(); - const escapeXml = (unsafe: string) => { - return unsafe.replace(/[<>&'"]/g, (c) => { - switch (c) { - case '<': return '<'; - case '>': return '>'; - case '&': return '&'; - case '\'': return '''; - case '"': return '"'; - default: return c; - } - }); - }; - win.webContents.on('dom-ready', async () => { // Inject index.html file as string using insertAdjacentHTML // In dev mode, get string from process.env.VITE_DEV_SERVER_URL, else use fs.readFileSync @@ -368,8 +356,12 @@ async function createMainWindow() { const rendererPath = path.join(__dirname, '..', 'renderer'); const indexHTML = parse(fs.readFileSync(path.join(rendererPath, 'index.html'), 'utf-8')); const scriptSrc = indexHTML.querySelector('script')!; - const scriptString = fs.readFileSync(path.join(rendererPath, scriptSrc.getAttribute('src')!), 'utf-8'); - await win.webContents.executeJavaScript(scriptString + `;0`); + const scriptPath = path.join(rendererPath, scriptSrc.getAttribute('src')!); + const scriptString = fs.readFileSync(scriptPath, 'utf-8'); + await win.webContents.executeJavaScriptInIsolatedWorld(0, [{ + code: scriptString + ';0', + url: url.pathToFileURL(scriptPath).toString(), + }], true); } }); From 369821d2c0a04c29fc432cf63dd713aa1ea410b8 Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Tue, 7 Nov 2023 15:23:09 +0900 Subject: [PATCH 08/11] feat: enable `minify` --- electron.vite.config.ts | 139 +++++++++++++++++++++++++++------------- package.json | 2 +- 2 files changed, 94 insertions(+), 47 deletions(-) diff --git a/electron.vite.config.ts b/electron.vite.config.ts index 1023854b36..c60b729828 100644 --- a/electron.vite.config.ts +++ b/electron.vite.config.ts @@ -1,56 +1,103 @@ -import { defineConfig } from 'electron-vite'; +import { defineConfig, defineViteConfig } from 'electron-vite'; import builtinModules from 'builtin-modules'; +import type { UserConfig } from 'vite'; + export default defineConfig({ - main: { - publicDir: 'assets', - build: { - lib: { - entry: 'src/index.ts', - formats: ['cjs'], - }, - outDir: 'dist/main', - commonjsOptions: { - ignoreDynamicRequires: true, - }, - rollupOptions: { - external: ['electron', 'custom-electron-prompt', ...builtinModules], - input: './src/index.ts', + main: defineViteConfig(({ command, mode }) => { + const commonConfig: UserConfig = { + publicDir: 'assets', + build: { + lib: { + entry: 'src/index.ts', + formats: ['cjs'], + }, + outDir: 'dist/main', + commonjsOptions: { + ignoreDynamicRequires: true, + }, + rollupOptions: { + external: ['electron', 'custom-electron-prompt', ...builtinModules], + input: './src/index.ts', + }, }, - }, - }, - preload: { - build: { - lib: { - entry: 'src/preload.ts', - formats: ['cjs'], + }; + + if (command === 'serve' && mode === 'development') { + return commonConfig; + } + + return { + ...commonConfig, + build: { + ...commonConfig.build, + minify: true, + cssMinify: true, }, - outDir: 'dist/preload', - commonjsOptions: { - ignoreDynamicRequires: true, + }; + }), + preload: defineViteConfig(({ command, mode }) => { + const commonConfig: UserConfig = { + build: { + lib: { + entry: 'src/preload.ts', + formats: ['cjs'], + }, + outDir: 'dist/preload', + commonjsOptions: { + ignoreDynamicRequires: true, + }, + rollupOptions: { + external: ['electron', 'custom-electron-prompt', ...builtinModules], + input: './src/preload.ts', + } }, - rollupOptions: { - external: ['electron', 'custom-electron-prompt', ...builtinModules], - input: './src/preload.ts', - } - }, - }, - renderer: { - root: './src/', - build: { - lib: { - entry: 'src/index.html', - formats: ['iife'], - name: 'renderer', + }; + + if (command === 'serve' && mode === 'development') { + return commonConfig; + } + + return { + ...commonConfig, + build: { + ...commonConfig.build, + minify: true, + cssMinify: true, }, - outDir: 'dist/renderer', - commonjsOptions: { - ignoreDynamicRequires: true, + }; + }), + renderer: defineViteConfig(({ command, mode }) => { + const commonConfig: UserConfig = { + root: './src/', + build: { + lib: { + entry: 'src/index.html', + formats: ['iife'], + name: 'renderer', + }, + outDir: 'dist/renderer', + commonjsOptions: { + ignoreDynamicRequires: true, + }, + rollupOptions: { + external: ['electron', ...builtinModules], + input: './src/index.html', + }, }, - rollupOptions: { - external: ['electron', ...builtinModules], - input: './src/index.html', + }; + + if (command === 'serve' && mode === 'development') { + return commonConfig; + } + + return { + ...commonConfig, + build: { + ...commonConfig.build, + minify: true, + cssMinify: true, }, - }, - }, + }; + }), }); diff --git a/package.json b/package.json index 4cfe27ef03..727acce82e 100644 --- a/package.json +++ b/package.json @@ -14,10 +14,10 @@ "build": { "appId": "com.github.th-ch.youtube-music", "productName": "YouTube Music", - "extraResources": ["assets"], "files": [ "!*", "dist", + "assets", "license", "!node_modules", "node_modules/custom-electron-prompt/**", From b54509fecc9644390743febf7ab7f539bbdb14e3 Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Tue, 7 Nov 2023 15:29:46 +0900 Subject: [PATCH 09/11] fix(actions): update task name --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0b2f46171b..4730d3690e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,8 +42,8 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile - # Only rollup build without release if it is a fork - - name: Rollup Build + # Only vite build without release if it is a fork, or it is a pull-request + - name: Vite Build if: github.repository == 'th-ch/youtube-music' && github.event_name == 'pull_request' run: | pnpm build From 932cee6babbb537ccb894a08e375119f20a161f7 Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Tue, 7 Nov 2023 15:43:36 +0900 Subject: [PATCH 10/11] fix: fix dev mode check --- electron.vite.config.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/electron.vite.config.ts b/electron.vite.config.ts index c60b729828..9ca4344800 100644 --- a/electron.vite.config.ts +++ b/electron.vite.config.ts @@ -23,7 +23,7 @@ export default defineConfig({ }, }; - if (command === 'serve' && mode === 'development') { + if (mode === 'development') { return commonConfig; } @@ -54,7 +54,7 @@ export default defineConfig({ }, }; - if (command === 'serve' && mode === 'development') { + if (mode === 'development') { return commonConfig; } @@ -87,7 +87,7 @@ export default defineConfig({ }, }; - if (command === 'serve' && mode === 'development') { + if (mode === 'development') { return commonConfig; } From 1a9d39d86f13d63eb6f3026904b5bb28864e5038 Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Tue, 7 Nov 2023 15:53:05 +0900 Subject: [PATCH 11/11] fix: remove unused variable --- electron.vite.config.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/electron.vite.config.ts b/electron.vite.config.ts index 9ca4344800..bdaed31184 100644 --- a/electron.vite.config.ts +++ b/electron.vite.config.ts @@ -4,7 +4,7 @@ import builtinModules from 'builtin-modules'; import type { UserConfig } from 'vite'; export default defineConfig({ - main: defineViteConfig(({ command, mode }) => { + main: defineViteConfig(({ mode }) => { const commonConfig: UserConfig = { publicDir: 'assets', build: { @@ -36,7 +36,7 @@ export default defineConfig({ }, }; }), - preload: defineViteConfig(({ command, mode }) => { + preload: defineViteConfig(({ mode }) => { const commonConfig: UserConfig = { build: { lib: { @@ -67,7 +67,7 @@ export default defineConfig({ }, }; }), - renderer: defineViteConfig(({ command, mode }) => { + renderer: defineViteConfig(({ mode }) => { const commonConfig: UserConfig = { root: './src/', build: {