Repository: web-scrobbler/web-scrobbler
Pull request #4346 (2023-12-09 16:49:19)

Bump typescript from 5.2.2 to 5.3.3
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.2.2 to 5.3.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/Microsoft/TypeScript/releases">typescript's releases</a>.</em></p>
<blockquote>
<h2>TypeScript 5.3.3</h2>
<p>For release notes, check out the <a href="https://devblogs.microsoft.com/typescript/announcing-typescript-5-3/">release announcement</a>.</p>
<p>For the complete list of fixed issues, check out the</p>
<ul>
<li><a href="https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&amp;q=milestone%3A%22TypeScript+5.3.0%22+is%3Aclosed+">fixed issues query for Typescript 5.3.0 (Beta)</a>.</li>
<li><a href="https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&amp;q=milestone%3A%22TypeScript+5.3.1%22+is%3Aclosed+">fixed issues query for Typescript 5.3.1 (RC)</a>.</li>
<li><a href="https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&amp;q=milestone%3A%22TypeScript+5.3.2%22+is%3Aclosed+">fixed issues query for Typescript 5.3.2 (Stable)</a>.</li>
<li><a href="https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&amp;q=milestone%3A%22TypeScript+5.3.3%22+is%3Aclosed+">fixed issues query for Typescript 5.3.3 (Stable)</a>.</li>
</ul>
<p>Downloads are available on:</p>
<ul>
<li><a href="https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild">NuGet package</a></li>
</ul>
<h2>TypeScript 5.3</h2>
<p>For release notes, check out the <a href="https://devblogs.microsoft.com/typescript/announcing-typescript-5-3/">release announcement</a>.</p>
<p>For the complete list of fixed issues, check out the</p>
<ul>
<li><a href="https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&amp;q=milestone%3A%22TypeScript+5.3.0%22+is%3Aclosed+">fixed issues query for Typescript 5.3.0 (Beta)</a>.</li>
<li><a href="https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&amp;q=milestone%3A%22TypeScript+5.3.1%22+is%3Aclosed+">fixed issues query for Typescript 5.3.1 (RC)</a>.</li>
<li><a href="https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&amp;q=milestone%3A%22TypeScript+5.3.2%22+is%3Aclosed+">fixed issues query for Typescript 5.3.2 (Stable)</a>.</li>
</ul>
<p>Downloads are available on:</p>
<ul>
<li><a href="https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild">NuGet package</a></li>
</ul>
<h2>TypeScript 5.3 RC</h2>
<p>For release notes, check out the <a href="https://devblogs.microsoft.com/typescript/announcing-typescript-5-3-rc/">release announcement</a>.</p>
<p>For the complete list of fixed issues, check out the</p>
<ul>
<li><a href="https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&amp;q=milestone%3A%22TypeScript+5.3.0%22+is%3Aclosed+">fixed issues query for Typescript 5.3.0 (Beta)</a>.</li>
<li><a href="https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&amp;q=milestone%3A%22TypeScript+5.3.1%22+is%3Aclosed+">fixed issues query for Typescript 5.3.1 (RC)</a>.</li>
</ul>
<p>Downloads are available on:</p>
<ul>
<li><a href="https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild">NuGet package</a></li>
</ul>
<h2>TypeScript 5.3 Beta</h2>
<p>For release notes, check out the <a href="https://devblogs.microsoft.com/typescript/announcing-typescript-5-3-beta/">release announcement</a>.</p>
<p>For the complete list of fixed issues, check out the</p>
<ul>
<li><a href="https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&amp;q=milestone%3A%22TypeScript+5.3.0%22+is%3Aclosed+">fixed issues query for Typescript v5.3.0 (Beta)</a>.</li>
</ul>
<p>Downloads are available on <a href="https://www.npmjs.com/package/typescript">npm</a>.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/microsoft/TypeScript/commit/63717cf44a64585175c76c336c8f8d87d5384d16"><code>63717cf</code></a> Bump version to 5.3.3 and LKG</li>
<li><a href="https://github.com/microsoft/TypeScript/commit/4c2afa7f7bbba7905f288a477ea773bdaa678b5c"><code>4c2afa7</code></a> 🤖 Pick PR <a href="https://redirect.github.com/Microsoft/TypeScript/issues/56627">#56627</a> (Transpile jsdoc parsing mode) into release-5.3 (<a href="https://redirect.github.com/Microsoft/TypeScript/issues/56629">#56629</a>)</li>
<li><a href="https://github.com/microsoft/TypeScript/commit/ba3d2b02b22bf3b3a6de735b9bab613451ec08b6"><code>ba3d2b0</code></a> 🤖 Pick PR <a href="https://redirect.github.com/Microsoft/TypeScript/issues/56434">#56434</a> (Fix support for intersections in te...) into release-5.3 (#...</li>
<li><a href="https://github.com/microsoft/TypeScript/commit/f3808c416d42f20093121b70d3f0a65b4d026b1f"><code>f3808c4</code></a> 🤖 Pick PR <a href="https://redirect.github.com/Microsoft/TypeScript/issues/56504">#56504</a> (Fixed an issue in boolean compariso...) into release-5.3 (#...</li>
<li><a href="https://github.com/microsoft/TypeScript/commit/b4fe221e65d3ebba0e06f9562cb939574f80fe20"><code>b4fe221</code></a> Cherry-pick <a href="https://redirect.github.com/Microsoft/TypeScript/issues/56489">#56489</a> into release-5.3 (<a href="https://redirect.github.com/Microsoft/TypeScript/issues/56490">#56490</a>)</li>
<li><a href="https://github.com/microsoft/TypeScript/commit/f750eb37942c0bacd7c3609088abc3207f8ab1ce"><code>f750eb3</code></a> Pick <a href="https://redirect.github.com/Microsoft/TypeScript/issues/56485">#56485</a> into release-5.3 (<a href="https://redirect.github.com/Microsoft/TypeScript/issues/56486">#56486</a>)</li>
<li><a href="https://github.com/microsoft/TypeScript/commit/27047e3391323fa2d8987f46a4c42f5361d07926"><code>27047e3</code></a> Update LKG.</li>
<li><a href="https://github.com/microsoft/TypeScript/commit/d09b1bfb5ac63bf8320d210f6c2ca9ead8ef24b3"><code>d09b1bf</code></a> Pick <a href="https://redirect.github.com/Microsoft/TypeScript/issues/56449">#56449</a> into release-5.3 (<a href="https://redirect.github.com/Microsoft/TypeScript/issues/56451">#56451</a>)</li>
<li><a href="https://github.com/microsoft/TypeScript/commit/e2a5d45b51a7127ab9f9b7f4b704b3499e9fd6d3"><code>e2a5d45</code></a> Update LKG.</li>
<li><a href="https://github.com/microsoft/TypeScript/commit/756efd2478dd4fcb492f53f335a0e4afcd7c875d"><code>756efd2</code></a> Fixes for release-5.3. (<a href="https://redirect.github.com/Microsoft/TypeScript/issues/56424">#56424</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/Microsoft/TypeScript/compare/v5.2.2...v5.3.3">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=typescript&package-manager=npm_and_yarn&previous-version=5.2.2&new-version=5.3.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Patch:
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 89a4da6d..178a79fa 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -16,6 +16,7 @@ jobs:
         uses: actions/setup-node@v4
         with:
           node-version-file: '.nvmrc'
+          cache: 'npm'
 
       - name: Install dependencies
         run: npm ci
@@ -24,12 +25,6 @@ jobs:
         run: |
           npm run build chrome
 
-      - name: Upload the extension as an artifact
-        uses: actions/upload-artifact@v3
-        with:
-          name: web-scrobbler-chrome
-          path: build/chrome
-
   build-firefox:
     name: Build the extension for Firefox
     runs-on: ubuntu-latest
@@ -45,6 +40,7 @@ jobs:
         uses: actions/setup-node@v4
         with:
           node-version-file: '.nvmrc'
+          cache: 'npm'
 
       - name: Install dependencies
         run: npm ci
@@ -53,12 +49,6 @@ jobs:
         run: |
           npm run build firefox
 
-      - name: Upload the extension as an artifact
-        uses: actions/upload-artifact@v3
-        with:
-          name: web-scrobbler-firefox
-          path: build/firefox
-
   build-safari:
     name: Build the extension for Safari
     runs-on: macos-latest
@@ -70,6 +60,7 @@ jobs:
         uses: actions/setup-node@v4
         with:
           node-version-file: '.nvmrc'
+          cache: 'npm'
 
       - name: Install dependencies
         run: npm ci
@@ -77,9 +68,3 @@ jobs:
       - name: Build the extension
         run: |
           npm run build safari
-
-      - name: Upload the extension as an artifact
-        uses: actions/upload-artifact@v3
-        with:
-          name: web-scrobbler-safari
-          path: build/safari
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 019a6ca1..ebda7f00 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -17,6 +17,7 @@ jobs:
         uses: actions/setup-node@v4
         with:
           node-version-file: '.nvmrc'
+          cache: 'npm'
 
       - name: Install dependencies
         run: npm ci
@@ -44,6 +45,7 @@ jobs:
         uses: actions/setup-node@v4
         with:
           node-version-file: '.nvmrc'
+          cache: 'npm'
 
       - name: Install dependencies
         run: npm ci
@@ -71,6 +73,7 @@ jobs:
         uses: actions/setup-node@v4
         with:
           node-version-file: '.nvmrc'
+          cache: 'npm'
 
       - name: Install dependencies
         run: npm ci
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index cda1d244..48ad0529 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -16,6 +16,7 @@ jobs:
         uses: actions/setup-node@v4
         with:
           node-version-file: '.nvmrc'
+          cache: 'npm'
 
       - name: Install dependencies
         run: npm ci
diff --git a/.github/workflows/release-extension.yml b/.github/workflows/release-extension.yml
index 6f2d73b4..01b36f31 100644
--- a/.github/workflows/release-extension.yml
+++ b/.github/workflows/release-extension.yml
@@ -20,16 +20,21 @@ jobs:
         uses: actions/checkout@v4
         with:
           token: ${{ secrets.BOT_PAT }}
+
       - name: Setup git config
         run: |
           git config user.name "web-scrobbler-bot"
           git config user.email "${{ secrets.BOT_EMAIL }}"
+
       - name: Setup Node.js
         uses: actions/setup-node@v4
         with:
           node-version-file: '.nvmrc'
+          cache: 'npm'
+
       - name: Install dependencies
         run: npm ci
+
       - name: Release
         run: ./release-extension.sh ${{ inputs.release_type }}
         env:
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 75911052..9ff4ec70 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -18,6 +18,7 @@ jobs:
         uses: actions/setup-node@v4
         with:
           node-version-file: '.nvmrc'
+          cache: 'npm'
 
       - name: Install dependencies
         run: npm ci
diff --git a/package-lock.json b/package-lock.json
index ee616605..9d2fed51 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -49,7 +49,7 @@
         "sass": "1.69.5",
         "solid-js": "1.8.5",
         "tsx": "4.6.2",
-        "typescript": "5.2.2",
+        "typescript": "5.3.3",
         "vite-plugin-conditional-compiler": "0.2.1",
         "vite-plugin-solid": "2.8.0",
         "vite-plugin-static-copy": "0.17.0",
@@ -12971,9 +12971,9 @@
       "dev": true
     },
     "node_modules/typescript": {
-      "version": "5.2.2",
-      "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
-      "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
+      "version": "5.3.3",
+      "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
+      "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
       "devOptional": true,
       "bin": {
         "tsc": "bin/tsc",
diff --git a/package.json b/package.json
index 5a158d48..95e2a3db 100644
--- a/package.json
+++ b/package.json
@@ -68,7 +68,7 @@
     "sass": "1.69.5",
     "solid-js": "1.8.5",
     "tsx": "4.6.2",
-    "typescript": "5.2.2",
+    "typescript": "5.3.3",
     "vite-plugin-conditional-compiler": "0.2.1",
     "vite-plugin-solid": "2.8.0",
     "vite-plugin-static-copy": "0.17.0",
diff --git a/src/connectors/rpfm.ts b/src/connectors/rpfm.ts
new file mode 100644
index 00000000..bca1218d
--- /dev/null
+++ b/src/connectors/rpfm.ts
@@ -0,0 +1,40 @@
+export {};
+
+interface Property {
+	[key: string]: string;
+}
+
+const props: Property = {
+	trackSelector: '.radio-current-track',
+	artistSelector: '.radio-current-artist',
+	trackArtSelector: '.radio-current-cover',
+	durationSelector: '.track-time-duration',
+	currentTimeSelector: '.track-time-position',
+};
+
+Connector.playerSelector = '.app-player';
+
+for (const prop in props) {
+	const selector = props[prop];
+	Object.defineProperty(Connector, prop, {
+		get: () => `${getCurrentContext()} ${selector}`,
+	});
+}
+
+Connector.isTrackArtDefault = (url) => url?.includes('no-cover');
+
+Connector.isPlaying = () =>
+	Util.getDataFromSelectors('.app-player', 'status') === 'play';
+
+Connector.isStateChangeAllowed = () => {
+	const artist = Connector.getArtist();
+	return artist !== null && artist !== 'Реклама';
+};
+
+function getCurrentContext(): string {
+	const single = Util.hasElementClass(
+		Connector.playerSelector,
+		'single-player',
+	);
+	return single ? '.app-player-panel' : '#broadcast-panel';
+}
diff --git a/src/core/connectors.ts b/src/core/connectors.ts
index 8e8e39a4..07215a36 100644
--- a/src/core/connectors.ts
+++ b/src/core/connectors.ts
@@ -150,6 +150,12 @@ export default <ConnectorMeta[]>[
 		js: 'radioplus.js',
 		id: 'radioplus',
 	},
+	{
+		label: 'Радио Premium',
+		matches: ['*://rpfm.ru/*'],
+		js: 'rpfm.js',
+		id: 'rpfm',
+	},
 	{
 		label: 'Douban.FM',
 		matches: ['*://douban.fm/*', '*://fm.douban.fm/*'],


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index cdbd73d1..30146143 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -37,6 +37,7 @@ jobs:
         uses: actions/setup-node@v4
         with:
           node-version-file: '.nvmrc'
+          cache: 'npm'
 
       - name: Install dependencies
         run: npm ci