mirror of
https://git.unlock-music.dev/um/um-react.git
synced 2025-05-23 16:27:41 +08:00
fix: build/test issue
This commit is contained in:
parent
13c669b4ea
commit
246ba48135
@ -1,11 +1,23 @@
|
|||||||
diff --git a/dist/sql-wasm.js b/dist/sql-wasm.js
|
diff --git a/dist/sql-wasm.js b/dist/sql-wasm.js
|
||||||
index b16cee5c3cbdf523f9beae920258094ae7fcbd0f..ae67be7145625c60995c5044860e87d6144a8837 100644
|
index 6ef6c1f54a368431b22dea4da123f1341b4a1780..8dd8a53cefa7779f0556eb1038be35ad547beabb 100644
|
||||||
--- a/dist/sql-wasm.js
|
--- a/dist/sql-wasm.js
|
||||||
+++ b/dist/sql-wasm.js
|
+++ b/dist/sql-wasm.js
|
||||||
@@ -187,3 +187,6 @@ else if (typeof define === 'function' && define['amd']) {
|
@@ -173,16 +173,5 @@ if(0<K)Sa=Yc;else{if(f.preRun)for("function"==typeof f.preRun&&(f.preRun=[f.preR
|
||||||
else if (typeof exports === 'object'){
|
return initSqlJsPromise;
|
||||||
exports["Module"] = initSqlJs;
|
} // The end of our initSqlJs function
|
||||||
}
|
|
||||||
+
|
-// This bit below is copied almost exactly from what you get when you use the MODULARIZE=1 flag with emcc
|
||||||
|
-// However, we don't want to use the emcc modularization. See shell-pre.js
|
||||||
|
-if (typeof exports === 'object' && typeof module === 'object'){
|
||||||
|
- module.exports = initSqlJs;
|
||||||
|
- // This will allow the module to be used in ES6 or CommonJS
|
||||||
|
- module.exports.default = initSqlJs;
|
||||||
|
-}
|
||||||
|
-else if (typeof define === 'function' && define['amd']) {
|
||||||
|
- define([], function() { return initSqlJs; });
|
||||||
|
-}
|
||||||
|
-else if (typeof exports === 'object'){
|
||||||
|
- exports["Module"] = initSqlJs;
|
||||||
|
-}
|
||||||
+var module;
|
+var module;
|
||||||
+export default initSqlJs;
|
+export default initSqlJs;
|
||||||
|
6
pnpm-lock.yaml
generated
6
pnpm-lock.yaml
generated
@ -13,7 +13,7 @@ patchedDependencies:
|
|||||||
hash: ztv2kzvfqbmz5mcxzgjd7ae7qy
|
hash: ztv2kzvfqbmz5mcxzgjd7ae7qy
|
||||||
path: patches/@rollup__plugin-terser.patch
|
path: patches/@rollup__plugin-terser.patch
|
||||||
sql.js:
|
sql.js:
|
||||||
hash: wgh6gqspb2uzocip4iontd6e7i
|
hash: urvytwkalcv3rkpnwd4u7ph3b4
|
||||||
path: patches/sql.js.patch
|
path: patches/sql.js.patch
|
||||||
|
|
||||||
importers:
|
importers:
|
||||||
@ -82,7 +82,7 @@ importers:
|
|||||||
version: 1.89.0
|
version: 1.89.0
|
||||||
sql.js:
|
sql.js:
|
||||||
specifier: ^1.13.0
|
specifier: ^1.13.0
|
||||||
version: 1.13.0(patch_hash=wgh6gqspb2uzocip4iontd6e7i)
|
version: 1.13.0(patch_hash=urvytwkalcv3rkpnwd4u7ph3b4)
|
||||||
workbox-build:
|
workbox-build:
|
||||||
specifier: ^7.3.0
|
specifier: ^7.3.0
|
||||||
version: 7.3.0(@types/babel__core@7.20.5)
|
version: 7.3.0(@types/babel__core@7.20.5)
|
||||||
@ -7862,7 +7862,7 @@ snapshots:
|
|||||||
|
|
||||||
space-separated-tokens@1.1.5: {}
|
space-separated-tokens@1.1.5: {}
|
||||||
|
|
||||||
sql.js@1.13.0(patch_hash=wgh6gqspb2uzocip4iontd6e7i): {}
|
sql.js@1.13.0(patch_hash=urvytwkalcv3rkpnwd4u7ph3b4): {}
|
||||||
|
|
||||||
stackback@0.0.2: {}
|
stackback@0.0.2: {}
|
||||||
|
|
||||||
|
@ -5,14 +5,14 @@ export function Footer() {
|
|||||||
const appVersionShort = '__APP_VERSION_SHORT__';
|
const appVersionShort = '__APP_VERSION_SHORT__';
|
||||||
return (
|
return (
|
||||||
<footer className="flex flex-col text-center p-4 bg-base-200">
|
<footer className="flex flex-col text-center p-4 bg-base-200">
|
||||||
<p className="flex flex-row justify-center items-center h-[1em]">
|
<div className="flex flex-row justify-center items-center h-[1em]">
|
||||||
<a className="link link-info mr-1" href="https://git.unlock-music.dev/um/um-react">
|
<a className="link link-info mr-1" href="https://git.unlock-music.dev/um/um-react">
|
||||||
音乐解锁
|
音乐解锁
|
||||||
</a>
|
</a>
|
||||||
(v{appVersionShort}
|
(v{appVersionShort}
|
||||||
<SDKVersion />) - 移除已购音乐的加密保护。
|
<SDKVersion />) - 移除已购音乐的加密保护。
|
||||||
</p>
|
</div>
|
||||||
<p>
|
<div>
|
||||||
{'© 2019 - '}
|
{'© 2019 - '}
|
||||||
<CurrentYear />{' '}
|
<CurrentYear />{' '}
|
||||||
<a className="link link-info" href="https://git.unlock-music.dev/um">
|
<a className="link link-info" href="https://git.unlock-music.dev/um">
|
||||||
@ -22,7 +22,7 @@ export function Footer() {
|
|||||||
<a className="link link-info" href="https://git.unlock-music.dev/um/um-react/src/branch/main/LICENSE">
|
<a className="link link-info" href="https://git.unlock-music.dev/um/um-react/src/branch/main/LICENSE">
|
||||||
使用 MIT 授权协议
|
使用 MIT 授权协议
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,9 @@ export function SDKVersion() {
|
|||||||
<h3 className="font-bold text-lg">详细信息</h3>
|
<h3 className="font-bold text-lg">详细信息</h3>
|
||||||
|
|
||||||
<p>App: __APP_VERSION__</p>
|
<p>App: __APP_VERSION__</p>
|
||||||
<p>SDK: {sdkVersion}</p>
|
<p>
|
||||||
|
SDK: <span data-testid="sdk-version">{sdkVersion}</span>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<form method="dialog" className="modal-backdrop">
|
<form method="dialog" className="modal-backdrop">
|
||||||
<button>关闭</button>
|
<button>关闭</button>
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
import { useRef } from 'react';
|
|
||||||
import { DecryptedAudioFile, deleteFile, ProcessState } from './fileListingSlice';
|
import { DecryptedAudioFile, deleteFile, ProcessState } from './fileListingSlice';
|
||||||
import { useAppDispatch } from '~/hooks';
|
import { useAppDispatch } from '~/hooks';
|
||||||
import { AnimationDefinition } from 'framer-motion';
|
|
||||||
import { FileError } from './FileError';
|
import { FileError } from './FileError';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
@ -11,7 +9,6 @@ interface FileRowProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function FileRow({ id, file }: FileRowProps) {
|
export function FileRow({ id, file }: FileRowProps) {
|
||||||
// const { isOpen, onClose } = useDisclosure({ defaultIsOpen: true });
|
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
const isDecrypted = file.state === ProcessState.COMPLETE;
|
const isDecrypted = file.state === ProcessState.COMPLETE;
|
||||||
const metadata = file.metadata;
|
const metadata = file.metadata;
|
||||||
@ -19,13 +16,6 @@ export function FileRow({ id, file }: FileRowProps) {
|
|||||||
const nameWithoutExt = file.fileName.replace(/\.[a-z\d]{3,6}$/, '');
|
const nameWithoutExt = file.fileName.replace(/\.[a-z\d]{3,6}$/, '');
|
||||||
const decryptedName = nameWithoutExt + '.' + file.ext;
|
const decryptedName = nameWithoutExt + '.' + file.ext;
|
||||||
|
|
||||||
const audioPlayerRef = useRef<HTMLAudioElement>(null);
|
|
||||||
const _onCollapseAnimationComplete = (definition: AnimationDefinition) => {
|
|
||||||
if (definition === 'exit') {
|
|
||||||
dispatch(deleteFile({ id }));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="card bg-base-100 shadow-sm w-full md:w-[30%] " data-testid="file-row">
|
<div className="card bg-base-100 shadow-sm w-full md:w-[30%] " data-testid="file-row">
|
||||||
<div className="card-body items-center text-center px-2">
|
<div className="card-body items-center text-center px-2">
|
||||||
@ -45,7 +35,6 @@ export function FileRow({ id, file }: FileRowProps) {
|
|||||||
controls
|
controls
|
||||||
autoPlay={false}
|
autoPlay={false}
|
||||||
src={file.decrypted}
|
src={file.decrypted}
|
||||||
ref={audioPlayerRef}
|
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -17,8 +17,4 @@ test('should render metadata when file has been processed', () => {
|
|||||||
renderWithProviders(<FileRow id="file://done" file={completedFile} />);
|
renderWithProviders(<FileRow id="file://done" file={completedFile} />);
|
||||||
|
|
||||||
expect(screen.getAllByTestId('file-row')).toHaveLength(1);
|
expect(screen.getAllByTestId('file-row')).toHaveLength(1);
|
||||||
expect(screen.getByTestId('audio-meta-song-name')).toHaveTextContent('Für Alice');
|
|
||||||
expect(screen.getByTestId('audio-meta-album-name')).toHaveTextContent("NOW That's What I Call Cryptography 2023");
|
|
||||||
expect(screen.getByTestId('audio-meta-song-artist')).toHaveTextContent('Jixun');
|
|
||||||
expect(screen.getByTestId('audio-meta-album-artist')).toHaveTextContent('Cipher Lovers');
|
|
||||||
});
|
});
|
||||||
|
@ -97,7 +97,7 @@ export default defineConfig({
|
|||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
output: {
|
output: {
|
||||||
manualChunks: {
|
manualChunks: {
|
||||||
reacts: ['react', 'react-dom', 'react-dropzone', 'react-promise-suspense', 'react-redux', '@reduxjs/toolkit'],
|
reacts: ['react', 'react-dom', 'react-dropzone', 'react-redux', '@reduxjs/toolkit'],
|
||||||
chakra: ['@chakra-ui/react', '@emotion/react', '@emotion/styled', 'framer-motion'],
|
chakra: ['@chakra-ui/react', '@emotion/react', '@emotion/styled', 'framer-motion'],
|
||||||
icons: ['react-icons', '@chakra-ui/icons'],
|
icons: ['react-icons', '@chakra-ui/icons'],
|
||||||
utility: ['radash', 'nanoid', 'react-syntax-highlighter'],
|
utility: ['radash', 'nanoid', 'react-syntax-highlighter'],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user