feat: monorepo
46
.gitignore
vendored
|
@ -11,21 +11,9 @@ pids
|
|||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
|
@ -36,9 +24,6 @@ build/Release
|
|||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# TypeScript v1 declaration files
|
||||
typings/
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
|
@ -57,37 +42,12 @@ typings/
|
|||
# dotenv environment variables file
|
||||
.env.test
|
||||
|
||||
# parcel-bundler cache (https://parceljs.org/)
|
||||
.cache
|
||||
|
||||
# next.js build output
|
||||
.next
|
||||
|
||||
# nuxt.js build output
|
||||
.nuxt
|
||||
|
||||
# vuepress build output
|
||||
.vuepress/dist
|
||||
|
||||
# Serverless directories
|
||||
.serverless/
|
||||
|
||||
# FuseBox cache
|
||||
.fusebox/
|
||||
|
||||
# DynamoDB Local files
|
||||
.dynamodb/
|
||||
|
||||
# ----
|
||||
dist
|
||||
**/dist
|
||||
**/.tmp
|
||||
/tmp
|
||||
release
|
||||
.DS_Store
|
||||
dist-ssr
|
||||
**/.DS_Store
|
||||
*.local
|
||||
.vscode/settings.json
|
||||
bundle-stats-main.html
|
||||
bundle-stats-preload.html
|
||||
bundle-stats-renderer.html
|
||||
tailwind-output.css
|
||||
.turbo
|
||||
|
|
39
.vscode/launch.json
vendored
|
@ -1,39 +0,0 @@
|
|||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Main(inspector)",
|
||||
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
|
||||
"runtimeArgs": [
|
||||
"--remote-debugging-port=9222",
|
||||
"${workspaceFolder}/dist/main/index.cjs",
|
||||
],
|
||||
"env": {
|
||||
"DEBUG": "true",
|
||||
},
|
||||
"windows": {
|
||||
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd"
|
||||
},
|
||||
"sourceMaps": true
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Main(vite)",
|
||||
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
|
||||
"runtimeArgs": [
|
||||
"${workspaceFolder}/dist/main/index.cjs",
|
||||
],
|
||||
"env": {
|
||||
"VITE_DEV_SERVER_HOST": "127.0.0.1",
|
||||
"VITE_DEV_SERVER_PORT": "3344",
|
||||
},
|
||||
"windows": {
|
||||
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd"
|
||||
},
|
||||
"sourceMaps": true
|
||||
},
|
||||
]
|
||||
}
|
13
.vscode/task.json
vendored
|
@ -1,13 +0,0 @@
|
|||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"type": "npm",
|
||||
"script": "debug",
|
||||
"problemMatcher": [],
|
||||
"label": "npm: debug",
|
||||
"detail": "cross-env-shell NODE_ENV=debug \"npm run typecheck && node scripts/build.main.mjs && vite ./src/renderer\"",
|
||||
"group": "build"
|
||||
}
|
||||
]
|
||||
}
|
34
auto-imports.d.ts
vendored
|
@ -1,34 +0,0 @@
|
|||
// Generated by 'unplugin-auto-import'
|
||||
// We suggest you to commit this file into source control
|
||||
declare global {
|
||||
const classNames: typeof import('classnames')['default']
|
||||
const createRef: typeof import('react')['createRef']
|
||||
const forwardRef: typeof import('react')['forwardRef']
|
||||
const lazy: typeof import('react')['lazy']
|
||||
const memo: typeof import('react')['memo']
|
||||
const startTransition: typeof import('react')['startTransition']
|
||||
const toast: typeof import('react-hot-toast')['toast']
|
||||
const useCallback: typeof import('react')['useCallback']
|
||||
const useContext: typeof import('react')['useContext']
|
||||
const useDebugValue: typeof import('react')['useDebugValue']
|
||||
const useDeferredValue: typeof import('react')['useDeferredValue']
|
||||
const useEffect: typeof import('react')['useEffect']
|
||||
const useEffectOnce: typeof import('react-use')['useEffectOnce']
|
||||
const useId: typeof import('react')['useId']
|
||||
const useImperativeHandle: typeof import('react')['useImperativeHandle']
|
||||
const useInfiniteQuery: typeof import('react-query')['useInfiniteQuery']
|
||||
const useInsertionEffect: typeof import('react')['useInsertionEffect']
|
||||
const useLayoutEffect: typeof import('react')['useLayoutEffect']
|
||||
const useMemo: typeof import('react')['useMemo']
|
||||
const useMutation: typeof import('react-query')['useMutation']
|
||||
const useNavigate: typeof import('react-router-dom')['useNavigate']
|
||||
const useParams: typeof import('react-router-dom')['useParams']
|
||||
const useQuery: typeof import('react-query')['useQuery']
|
||||
const useReducer: typeof import('react')['useReducer']
|
||||
const useRef: typeof import('react')['useRef']
|
||||
const useSnapshot: typeof import('valtio')['useSnapshot']
|
||||
const useState: typeof import('react')['useState']
|
||||
const useSyncExternalStore: typeof import('react')['useSyncExternalStore']
|
||||
const useTransition: typeof import('react')['useTransition']
|
||||
}
|
||||
export {}
|
126
package.json
|
@ -8,122 +8,22 @@
|
|||
"license": "MIT",
|
||||
"author": "qier222 <qier222@outlook.com>",
|
||||
"repository": "github:qier222/YesPlayMusic",
|
||||
"main": "dist/main/index.js",
|
||||
"scripts": {
|
||||
"install:sqlite3": "node scripts/build.sqlite3.js",
|
||||
"dev": "concurrently -n=vite,main -c=#646cff,#74b1be \"npm run dev:renderer\" \"node scripts/build.main.mjs --watch\"",
|
||||
"dev:renderer": "vite dev",
|
||||
"build:main": "node scripts/build.main.mjs",
|
||||
"build:renderer": "vite build",
|
||||
"build": "cross-env-shell IS_ELECTRON=true npm run build:renderer && npm run build:main",
|
||||
"build:app": "npm run build && electron-builder --config .electron-builder.config.js",
|
||||
"build:app-dir": "npm run build && electron-builder --config .electron-builder.config.js --dir",
|
||||
"build:app-win": "npm run build && electron-builder --config .electron-builder.config.js --win",
|
||||
"build:app-mac": "npm run build && electron-builder --config .electron-builder.config.js --mac",
|
||||
"build:app-linux": "npm run build && electron-builder --config .electron-builder.config.js --linux",
|
||||
"debug": "cross-env-shell NODE_ENV=debug \"npm run typecheck && node scripts/build.mjs && vite ./src/renderer\"",
|
||||
"test": "vitest",
|
||||
"test:ui": "vitest --ui",
|
||||
"test:coverage": "vitest run --coverage",
|
||||
"test:types": "npm run test:types-renderer && npm run test:types-main && npm run test:types-shared",
|
||||
"test:types-renderer": "tsc --noEmit --project src/renderer/tsconfig.json",
|
||||
"test:types-main": "tsc --noEmit --project src/main/tsconfig.json",
|
||||
"test:types-shared": "tsc --noEmit --project src/shared/tsconfig.json",
|
||||
"netease": "npx NeteaseCloudMusicApi",
|
||||
"eslint": "eslint --ext .ts,.js ./",
|
||||
"prettier": "prettier --write './**/*.{ts,js,tsx,jsx}'",
|
||||
"analyze:css": "npx windicss-analysis",
|
||||
"analyze:js": "npm run build:renderer && open-cli bundle-stats-renderer.html"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
||||
"node": "^14.13.1 || >=16.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@sentry/node": "^6.19.7",
|
||||
"@sentry/tracing": "^6.19.7",
|
||||
"@unblockneteasemusic/rust-napi": "^0.3.0-pre.1",
|
||||
"NeteaseCloudMusicApi": "^4.5.12",
|
||||
"better-sqlite3": "7.5.1",
|
||||
"change-case": "^4.1.2",
|
||||
"cookie-parser": "^1.4.6",
|
||||
"electron-log": "^4.4.6",
|
||||
"electron-store": "^8.0.1",
|
||||
"express": "^4.18.0",
|
||||
"fast-folder-size": "^1.6.1"
|
||||
"packageManager": "pnpm@7.0.0",
|
||||
"scripts": {
|
||||
"install": "turbo run post-install --parallel --no-cache",
|
||||
"build": "turbo run build",
|
||||
"build:web": "turbo run build:web",
|
||||
"dev": "turbo run dev --parallel",
|
||||
"lint": "turbo run lint",
|
||||
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,md}\""
|
||||
},
|
||||
"devDependencies": {
|
||||
"@electron/universal": "1.2.1",
|
||||
"@sentry/react": "^6.19.7",
|
||||
"@testing-library/react": "^13.1.1",
|
||||
"@types/better-sqlite3": "^7.5.0",
|
||||
"@types/cookie-parser": "^1.4.3",
|
||||
"@types/express": "^4.17.13",
|
||||
"@types/express-fileupload": "^1.2.2",
|
||||
"@types/howler": "^2.2.7",
|
||||
"@types/js-cookie": "^3.0.2",
|
||||
"@types/lodash-es": "^4.17.6",
|
||||
"@types/md5": "^2.3.2",
|
||||
"@types/qrcode": "^1.4.2",
|
||||
"@types/react": "^18.0.8",
|
||||
"@types/react-dom": "^18.0.1",
|
||||
"@typescript-eslint/eslint-plugin": "^5.21.0",
|
||||
"@typescript-eslint/parser": "^5.21.0",
|
||||
"@vitejs/plugin-react": "^1.3.1",
|
||||
"@vitest/ui": "^0.10.0",
|
||||
"autoprefixer": "^10.4.5",
|
||||
"axios": "^0.27.2",
|
||||
"c8": "^7.11.2",
|
||||
"classnames": "^2.3.1",
|
||||
"color.js": "^1.2.0",
|
||||
"colord": "^2.9.2",
|
||||
"concurrently": "^7.1.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"dayjs": "^1.11.1",
|
||||
"dotenv": "^16.0.0",
|
||||
"electron": "^18.1.0",
|
||||
"electron-builder": "^23.0.3",
|
||||
"electron-devtools-installer": "^3.2.0",
|
||||
"electron-rebuild": "^3.2.7",
|
||||
"electron-releases": "^3.1004.0",
|
||||
"esbuild": "^0.14.38",
|
||||
"eslint": "^8.14.0",
|
||||
"eslint-plugin-react": "^7.29.4",
|
||||
"eslint-plugin-react-hooks": "^4.5.0",
|
||||
"express-fileupload": "^1.3.1",
|
||||
"framer-motion": "^6.3.2",
|
||||
"howler": "^2.2.3",
|
||||
"js-cookie": "^3.0.1",
|
||||
"jsdom": "^19.0.0",
|
||||
"lodash-es": "^4.17.21",
|
||||
"md5": "^2.3.0",
|
||||
"minimist": "^1.2.6",
|
||||
"music-metadata": "^7.12.3",
|
||||
"open-cli": "^7.0.1",
|
||||
"ora": "^6.1.0",
|
||||
"picocolors": "^1.0.0",
|
||||
"postcss": "^8.4.12",
|
||||
"prettier": "2.6.2",
|
||||
"prettier-plugin-tailwindcss": "^0.1.10",
|
||||
"qrcode": "^1.5.0",
|
||||
"react": "^18.1.0",
|
||||
"react-dom": "^18.1.0",
|
||||
"react-ga4": "^1.4.1",
|
||||
"react-hot-toast": "^2.2.0",
|
||||
"react-query": "^3.38.0",
|
||||
"react-router-dom": "^6.3.0",
|
||||
"react-use": "^17.3.2",
|
||||
"rollup-plugin-visualizer": "^5.6.0",
|
||||
"sass": "^1.51.0",
|
||||
"tailwindcss": "^3.0.24",
|
||||
"typescript": "^4.6.3",
|
||||
"unplugin-auto-import": "^0.7.1",
|
||||
"valtio": "^1.6.0",
|
||||
"vite": "^2.9.6",
|
||||
"vite-plugin-svg-icons": "^2.0.1",
|
||||
"vitest": "^0.10.0",
|
||||
"wait-on": "^6.0.1"
|
||||
},
|
||||
"resolutions": {
|
||||
"@electron/universal": "1.2.1"
|
||||
"eslint": "^8.15.0",
|
||||
"prettier": "^2.6.2",
|
||||
"turbo": "^1.2.8",
|
||||
"typescript": "^4.6.4"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
* @type {import('electron-builder').Configuration}
|
||||
* @see https://www.electron.build/configuration/configuration
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
appId: 'com.qier222.yesplaymusic',
|
||||
productName: 'YesPlayMusic',
|
||||
|
@ -100,7 +101,7 @@ module.exports = {
|
|||
'dist/main/**/*',
|
||||
'dist/renderer/**/*',
|
||||
{
|
||||
from: 'src/main/migrations',
|
||||
from: 'packages/electron/migrations',
|
||||
to: 'dist/main/migrations',
|
||||
},
|
||||
{
|
Before Width: | Height: | Size: 936 B After Width: | Height: | Size: 936 B |
Before Width: | Height: | Size: 612 B After Width: | Height: | Size: 612 B |
Before Width: | Height: | Size: 844 B After Width: | Height: | Size: 844 B |
Before Width: | Height: | Size: 890 B After Width: | Height: | Size: 890 B |
Before Width: | Height: | Size: 223 B After Width: | Height: | Size: 223 B |
Before Width: | Height: | Size: 191 B After Width: | Height: | Size: 191 B |
Before Width: | Height: | Size: 308 B After Width: | Height: | Size: 308 B |
Before Width: | Height: | Size: 311 B After Width: | Height: | Size: 311 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 953 B After Width: | Height: | Size: 953 B |
Before Width: | Height: | Size: 396 B After Width: | Height: | Size: 396 B |
Before Width: | Height: | Size: 344 B After Width: | Height: | Size: 344 B |
Before Width: | Height: | Size: 218 B After Width: | Height: | Size: 218 B |
Before Width: | Height: | Size: 932 B After Width: | Height: | Size: 932 B |
|
@ -86,7 +86,7 @@ class DB {
|
|||
initTables() {
|
||||
const migration = fs.readFileSync(
|
||||
isDev
|
||||
? path.join(process.cwd(), './src/main/migrations/init.sql')
|
||||
? path.join(process.cwd(), './migrations/init.sql')
|
||||
: path.join(__dirname, './migrations/init.sql'),
|
||||
'utf8'
|
||||
)
|
63
packages/electron/package.json
Normal file
|
@ -0,0 +1,63 @@
|
|||
{
|
||||
"name": "electron",
|
||||
"private": true,
|
||||
"version": "2.0.0",
|
||||
"main": "./index.js",
|
||||
"scripts": {
|
||||
"post-install": "node scripts/build.sqlite3.js",
|
||||
"dev": "node scripts/build.main.mjs --watch",
|
||||
"build": "node scripts/build.main.mjs",
|
||||
"test:types": "tsc --noEmit --project src/main/tsconfig.json",
|
||||
"lint": "eslint --ext .ts,.js ./",
|
||||
"format": "prettier --write './**/*.{ts,js,tsx,jsx}'"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^14.13.1 || >=16.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@sentry/node": "^6.19.7",
|
||||
"@sentry/tracing": "^6.19.7",
|
||||
"@unblockneteasemusic/rust-napi": "^0.3.0-pre.1",
|
||||
"NeteaseCloudMusicApi": "^4.5.12",
|
||||
"better-sqlite3": "7.5.1",
|
||||
"change-case": "^4.1.2",
|
||||
"cookie-parser": "^1.4.6",
|
||||
"electron-log": "^4.4.6",
|
||||
"electron-store": "^8.0.1",
|
||||
"express": "^4.18.1",
|
||||
"fast-folder-size": "^1.6.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@electron/universal": "1.2.1",
|
||||
"@types/better-sqlite3": "^7.5.0",
|
||||
"@types/cookie-parser": "^1.4.3",
|
||||
"@types/express": "^4.17.13",
|
||||
"@types/express-fileupload": "^1.2.2",
|
||||
"@typescript-eslint/eslint-plugin": "^5.21.0",
|
||||
"@typescript-eslint/parser": "^5.21.0",
|
||||
"@vitejs/plugin-react": "^1.3.1",
|
||||
"axios": "^0.27.2",
|
||||
"cross-env": "^7.0.3",
|
||||
"dotenv": "^16.0.0",
|
||||
"electron": "^18.2.2",
|
||||
"electron-builder": "^23.0.3",
|
||||
"electron-devtools-installer": "^3.2.0",
|
||||
"electron-rebuild": "^3.2.7",
|
||||
"electron-releases": "^3.1009.0",
|
||||
"esbuild": "^0.14.38",
|
||||
"eslint": "*",
|
||||
"express-fileupload": "^1.3.1",
|
||||
"minimist": "^1.2.6",
|
||||
"music-metadata": "^7.12.3",
|
||||
"open-cli": "^7.0.1",
|
||||
"ora": "^6.1.0",
|
||||
"picocolors": "^1.0.0",
|
||||
"prettier": "*",
|
||||
"prettier-plugin-tailwindcss": "^0.1.10",
|
||||
"typescript": "*",
|
||||
"wait-on": "^6.0.1"
|
||||
},
|
||||
"resolutions": {
|
||||
"@electron/universal": "1.2.1"
|
||||
}
|
||||
}
|
|
@ -6,7 +6,7 @@ import { createDirIfNotExist } from './utils'
|
|||
const isDev = process.env.NODE_ENV === 'development'
|
||||
|
||||
if (isDev) {
|
||||
const devUserDataPath = path.resolve(process.cwd(), './tmp/userData')
|
||||
const devUserDataPath = path.resolve(process.cwd(), '../../tmp/userData')
|
||||
createDirIfNotExist(devUserDataPath)
|
||||
app.setPath('appData', devUserDataPath)
|
||||
}
|
|
@ -10,10 +10,10 @@ import pc from 'picocolors'
|
|||
import minimist from 'minimist'
|
||||
|
||||
const env = dotenv.config({
|
||||
path: path.resolve(process.cwd(), '.env'),
|
||||
path: path.resolve(process.cwd(), '../../.env'),
|
||||
})
|
||||
const envForEsbuild = {}
|
||||
Object.entries(env.parsed).forEach(([key, value]) => {
|
||||
Object.entries(env.parsed || {}).forEach(([key, value]) => {
|
||||
envForEsbuild[`process.env.${key}`] = `"${value}"`
|
||||
})
|
||||
console.log(envForEsbuild)
|
||||
|
@ -23,8 +23,8 @@ const TAG = '[script/build.main.ts]'
|
|||
const spinner = ora(`${TAG} Main Process Building...`)
|
||||
|
||||
const options = {
|
||||
entryPoints: ['./src/main/index.ts', './src/main/rendererPreload.ts'],
|
||||
outdir: './dist/main/',
|
||||
entryPoints: ['./index.ts', './rendererPreload.ts'],
|
||||
outdir: './dist',
|
||||
platform: 'node',
|
||||
format: 'cjs',
|
||||
bundle: true,
|
||||
|
@ -37,22 +37,18 @@ const options = {
|
|||
'electron',
|
||||
'NeteaseCloudMusicApi',
|
||||
'better-sqlite3',
|
||||
'@unblockneteasemusic/rust-napi'
|
||||
'@unblockneteasemusic/rust-napi',
|
||||
],
|
||||
}
|
||||
|
||||
const runApp = () => {
|
||||
return spawn(
|
||||
electron,
|
||||
[path.resolve(process.cwd(), './dist/main/index.js')],
|
||||
{
|
||||
stdio: 'inherit',
|
||||
env: {
|
||||
...process.env,
|
||||
NODE_ENV: 'development',
|
||||
},
|
||||
}
|
||||
)
|
||||
return spawn(electron, [path.resolve(process.cwd(), './dist/index.js')], {
|
||||
stdio: 'inherit',
|
||||
env: {
|
||||
...process.env,
|
||||
NODE_ENV: 'development',
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
if (argv.watch) {
|
|
@ -7,6 +7,7 @@ const releases = require('electron-releases')
|
|||
const pkg = require(`${process.cwd()}/package.json`)
|
||||
const axios = require('axios')
|
||||
const { execSync } = require('child_process')
|
||||
const path = require('path')
|
||||
|
||||
const electronVersion = pkg.devDependencies.electron.replaceAll('^', '')
|
||||
const betterSqlite3Version = pkg.dependencies['better-sqlite3'].replaceAll(
|
||||
|
@ -21,10 +22,10 @@ const isWin = process.platform === 'win32'
|
|||
const isMac = process.platform === 'darwin'
|
||||
const isLinux = process.platform === 'linux'
|
||||
|
||||
const projectDir = process.cwd()
|
||||
const projectDir = path.resolve(process.cwd(), '../../')
|
||||
|
||||
if (!fs.existsSync(`${projectDir}/dist/main`)) {
|
||||
fs.mkdirSync(`${projectDir}/dist/main`, {
|
||||
if (!fs.existsSync(`${projectDir}/src/main/dist`)) {
|
||||
fs.mkdirSync(`${projectDir}/src/main/dist`, {
|
||||
recursive: true,
|
||||
})
|
||||
}
|
||||
|
@ -69,7 +70,7 @@ const download = async arch => {
|
|||
try {
|
||||
fs.copyFileSync(
|
||||
`${dir}/build/Release/better_sqlite3.node`,
|
||||
`${projectDir}/dist/main/better_sqlite3_${arch}.node`
|
||||
`${projectDir}/src/main/dist/better_sqlite3_${arch}.node`
|
||||
)
|
||||
} catch (e) {
|
||||
console.log(pc.red('Copy failed! Skip copy.', e))
|
||||
|
@ -77,7 +78,7 @@ const download = async arch => {
|
|||
}
|
||||
|
||||
try {
|
||||
fs.rmdirSync(`${dir}/build`, { recursive: true, force: true })
|
||||
fs.rmSync(`${dir}/build`, { recursive: true, force: true })
|
||||
} catch (e) {
|
||||
console.log(pc.red('Delete failed! Skip delete.'))
|
||||
return false
|
||||
|
@ -92,15 +93,20 @@ const build = async arch => {
|
|||
|
||||
console.log(pc.cyan(`Building for ${arch}...`))
|
||||
await rebuild({
|
||||
buildPath: projectDir,
|
||||
// projectRootPath: projectDir,
|
||||
// buildPath: process.cwd(),
|
||||
projectRootPath: projectDir,
|
||||
buildPath: process.cwd(),
|
||||
electronVersion,
|
||||
arch: arch,
|
||||
arch,
|
||||
onlyModules: ['better-sqlite3'],
|
||||
force: true,
|
||||
})
|
||||
.then(() => {
|
||||
console.info('Build succeeded')
|
||||
fs.copyFileSync(
|
||||
`${projectDir}/node_modules/better-sqlite3/build/Release/better_sqlite3.node`,
|
||||
`${projectDir}/dist/main/better_sqlite3_${arch}.node`
|
||||
`${projectDir}/src/main/dist/better_sqlite3_${arch}.node`
|
||||
)
|
||||
})
|
||||
.catch(e => {
|
|
@ -76,7 +76,7 @@ class Server {
|
|||
|
||||
serveStaticForProd() {
|
||||
if (isProd) {
|
||||
this.app.use('/', express.static(path.join(__dirname, '../renderer/')))
|
||||
this.app.use('/', express.static(path.join(__dirname, '../web/')))
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
import { Toaster } from 'react-hot-toast'
|
||||
import { QueryClientProvider } from 'react-query'
|
||||
import { ReactQueryDevtools } from 'react-query/devtools'
|
||||
import Player from '@/renderer/components/Player'
|
||||
import Sidebar from '@/renderer/components/Sidebar'
|
||||
import reactQueryClient from '@/renderer/utils/reactQueryClient'
|
||||
import Main from '@/renderer/components/Main'
|
||||
import TitleBar from '@/renderer/components/TitleBar'
|
||||
import Lyric from '@/renderer/components/Lyric'
|
||||
import IpcRendererReact from '@/renderer/IpcRendererReact'
|
||||
import Player from '@/web/components/Player'
|
||||
import Sidebar from '@/web/components/Sidebar'
|
||||
import reactQueryClient from '@/web/utils/reactQueryClient'
|
||||
import Main from '@/web/components/Main'
|
||||
import TitleBar from '@/web/components/TitleBar'
|
||||
import Lyric from '@/web/components/Lyric'
|
||||
import IpcRendererReact from '@/web/IpcRendererReact'
|
||||
|
||||
const App = () => {
|
||||
return (
|
|
@ -1,10 +1,13 @@
|
|||
import { IpcChannels } from '@/shared/IpcChannels'
|
||||
import useUserLikedTracksIDs, {
|
||||
useMutationLikeATrack,
|
||||
} from '@/renderer/hooks/useUserLikedTracksIDs'
|
||||
import { player } from '@/renderer/store'
|
||||
import useIpcRenderer from '@/renderer/hooks/useIpcRenderer'
|
||||
import { State as PlayerState } from '@/renderer/utils/player'
|
||||
} from '@/web/hooks/useUserLikedTracksIDs'
|
||||
import { player } from '@/web/store'
|
||||
import useIpcRenderer from '@/web/hooks/useIpcRenderer'
|
||||
import { State as PlayerState } from '@/web/utils/player'
|
||||
import { useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { useEffectOnce } from 'react-use'
|
||||
import { useSnapshot } from 'valtio'
|
||||
|
||||
const IpcRendererReact = () => {
|
||||
const [isPlaying, setIsPlaying] = useState(false)
|
|
@ -1,4 +1,4 @@
|
|||
import request from '@/renderer/utils/request'
|
||||
import request from '@/web/utils/request'
|
||||
import {
|
||||
FetchAlbumParams,
|
||||
FetchAlbumResponse,
|
|
@ -1,4 +1,4 @@
|
|||
import request from '@/renderer/utils/request'
|
||||
import request from '@/web/utils/request'
|
||||
import {
|
||||
FetchArtistParams,
|
||||
FetchArtistResponse,
|
|
@ -1,4 +1,4 @@
|
|||
import request from '@/renderer/utils/request'
|
||||
import request from '@/web/utils/request'
|
||||
import { FetchUserAccountResponse } from '@/shared/api/User'
|
||||
|
||||
// 手机号登录
|
|
@ -1,4 +1,4 @@
|
|||
import request from '@/renderer/utils/request'
|
||||
import request from '@/web/utils/request'
|
||||
|
||||
export enum PersonalFMApiNames {
|
||||
FetchPersonalFm = 'fetchPersonalFM',
|
|
@ -1,4 +1,4 @@
|
|||
import request from '@/renderer/utils/request'
|
||||
import request from '@/web/utils/request'
|
||||
import {
|
||||
FetchPlaylistParams,
|
||||
FetchPlaylistResponse,
|
|
@ -1,4 +1,4 @@
|
|||
import request from '@/renderer/utils/request'
|
||||
import request from '@/web/utils/request'
|
||||
import {
|
||||
SearchParams,
|
||||
SearchResponse,
|
|
@ -1,4 +1,4 @@
|
|||
import request from '@/renderer/utils/request'
|
||||
import request from '@/web/utils/request'
|
||||
import {
|
||||
FetchAudioSourceParams,
|
||||
FetchAudioSourceResponse,
|
|
@ -1,4 +1,4 @@
|
|||
import request from '@/renderer/utils/request'
|
||||
import request from '@/web/utils/request'
|
||||
import {
|
||||
FetchUserAccountResponse,
|
||||
FetchUserPlaylistsParams,
|
Before Width: | Height: | Size: 259 B After Width: | Height: | Size: 259 B |
Before Width: | Height: | Size: 538 B After Width: | Height: | Size: 538 B |
Before Width: | Height: | Size: 946 B After Width: | Height: | Size: 946 B |
Before Width: | Height: | Size: 261 B After Width: | Height: | Size: 261 B |
Before Width: | Height: | Size: 542 B After Width: | Height: | Size: 542 B |
Before Width: | Height: | Size: 494 B After Width: | Height: | Size: 494 B |
Before Width: | Height: | Size: 429 B After Width: | Height: | Size: 429 B |
Before Width: | Height: | Size: 540 B After Width: | Height: | Size: 540 B |
Before Width: | Height: | Size: 257 B After Width: | Height: | Size: 257 B |
Before Width: | Height: | Size: 847 B After Width: | Height: | Size: 847 B |
Before Width: | Height: | Size: 484 B After Width: | Height: | Size: 484 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 550 B After Width: | Height: | Size: 550 B |
Before Width: | Height: | Size: 535 B After Width: | Height: | Size: 535 B |
Before Width: | Height: | Size: 258 B After Width: | Height: | Size: 258 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 557 B After Width: | Height: | Size: 557 B |
Before Width: | Height: | Size: 367 B After Width: | Height: | Size: 367 B |
Before Width: | Height: | Size: 284 B After Width: | Height: | Size: 284 B |
Before Width: | Height: | Size: 254 B After Width: | Height: | Size: 254 B |
Before Width: | Height: | Size: 369 B After Width: | Height: | Size: 369 B |
Before Width: | Height: | Size: 349 B After Width: | Height: | Size: 349 B |
Before Width: | Height: | Size: 741 B After Width: | Height: | Size: 741 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 371 B After Width: | Height: | Size: 371 B |
Before Width: | Height: | Size: 708 B After Width: | Height: | Size: 708 B |