Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into partykit
Browse files Browse the repository at this point in the history
  • Loading branch information
noahm committed Nov 13, 2024
2 parents 23d707b + c3ae525 commit 4fa3946
Show file tree
Hide file tree
Showing 22 changed files with 2,272 additions and 2,382 deletions.
34 changes: 0 additions & 34 deletions .eslintrc.js

This file was deleted.

4 changes: 3 additions & 1 deletion .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ jobs:
name: Typecheck
- check: "validate:format"
name: Formatting
- check: "validate:lint"
name: Linter
- check: webpack
name: Build
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: 22
cache: "yarn"
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
nodejs 22.9
nodejs 22.11
yarn 1.22.22
725 changes: 367 additions & 358 deletions .yarn/releases/yarn-4.5.0.cjs → .yarn/releases/yarn-4.5.1.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.5.0.cjs
yarnPath: .yarn/releases/yarn-4.5.1.cjs
33 changes: 33 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import eslintConfigPrettier from "eslint-config-prettier";

import reactHooksPlugin from "eslint-plugin-react-hooks";

/** @type {import("@typescript-eslint/utils").TSESLint.FlatConfig.Config}*/
const reactHooksConfig = {
plugins: {
"react-hooks": reactHooksPlugin,
},
rules: reactHooksPlugin.configs.recommended.rules,
};

export default tseslint.config(
{
ignores: ["scripts/", "surge-redirect/", "webpack.config.js"],
},
{
settings: {
node: {
extensions: [".ts", ".json"],
},
react: {
version: "detect",
},
},
},
// eslint.configs.recommended,
...tseslint.configs.recommended,
reactHooksConfig,
eslintConfigPrettier,
);
78 changes: 40 additions & 38 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"import:iidx": "node scripts/import-iidx.mjs",
"import:smx": "node scripts/import-smx.mjs",
"import:itg": "node scripts/import-itg.mjs",
"validate": "npm run validate:json && npm run validate:ts && npm run validate:format && eslint src",
"validate": "npm run validate:json && npm run validate:ts && npm run validate:format && npm run validate:lint",
"validate:lint": "eslint",
"validate:json": "node scripts/validate.mjs",
"validate:format": "prettier --check ./src ./scripts",
"validate:ts": "tsc --noemit"
Expand All @@ -33,55 +34,54 @@
"license": "BSD-2-Clause",
"prettier": {},
"devDependencies": {
"@babel/core": "7.25.7",
"@babel/core": "7.26.0",
"@babel/plugin-syntax-dynamic-import": "7.8.3",
"@babel/plugin-transform-class-properties": "7.25.7",
"@babel/plugin-transform-optional-chaining": "7.25.7",
"@babel/plugin-transform-react-jsx": "7.25.7",
"@babel/plugin-transform-react-jsx-source": "7.25.7",
"@babel/preset-env": "7.25.7",
"@babel/preset-typescript": "7.25.7",
"@blueprintjs/core": "5.13.1",
"@blueprintjs/datetime2": "2.3.11",
"@blueprintjs/icons": "5.13.0",
"@blueprintjs/select": "5.2.5",
"@babel/plugin-transform-class-properties": "7.25.9",
"@babel/plugin-transform-optional-chaining": "7.25.9",
"@babel/plugin-transform-react-jsx": "7.25.9",
"@babel/plugin-transform-react-jsx-source": "7.25.9",
"@babel/preset-env": "7.26.0",
"@babel/preset-typescript": "7.26.0",
"@blueprintjs/core": "5.14.0",
"@blueprintjs/datetime2": "2.3.13",
"@blueprintjs/icons": "5.14.0",
"@blueprintjs/select": "5.3.1",
"@blueprintjs/table": "^5.2.2",
"@eslint/js": "^9.14.0",
"@graphql-codegen/cli": "5.0.3",
"@graphql-codegen/client-preset": "4.4.0",
"@lcdp/offline-plugin": "5.1.1",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
"@reduxjs/toolkit": "2.3.0",
"@supabase/supabase-js": "^2.45.4",
"@types/better-sqlite3": "7.6.11",
"@types/eslint__js": "^8.42.3",
"@types/fuzzy-search": "2.1.5",
"@types/inquirer": "9.0.7",
"@types/jsdom": "21.1.7",
"@types/node": "20.16.11",
"@types/node": "22.9.0",
"@types/papaparse": "patch:@types/papaparse@npm%3A5.3.14#~/.yarn/patches/@types-papaparse-npm-5.3.14-864eddd3a0.patch",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^8.2.0",
"@typescript-eslint/parser": "^8.2.0",
"@urql/core": "^5.0.4",
"@urql/exchange-graphcache": "^7.1.2",
"autoprefixer": "10.4.20",
"axios": "1.7.7",
"babel-loader": "9.2.1",
"better-sqlite3": "11.3.0",
"better-sqlite3": "11.5.0",
"cacheable-lookup": "7.0.0",
"canvas": "3.0.0-rc2",
"classnames": "2.5.1",
"clean-webpack-plugin": "4.0.0",
"copy-webpack-plugin": "12.0.2",
"cross-spawn": "7.0.3",
"cross-spawn": "7.0.5",
"css-loader": "7.1.2",
"css-minimizer-webpack-plugin": "7.0.0",
"date-fns": "2.30.0",
"dotenv": "^16.4.5",
"eslint": "^8.57.0",
"eslint": "^9.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-hooks": "^5.0.0",
"favicons": "7.2.0",
"favicons-webpack-plugin": "6.0.1",
"fork-ts-checker-webpack-plugin": "9.0.2",
Expand All @@ -90,51 +90,53 @@
"he": "1.2.0",
"html-entities": "2.5.2",
"html-loader": "5.1.0",
"html-webpack-plugin": "5.6.0",
"html-webpack-plugin": "5.6.3",
"iconv-lite": "0.6.3",
"inquirer": "9.3.7",
"jimp": "0.22.12",
"jotai": "2.10.0",
"jsdom": "24.1.3",
"json-schema-to-typescript": "15.0.2",
"jimp": "1.6.0",
"jotai": "2.10.2",
"jsdom": "25.0.1",
"json-schema-to-typescript": "15.0.3",
"jsonschema": "1.4.1",
"mini-css-extract-plugin": "2.9.1",
"modern-screenshot": "4.4.39",
"nanoid": "5.0.7",
"mini-css-extract-plugin": "2.9.2",
"modern-screenshot": "4.5.4",
"nanoid": "5.0.8",
"normalize.css": "8.0.1",
"p-queue": "8.0.1",
"papaparse": "5.4.1",
"partykit": "0.0.111",
"partysocket": "1.0.1",
"peerjs": "2.0.0-beta.3",
"postcss": "8.4.47",
"postcss": "8.4.49",
"postcss-loader": "8.1.1",
"prettier": "^3.3.3",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-error-boundary": "4.0.13",
"react-intl": "6.7.2",
"react-error-boundary": "4.1.2",
"react-intl": "6.8.7",
"react-redux": "^9.1.2",
"react-refresh": "0.14.2",
"react-router-dom": "^6.24.1",
"sanitize-filename": "1.6.3",
"simfile-parser": "0.7.2",
"style-loader": "4.0.0",
"typescript": "5.6.3",
"undici": "6.19.8",
"typescript-eslint": "^8.14.0",
"undici": "6.20.1",
"urql": "^4.1.0",
"victory": "37.1.2",
"webpack": "5.95.0",
"victory": "37.3.2",
"webpack": "5.96.1",
"webpack-cli": "5.1.4",
"webpack-dev-server": "5.1.0",
"webpack-sources": "3.2.3",
"xml2js": "0.6.2",
"zip-webpack-plugin": "4.0.1",
"zustand": "4.5.5"
"zip-webpack-plugin": "4.0.2",
"zustand": "5.0.1"
},
"resolutions": {
"loader-utils": "^2.0.0",
"semver": "^7.5.2"
"semver": "^7.5.2",
"xml2js": "0.6.2"
},
"packageManager": "[email protected].0"
"packageManager": "[email protected].1"
}
6 changes: 3 additions & 3 deletions scripts/process-images.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Place manually downloaded images into `new-jackets`
* and run this to downscale and post-proccess names
**/
import jimp from "jimp";
import { Jimp, ResizeStrategy } from "jimp";
import { statSync, readdirSync } from "fs";
import { resolve, join, dirname } from "path";

