Merge branch 'master' of github.com:th-ch/youtube-music into release-1-20

* 'master' of github.com:th-ch/youtube-music:
  fix security issues in deps
  commit assets/generated
  .gitattributes set `eol=lf` on **all** files
  remove `electron.remote` dependency
This commit is contained in:
TC
2023-04-16 22:08:11 +02:00
16 changed files with 110 additions and 1720 deletions

4
.gitattributes vendored
View File

@ -1,2 +1,2 @@
* text=auto * text=auto eol=lf
*.js text eol=lf *.js text

1
.gitignore vendored
View File

@ -1,6 +1,5 @@
node_modules node_modules
/dist /dist
/assets/generated
electron-builder.yml electron-builder.yml
.vscode/settings.json .vscode/settings.json
.idea .idea

View File

@ -0,0 +1,24 @@
diff --git a/index.js b/index.js
index c8f2fd4467c11b484fe654f7f250e2ba37e8100d..c9ae1ed3d3c7683b14dfe0eee801f5a07585d2aa 100644
--- a/index.js
+++ b/index.js
@@ -5,7 +5,16 @@ if (typeof electron === 'string') {
throw new TypeError('Not running in an Electron environment!');
}
-const isEnvSet = 'ELECTRON_IS_DEV' in process.env;
-const getFromEnv = Number.parseInt(process.env.ELECTRON_IS_DEV, 10) === 1;
+const isDev = () => {
+ if ('ELECTRON_IS_DEV' in process.env) {
+ return Number.parseInt(process.env.ELECTRON_IS_DEV, 10) === 1;
+ }
-module.exports = isEnvSet ? getFromEnv : !electron.app.isPackaged;
+ if (process.type === 'browser') {
+ return !electron.app.isPackaged;
+ }
+
+ return 'npm_package_name' in process.env;
+};
+
+module.exports = isDev();

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 931 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 KiB

View File

@ -83,9 +83,8 @@
"test:debug": "DEBUG=pw:browser* playwright test", "test:debug": "DEBUG=pw:browser* playwright test",
"start": "electron .", "start": "electron .",
"start:debug": "ELECTRON_ENABLE_LOGGING=1 electron .", "start:debug": "ELECTRON_ENABLE_LOGGING=1 electron .",
"icon": "del-cli assets/generated && electron-icon-builder --input=assets/youtube-music.png --output=assets/generated",
"generate:package": "node utils/generate-package-json.js", "generate:package": "node utils/generate-package-json.js",
"postinstall": "yarn run icon && yarn run plugins", "postinstall": "yarn run plugins",
"clean": "del-cli dist", "clean": "del-cli dist",
"build": "yarn run clean && electron-builder --win --mac --linux -p never", "build": "yarn run clean && electron-builder --win --mac --linux -p never",
"build:linux": "yarn run clean && electron-builder --linux -p never", "build:linux": "yarn run clean && electron-builder --linux -p never",
@ -137,6 +136,11 @@
"youtubei.js": "^4.3.0", "youtubei.js": "^4.3.0",
"ytpl": "^2.3.0" "ytpl": "^2.3.0"
}, },
"resolutions": {
"xml2js": "^0.5.0",
"@electron/universal": "^1.3.4",
"electron-is-dev": "patch:electron-is-dev@npm%3A2.0.0#./.yarn/patches/electron-is-dev-npm-2.0.0-9d41637d91.patch"
},
"devDependencies": { "devDependencies": {
"@playwright/test": "^1.29.2", "@playwright/test": "^1.29.2",
"auto-changelog": "^2.4.0", "auto-changelog": "^2.4.0",
@ -144,7 +148,6 @@
"electron": "^22.3.6", "electron": "^22.3.6",
"electron-builder": "^23.6.0", "electron-builder": "^23.6.0",
"electron-devtools-installer": "^3.2.0", "electron-devtools-installer": "^3.2.0",
"electron-icon-builder": "^2.0.1",
"node-gyp": "^9.3.1", "node-gyp": "^9.3.1",
"playwright": "^1.29.2", "playwright": "^1.29.2",
"xo": "^0.53.1" "xo": "^0.53.1"

1792
yarn.lock

File diff suppressed because it is too large Load Diff