[READ-ONLY] Mirror of https://github.com/FoxxMD/multi-scrobbler. Scrobble plays from multiple sources to multiple clients docs.multi-scrobbler.app
deezer docker jellyfin koito lastfm listenbrainz maloja mopidy mpris music music-assistant plex scrobble self-hosted spotify subsonic tautulli youtube-music
0

Configure Feed

Select the types of activity you want to include in your feed.

refactor: Replace jsondiffpatch-react with @pierre/diffs

Good ridance.

FoxxMD (May 30, 2026, 8:02 PM UTC) 004400d7 d54e169a

+236 -239
+152 -164
package-lock.json
··· 26 26 "@kenyip/backoff-strategies": "^1.0.4", 27 27 "@keyv/valkey": "^1.0.8", 28 28 "@lukehagar/plexjs": "^0.39.0", 29 + "@pierre/diffs": "^1.2.4", 29 30 "@supercharge/promise-pool": "^3.0.0", 30 31 "@svrooij/sonos": "^2.5.0", 31 32 "@xhayper/discord-rpc": "^1.3.0", ··· 152 153 "eslint-plugin-prefer-arrow-functions": "^3.2.4", 153 154 "eslint-plugin-storybook": "^10.3.6", 154 155 "git-cliff": "^2.12.0", 155 - "jsondiffpatch-react": "^1.0.8", 156 156 "mocha": "^10.3.0", 157 157 "mockdate": "^3.0.5", 158 158 "msw": "^2.12.10", ··· 2990 2990 "url": "https://opencollective.com/parcel" 2991 2991 } 2992 2992 }, 2993 + "node_modules/@pierre/diffs": { 2994 + "version": "1.2.4", 2995 + "resolved": "https://registry.npmjs.org/@pierre/diffs/-/diffs-1.2.4.tgz", 2996 + "integrity": "sha512-SEuYxGpSCHVvfoLly/Q/OYpJSBLWaVLV3M3wI/VBW7aZmzYenNe4aXjOf5sIKJMWW5gbZe9WdLvtKUt6cQ1k1A==", 2997 + "license": "apache-2.0", 2998 + "dependencies": { 2999 + "@pierre/theme": "1.0.3", 3000 + "@shikijs/transformers": "^3.0.0", 3001 + "diff": "8.0.3", 3002 + "hast-util-to-html": "9.0.5", 3003 + "lru_map": "0.4.1", 3004 + "shiki": "^3.0.0" 3005 + }, 3006 + "peerDependencies": { 3007 + "react": "^18.3.1 || ^19.0.0", 3008 + "react-dom": "^18.3.1 || ^19.0.0" 3009 + } 3010 + }, 3011 + "node_modules/@pierre/diffs/node_modules/@shikijs/core": { 3012 + "version": "3.23.0", 3013 + "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-3.23.0.tgz", 3014 + "integrity": "sha512-NSWQz0riNb67xthdm5br6lAkvpDJRTgB36fxlo37ZzM2yq0PQFFzbd8psqC2XMPgCzo1fW6cVi18+ArJ44wqgA==", 3015 + "license": "MIT", 3016 + "dependencies": { 3017 + "@shikijs/types": "3.23.0", 3018 + "@shikijs/vscode-textmate": "^10.0.2", 3019 + "@types/hast": "^3.0.4", 3020 + "hast-util-to-html": "^9.0.5" 3021 + } 3022 + }, 3023 + "node_modules/@pierre/diffs/node_modules/@shikijs/engine-javascript": { 3024 + "version": "3.23.0", 3025 + "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-3.23.0.tgz", 3026 + "integrity": "sha512-aHt9eiGFobmWR5uqJUViySI1bHMqrAgamWE1TYSUoftkAeCCAiGawPMwM+VCadylQtF4V3VNOZ5LmfItH5f3yA==", 3027 + "license": "MIT", 3028 + "dependencies": { 3029 + "@shikijs/types": "3.23.0", 3030 + "@shikijs/vscode-textmate": "^10.0.2", 3031 + "oniguruma-to-es": "^4.3.4" 3032 + } 3033 + }, 3034 + "node_modules/@pierre/diffs/node_modules/@shikijs/engine-oniguruma": { 3035 + "version": "3.23.0", 3036 + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-3.23.0.tgz", 3037 + "integrity": "sha512-1nWINwKXxKKLqPibT5f4pAFLej9oZzQTsby8942OTlsJzOBZ0MWKiwzMsd+jhzu8YPCHAswGnnN1YtQfirL35g==", 3038 + "license": "MIT", 3039 + "dependencies": { 3040 + "@shikijs/types": "3.23.0", 3041 + "@shikijs/vscode-textmate": "^10.0.2" 3042 + } 3043 + }, 3044 + "node_modules/@pierre/diffs/node_modules/@shikijs/langs": { 3045 + "version": "3.23.0", 3046 + "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-3.23.0.tgz", 3047 + "integrity": "sha512-2Ep4W3Re5aB1/62RSYQInK9mM3HsLeB91cHqznAJMuylqjzNVAVCMnNWRHFtcNHXsoNRayP9z1qj4Sq3nMqYXg==", 3048 + "license": "MIT", 3049 + "dependencies": { 3050 + "@shikijs/types": "3.23.0" 3051 + } 3052 + }, 3053 + "node_modules/@pierre/diffs/node_modules/@shikijs/themes": { 3054 + "version": "3.23.0", 3055 + "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-3.23.0.tgz", 3056 + "integrity": "sha512-5qySYa1ZgAT18HR/ypENL9cUSGOeI2x+4IvYJu4JgVJdizn6kG4ia5Q1jDEOi7gTbN4RbuYtmHh0W3eccOrjMA==", 3057 + "license": "MIT", 3058 + "dependencies": { 3059 + "@shikijs/types": "3.23.0" 3060 + } 3061 + }, 3062 + "node_modules/@pierre/diffs/node_modules/@shikijs/types": { 3063 + "version": "3.23.0", 3064 + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-3.23.0.tgz", 3065 + "integrity": "sha512-3JZ5HXOZfYjsYSk0yPwBrkupyYSLpAE26Qc0HLghhZNGTZg/SKxXIIgoxOpmmeQP0RRSDJTk1/vPfw9tbw+jSQ==", 3066 + "license": "MIT", 3067 + "dependencies": { 3068 + "@shikijs/vscode-textmate": "^10.0.2", 3069 + "@types/hast": "^3.0.4" 3070 + } 3071 + }, 3072 + "node_modules/@pierre/diffs/node_modules/diff": { 3073 + "version": "8.0.3", 3074 + "resolved": "https://registry.npmjs.org/diff/-/diff-8.0.3.tgz", 3075 + "integrity": "sha512-qejHi7bcSD4hQAZE0tNAawRK1ZtafHDmMTMkrrIGgSLl7hTnQHmKCeB45xAcbfTqK2zowkM3j3bHt/4b/ARbYQ==", 3076 + "license": "BSD-3-Clause", 3077 + "engines": { 3078 + "node": ">=0.3.1" 3079 + } 3080 + }, 3081 + "node_modules/@pierre/diffs/node_modules/shiki": { 3082 + "version": "3.23.0", 3083 + "resolved": "https://registry.npmjs.org/shiki/-/shiki-3.23.0.tgz", 3084 + "integrity": "sha512-55Dj73uq9ZXL5zyeRPzHQsK7Nbyt6Y10k5s7OjuFZGMhpp4r/rsLBH0o/0fstIzX1Lep9VxefWljK/SKCzygIA==", 3085 + "license": "MIT", 3086 + "dependencies": { 3087 + "@shikijs/core": "3.23.0", 3088 + "@shikijs/engine-javascript": "3.23.0", 3089 + "@shikijs/engine-oniguruma": "3.23.0", 3090 + "@shikijs/langs": "3.23.0", 3091 + "@shikijs/themes": "3.23.0", 3092 + "@shikijs/types": "3.23.0", 3093 + "@shikijs/vscode-textmate": "^10.0.2", 3094 + "@types/hast": "^3.0.4" 3095 + } 3096 + }, 3097 + "node_modules/@pierre/theme": { 3098 + "version": "1.0.3", 3099 + "resolved": "https://registry.npmjs.org/@pierre/theme/-/theme-1.0.3.tgz", 3100 + "integrity": "sha512-sWHv11TMoqKxKDgTIk5VbhQjdPhs8DCcBxbjh3mRlS3YOM/OcrWoGX6MM8eBGn9cUu3M46Py0JnxsG2nJaFTuA==", 3101 + "license": "MIT", 3102 + "engines": { 3103 + "vscode": "^1.0.0" 3104 + } 3105 + }, 2993 3106 "node_modules/@pkgjs/parseargs": { 2994 3107 "version": "0.11.0", 2995 3108 "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", ··· 3528 3641 "node": ">=20" 3529 3642 } 3530 3643 }, 3644 + "node_modules/@shikijs/transformers": { 3645 + "version": "3.23.0", 3646 + "resolved": "https://registry.npmjs.org/@shikijs/transformers/-/transformers-3.23.0.tgz", 3647 + "integrity": "sha512-F9msZVxdF+krQNSdQ4V+Ja5QemeAoTQ2jxt7nJCwhDsdF1JWS3KxIQXA3lQbyKwS3J61oHRUSv4jYWv3CkaKTQ==", 3648 + "license": "MIT", 3649 + "dependencies": { 3650 + "@shikijs/core": "3.23.0", 3651 + "@shikijs/types": "3.23.0" 3652 + } 3653 + }, 3654 + "node_modules/@shikijs/transformers/node_modules/@shikijs/core": { 3655 + "version": "3.23.0", 3656 + "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-3.23.0.tgz", 3657 + "integrity": "sha512-NSWQz0riNb67xthdm5br6lAkvpDJRTgB36fxlo37ZzM2yq0PQFFzbd8psqC2XMPgCzo1fW6cVi18+ArJ44wqgA==", 3658 + "license": "MIT", 3659 + "dependencies": { 3660 + "@shikijs/types": "3.23.0", 3661 + "@shikijs/vscode-textmate": "^10.0.2", 3662 + "@types/hast": "^3.0.4", 3663 + "hast-util-to-html": "^9.0.5" 3664 + } 3665 + }, 3666 + "node_modules/@shikijs/transformers/node_modules/@shikijs/types": { 3667 + "version": "3.23.0", 3668 + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-3.23.0.tgz", 3669 + "integrity": "sha512-3JZ5HXOZfYjsYSk0yPwBrkupyYSLpAE26Qc0HLghhZNGTZg/SKxXIIgoxOpmmeQP0RRSDJTk1/vPfw9tbw+jSQ==", 3670 + "license": "MIT", 3671 + "dependencies": { 3672 + "@shikijs/vscode-textmate": "^10.0.2", 3673 + "@types/hast": "^3.0.4" 3674 + } 3675 + }, 3531 3676 "node_modules/@shikijs/types": { 3532 3677 "version": "4.0.2", 3533 3678 "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-4.0.2.tgz", ··· 3546 3691 "version": "10.0.2", 3547 3692 "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.0.2.tgz", 3548 3693 "integrity": "sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==", 3549 - "dev": true, 3550 3694 "license": "MIT" 3551 3695 }, 3552 3696 "node_modules/@sindresorhus/is": { ··· 4685 4829 "version": "3.0.4", 4686 4830 "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", 4687 4831 "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", 4688 - "dev": true, 4689 4832 "license": "MIT", 4690 4833 "dependencies": { 4691 4834 "@types/unist": "*" ··· 4761 4904 "version": "4.0.4", 4762 4905 "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", 4763 4906 "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", 4764 - "dev": true, 4765 4907 "license": "MIT", 4766 4908 "dependencies": { 4767 4909 "@types/unist": "*" ··· 4974 5116 "version": "3.0.3", 4975 5117 "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", 4976 5118 "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", 4977 - "dev": true, 4978 5119 "license": "MIT" 4979 5120 }, 4980 5121 "node_modules/@types/use-sync-external-store": { ··· 5302 5443 "version": "1.2.0", 5303 5444 "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", 5304 5445 "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", 5305 - "dev": true, 5306 5446 "license": "ISC" 5307 5447 }, 5308 5448 "node_modules/@vitejs/plugin-react": { ··· 7325 7465 "version": "2.0.1", 7326 7466 "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", 7327 7467 "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", 7328 - "dev": true, 7329 7468 "license": "MIT", 7330 7469 "funding": { 7331 7470 "type": "github", ··· 7403 7542 "version": "2.1.0", 7404 7543 "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", 7405 7544 "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", 7406 - "dev": true, 7407 7545 "license": "MIT", 7408 7546 "funding": { 7409 7547 "type": "github", ··· 7414 7552 "version": "3.0.0", 7415 7553 "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", 7416 7554 "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", 7417 - "dev": true, 7418 7555 "license": "MIT", 7419 7556 "funding": { 7420 7557 "type": "github", ··· 7668 7805 "version": "2.0.3", 7669 7806 "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", 7670 7807 "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", 7671 - "dev": true, 7672 7808 "license": "MIT", 7673 7809 "funding": { 7674 7810 "type": "github", ··· 8079 8215 "version": "2.0.3", 8080 8216 "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", 8081 8217 "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", 8082 - "dev": true, 8083 8218 "license": "MIT", 8084 8219 "engines": { 8085 8220 "node": ">=6" ··· 8113 8248 "version": "1.1.0", 8114 8249 "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", 8115 8250 "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", 8116 - "dev": true, 8117 8251 "license": "MIT", 8118 8252 "dependencies": { 8119 8253 "dequal": "^2.0.0" ··· 8159 8293 "node": ">=0.3.1" 8160 8294 } 8161 8295 }, 8162 - "node_modules/diff-match-patch": { 8163 - "version": "1.0.5", 8164 - "resolved": "https://registry.npmjs.org/diff-match-patch/-/diff-match-patch-1.0.5.tgz", 8165 - "integrity": "sha512-IayShXAgj/QMXgB0IWmKx+rOPuGMhqm5w6jvFxmVenXKIzRqTAAsbBPT3kWQeGANj3jGgvcvv4yK6SxqYmikgw==", 8166 - "dev": true, 8167 - "license": "Apache-2.0" 8168 - }, 8169 8296 "node_modules/diff-sequences": { 8170 8297 "version": "27.5.1", 8171 8298 "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-27.5.1.tgz", ··· 10627 10754 "version": "9.0.5", 10628 10755 "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.5.tgz", 10629 10756 "integrity": "sha512-OguPdidb+fbHQSU4Q4ZiLKnzWo8Wwsf5bZfbvu7//a9oTYoqD/fWpe96NuHkoS9h0ccGOTe0C4NGXdtS0iObOw==", 10630 - "dev": true, 10631 10757 "license": "MIT", 10632 10758 "dependencies": { 10633 10759 "@types/hast": "^3.0.0", ··· 10651 10777 "version": "3.0.0", 10652 10778 "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", 10653 10779 "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", 10654 - "dev": true, 10655 10780 "license": "MIT", 10656 10781 "dependencies": { 10657 10782 "@types/hast": "^3.0.0" ··· 10727 10852 "version": "3.0.0", 10728 10853 "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz", 10729 10854 "integrity": "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==", 10730 - "dev": true, 10731 10855 "license": "MIT", 10732 10856 "funding": { 10733 10857 "type": "github", ··· 11548 11672 "node": "^18.0.0 || >=20.0.0" 11549 11673 } 11550 11674 }, 11551 - "node_modules/jsondiffpatch-react": { 11552 - "version": "1.0.8", 11553 - "resolved": "https://registry.npmjs.org/jsondiffpatch-react/-/jsondiffpatch-react-1.0.8.tgz", 11554 - "integrity": "sha512-dbipCQLrCsIN3w1+F+AtIaU9CmcTzfeHQ74QqUW0qZHITpi6F2P5580TB2u1A943Wyod8+09NSxxDjy5gFnXzw==", 11555 - "dev": true, 11556 - "license": "MIT", 11557 - "dependencies": { 11558 - "jsondiffpatch": "^0.4.1", 11559 - "yarn.lock": "^0.0.1-security" 11560 - }, 11561 - "peerDependencies": { 11562 - "react": "^16.8 || ^17 || ^18", 11563 - "react-dom": "^16.8 || ^17 || ^18" 11564 - } 11565 - }, 11566 - "node_modules/jsondiffpatch-react/node_modules/ansi-styles": { 11567 - "version": "3.2.1", 11568 - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 11569 - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 11570 - "dev": true, 11571 - "license": "MIT", 11572 - "dependencies": { 11573 - "color-convert": "^1.9.0" 11574 - }, 11575 - "engines": { 11576 - "node": ">=4" 11577 - } 11578 - }, 11579 - "node_modules/jsondiffpatch-react/node_modules/chalk": { 11580 - "version": "2.4.2", 11581 - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", 11582 - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", 11583 - "dev": true, 11584 - "license": "MIT", 11585 - "dependencies": { 11586 - "ansi-styles": "^3.2.1", 11587 - "escape-string-regexp": "^1.0.5", 11588 - "supports-color": "^5.3.0" 11589 - }, 11590 - "engines": { 11591 - "node": ">=4" 11592 - } 11593 - }, 11594 - "node_modules/jsondiffpatch-react/node_modules/color-convert": { 11595 - "version": "1.9.3", 11596 - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", 11597 - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", 11598 - "dev": true, 11599 - "license": "MIT", 11600 - "dependencies": { 11601 - "color-name": "1.1.3" 11602 - } 11603 - }, 11604 - "node_modules/jsondiffpatch-react/node_modules/color-name": { 11605 - "version": "1.1.3", 11606 - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", 11607 - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", 11608 - "dev": true, 11609 - "license": "MIT" 11610 - }, 11611 - "node_modules/jsondiffpatch-react/node_modules/escape-string-regexp": { 11612 - "version": "1.0.5", 11613 - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 11614 - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", 11615 - "dev": true, 11616 - "license": "MIT", 11617 - "engines": { 11618 - "node": ">=0.8.0" 11619 - } 11620 - }, 11621 - "node_modules/jsondiffpatch-react/node_modules/has-flag": { 11622 - "version": "3.0.0", 11623 - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 11624 - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", 11625 - "dev": true, 11626 - "license": "MIT", 11627 - "engines": { 11628 - "node": ">=4" 11629 - } 11630 - }, 11631 - "node_modules/jsondiffpatch-react/node_modules/jsondiffpatch": { 11632 - "version": "0.4.1", 11633 - "resolved": "https://registry.npmjs.org/jsondiffpatch/-/jsondiffpatch-0.4.1.tgz", 11634 - "integrity": "sha512-t0etAxTUk1w5MYdNOkZBZ8rvYYN5iL+2dHCCx/DpkFm/bW28M6y5nUS83D4XdZiHy35Fpaw6LBb+F88fHZnVCw==", 11635 - "dev": true, 11636 - "license": "MIT", 11637 - "dependencies": { 11638 - "chalk": "^2.3.0", 11639 - "diff-match-patch": "^1.0.0" 11640 - }, 11641 - "bin": { 11642 - "jsondiffpatch": "bin/jsondiffpatch" 11643 - }, 11644 - "engines": { 11645 - "node": ">=8.17.0" 11646 - } 11647 - }, 11648 - "node_modules/jsondiffpatch-react/node_modules/supports-color": { 11649 - "version": "5.5.0", 11650 - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 11651 - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 11652 - "dev": true, 11653 - "license": "MIT", 11654 - "dependencies": { 11655 - "has-flag": "^3.0.0" 11656 - }, 11657 - "engines": { 11658 - "node": ">=4" 11659 - } 11660 - }, 11661 11675 "node_modules/jsonfile": { 11662 11676 "version": "6.1.0", 11663 11677 "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", ··· 12188 12202 "node": ">=8" 12189 12203 } 12190 12204 }, 12205 + "node_modules/lru_map": { 12206 + "version": "0.4.1", 12207 + "resolved": "https://registry.npmjs.org/lru_map/-/lru_map-0.4.1.tgz", 12208 + "integrity": "sha512-I+lBvqMMFfqaV8CJCISjI3wbjmwVu/VyOoU7+qtu9d7ioW5klMgsTTiUOUp+DJvfTTzKXoPbyC6YfgkNcyPSOg==", 12209 + "license": "MIT" 12210 + }, 12191 12211 "node_modules/lru-cache": { 12192 12212 "version": "5.1.1", 12193 12213 "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", ··· 12238 12258 "version": "13.2.1", 12239 12259 "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.1.tgz", 12240 12260 "integrity": "sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA==", 12241 - "dev": true, 12242 12261 "license": "MIT", 12243 12262 "dependencies": { 12244 12263 "@types/hast": "^3.0.0", ··· 12305 12324 "version": "2.1.1", 12306 12325 "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", 12307 12326 "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==", 12308 - "dev": true, 12309 12327 "funding": [ 12310 12328 { 12311 12329 "type": "GitHub Sponsors", ··· 12326 12344 "version": "2.0.1", 12327 12345 "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz", 12328 12346 "integrity": "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==", 12329 - "dev": true, 12330 12347 "funding": [ 12331 12348 { 12332 12349 "type": "GitHub Sponsors", ··· 12343 12360 "version": "2.0.1", 12344 12361 "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz", 12345 12362 "integrity": "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==", 12346 - "dev": true, 12347 12363 "funding": [ 12348 12364 { 12349 12365 "type": "GitHub Sponsors", ··· 12365 12381 "version": "2.0.1", 12366 12382 "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", 12367 12383 "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", 12368 - "dev": true, 12369 12384 "funding": [ 12370 12385 { 12371 12386 "type": "GitHub Sponsors", ··· 12382 12397 "version": "2.0.2", 12383 12398 "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.2.tgz", 12384 12399 "integrity": "sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==", 12385 - "dev": true, 12386 12400 "funding": [ 12387 12401 { 12388 12402 "type": "GitHub Sponsors", ··· 13251 13265 "version": "0.12.1", 13252 13266 "resolved": "https://registry.npmjs.org/oniguruma-parser/-/oniguruma-parser-0.12.1.tgz", 13253 13267 "integrity": "sha512-8Unqkvk1RYc6yq2WBYRj4hdnsAxVze8i7iPfQr8e4uSP3tRv0rpZcbGUDvxfQQcdwHt/e9PrMvGCsa8OqG9X3w==", 13254 - "dev": true, 13255 13268 "license": "MIT" 13256 13269 }, 13257 13270 "node_modules/oniguruma-to-es": { 13258 13271 "version": "4.3.5", 13259 13272 "resolved": "https://registry.npmjs.org/oniguruma-to-es/-/oniguruma-to-es-4.3.5.tgz", 13260 13273 "integrity": "sha512-Zjygswjpsewa0NLTsiizVuMQZbp0MDyM6lIt66OxsF21npUDlzpHi1Mgb/qhQdkb+dWFTzJmFbEWdvZgRho8eQ==", 13261 - "dev": true, 13262 13274 "license": "MIT", 13263 13275 "dependencies": { 13264 13276 "oniguruma-parser": "^0.12.1", ··· 14001 14013 "version": "7.1.0", 14002 14014 "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.1.0.tgz", 14003 14015 "integrity": "sha512-TwEZ+X+yCJmYfL7TPUOcvBZ4QfoT5YenQiJuX//0th53DE6w0xxLEtfK3iyryQFddXuvkIk51EEgrJQ0WJkOmQ==", 14004 - "dev": true, 14005 14016 "license": "MIT", 14006 14017 "funding": { 14007 14018 "type": "github", ··· 14177 14188 "version": "19.2.6", 14178 14189 "resolved": "https://registry.npmjs.org/react/-/react-19.2.6.tgz", 14179 14190 "integrity": "sha512-sfWGGfavi0xr8Pg0sVsyHMAOziVYKgPLNrS7ig+ivMNb3wbCBw3KxtflsGBAwD3gYQlE/AEZsTLgToRrSCjb0Q==", 14180 - "dev": true, 14181 14191 "license": "MIT", 14182 14192 "engines": { 14183 14193 "node": ">=0.10.0" ··· 14232 14242 "version": "19.2.6", 14233 14243 "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.6.tgz", 14234 14244 "integrity": "sha512-0prMI+hvBbPjsWnxDLxlCGyM8PN6UuWjEUCYmZhO67xIV9Xasa/r/vDnq+Xyq4Lo27g8QSbO5YzARu0D1Sps3g==", 14235 - "dev": true, 14236 14245 "license": "MIT", 14237 14246 "dependencies": { 14238 14247 "scheduler": "^0.27.0" ··· 14496 14505 "version": "6.1.0", 14497 14506 "resolved": "https://registry.npmjs.org/regex/-/regex-6.1.0.tgz", 14498 14507 "integrity": "sha512-6VwtthbV4o/7+OaAF9I5L5V3llLEsoPyq9P1JVXkedTP33c7MfCG0/5NOPcSJn0TzXcG9YUrR0gQSWioew3LDg==", 14499 - "dev": true, 14500 14508 "license": "MIT", 14501 14509 "dependencies": { 14502 14510 "regex-utilities": "^2.3.0" ··· 14506 14514 "version": "6.0.2", 14507 14515 "resolved": "https://registry.npmjs.org/regex-recursion/-/regex-recursion-6.0.2.tgz", 14508 14516 "integrity": "sha512-0YCaSCq2VRIebiaUviZNs0cBz1kg5kVS2UKUfNIx8YVs1cN3AV7NTctO5FOKBA+UT2BPJIWZauYHPqJODG50cg==", 14509 - "dev": true, 14510 14517 "license": "MIT", 14511 14518 "dependencies": { 14512 14519 "regex-utilities": "^2.3.0" ··· 14516 14523 "version": "2.3.0", 14517 14524 "resolved": "https://registry.npmjs.org/regex-utilities/-/regex-utilities-2.3.0.tgz", 14518 14525 "integrity": "sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng==", 14519 - "dev": true, 14520 14526 "license": "MIT" 14521 14527 }, 14522 14528 "node_modules/require-directory": { ··· 14833 14839 "version": "0.27.0", 14834 14840 "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", 14835 14841 "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", 14836 - "dev": true, 14837 14842 "license": "MIT" 14838 14843 }, 14839 14844 "node_modules/secure-json-parse": { ··· 15248 15253 "version": "2.0.2", 15249 15254 "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", 15250 15255 "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", 15251 - "dev": true, 15252 15256 "license": "MIT", 15253 15257 "funding": { 15254 15258 "type": "github", ··· 15538 15542 "version": "4.0.4", 15539 15543 "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz", 15540 15544 "integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==", 15541 - "dev": true, 15542 15545 "license": "MIT", 15543 15546 "dependencies": { 15544 15547 "character-entities-html4": "^2.0.0", ··· 15943 15946 "version": "3.0.1", 15944 15947 "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", 15945 15948 "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", 15946 - "dev": true, 15947 15949 "license": "MIT", 15948 15950 "funding": { 15949 15951 "type": "github", ··· 16441 16443 "version": "6.0.1", 16442 16444 "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.1.tgz", 16443 16445 "integrity": "sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==", 16444 - "dev": true, 16445 16446 "license": "MIT", 16446 16447 "dependencies": { 16447 16448 "@types/unist": "^3.0.0" ··· 16455 16456 "version": "5.0.0", 16456 16457 "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", 16457 16458 "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", 16458 - "dev": true, 16459 16459 "license": "MIT", 16460 16460 "dependencies": { 16461 16461 "@types/unist": "^3.0.0" ··· 16469 16469 "version": "4.0.0", 16470 16470 "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", 16471 16471 "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", 16472 - "dev": true, 16473 16472 "license": "MIT", 16474 16473 "dependencies": { 16475 16474 "@types/unist": "^3.0.0" ··· 16483 16482 "version": "5.1.0", 16484 16483 "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.1.0.tgz", 16485 16484 "integrity": "sha512-m+vIdyeCOpdr/QeQCu2EzxX/ohgS8KbnPDgFni4dQsfSCtpz8UqDyY5GjRru8PDKuYn7Fq19j1CQ+nJSsGKOzg==", 16486 - "dev": true, 16487 16485 "license": "MIT", 16488 16486 "dependencies": { 16489 16487 "@types/unist": "^3.0.0", ··· 16499 16497 "version": "6.0.2", 16500 16498 "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.2.tgz", 16501 16499 "integrity": "sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ==", 16502 - "dev": true, 16503 16500 "license": "MIT", 16504 16501 "dependencies": { 16505 16502 "@types/unist": "^3.0.0", ··· 16683 16680 "version": "6.0.3", 16684 16681 "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", 16685 16682 "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", 16686 - "dev": true, 16687 16683 "license": "MIT", 16688 16684 "dependencies": { 16689 16685 "@types/unist": "^3.0.0", ··· 16698 16694 "version": "4.0.3", 16699 16695 "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.3.tgz", 16700 16696 "integrity": "sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw==", 16701 - "dev": true, 16702 16697 "license": "MIT", 16703 16698 "dependencies": { 16704 16699 "@types/unist": "^3.0.0", ··· 17205 17200 "node": ">=8" 17206 17201 } 17207 17202 }, 17208 - "node_modules/yarn.lock": { 17209 - "version": "0.0.1-security", 17210 - "resolved": "https://registry.npmjs.org/yarn.lock/-/yarn.lock-0.0.1-security.tgz", 17211 - "integrity": "sha512-ZRX6v5zGCJMI1T2aO+BQxJggy1vvorXEwonQhWXIC+brO7lkDB3zWelVNAti183ddH6FmJP8z4UDCJnJlioK4Q==", 17212 - "dev": true 17213 - }, 17214 17203 "node_modules/yocto-queue": { 17215 17204 "version": "0.1.0", 17216 17205 "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", ··· 17298 17287 "version": "2.0.4", 17299 17288 "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", 17300 17289 "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", 17301 - "dev": true, 17302 17290 "license": "MIT", 17303 17291 "funding": { 17304 17292 "type": "github",
+1 -5
package.json
··· 64 64 "@kenyip/backoff-strategies": "^1.0.4", 65 65 "@keyv/valkey": "^1.0.8", 66 66 "@lukehagar/plexjs": "^0.39.0", 67 + "@pierre/diffs": "^1.2.4", 67 68 "@supercharge/promise-pool": "^3.0.0", 68 69 "@svrooij/sonos": "^2.5.0", 69 70 "@xhayper/discord-rpc": "^1.3.0", ··· 190 191 "eslint-plugin-prefer-arrow-functions": "^3.2.4", 191 192 "eslint-plugin-storybook": "^10.3.6", 192 193 "git-cliff": "^2.12.0", 193 - "jsondiffpatch-react": "^1.0.8", 194 194 "mocha": "^10.3.0", 195 195 "mockdate": "^3.0.5", 196 196 "msw": "^2.12.10", ··· 234 234 }, 235 235 "musicbrainz-api": { 236 236 "rate-limit-threshold": "0.2.1" 237 - }, 238 - "jsondiffpatch-react": { 239 - "react": "$react", 240 - "react-dom": "$react-dom" 241 237 } 242 238 } 243 239 }
-17
src/client/components/JsonDiff.css
··· 1 - .jsondiffpatch-added .jsondiffpatch-property-name, 2 - .jsondiffpatch-added .jsondiffpatch-value pre, 3 - .jsondiffpatch-modified .jsondiffpatch-right-value pre, 4 - .jsondiffpatch-textdiff-added { 5 - background: #0e2e1b; 6 - } 7 - 8 - .jsondiffpatch-deleted .jsondiffpatch-property-name, 9 - .jsondiffpatch-deleted pre, 10 - .jsondiffpatch-modified .jsondiffpatch-left-value pre, 11 - .jsondiffpatch-textdiff-deleted { 12 - background: #371516 ; 13 - } 14 - 15 - /* .jsondiffpatch-delta, .jsondiffpatch-delta ul { 16 - padding: 0 0 0 0; 17 - } */
-43
src/client/components/JsonDiff.tsx
··· 1 - import React, { ComponentProps } from 'react'; 2 - import JsonDiffReact from 'jsondiffpatch-react'; 3 - import { MSErrorBoundary } from './ErrorBoundary'; 4 - import { MarkOptional } from 'ts-essentials'; 5 - import { patchObject } from '../../core/DataUtils'; 6 - import './JsonDiff.css'; 7 - import { Changeset } from 'json-diff-ts'; 8 - 9 - type DiffableVal = [] | object | string; 10 - 11 - export interface JsonDiffReactProps { 12 - right: DiffableVal, 13 - left: DiffableVal 14 - show?: boolean, 15 - annotated?: boolean, 16 - tips?: any, 17 - objectHash?: CallableFunction, 18 - } 19 - 20 - export type JsonDiffPatchProps = MarkOptional<JsonDiffReactProps, 'right'> & { 21 - diff?: Changeset 22 - } 23 - 24 - export const JsonDiffPatch = (props: JsonDiffPatchProps) => { 25 - const { 26 - right, 27 - left, 28 - diff, 29 - ...rest 30 - } = props; 31 - const detachedLeft = JSON.parse(JSON.stringify(left)); 32 - let realRight: DiffableVal; 33 - if (right !== undefined) { 34 - realRight = structuredClone(right); 35 - } else if (diff !== undefined) { 36 - realRight = patchObject(left, diff); 37 - } else { 38 - throw new Error(`must provide either 'right' or 'diff'`); 39 - } 40 - return <MSErrorBoundary> 41 - <JsonDiffReact {...rest} left={detachedLeft} right={realRight} /> 42 - </MSErrorBoundary> 43 - };
-1
src/client/components/MSCollapsible.tsx
··· 1 1 import { Collapsible, Stack, Box, useBreakpointValue } from "@chakra-ui/react" 2 - import { diff } from "jsondiffpatch"; 3 2 import { ComponentProps, PropsWithChildren, useState, useEffect, useMemo } from "react"; 4 3 import { LuChevronRight } from "react-icons/lu" 5 4
-1
src/client/components/ScrobbleActionResult.tsx
··· 8 8 import { HiOutlineCloudUpload, HiOutlineCloudDownload } from "react-icons/hi"; 9 9 import { LuCheck, LuCircleX, LuX } from "react-icons/lu"; 10 10 import { ChakraCodeBlockShort, ChakraPlainBlock, ChakraPlainBlockShort } from "./CodeBlock"; 11 - import { JsonDiffPatch } from "./JsonDiff"; 12 11 import { formatNumber, jdiff } from "../../core/DataUtils"; 13 12 import { capitalize } from "../../core/StringUtils"; 14 13 import { MSCollapsible, MSCollapsibleExternalProps } from "./MSCollapsible";
-1
src/client/components/ScrobbleMatchResult.tsx
··· 7 7 import { IoMusicalNoteOutline } from "react-icons/io5"; 8 8 import { LuCheck, LuCircleX, LuX } from "react-icons/lu"; 9 9 import { ChakraCodeBlockShort, ChakraPlainBlock, ChakraPlainBlockShort } from "./CodeBlock"; 10 - import { JsonDiffPatch } from "./JsonDiff"; 11 10 import { formatNumber, jdiff } from "../../core/DataUtils"; 12 11 13 12 export interface ScrobbleMatchResultProps {
+3 -5
src/client/components/TransformSteps.tsx
··· 8 8 import { BsExclamationTriangle, BsExclamationOctagon } from "react-icons/bs"; 9 9 import { MdMusicNote } from "react-icons/md"; 10 10 import { ChakraCodeBlockShort, ChakraPlainBlockShort } from "./CodeBlock"; 11 - import { JsonDiffPatch } from "./JsonDiff"; 12 - import { jdiff, patchObject } from "../../core/DataUtils"; 11 + import { patchObject } from "../../core/DataUtils"; 13 12 import { MSCollapsible, MSCollapsibleExternalProps } from "./MSCollapsible"; 14 13 import { Muted } from "./Typography"; 14 + import { JsonDiffPatch } from "./diffs/JsonDiff"; 15 15 16 16 export interface LifeycleStepsTimelineProps extends MSCollapsibleExternalProps { 17 17 steps: LifecycleStep[] ··· 63 63 try { 64 64 currentPlay.data = patchObject(currentPlay.data, patch)// jdiff.patch(currentPlay, patch) as JsonPlayObject; 65 65 diffElements.push( 66 - <ChakraPlainBlockShort title="Play Diff" key={`diffblock-${index}`} code={left.data}> 67 - <JsonDiffPatch key={`diff-${index}`} left={left.data} right={currentPlay.data} /> 68 - </ChakraPlainBlockShort> 66 + <JsonDiffPatch left={left.data} right={currentPlay.data}/> 69 67 ) 70 68 } catch (e) { 71 69 diffElements.push(<Fragment><ErrorAlert error={e} /><ChakraCodeBlockShort title="Diff Patch" key={`diffblockfallback-${index}`} code={patch} /></Fragment>);
+80
src/client/components/diffs/JsonDiff.tsx
··· 1 + import React, { ComponentProps } from 'react'; 2 + import { 3 + parseDiffFromFile, 4 + type FileContents 5 + } from '@pierre/diffs'; 6 + import { 7 + type FileDiffMetadata, 8 + type FileDiffProps, 9 + FileDiff, 10 + } from '@pierre/diffs/react'; 11 + import { MarkRequired } from 'ts-essentials'; 12 + import { Changeset } from 'json-diff-ts'; 13 + import { MSErrorBoundary } from '../ErrorBoundary'; 14 + import { patchObject } from "../../../core/DataUtils"; 15 + 16 + type DiffableVal = [] | object | string; 17 + 18 + interface JsonDiffOptionalProps { 19 + right?: DiffableVal, 20 + left: DiffableVal 21 + diff?: Changeset 22 + diffOpts?: FileDiffProps<undefined> 23 + } 24 + 25 + export type JsonDiffProps = MarkRequired<JsonDiffOptionalProps, 'diff'> | MarkRequired<JsonDiffOptionalProps, 'right'> 26 + 27 + const JsonDiffPatchComponent = (props: JsonDiffProps) => { 28 + const { 29 + right: rightVal, 30 + left, 31 + diff, 32 + diffOpts = {}, 33 + } = props; 34 + 35 + if(rightVal === undefined && diff === undefined) { 36 + throw new Error(`Must provide either 'right' or 'diff' props`); 37 + } 38 + 39 + let right = rightVal; 40 + if(right === undefined) { 41 + right = patchObject(structuredClone(left), diff); 42 + } 43 + 44 + const fileDiff: FileDiffMetadata = parseDiffFromFile(valToFileContents(left), valToFileContents(right)); 45 + return <FileDiff 46 + // Required: pre-parsed FileDiffMetadata 47 + fileDiff={fileDiff} 48 + options={{ 49 + theme: { dark: 'github-dark', light: 'github-light' }, 50 + diffStyle: 'unified', 51 + themeType: 'system', 52 + lineDiffType: 'word-alt', 53 + disableFileHeader: true, 54 + disableLineNumbers: true, 55 + ...diffOpts 56 + }} 57 + /> 58 + } 59 + 60 + export const JsonDiffPatch = (props: JsonDiffProps) => <MSErrorBoundary><JsonDiffPatchComponent {...props}/></MSErrorBoundary> 61 + 62 + const valToFileContents = (val: DiffableVal, fileContentOpts: Partial<FileContents> = {}): FileContents => { 63 + let strContent: string; 64 + const { 65 + name = 'Content' 66 + } = fileContentOpts; 67 + let fileName: string = name; 68 + let lang: FileContents['lang']; 69 + if(typeof val === 'string') { 70 + strContent = val; 71 + } else { 72 + strContent = JSON.stringify(val, undefined, 2); 73 + lang = 'json'; 74 + } 75 + return { 76 + name: fileName, 77 + lang, 78 + contents: strContent 79 + }; 80 + }
src/client/components/diffs/PlayDiff.tsx

This is a binary file and will not be displayed.

-1
src/client/recent/RecentPage.tsx
··· 8 8 import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; 9 9 import { useCopyToClipboard } from '../components/copyToClipboardHook'; 10 10 import clsx from "clsx"; 11 - import {patch} from 'jsondiffpatch'; 12 11 13 12 const displayOpts = { 14 13 include: recentIncludes,
-1
src/core/Atomic.ts
··· 2 2 import { Dayjs } from "dayjs"; 3 3 import { ListenProgress } from "../backend/sources/PlayerState/ListenProgress.js"; 4 4 import { AdditionalTrackInfoResponse } from "../backend/common/vendor/listenbrainz/interfaces.js"; 5 - import { Delta } from 'jsondiffpatch'; 6 5 import { MarkOptional } from "ts-essentials"; 7 6 import { ErrorObject } from "serialize-error"; 8 7 import { PlayPlatformIdStr } from "../backend/common/infrastructure/Atomic.js";