Expand All @@ -17,9 +17,9 @@ function transformFilename(f) {

async function processImg(input, output) {
try {
const img = await jimp.read(input);
const img = await Jimp.read(input);

await img.resize(200, jimp.AUTO).quality(80).writeAsync(output);
await img.resize({ w: 200, mode: ResizeStrategy.BILINEAR }).write(output);

console.log(
`Wrote ${output} (${(statSync(output).size / 1024).toFixed(0)}kb)`,
Expand Down
10 changes: 7 additions & 3 deletions scripts/utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { promises, existsSync } from "fs";
import { resolve, basename, join, dirname } from "path";
import { format } from "prettier";
import PQueue from "p-queue";
import jimp from "jimp";
import { Jimp, ResizeStrategy } from "jimp";
import BottomBar from "inquirer/lib/ui/bottom-bar.js";
import sanitize from "sanitize-filename";

Expand Down Expand Up @@ -117,6 +117,8 @@ function getOutputPath(coverUrl, localFilename) {
);
const outputPath = join(dirname(localFilename), sanitizedFilename);
return {
/** @type {"someFilePath.jpg"} */
// @ts-ignore
absolute: join(JACKETS_PATH, outputPath),
relative: outputPath.replace(/\\/g, "/"),
};
Expand All @@ -137,12 +139,14 @@ export function downloadJacket(coverUrl, localFilename = undefined) {
.add(
() => {
console.log("fetching", coverUrl);
return jimp.read(coverUrl);
return Jimp.read(coverUrl);
},
{ throwOnTimeout: true },
)
.then((img) =>
img.resize(128, jimp.AUTO).quality(80).writeAsync(absolute),
img
.resize({ w: 128, mode: ResizeStrategy.BILINEAR })
.write(absolute, { quality: 80 }),
)
.catch((e) => {
console.error("image download failure for", coverUrl);
Expand Down
Binary file added src/assets/jackets/smx/LoveToxic.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/jackets/smx/Lunatic.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/jackets/smx/ParallelUniverse.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/jackets/smx/Paranoid.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/jackets/smx/Sengoku.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion src/controls/input-button-pair.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ interface Props {
export function InputButtonPair({ onClick, ...props }: Props) {
const inputRef = useRef<HTMLInputElement>(null);
const handleClick = useCallback(() => {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const el = inputRef.current!;
console.log(el);
return onClick(el.value, el);
Expand Down
3 changes: 2 additions & 1 deletion src/song-card/song-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,9 @@ export function SongCard(props: Props) {
<SongSearch
isOpen={pocketPickPendingForPlayer !== null}
onSongSelect={(song, chart) => {
if (actionsEnabled && chart)
if (actionsEnabled && chart) {
iconCallbacks.onReplace(pocketPickPendingForPlayer!, chart);
}
setPocketPickPendingForPlayer(null);
}}
onCancel={() => setPocketPickPendingForPlayer(null)}
Expand Down
Loading

0 comments on commit 4fa3946

Please sign in to comment.