Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/crisp-cities-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"exclude-dv": patch
---

Simplify regex by removing unnecessary escape characters

The regex pattern for DV_TRAIT was updated to remove escape characters before dots and hyphens within character classes. In regex character classes, dots and hyphens do not need to be escaped, making the pattern cleaner and more readable while maintaining the same functionality.
13 changes: 13 additions & 0 deletions .changeset/wacky-pandas-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"better-steam-rating": patch
---

Some details optimized:

- `packages/better-steam-rating/src/main.js:39:17`
`Date.now()` is more readable and also avoids unnecessary instantiation of Date object.

- `packages/better-steam-rating/src/main.js:40:16`
`packages/better-steam-rating/src/main.js:67:21`
`packages/better-steam-rating/src/main.js:81:157`
Add a non-fractional number to 10.
14 changes: 2 additions & 12 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"organizeImports": { "enabled": true },
"linter": {
"rules": { "recommended": true }
},
"formatter": {
"useEditorconfig": true
},
"files": { "ignoreUnknown": true },
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
}
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
"formatter": { "useEditorconfig": true }
}
285 changes: 84 additions & 201 deletions bun.lock

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@
"scripts": {
"build": "turbo run build && bun run pkg",
"pkg": "bun ./scripts/pack.ts",
"test": "vitest run",
"cov": "vitest run --coverage",
"test": "turbo run test",
"cov": "turbo run cov",
"lint": "biome check",
"fmt": "biome check --write",
"changeset": "changeset"
},
"workspaces": ["packages/*"],
"workspaces": [
"packages/*"
],
"devDependencies": {
"@biomejs/biome": "1.9.2",
"@biomejs/biome": "2.3.11",
"@changesets/changelog-github": "^0.5.2",
"@changesets/cli": "^2.29.8",
"@types/bun": "^1.3.5",
"@vitest/coverage-v8": "^4.0.16",
"turbo": "^2.7.3",
"vitest": "^4.0.16"
"turbo": "^2.7.3"
},
"peerDependencies": {
"typescript": "^5"
Expand Down
9 changes: 6 additions & 3 deletions packages/_template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@
"url": "https://github.com/mogeko/userscripts/issues",
"email": "zhengjunyi@live.com"
},
"keywords": ["userscript", "tampermonkey"],
"keywords": [
"userscript",
"tampermonkey"
],
"license": "MIT",
"scripts": {
"build": "vite build"
},
"devDependencies": {
"@tsconfig/bun": "^1.0.10",
"@types/bun": "^1.3.5",
"vite": "^5.4.7",
"vite-plugin-monkey": "^4.0.6"
"vite": "^7.3.1",
"vite-plugin-monkey": "^7.1.8"
},
"peerDependencies": {
"typescript": "^5"
Expand Down
10 changes: 7 additions & 3 deletions packages/better-steam-rating/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,19 @@
"url": "https://github.com/mogeko/userscripts/issues",
"email": "zhengjunyi@live.com"
},
"keywords": ["userscript", "tampermonkey", "steam"],
"keywords": [
"userscript",
"tampermonkey",
"steam"
],
"license": "MIT",
"scripts": {
"build": "vite build"
},
"devDependencies": {
"@types/bun": "^1.3.5",
"vite": "^5.4.7",
"vite-plugin-monkey": "^4.0.6"
"vite": "^7.3.1",
"vite-plugin-monkey": "^7.1.8"
},
"peerDependencies": {
"typescript": "^5"
Expand Down
9 changes: 5 additions & 4 deletions packages/better-steam-rating/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ function checkFn() {
gameDate.setMonth(dateArr[1] - 1);
gameDate.setDate(dateArr[2]);

days = (new Date().getTime() - gameDate.getTime()) / 86400000;
days = Number.parseInt(days);
days = (Date.now() - gameDate.getTime()) / 86400000;
days = Number.parseInt(days, 10);
}
}

Expand All @@ -62,9 +62,9 @@ function checkFn() {
return;
}

const num = lastArr[0].replace(/\,/g, "");
const num = lastArr[0].replace(/,/g, "");
const rate = lastArr[2].replace("%", "");
const realNum = Number.parseInt((num * rate) / 100);
const realNum = Number.parseInt((num * rate) / 100, 10);

