Skip to content

Commit 5f2cef1

Browse files
authored
Merge pull request #13 from lanly-dev/2.0.0
2.0.0
2 parents 52c8487 + 381a7a8 commit 5f2cef1

39 files changed

+914
-708
lines changed

.eslintrc.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
{
2+
"env": { "browser": true, "node":true },
3+
"extends": [
4+
"eslint:recommended",
5+
"plugin:@typescript-eslint/eslint-recommended",
6+
"plugin:@typescript-eslint/recommended"],
27
"ignorePatterns": ["dist"],
3-
"root": true,
48
"parser": "@typescript-eslint/parser",
59
"parserOptions": {
6-
"ecmaVersion": 6,
10+
"ecmaVersion": "latest",
711
"sourceType": "module"
812
},
913
"plugins": ["@typescript-eslint"],
14+
"root": true,
1015
"rules": {
16+
"@typescript-eslint/ban-ts-comment": "off",
17+
"@typescript-eslint/explicit-module-boundary-types": "off",
18+
"@typescript-eslint/naming-convention": "warn",
1119
"@typescript-eslint/semi": ["error", "never"],
12-
"arrow-parens": ["warn", "as-needed"],
20+
"arrow-parens": ["error", "as-needed"],
1321
"curly": ["error", "multi-or-nest"],
1422
"eqeqeq": "warn",
1523
"no-throw-literal": "warn",

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
.token
12
*.vsix
2-
dist/
3-
icon/res/
3+
dist
4+
media/res
45
node_modules
5-
out
66
package-lock.json
7-
src/ref
7+
src/ref

.prettierrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
arrowParens: 'avoid',
3+
printWidth: 120,
4+
semi: false,
5+
singleQuote: true,
6+
trailingComma: 'none'
7+
}

.vscode/extensions.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
{
22
// See http://go.microsoft.com/fwlink/?LinkId=827846
33
// for the documentation about the extensions.json format
4-
"recommendations": ["dbaeumer.vscode-eslint"]
4+
"recommendations": [
5+
"dbaeumer.vscode-eslint",
6+
"amodio.tsl-problem-matcher",
7+
"ue.alphabetical-sorter",
8+
"shardulm94.trailing-spaces",
9+
"streetsidesoftware.code-spell-checker"
10+
]
511
}

.vscode/launch.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,20 @@
66
"version": "0.2.0",
77
"configurations": [
88
{
9-
"name": "Extension:webpack",
9+
"name": "Launch Extension webpack",
1010
"type": "extensionHost",
1111
"request": "launch",
12-
"runtimeExecutable": "${execPath}",
1312
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
1413
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
15-
"preLaunchTask": "npm: webpack"
14+
"preLaunchTask": "${defaultBuildTask}"
1615
},
1716
{
18-
"name": "Extension:watch",
17+
"name": "Launch Extension ts-watch",
1918
"type": "extensionHost",
2019
"request": "launch",
21-
"runtimeExecutable": "${execPath}",
2220
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
23-
"outFiles": ["${workspaceFolder}/out/**/*.js"],
24-
"preLaunchTask": "npm: watch"
21+
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
22+
"preLaunchTask": "ts-watch"
2523
}
2624
]
2725
}

.vscode/settings.json

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,42 @@
11
// Place your settings in this file to overwrite default and user settings.
22
{
3+
"cSpell.words": [
4+
"Adblocker",
5+
"Btns",
6+
"bufferutil",
7+
"deepskyblue",
8+
"Execa",
9+
"lanly",
10+
"letmeplaythemusic",
11+
"lmptm",
12+
"playpause",
13+
"soundcloud",
14+
"spoticon",
15+
"targetchanged",
16+
"targetcreated",
17+
"targetdestroyed",
18+
"testid",
19+
"treeview",
20+
"uddir",
21+
"ytmusic"
22+
],
23+
"cSpell.ignorePaths": [
24+
".git/objects",
25+
".vscode",
26+
".eslintrc.json",
27+
"node_modules",
28+
"package-lock.json"
29+
],
30+
"editor.rulers": [120],
31+
"explorer.sortOrder": "type",
332
"files.exclude": {
33+
"dist": false, // set this to true to hide the "dist" folder with the compiled JS files
434
"out": false // set this to true to hide the "out" folder with the compiled JS files
535
},
636
"search.exclude": {
37+
"dist": true, // set this to false to include "dist" folder in search results
738
"out": true // set this to false to include "out" folder in search results
839
},
940
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
1041
"typescript.tsc.autoDetect": "off"
11-
}
42+
}

