mirror of
https://github.com/NoCrypt/migu.git
synced 2026-04-21 16:41:59 +00:00
feat: monorepo
This commit is contained in:
parent
c04db6548e
commit
832b3bb33d
97 changed files with 2466 additions and 1818 deletions
10
capacitor/.gitignore
vendored
Normal file
10
capacitor/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
/node_modules/
|
||||
/public/build/
|
||||
/public
|
||||
.routify/
|
||||
android/
|
||||
ios/
|
||||
|
||||
package-lock.json
|
||||
.env
|
||||
.DS_Store
|
||||
21
capacitor/LICENSE
Normal file
21
capacitor/LICENSE
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2021 t. Macleod Sawyer
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
20
capacitor/capacitor.config.js
Normal file
20
capacitor/capacitor.config.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
const config = {
|
||||
appId: 'watch.miru',
|
||||
appName: 'Miru',
|
||||
webDir: 'public',
|
||||
bundledWebRuntime: false,
|
||||
plugins: {
|
||||
SplashScreen: {
|
||||
launchShowDuration: 0
|
||||
}
|
||||
},
|
||||
// remove server section before making production build
|
||||
server: {
|
||||
// for android only, below settings will work out of the box
|
||||
// for iOS or both, change the url to http://your-device-ip
|
||||
// To discover your workstation IP, just run ifconfig
|
||||
url: 'http://10.0.2.2:5001',
|
||||
cleartext: true
|
||||
}
|
||||
}
|
||||
module.exports = config
|
||||
21
capacitor/index.html
Normal file
21
capacitor/index.html
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="/assets/favicon/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon/favicon-16x16.png">
|
||||
<link rel="manifest" href="/assets/favicon/site.webmanifest">
|
||||
<link rel="mask-icon" href="/assets/favicon/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Svelte_Capacitor v2.0.0</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
26
capacitor/package.json
Normal file
26
capacitor/package.json
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"scripts": {
|
||||
"build:app": "vite build",
|
||||
"build:android": "run-s build:app cap-run:android",
|
||||
"build:ios": "run-s build:app cap-run:ios",
|
||||
"cap-run:android": "cap sync android && cap open android",
|
||||
"cap-run:ios": "cap sync ios && cap open ios",
|
||||
"dev:ios": "run-p dev:start cap-run:ios",
|
||||
"dev:android": "run-p dev:start cap-run:android",
|
||||
"dev:preview": "vite preview",
|
||||
"dev:start": "run-p dev:vite",
|
||||
"dev:vite": "vite --host --port 5001"
|
||||
},
|
||||
"devDependencies": {
|
||||
"cordova-res": "^0.15.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"@capacitor/android": "^5.5.1",
|
||||
"@capacitor/cli": "^5.5.1",
|
||||
"@capacitor/core": "^5.5.1",
|
||||
"@capacitor/ios": "^5.5.1",
|
||||
"cordova-plugin-chrome-apps-common": "^1.0.7",
|
||||
"cordova-plugin-chrome-apps-sockets-tcp": "github:KoenLav/cordova-plugin-chrome-apps-sockets-tcp",
|
||||
"cordova-plugin-chrome-apps-sockets-udp": "^1.3.0"
|
||||
}
|
||||
}
|
||||
1
capacitor/src/App.svelte
Normal file
1
capacitor/src/App.svelte
Normal file
|
|
@ -0,0 +1 @@
|
|||
<h1>uwu</h1>
|
||||
7
capacitor/src/main.js
Normal file
7
capacitor/src/main.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import App from './App.svelte'
|
||||
|
||||
const app = new App({
|
||||
target: document.getElementById('app')
|
||||
})
|
||||
|
||||
export default app
|
||||
54
capacitor/webpack.config.cjs
Normal file
54
capacitor/webpack.config.cjs
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
import webpack from 'webpack'
|
||||
import TerserPlugin from 'terser-webpack-plugin'
|
||||
import info from 'webtorrent/package.json' assert { type: 'json' }
|
||||
|
||||
/** @type {import('webpack').Configuration} */
|
||||
export default {
|
||||
entry: './index.js',
|
||||
devtool: 'source-map',
|
||||
resolve: {
|
||||
aliasFields: ['chromeapp'],
|
||||
alias: {
|
||||
...info.chromeapp,
|
||||
path: 'path-esm',
|
||||
stream: 'stream-browserify',
|
||||
timers: 'timers-browserify',
|
||||
crypto: 'crypto-browserify',
|
||||
buffer: 'buffer',
|
||||
querystring: 'querystring',
|
||||
zlib: '/polyfills/inflate-sync-web.js'
|
||||
}
|
||||
},
|
||||
output: {
|
||||
chunkFormat: 'module',
|
||||
filename: 'webtorrent.chromeapp.js',
|
||||
library: {
|
||||
type: 'module'
|
||||
}
|
||||
},
|
||||
mode: 'production',
|
||||
target: 'web',
|
||||
experiments: {
|
||||
outputModule: true
|
||||
},
|
||||
plugins: [
|
||||
new webpack.ProvidePlugin({
|
||||
process: '/polyfills/process-fast.js',
|
||||
Buffer: ['buffer', 'Buffer']
|
||||
}),
|
||||
new webpack.DefinePlugin({
|
||||
global: 'globalThis'
|
||||
})
|
||||
],
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [new TerserPlugin({
|
||||
terserOptions: {
|
||||
format: {
|
||||
comments: false
|
||||
}
|
||||
},
|
||||
extractComments: false
|
||||
})]
|
||||
}
|
||||
}
|
||||
15
common/jsconfig.json
Normal file
15
common/jsconfig.json
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"@/*": ["./*"],
|
||||
},
|
||||
"checkJs": true,
|
||||
"target": "ESNext",
|
||||
"moduleResolution": "node",
|
||||
"module": "ESNext",
|
||||
"types": ["./types.d.ts"],
|
||||
"allowSyntheticDefaultImports": true
|
||||
},
|
||||
"exclude": ["node_modules/**", "**/node_modules", "dist", "build"]
|
||||
}
|
||||
23
common/package.json
Normal file
23
common/package.json
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"name": "common",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@fontsource-variable/material-symbols-outlined": "latest",
|
||||
"@fontsource-variable/nunito": "latest",
|
||||
"@fontsource/roboto": "latest",
|
||||
"anitomyscript": "github:ThaUnknown/anitomyscript#42290c4b3f256893be08a4e89051f448ff5e9d00",
|
||||
"bottleneck": "^2.19.5",
|
||||
"browser-event-target-emitter": "^1.0.1",
|
||||
"jassub": "latest",
|
||||
"js-levenshtein": "^1.1.6",
|
||||
"p2pt": "github:ThaUnknown/p2pt#modernise",
|
||||
"perfect-seekbar": "^1.1.0",
|
||||
"quartermoon": "^1.2.3",
|
||||
"simple-store-svelte": "^1.0.1",
|
||||
"svelte": "^4.2.3",
|
||||
"svelte-keybinds": "^1.0.5",
|
||||
"svelte-loader": "^3.1.9",
|
||||
"svelte-miniplayer": "^1.0.3",
|
||||
"svelte-sonner": "^0.3.3"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
15
common/tsconfig.json
Normal file
15
common/tsconfig.json
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"@/*": ["./*"],
|
||||
},
|
||||
"checkJs": true,
|
||||
"target": "ESNext",
|
||||
"moduleResolution": "node",
|
||||
"module": "ESNext",
|
||||
"types": ["./types.d.ts"],
|
||||
"allowSyntheticDefaultImports": true
|
||||
},
|
||||
"exclude": ["node_modules/**", "**/node_modules", "dist", "build"]
|
||||
}
|
||||
0
types.d.ts → common/types.d.ts
vendored
0
types.d.ts → common/types.d.ts
vendored
98
common/webpack.config.cjs
Normal file
98
common/webpack.config.cjs
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
const { join, resolve } = require('path')
|
||||
|
||||
const mode = process.env.NODE_ENV?.trim() || 'development'
|
||||
const isDev = mode === 'development'
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
|
||||
module.exports = (parentDir, alias = {}) => ({
|
||||
devtool: 'source-map',
|
||||
entry: join(__dirname, 'main.js'),
|
||||
output: {
|
||||
path: join(parentDir, 'build'),
|
||||
filename: 'renderer.js'
|
||||
},
|
||||
mode,
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.svelte$/,
|
||||
use: {
|
||||
loader: 'svelte-loader',
|
||||
options: {
|
||||
compilerOptions: {
|
||||
dev: isDev
|
||||
},
|
||||
emitCss: !isDev,
|
||||
hotReload: isDev
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [
|
||||
MiniCssExtractPlugin.loader,
|
||||
{
|
||||
loader: 'css-loader',
|
||||
options: {
|
||||
sourceMap: true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
// required to prevent errors from Svelte on Webpack 5+
|
||||
test: /node_modules\/svelte\/.*\.mjs$/,
|
||||
resolve: {
|
||||
fullySpecified: false
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
resolve: {
|
||||
aliasFields: ['browser'],
|
||||
alias: {
|
||||
...alias,
|
||||
'@': __dirname,
|
||||
module: false,
|
||||
url: false,
|
||||
'bittorrent-tracker/lib/client/websocket-tracker.js': resolve('../node_modules/bittorrent-tracker/lib/client/websocket-tracker.js')
|
||||
},
|
||||
extensions: ['.mjs', '.js', '.svelte']
|
||||
},
|
||||
plugins: [
|
||||
new MiniCssExtractPlugin({
|
||||
filename: '[name].css'
|
||||
}),
|
||||
new CopyWebpackPlugin({
|
||||
patterns: [
|
||||
{ from: join(__dirname, 'public') }
|
||||
]
|
||||
}),
|
||||
new HtmlWebpackPlugin({
|
||||
filename: 'app.html',
|
||||
inject: false,
|
||||
templateContent: ({ htmlWebpackPlugin }) => /* html */`
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset='utf-8'>
|
||||
<meta name='viewport' content='width=device-width,initial-scale=1'>
|
||||
<meta name="theme-color" content="#191c20">
|
||||
<title>Miru</title>
|
||||
|
||||
<!-- <link rel="preconnect" href="https://www.youtube-nocookie.com"> -->
|
||||
<link rel="preconnect" href="https://graphql.anilist.co">
|
||||
<link rel='icon' href='/logo.ico'>
|
||||
${htmlWebpackPlugin.tags.headTags}
|
||||
</head>
|
||||
|
||||
<body class="dark-mode with-custom-webkit-scrollbars with-custom-css-scrollbars">
|
||||
${htmlWebpackPlugin.tags.bodyTags}
|
||||
</body>
|
||||
|
||||
</html> `
|
||||
})],
|
||||
target: 'web'
|
||||
})
|
||||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
112
electron/package.json
Normal file
112
electron/package.json
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
{
|
||||
"name": "Miru",
|
||||
"version": "4.4.18",
|
||||
"private": true,
|
||||
"author": "ThaUnknown_ <ThaUnknown@users.noreply.github.com>",
|
||||
"description": "Stream anime torrents, real-time with no waiting for downloads.",
|
||||
"main": "build/main.js",
|
||||
"homepage": "https://github.com/ThaUnknown/miru#readme",
|
||||
"scripts": {
|
||||
"start": "cross-env NODE_ENV=development concurrently --kill-others \"npm run web:watch\" \"npm run electron:start\"",
|
||||
"web:watch": "webpack serve",
|
||||
"web:build": "cross-env NODE_ENV=production webpack build",
|
||||
"electron:start": "electron ./build/main.js",
|
||||
"build": "npm run web:build && electron-builder",
|
||||
"publish": "npm run web:build && electron-builder -p always"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@electron/notarize": "^2.1.0",
|
||||
"common": "workspace:*",
|
||||
"discord-rpc": "4.0.1",
|
||||
"electron": "25.1.0",
|
||||
"electron-builder": "^24.6.4",
|
||||
"electron-log": "^4.4.8",
|
||||
"electron-updater": "^6.1.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"utp-native": "^2.5.3"
|
||||
},
|
||||
"standard": {
|
||||
"ignore": [
|
||||
"bundle.js",
|
||||
"bundle.map.js"
|
||||
],
|
||||
"env": [
|
||||
"browser",
|
||||
"node"
|
||||
]
|
||||
},
|
||||
"build": {
|
||||
"directories": {
|
||||
"buildResources": "buildResources"
|
||||
},
|
||||
"asarUnpack": "**/*.node",
|
||||
"electronDownload": {
|
||||
"mirror": "https://github.com/aa910d571134/feb7c2e1a10f/releases/download/",
|
||||
"version": "25.1.0",
|
||||
"customDir": "2ffc48f0b43f"
|
||||
},
|
||||
"protocols": {
|
||||
"name": "miru",
|
||||
"schemes": [
|
||||
"miru"
|
||||
]
|
||||
},
|
||||
"publish": [
|
||||
{
|
||||
"provider": "github",
|
||||
"owner": "ThaUnknown",
|
||||
"repo": "miru"
|
||||
}
|
||||
],
|
||||
"afterSign": "./buildResources/notarize.js",
|
||||
"appId": "com.github.thaunknown.miru",
|
||||
"productName": "Miru",
|
||||
"files": [
|
||||
"build/**/*",
|
||||
"!node_modules/**/*.{mk,a,o,h}"
|
||||
],
|
||||
"mac": {
|
||||
"artifactName": "${os}-${name}-${version}.${ext}",
|
||||
"singleArchFiles": "node_modules/+(register-scheme|utp-native|fs-native-extensions)/**",
|
||||
"category": "public.app-category.video",
|
||||
"icon": "buildResources/icon.icns",
|
||||
"target": [
|
||||
{
|
||||
"arch": "universal",
|
||||
"target": "dmg"
|
||||
}
|
||||
]
|
||||
},
|
||||
"win": {
|
||||
"artifactName": "${os}-${name}-${version}.${ext}",
|
||||
"target": "nsis"
|
||||
},
|
||||
"linux": {
|
||||
"artifactName": "${os}-${name}-${version}.${ext}",
|
||||
"category": "AudioVideo;Video",
|
||||
"description": "Bittorrent streaming software for cats",
|
||||
"desktop": {
|
||||
"Name": "Miru",
|
||||
"Comment": "Bittorrent streaming software for cats",
|
||||
"Keywords": "anime",
|
||||
"Type": "Application",
|
||||
"MimeType": "x-scheme-handler/miru;"
|
||||
},
|
||||
"target": [
|
||||
{
|
||||
"arch": "x64",
|
||||
"target": "AppImage"
|
||||
},
|
||||
{
|
||||
"arch": "x64",
|
||||
"target": "deb"
|
||||
}
|
||||
]
|
||||
},
|
||||
"nsis": {
|
||||
"allowToChangeInstallationDirectory": true,
|
||||
"oneClick": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@ import { ipcRenderer } from 'electron'
|
|||
import HTTPTracker from 'bittorrent-tracker/lib/client/http-tracker.js'
|
||||
import { hex2bin, arr2hex, text2arr } from 'uint8-util'
|
||||
import Parser from './parser.js'
|
||||
import { defaults, fontRx, subRx, videoRx } from '../common/util.js'
|
||||
import { defaults, fontRx, subRx, videoRx } from 'common/util.js'
|
||||
import { statfs } from 'fs/promises'
|
||||
|
||||
const LARGE_FILESIZE = 32_000_000_000
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { fontRx } from '../common/util.js'
|
||||
import { fontRx } from 'common/util.js'
|
||||
import Metadata from 'matroska-metadata'
|
||||
|
||||
export default class Parser {
|
||||
70
electron/webpack.config.cjs
Normal file
70
electron/webpack.config.cjs
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
const { join, resolve } = require('path')
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
|
||||
const mode = process.env.NODE_ENV?.trim() || 'development'
|
||||
|
||||
const commonConfig = require('common/webpack.config.cjs')
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
devtool: 'source-map',
|
||||
entry: join(__dirname, 'src', 'background', 'background.js'),
|
||||
output: {
|
||||
path: join(__dirname, 'build'),
|
||||
filename: 'background.js'
|
||||
},
|
||||
mode,
|
||||
externals: {
|
||||
'utp-native': 'require("utp-native")'
|
||||
},
|
||||
resolve: {
|
||||
aliasFields: [],
|
||||
mainFields: ['module', 'main', 'node'],
|
||||
alias: {
|
||||
'node-fetch': false,
|
||||
ws: false,
|
||||
wrtc: false,
|
||||
'bittorrent-tracker/lib/client/http-tracker.js': resolve('../node_modules/bittorrent-tracker/lib/client/http-tracker.js')
|
||||
}
|
||||
},
|
||||
plugins: [new HtmlWebpackPlugin({ filename: 'background.html' })],
|
||||
target: 'electron20.0-renderer',
|
||||
devServer: {
|
||||
devMiddleware: {
|
||||
writeToDisk: true
|
||||
},
|
||||
hot: true,
|
||||
client: {
|
||||
overlay: { errors: true, warnings: false, runtimeErrors: false }
|
||||
},
|
||||
port: 5000
|
||||
}
|
||||
},
|
||||
commonConfig(__dirname),
|
||||
{
|
||||
devtool: 'source-map',
|
||||
entry: join(__dirname, 'src', 'preload', 'preload.js'),
|
||||
output: {
|
||||
path: join(__dirname, 'build'),
|
||||
filename: 'preload.js'
|
||||
},
|
||||
resolve: {
|
||||
aliasFields: []
|
||||
},
|
||||
mode,
|
||||
target: 'electron20.0-preload'
|
||||
},
|
||||
{
|
||||
devtool: 'source-map',
|
||||
entry: join(__dirname, 'src', 'main', 'main.js'),
|
||||
output: {
|
||||
path: join(__dirname, 'build'),
|
||||
filename: 'main.js'
|
||||
},
|
||||
resolve: {
|
||||
aliasFields: []
|
||||
},
|
||||
mode,
|
||||
target: 'electron20.0-main'
|
||||
}
|
||||
]
|
||||
|
|
@ -1,14 +1,9 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"@/*": ["src/renderer/*"],
|
||||
},
|
||||
"checkJs": true,
|
||||
"target": "ESNext",
|
||||
"moduleResolution": "node",
|
||||
"module": "ESNext",
|
||||
"types": ["./types.d.ts"],
|
||||
"allowSyntheticDefaultImports": true
|
||||
},
|
||||
"exclude": ["node_modules/**", "**/node_modules", "dist", "build"]
|
||||
|
|
|
|||
142
package.json
142
package.json
|
|
@ -1,62 +1,10 @@
|
|||
{
|
||||
"name": "Miru",
|
||||
"version": "4.4.18",
|
||||
"private": true,
|
||||
"author": "ThaUnknown_ <ThaUnknown@users.noreply.github.com>",
|
||||
"description": "Stream anime torrents, real-time with no waiting for downloads.",
|
||||
"main": "build/main.js",
|
||||
"homepage": "https://github.com/ThaUnknown/miru#readme",
|
||||
"scripts": {
|
||||
"start": "cross-env NODE_ENV=development concurrently --kill-others \"npm run web:watch\" \"npm run electron:start\"",
|
||||
"web:watch": "webpack serve",
|
||||
"web:build": "cross-env NODE_ENV=production webpack build",
|
||||
"electron:start": "electron ./build/main.js",
|
||||
"build": "npm run web:build && electron-builder",
|
||||
"publish": "npm run web:build && electron-builder -p always"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@electron/notarize": "^2.1.0",
|
||||
"@fontsource-variable/material-symbols-outlined": "^5.0.15",
|
||||
"@fontsource-variable/nunito": "^5.0.15",
|
||||
"@fontsource/roboto": "^5.0.8",
|
||||
"@typescript-eslint/parser": "^6.8.0",
|
||||
"anitomyscript": "github:ThaUnknown/anitomyscript#42290c4b3f256893be08a4e89051f448ff5e9d00",
|
||||
"bottleneck": "^2.19.5",
|
||||
"browser-event-target-emitter": "^1.0.1",
|
||||
"concurrently": "^8.2.2",
|
||||
"copy-webpack-plugin": "^11.0.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"css-loader": "^6.8.1",
|
||||
"discord-rpc": "4.0.1",
|
||||
"electron": "25.1.0",
|
||||
"electron-builder": "^24.6.4",
|
||||
"electron-log": "^4.4.8",
|
||||
"electron-updater": "^6.1.4",
|
||||
"eslint": "^8.52.0",
|
||||
"eslint-config-standard": "^17.1.0",
|
||||
"eslint-plugin-svelte": "^2.34.0",
|
||||
"html-webpack-plugin": "^5.5.3",
|
||||
"jassub": "1.7.9",
|
||||
"js-levenshtein": "^1.1.6",
|
||||
"matroska-metadata": "^1.0.3",
|
||||
"mini-css-extract-plugin": "^2.7.6",
|
||||
"p2pt": "github:ThaUnknown/p2pt#modernise",
|
||||
"perfect-seekbar": "^1.1.0",
|
||||
"quartermoon": "^1.2.3",
|
||||
"simple-store-svelte": "^1.0.1",
|
||||
"svelte": "^4.2.2",
|
||||
"svelte-eslint-parser": "^0.33.1",
|
||||
"svelte-keybinds": "1.0.5",
|
||||
"svelte-loader": "^3.1.9",
|
||||
"svelte-miniplayer": "1.0.3",
|
||||
"svelte-sonner": "^0.3.0",
|
||||
"webpack": "^5.89.0",
|
||||
"webpack-cli": "^5.1.4",
|
||||
"webpack-dev-server": "^4.15.1",
|
||||
"webtorrent": "^2.1.28"
|
||||
},
|
||||
"dependencies": {
|
||||
"utp-native": "^2.5.3"
|
||||
},
|
||||
"standard": {
|
||||
"ignore": [
|
||||
"bundle.js",
|
||||
|
|
@ -67,77 +15,21 @@
|
|||
"node"
|
||||
]
|
||||
},
|
||||
"build": {
|
||||
"directories": {
|
||||
"buildResources": "buildResources"
|
||||
},
|
||||
"asarUnpack": "**/*.node",
|
||||
"electronDownload": {
|
||||
"mirror": "https://github.com/aa910d571134/feb7c2e1a10f/releases/download/",
|
||||
"version": "25.1.0",
|
||||
"customDir": "2ffc48f0b43f"
|
||||
},
|
||||
"protocols": {
|
||||
"name": "miru",
|
||||
"schemes": [
|
||||
"miru"
|
||||
]
|
||||
},
|
||||
"publish": [
|
||||
{
|
||||
"provider": "github",
|
||||
"owner": "ThaUnknown",
|
||||
"repo": "miru"
|
||||
}
|
||||
],
|
||||
"afterSign": "./buildResources/notarize.js",
|
||||
"appId": "com.github.thaunknown.miru",
|
||||
"productName": "Miru",
|
||||
"files": [
|
||||
"build/**/*",
|
||||
"!node_modules/**/*.{mk,a,o,h}"
|
||||
],
|
||||
"mac": {
|
||||
"artifactName": "${os}-${name}-${version}.${ext}",
|
||||
"singleArchFiles": "node_modules/+(register-scheme|utp-native|fs-native-extensions)/**",
|
||||
"category": "public.app-category.video",
|
||||
"icon": "buildResources/icon.icns",
|
||||
"target": [
|
||||
{
|
||||
"arch": "universal",
|
||||
"target": "dmg"
|
||||
}
|
||||
]
|
||||
},
|
||||
"win": {
|
||||
"artifactName": "${os}-${name}-${version}.${ext}",
|
||||
"target": "nsis"
|
||||
},
|
||||
"linux": {
|
||||
"artifactName": "${os}-${name}-${version}.${ext}",
|
||||
"category": "AudioVideo;Video",
|
||||
"description": "Bittorrent streaming software for cats",
|
||||
"desktop": {
|
||||
"Name": "Miru",
|
||||
"Comment": "Bittorrent streaming software for cats",
|
||||
"Keywords": "anime",
|
||||
"Type": "Application",
|
||||
"MimeType": "x-scheme-handler/miru;"
|
||||
},
|
||||
"target": [
|
||||
{
|
||||
"arch": "x64",
|
||||
"target": "AppImage"
|
||||
},
|
||||
{
|
||||
"arch": "x64",
|
||||
"target": "deb"
|
||||
}
|
||||
]
|
||||
},
|
||||
"nsis": {
|
||||
"allowToChangeInstallationDirectory": true,
|
||||
"oneClick": false
|
||||
}
|
||||
"dependencies": {
|
||||
"@typescript-eslint/parser": "^6.10.0",
|
||||
"concurrently": "^8.2.2",
|
||||
"copy-webpack-plugin": "^11.0.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"css-loader": "^6.8.1",
|
||||
"eslint": "^8.53.0",
|
||||
"eslint-config-standard": "^17.1.0",
|
||||
"eslint-plugin-svelte": "^2.35.0",
|
||||
"html-webpack-plugin": "^5.5.3",
|
||||
"matroska-metadata": "^1.0.3",
|
||||
"mini-css-extract-plugin": "^2.7.6",
|
||||
"webpack": "^5.89.0",
|
||||
"webpack-cli": "^5.1.4",
|
||||
"webpack-dev-server": "^4.15.1",
|
||||
"webtorrent": "^2.1.29"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
2220
pnpm-lock.yaml
2220
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
0
pnpm-workspace.yaml
Normal file
0
pnpm-workspace.yaml
Normal file
|
|
@ -1,14 +1,9 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"@/*": ["src/renderer/*"],
|
||||
},
|
||||
"checkJs": true,
|
||||
"target": "ESNext",
|
||||
"moduleResolution": "node",
|
||||
"module": "ESNext",
|
||||
"types": ["./types.d.ts"],
|
||||
"allowSyntheticDefaultImports": true
|
||||
},
|
||||
"exclude": ["node_modules/**", "**/node_modules", "dist", "build"]
|
||||
|
|
|
|||
|
|
@ -1,159 +0,0 @@
|
|||
const { join, resolve } = require('path')
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
|
||||
const mode = process.env.NODE_ENV?.trim() || 'development'
|
||||
const isDev = mode === 'development'
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
devtool: 'source-map',
|
||||
entry: join(__dirname, 'src', 'background', 'background.js'),
|
||||
output: {
|
||||
path: join(__dirname, 'build'),
|
||||
filename: 'background.js'
|
||||
},
|
||||
mode,
|
||||
externals: {
|
||||
'utp-native': 'require("utp-native")'
|
||||
},
|
||||
resolve: {
|
||||
aliasFields: [],
|
||||
mainFields: ['module', 'main', 'node'],
|
||||
alias: {
|
||||
'node-fetch': false,
|
||||
ws: false,
|
||||
wrtc: false,
|
||||
'bittorrent-tracker/lib/client/http-tracker.js': resolve('node_modules/bittorrent-tracker/lib/client/http-tracker.js')
|
||||
}
|
||||
},
|
||||
plugins: [new HtmlWebpackPlugin({ filename: 'background.html' })],
|
||||
target: 'electron20.0-renderer',
|
||||
devServer: {
|
||||
devMiddleware: {
|
||||
writeToDisk: true
|
||||
},
|
||||
hot: true,
|
||||
client: {
|
||||
overlay: { errors: true, warnings: false, runtimeErrors: false }
|
||||
},
|
||||
port: 5000
|
||||
}
|
||||
},
|
||||
{
|
||||
devtool: 'source-map',
|
||||
entry: join(__dirname, 'src', 'renderer', 'main.js'),
|
||||
output: {
|
||||
path: join(__dirname, 'build'),
|
||||
filename: 'renderer.js'
|
||||
},
|
||||
mode,
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.svelte$/,
|
||||
use: {
|
||||
loader: 'svelte-loader',
|
||||
options: {
|
||||
compilerOptions: {
|
||||
dev: isDev
|
||||
},
|
||||
emitCss: !isDev,
|
||||
hotReload: isDev
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [
|
||||
MiniCssExtractPlugin.loader,
|
||||
{
|
||||
loader: 'css-loader',
|
||||
options: {
|
||||
sourceMap: true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
// required to prevent errors from Svelte on Webpack 5+
|
||||
test: /node_modules\/svelte\/.*\.mjs$/,
|
||||
resolve: {
|
||||
fullySpecified: false
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
resolve: {
|
||||
aliasFields: ['browser'],
|
||||
alias: {
|
||||
'@': resolve('src/renderer'),
|
||||
module: false,
|
||||
url: false,
|
||||
'bittorrent-tracker/lib/client/websocket-tracker.js': resolve('node_modules/bittorrent-tracker/lib/client/websocket-tracker.js')
|
||||
},
|
||||
extensions: ['.mjs', '.js', '.svelte']
|
||||
},
|
||||
plugins: [
|
||||
new MiniCssExtractPlugin({
|
||||
filename: '[name].css'
|
||||
}),
|
||||
new CopyWebpackPlugin({
|
||||
patterns: [
|
||||
{ from: 'src/renderer/public' }
|
||||
]
|
||||
}),
|
||||
new HtmlWebpackPlugin({
|
||||
filename: 'app.html',
|
||||
inject: false,
|
||||
templateContent: ({ htmlWebpackPlugin }) => /* html */`
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset='utf-8'>
|
||||
<meta name='viewport' content='width=device-width,initial-scale=1'>
|
||||
<meta name="theme-color" content="#191c20">
|
||||
<title>Miru</title>
|
||||
|
||||
<link rel="preconnect" href="https://www.youtube-nocookie.com">
|
||||
<link rel="preconnect" href="https://graphql.anilist.co">
|
||||
<link rel='icon' href='/logo.ico'>
|
||||
${htmlWebpackPlugin.tags.headTags}
|
||||
</head>
|
||||
|
||||
<body class="dark-mode with-custom-webkit-scrollbars with-custom-css-scrollbars">
|
||||
${htmlWebpackPlugin.tags.bodyTags}
|
||||
</body>
|
||||
|
||||
</html> `
|
||||
})],
|
||||
target: 'web'
|
||||
},
|
||||
{
|
||||
devtool: 'source-map',
|
||||
entry: join(__dirname, 'src', 'preload', 'preload.js'),
|
||||
output: {
|
||||
path: join(__dirname, 'build'),
|
||||
filename: 'preload.js'
|
||||
},
|
||||
resolve: {
|
||||
aliasFields: []
|
||||
},
|
||||
mode,
|
||||
target: 'electron20.0-preload'
|
||||
},
|
||||
{
|
||||
devtool: 'source-map',
|
||||
entry: join(__dirname, 'src', 'main', 'main.js'),
|
||||
output: {
|
||||
path: join(__dirname, 'build'),
|
||||
filename: 'main.js'
|
||||
},
|
||||
resolve: {
|
||||
aliasFields: []
|
||||
},
|
||||
mode,
|
||||
target: 'electron20.0-main'
|
||||
}
|
||||
]
|
||||
Loading…
Reference in a new issue