if (Number.isNaN(realNum)) {
console.log(content);
Expand All @@ -80,6 +80,7 @@ function checkFn() {

const innerHtml = `<span style="padding-left: 0.5em;width: 2em;display: inline-block;">${rate}</span><span style="width: 4.5em;display:inline-block;">${Number.parseInt(
(num * rate) / 100,
10,
)}</span><span style="width: 3em;display:inline-block;">${days}</span><span style="width:3em;display:inline-block;">${realRate}</span>`;

item.innerHTML = innerHtml;
Expand Down
17 changes: 12 additions & 5 deletions packages/douban2rarbg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,26 @@
"url": "https://github.com/mogeko/userscripts/issues",
"email": "zhengjunyi@live.com"
},
"keywords": ["userscript", "tampermonkey", "douban", "rarbg"],
"keywords": [
"userscript",
"tampermonkey",
"douban",
"rarbg"
],
"license": "MIT",
"scripts": {
"build": "vite build",
"test": "vitest run"
"test": "vitest run",
"cov": "vitest run --coverage"
},
"devDependencies": {
"@tsconfig/bun": "^1.0.10",
"@types/bun": "^1.3.5",
"@vitest/coverage-v8": "^4.0.16",
"happy-dom": "^20.1.0",
"vite": "^5.4.7",
"vite-plugin-monkey": "^4.0.6",
"vitest": "^2.1.1"
"vite": "^7.3.1",
"vite-plugin-monkey": "^7.1.8",
"vitest": "^4.0.16"
},
"peerDependencies": {
"typescript": "^5"
Expand Down
1 change: 1 addition & 0 deletions packages/douban2rarbg/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="vitest/config" />
import { defineConfig } from "vite";
import monkey from "vite-plugin-monkey";

Expand Down
10 changes: 7 additions & 3 deletions packages/down-git/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,20 @@
"url": "https://github.com/mogeko/userscripts/issues",
"email": "zhengjunyi@live.com"
},
"keywords": ["userscript", "tampermonkey", "github"],
"keywords": [
"userscript",
"tampermonkey",
"github"
],
"license": "MIT",
"scripts": {
"build": "vite build"
},
"devDependencies": {
"@tsconfig/bun": "^1.0.10",
"@types/bun": "^1.3.5",
"vite": "^5.4.7",
"vite-plugin-monkey": "^4.0.6"
"vite": "^7.3.1",
"vite-plugin-monkey": "^7.1.8"
},
"peerDependencies": {
"typescript": "^5"
Expand Down
10 changes: 7 additions & 3 deletions packages/exclude-dv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,20 @@
"url": "https://github.com/mogeko/userscripts/issues",
"email": "zhengjunyi@live.com"
},
"keywords": ["userscript", "tampermonkey", "rarbg"],
"keywords": [
"userscript",
"tampermonkey",
"rarbg"
],
"license": "MIT",
"scripts": {
"build": "vite build"
},
"devDependencies": {
"@tsconfig/bun": "^1.0.10",
"@types/bun": "^1.3.5",
"vite": "^5.4.7",
"vite-plugin-monkey": "^4.0.6"
"vite": "^7.3.1",
"vite-plugin-monkey": "^7.1.8"
},
"peerDependencies": {
"typescript": "^5"
Expand Down
2 changes: 1 addition & 1 deletion packages/exclude-dv/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const DV_TRAIT = /(\w+[\.\-\ \[\]])+DV[\.\-\ \[\]](\w+[\.\-\ \[\]]?)+/;
const DV_TRAIT = /(\w+[.\- [\]])+DV[.\- [\]](\w+[.\- [\]]?)+/;

for (const tr of document.querySelectorAll("table.lista2t tr.lista2")) {
const link = tr.querySelector<HTMLAnchorElement>("td:nth-child(2) > a");
Expand Down
11 changes: 8 additions & 3 deletions packages/ghproxy-gist-raw/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,21 @@
"url": "https://github.com/mogeko/userscripts/issues",
"email": "zhengjunyi@live.com"
},
"keywords": ["userscript", "tampermonkey", "github", "gist"],
"keywords": [
"userscript",
"tampermonkey",
"github",
"gist"
],
"license": "MIT",
"scripts": {
"build": "vite build"
},
"devDependencies": {
"@tsconfig/bun": "^1.0.10",
"@types/bun": "^1.3.5",
"vite": "^5.4.7",
"vite-plugin-monkey": "^4.0.6"
"vite": "^7.3.1",
"vite-plugin-monkey": "^7.1.8"
},
"peerDependencies": {
"typescript": "^5"
Expand Down
10 changes: 7 additions & 3 deletions packages/ghproxy-raw/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,20 @@
"url": "https://github.com/mogeko/userscripts/issues",
"email": "zhengjunyi@live.com"
},
"keywords": ["userscript", "tampermonkey", "github"],
"keywords": [
"userscript",
"tampermonkey",
"github"
],
"license": "MIT",
"scripts": {
"build": "vite build"
},
"devDependencies": {
"@tsconfig/bun": "^1.0.10",
"@types/bun": "^1.3.5",
"vite": "^5.4.7",
"vite-plugin-monkey": "^4.0.6"
"vite": "^7.3.1",
"vite-plugin-monkey": "^7.1.8"
},
"peerDependencies": {
"typescript": "^5"
Expand Down
10 changes: 7 additions & 3 deletions packages/ghproxy-releases/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,20 @@
"url": "https://github.com/mogeko/userscripts/issues",
"email": "zhengjunyi@live.com"
},
"keywords": ["userscript", "tampermonkey", "github"],
"keywords": [
"userscript",
"tampermonkey",
"github"
],
"license": "MIT",
"scripts": {
"build": "vite build"
},
"devDependencies": {
"@tsconfig/bun": "^1.0.10",
"@types/bun": "^1.3.5",
"vite": "^5.4.7",
"vite-plugin-monkey": "^4.0.6"
"vite": "^7.3.1",
"vite-plugin-monkey": "^7.1.8"
},
"peerDependencies": {
"typescript": "^5"
Expand Down
4 changes: 3 additions & 1 deletion turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"$schema": "https://turborepo.com/schema.json",
"tasks": {
"build": { "dependsOn": ["^build"], "outputs": ["dist"] },
"//#pkg": { "outputs": ["release"] }
"//#pkg": { "outputs": ["release"] },
"test": { "inputs": ["$TURBO_DEFAULT$", "tests"] },
"cov": { "outputs": ["coverage"], "inputs": ["$TURBO_DEFAULT$", "tests"] }
},
"globalEnv": ["GITHUB_TOKEN", "BASE_URL"]
}
11 changes: 0 additions & 11 deletions vitest.config.ts

This file was deleted.