.vscode/tasks.json

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,43 @@
55
"tasks": [
66
{
77
"type": "npm",
8-
"script": "watch",
9-
"problemMatcher": "$tsc-watch",
8+
"script": "wp-watch",
9+
"problemMatcher": ["$ts-webpack-watch", "$tslint-webpack-watch"],
1010
"isBackground": true,
1111
"presentation": {
12-
"reveal": "never"
12+
"reveal": "never",
13+
"group": "watcher"
1314
},
1415
"group": {
1516
"kind": "build",
1617
"isDefault": true
17-
}
18+
},
19+
"dependsOn": ["npm: task-clean-output"]
20+
},
21+
{
22+
"label": "ts-watch",
23+
"type": "npm",
24+
"script": "ts-watch",
25+
"problemMatcher": "$tsc-watch",
26+
"isBackground": true,
27+
"presentation": { "reveal": "never" },
28+
"dependsOrder": "sequence",
29+
"dependsOn": ["npm: task-clean-output", "npm: task-copy-static-assets"]
1830
},
31+
// ↓↓↓↓ For vscode command palette ↓↓↓↓
1932
{
2033
"type": "npm",
21-
"script": "compile",
22-
"dependsOn": ["npm: copy-static-assets"]
34+
"script": "test-compile",
35+
"dependsOn": ["npm: task-clean-output"]
2336
},
2437
{
2538
"type": "npm",
26-
"script": "copy-static-assets",
39+
"script": "task-copy-static-assets",
2740
"isBackground": false
2841
},
2942
{
3043
"type": "npm",
31-
"script": "clean-output",
44+
"script": "task-clean-output",
3245
"isBackground": false
3346
}
3447
]

.vscodeignore

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
.gitignore
2-
.vscode/
2+
.token
3+
.vscode
34
**/.eslintrc.json
45
**/*.map
56
**/*.ts
67
**/tsconfig.json
7-
clearOutFiles.ts
8-
copyStaticAssets.ts
9-
icon/res/
8+
media/res
9+
media/vscodeignore
1010
node_modules
11-
out/
12-
src/
11+
src
1312
vsc-extension-quickstart.md
14-
webpack.config.js
13+
webpack.config.js

CHANGELOG.md

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,49 @@ All notable changes to the "LetMePlayTheMusic" extension will be documented in t
44

55
Check [Keep a Changelog](http://keepachangelog.com) for recommendations on how to structure this file.
66

7+
### References
8+
- https://github.com/microsoft/vscode-generator-code/tree/main/generators/app/templates/ext-command-ts
9+
- https://github.com/microsoft/vscode-extension-samples
10+
- https://www.conventionalcommits.org
11+
712
### TODO
8-
- Extention settings scope
9-
- I18n?
10-
- Site English version issue
13+
- Brave setting removal
14+
- I18n
15+
- Playwright vs Puppeteer option
16+
- Seek backward/forward setting option
17+
- Shelljs vs Execa
18+
- Support for other sites
19+
20+
## [2.0.0] - December 2021
21+
- Add new feature - treeview
22+
- Rewrite/refactor most of the code - 30+ commits
23+
- New float button style - old vs new in Windows
24+
<br><img src='./media/btn1.4.png' width='100'/> <img src='./media/btn2.0.png' width='100'/>
25+
- Fix Spotify bug due to it's style class's changes
26+
- Fix site English version issue - observes another DOM element to update playback status
27+
- Merge play and pause commands into one toggle function
28+
- Move most of the minor inject action to inject script instead
29+
- Re-config project's configs like eslint, tsconfig, vscode setting, and webpack (.js -> .ts)
30+
- Rename directories: icon -> media, scripts -> inject
31+
- Playback icons is sync with the site's playback icons which was behaved contrarily before
32+
- Webpack 5.65.0 compiled successfully in 9980 ms
33+
- 15 files, 1.39MB, 1.63.0
34+
35+
### Note
36+
37+
#### This release mostly has more significant impact on the dev side rather than like a product update.
38+
39+
#### One funny thing is that the picture in README.md accounts for a large part of this extension's size.
40+
41+
#### [MediaSession](https://developer.mozilla.org/en-US/docs/Web/API/MediaSession)
42+
- Soundcloud does update `playbackState` but only call `set` for from press play
43+
- Spotify does call `set` to update metadata but playbackState always *none*
44+
- Youtube and YTmusic update `playbackState` consistent with proxy `set` event
45+
46+
#### Puppeteer
47+
- Seem Puppeteer doesn't keep track pages/tabs' order
48+
- If click too quick, this shows up: `Error: Execution context is not available in detached frame "about:blank" (are you trying to evaluate?)`
49+
Waiting and try/catch was fruitless
1150

1251
## [1.4.0] - October 2020
1352
- Add key shortcuts [#7](https://github.com/lanly-dev/VSCode-LMPTM/issues/7)
@@ -24,7 +63,7 @@ Check [Keep a Changelog](http://keepachangelog.com) for recommendations on how t
2463
- 11 files, 141.77KB, 1.42.0
2564

2665
## [1.2.0] - December 2019
27-
- Add browser execuatble file setting [#3](https://github.com/lanly-dev/VSCode-LMPTM/issues/3)
66+
- Add browser executable file setting [#3](https://github.com/lanly-dev/VSCode-LMPTM/issues/3)
2867
- Add Incognito/Private mode setting
2968
- Add [User Data Directory](https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md) setting [#4](https://github.com/lanly-dev/VSCode-LMPTM/issues/4)
3069
- 11 files, 192KB, 1.41.0
@@ -36,4 +75,4 @@ Check [Keep a Changelog](http://keepachangelog.com) for recommendations on how t
3675

3776
## [1.0.0] - August 2019
3877
- Initial release
39-
- 2117 files, 5.09MB, 1.35.0
78+
- 2117 files, 5.09MB, 1.35.0

README.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@
22

33
[![Version](https://vsmarketplacebadge.apphb.com/version-short/lanly-dev.letmeplaythemusic.svg)](https://marketplace.visualstudio.com/items?itemName=lanly-dev.letmeplaythemusic)
44

5-
Tired or get annoyed from switching windows in order to pause or skip a song?
6-
Doesn't want to or lazy to install the extra official players to the system?
7-
Want to stay focus on your programing instead of those distracting actions and feelings above?
5+
Tired or get annoyed from switching windows in order to pause or skip a song?\
6+
Doesn't want to or lazy to install the extra official players to the system?\
7+
Or perhaps your keyboard doesn't have the handy media hotkeys?\
8+
Wanted to stay focus on your programing instead of those shortcomings above?
89

9-
If yes, you are in luck!
10+
If yes, you are in luck!\
1011
This extension launches a Chrome/Chromium browser to the 4 popular music sites and you can control the playback from within your favorite Visual Studio Code editor.
1112

12-
Extra [use case](https://github.com/lanly-dev/VSCode-LMPTM/issues/8#issuecomment-661796089) - you could use this extension to follow programming tutorials on Youtube with the handy seek forward/backward key shortcuts.
13+
>Extra [use case](https://github.com/lanly-dev/VSCode-LMPTM/issues/8#issuecomment-661796089) - you could use this extension to follow programming tutorials on Youtube with the handy seek forward/backward key shortcuts.
1314
14-
[How to use it?](https://github.com/lanly-dev/VSCode-LMPTM/issues/1)
15+
>[How to use it?](https://github.com/lanly-dev/VSCode-LMPTM/issues/1)
1516
16-
## Features
17+
<img src='./media/capture2.0.png' width='700'/>
1718

19+
## Features
1820
Supports SoundCloud, Spotify, Youtube and Youtube Music
1921

2022
## Requirements
21-
2223
Required Chromium-based browser
2324

2425
## Extension Settings
25-
2626
* `lmptm.browserPath`: Specify custom browser executable file path.
2727
* `lmptm.ignoreDisableSync`: Ignore --disable-sync, this option is specifically for [Brave](https://brave.com) browser.
2828
* `lmptm.incognitoMode`: Specify whether to launch browser in incognito/private mode.
@@ -31,14 +31,21 @@ Required Chromium-based browser
3131
* `lmptm.userDataDirectory`: Specify [user data directory](https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md), this will be ignored if **User Data** setting is unchecked.
3232

3333
## Known Issues
34-
- Work only with English version of the supported music sites
3534
- Does not work with Opera browser
36-
- Won't be able to login Youtube and SoundCLoud(email method)
35+
- Won't be able to login Youtube and SoundCloud(email method)
3736

3837
## Release Notes
38+
### 2.0.0
39+
- Add treeview - so now the the app can switch between tabs
40+
1. The page has to be picked before being able to use in the treeview
41+
2. You can select the treeview items that have the play/pause icon
42+
3. The emoji ⛏️ means the tab is currently picked
43+
4. First click switches the picked icon to target tab, later clicks toggles playing/paused status of the target tab media's playback
44+
45+
- Fix spotify bugs due to it's new UI changes
3946

4047
### 1.4.0
41-
- Add key shorcuts
48+
- Add key shortcuts
4249
- Add seek 5s forward/backward for Youtube shortcuts
4350
- Add support for [Youtube Music](https://music.youtube.com/)
4451
- Add startPages settings

0 commit comments

Comments
 (0)