mirror of
https://github.com/fanchenio/DawnLauncher.git
synced 2025-07-14 13:22:09 +08:00
fix: yarn link mode & electron build
This commit is contained in:
parent
baca5ec985
commit
c1a115bd1e
@ -1,3 +1,9 @@
|
|||||||
|
compressionLevel: mixed
|
||||||
|
|
||||||
|
enableGlobalCache: true
|
||||||
|
|
||||||
|
nmMode: hardlinks-local
|
||||||
|
|
||||||
nodeLinker: node-modules
|
nodeLinker: node-modules
|
||||||
|
|
||||||
yarnPath: .yarn/releases/yarn-4.0.2.cjs
|
yarnPath: .yarn/releases/yarn-4.0.2.cjs
|
||||||
|
33
package.json
33
package.json
@ -1,18 +1,19 @@
|
|||||||
{
|
{
|
||||||
"name": "@dawn-launcher/monorepos",
|
"name": "@dawn-launcher/monorepos",
|
||||||
"productName": "Dawn Launcher",
|
"productName": "Dawn Launcher",
|
||||||
"version": "1.3.5",
|
"version": "1.3.5",
|
||||||
"private": true,
|
"private": true,
|
||||||
"author": "FanChenIO",
|
"author": "FanChenIO",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"packages/*"
|
"packages/*"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "yarn workspace @dawn-launcher/electron dev",
|
"dev": "yarn workspace @dawn-launcher/electron dev",
|
||||||
"build:addon": "yarn workspace @dawn-launcher/addon build",
|
"build": "yarn workspace @dawn-launcher/electron build",
|
||||||
"build:sqlite": "npx electron rebuild.js",
|
"build:addon": "yarn workspace @dawn-launcher/addon build",
|
||||||
"postinstall": "yarn build:addon && yarn build:sqlite"
|
"build:sqlite": "yarn workspace @dawn-launcher/electron build:sqlite",
|
||||||
},
|
"postinstall": "yarn build:addon && yarn build:sqlite"
|
||||||
"packageManager": "yarn@4.0.2"
|
},
|
||||||
|
"packageManager": "yarn@4.0.2"
|
||||||
}
|
}
|
||||||
|
@ -1,305 +1,49 @@
|
|||||||
/* tslint:disable */
|
import * as Addon from './addon.node'
|
||||||
/* eslint-disable */
|
|
||||||
/* prettier-ignore */
|
|
||||||
|
|
||||||
/* auto-generated by NAPI-RS */
|
const {
|
||||||
|
getFileIcon,
|
||||||
|
searchPath,
|
||||||
|
getShortcutFileInfo,
|
||||||
|
shellExecute,
|
||||||
|
systemItemExecute,
|
||||||
|
openFileLocation,
|
||||||
|
explorerContextMenu,
|
||||||
|
getEnvByName,
|
||||||
|
isFullscreen,
|
||||||
|
switchEnglish,
|
||||||
|
createMouseHook,
|
||||||
|
enableMouseHook,
|
||||||
|
disableMouseHook,
|
||||||
|
getCursorPosWindowClassName,
|
||||||
|
getClipboardFileList,
|
||||||
|
clipboardHasBitmap,
|
||||||
|
getClipboardBitmapBase64,
|
||||||
|
emptyRecycleBin,
|
||||||
|
removeWindowAnimation,
|
||||||
|
getAppxList,
|
||||||
|
} = Addon
|
||||||
|
|
||||||
const { existsSync, readFileSync } = require('fs')
|
export default Addon
|
||||||
const { join } = require('path')
|
|
||||||
|
|
||||||
const { platform, arch } = process
|
export {
|
||||||
|
getFileIcon,
|
||||||
let nativeBinding = null
|
searchPath,
|
||||||
let localFileExisted = false
|
getShortcutFileInfo,
|
||||||
let loadError = null
|
shellExecute,
|
||||||
|
systemItemExecute,
|
||||||
function isMusl() {
|
openFileLocation,
|
||||||
// For Node 10
|
explorerContextMenu,
|
||||||
if (!process.report || typeof process.report.getReport !== 'function') {
|
getEnvByName,
|
||||||
try {
|
isFullscreen,
|
||||||
const lddPath = require('child_process').execSync('which ldd').toString().trim()
|
switchEnglish,
|
||||||
return readFileSync(lddPath, 'utf8').includes('musl')
|
createMouseHook,
|
||||||
} catch (e) {
|
enableMouseHook,
|
||||||
return true
|
disableMouseHook,
|
||||||
}
|
getCursorPosWindowClassName,
|
||||||
} else {
|
getClipboardFileList,
|
||||||
const { glibcVersionRuntime } = process.report.getReport().header
|
clipboardHasBitmap,
|
||||||
return !glibcVersionRuntime
|
getClipboardBitmapBase64,
|
||||||
}
|
emptyRecycleBin,
|
||||||
|
removeWindowAnimation,
|
||||||
|
getAppxList,
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (platform) {
|
|
||||||
case 'android':
|
|
||||||
switch (arch) {
|
|
||||||
case 'arm64':
|
|
||||||
localFileExisted = existsSync(join(__dirname, 'addon.android-arm64.node'))
|
|
||||||
try {
|
|
||||||
if (localFileExisted) {
|
|
||||||
nativeBinding = require('./addon.android-arm64.node')
|
|
||||||
} else {
|
|
||||||
nativeBinding = require('@dawn-launcher/addon-android-arm64')
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
loadError = e
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case 'arm':
|
|
||||||
localFileExisted = existsSync(join(__dirname, 'addon.android-arm-eabi.node'))
|
|
||||||
try {
|
|
||||||
if (localFileExisted) {
|
|
||||||
nativeBinding = require('./addon.android-arm-eabi.node')
|
|
||||||
} else {
|
|
||||||
nativeBinding = require('@dawn-launcher/addon-android-arm-eabi')
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
loadError = e
|
|
||||||
}
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
throw new Error(`Unsupported architecture on Android ${arch}`)
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case 'win32':
|
|
||||||
switch (arch) {
|
|
||||||
case 'x64':
|
|
||||||
localFileExisted = existsSync(
|
|
||||||
join(__dirname, 'addon.win32-x64-msvc.node')
|
|
||||||
)
|
|
||||||
try {
|
|
||||||
if (localFileExisted) {
|
|
||||||
nativeBinding = require('./addon.win32-x64-msvc.node')
|
|
||||||
} else {
|
|
||||||
nativeBinding = require('@dawn-launcher/addon-win32-x64-msvc')
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
loadError = e
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case 'ia32':
|
|
||||||
localFileExisted = existsSync(
|
|
||||||
join(__dirname, 'addon.win32-ia32-msvc.node')
|
|
||||||
)
|
|
||||||
try {
|
|
||||||
if (localFileExisted) {
|
|
||||||
nativeBinding = require('./addon.win32-ia32-msvc.node')
|
|
||||||
} else {
|
|
||||||
nativeBinding = require('@dawn-launcher/addon-win32-ia32-msvc')
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
loadError = e
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case 'arm64':
|
|
||||||
localFileExisted = existsSync(
|
|
||||||
join(__dirname, 'addon.win32-arm64-msvc.node')
|
|
||||||
)
|
|
||||||
try {
|
|
||||||
if (localFileExisted) {
|
|
||||||
nativeBinding = require('./addon.win32-arm64-msvc.node')
|
|
||||||
} else {
|
|
||||||
nativeBinding = require('@dawn-launcher/addon-win32-arm64-msvc')
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
loadError = e
|
|
||||||
}
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
throw new Error(`Unsupported architecture on Windows: ${arch}`)
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case 'darwin':
|
|
||||||
localFileExisted = existsSync(join(__dirname, 'addon.darwin-universal.node'))
|
|
||||||
try {
|
|
||||||
if (localFileExisted) {
|
|
||||||
nativeBinding = require('./addon.darwin-universal.node')
|
|
||||||
} else {
|
|
||||||
nativeBinding = require('@dawn-launcher/addon-darwin-universal')
|
|
||||||
}
|
|
||||||
break
|
|
||||||
} catch {}
|
|
||||||
switch (arch) {
|
|
||||||
case 'x64':
|
|
||||||
localFileExisted = existsSync(join(__dirname, 'addon.darwin-x64.node'))
|
|
||||||
try {
|
|
||||||
if (localFileExisted) {
|
|
||||||
nativeBinding = require('./addon.darwin-x64.node')
|
|
||||||
} else {
|
|
||||||
nativeBinding = require('@dawn-launcher/addon-darwin-x64')
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
loadError = e
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case 'arm64':
|
|
||||||
localFileExisted = existsSync(
|
|
||||||
join(__dirname, 'addon.darwin-arm64.node')
|
|
||||||
)
|
|
||||||
try {
|
|
||||||
if (localFileExisted) {
|
|
||||||
nativeBinding = require('./addon.darwin-arm64.node')
|
|
||||||
} else {
|
|
||||||
nativeBinding = require('@dawn-launcher/addon-darwin-arm64')
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
loadError = e
|
|
||||||
}
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
throw new Error(`Unsupported architecture on macOS: ${arch}`)
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case 'freebsd':
|
|
||||||
if (arch !== 'x64') {
|
|
||||||
throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
|
|
||||||
}
|
|
||||||
localFileExisted = existsSync(join(__dirname, 'addon.freebsd-x64.node'))
|
|
||||||
try {
|
|
||||||
if (localFileExisted) {
|
|
||||||
nativeBinding = require('./addon.freebsd-x64.node')
|
|
||||||
} else {
|
|
||||||
nativeBinding = require('@dawn-launcher/addon-freebsd-x64')
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
loadError = e
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case 'linux':
|
|
||||||
switch (arch) {
|
|
||||||
case 'x64':
|
|
||||||
if (isMusl()) {
|
|
||||||
localFileExisted = existsSync(
|
|
||||||
join(__dirname, 'addon.linux-x64-musl.node')
|
|
||||||
)
|
|
||||||
try {
|
|
||||||
if (localFileExisted) {
|
|
||||||
nativeBinding = require('./addon.linux-x64-musl.node')
|
|
||||||
} else {
|
|
||||||
nativeBinding = require('@dawn-launcher/addon-linux-x64-musl')
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
loadError = e
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
localFileExisted = existsSync(
|
|
||||||
join(__dirname, 'addon.linux-x64-gnu.node')
|
|
||||||
)
|
|
||||||
try {
|
|
||||||
if (localFileExisted) {
|
|
||||||
nativeBinding = require('./addon.linux-x64-gnu.node')
|
|
||||||
} else {
|
|
||||||
nativeBinding = require('@dawn-launcher/addon-linux-x64-gnu')
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
loadError = e
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case 'arm64':
|
|
||||||
if (isMusl()) {
|
|
||||||
localFileExisted = existsSync(
|
|
||||||
join(__dirname, 'addon.linux-arm64-musl.node')
|
|
||||||
)
|
|
||||||
try {
|
|
||||||
if (localFileExisted) {
|
|
||||||
nativeBinding = require('./addon.linux-arm64-musl.node')
|
|
||||||
} else {
|
|
||||||
nativeBinding = require('@dawn-launcher/addon-linux-arm64-musl')
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
loadError = e
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
localFileExisted = existsSync(
|
|
||||||
join(__dirname, 'addon.linux-arm64-gnu.node')
|
|
||||||
)
|
|
||||||
try {
|
|
||||||
if (localFileExisted) {
|
|
||||||
nativeBinding = require('./addon.linux-arm64-gnu.node')
|
|
||||||
} else {
|
|
||||||
nativeBinding = require('@dawn-launcher/addon-linux-arm64-gnu')
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
loadError = e
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case 'arm':
|
|
||||||
localFileExisted = existsSync(
|
|
||||||
join(__dirname, 'addon.linux-arm-gnueabihf.node')
|
|
||||||
)
|
|
||||||
try {
|
|
||||||
if (localFileExisted) {
|
|
||||||
nativeBinding = require('./addon.linux-arm-gnueabihf.node')
|
|
||||||
} else {
|
|
||||||
nativeBinding = require('@dawn-launcher/addon-linux-arm-gnueabihf')
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
loadError = e
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case 'riscv64':
|
|
||||||
if (isMusl()) {
|
|
||||||
localFileExisted = existsSync(
|
|
||||||
join(__dirname, 'addon.linux-riscv64-musl.node')
|
|
||||||
)
|
|
||||||
try {
|
|
||||||
if (localFileExisted) {
|
|
||||||
nativeBinding = require('./addon.linux-riscv64-musl.node')
|
|
||||||
} else {
|
|
||||||
nativeBinding = require('@dawn-launcher/addon-linux-riscv64-musl')
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
loadError = e
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
localFileExisted = existsSync(
|
|
||||||
join(__dirname, 'addon.linux-riscv64-gnu.node')
|
|
||||||
)
|
|
||||||
try {
|
|
||||||
if (localFileExisted) {
|
|
||||||
nativeBinding = require('./addon.linux-riscv64-gnu.node')
|
|
||||||
} else {
|
|
||||||
nativeBinding = require('@dawn-launcher/addon-linux-riscv64-gnu')
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
loadError = e
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
throw new Error(`Unsupported architecture on Linux: ${arch}`)
|
|
||||||
}
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!nativeBinding) {
|
|
||||||
if (loadError) {
|
|
||||||
throw loadError
|
|
||||||
}
|
|
||||||
throw new Error(`Failed to load native binding`)
|
|
||||||
}
|
|
||||||
|
|
||||||
const { getFileIcon, searchPath, getShortcutFileInfo, shellExecute, systemItemExecute, openFileLocation, explorerContextMenu, getEnvByName, isFullscreen, switchEnglish, createMouseHook, enableMouseHook, disableMouseHook, getCursorPosWindowClassName, getClipboardFileList, clipboardHasBitmap, getClipboardBitmapBase64, emptyRecycleBin, removeWindowAnimation, getAppxList } = nativeBinding
|
|
||||||
|
|
||||||
module.exports.getFileIcon = getFileIcon
|
|
||||||
module.exports.searchPath = searchPath
|
|
||||||
module.exports.getShortcutFileInfo = getShortcutFileInfo
|
|
||||||
module.exports.shellExecute = shellExecute
|
|
||||||
module.exports.systemItemExecute = systemItemExecute
|
|
||||||
module.exports.openFileLocation = openFileLocation
|
|
||||||
module.exports.explorerContextMenu = explorerContextMenu
|
|
||||||
module.exports.getEnvByName = getEnvByName
|
|
||||||
module.exports.isFullscreen = isFullscreen
|
|
||||||
module.exports.switchEnglish = switchEnglish
|
|
||||||
module.exports.createMouseHook = createMouseHook
|
|
||||||
module.exports.enableMouseHook = enableMouseHook
|
|
||||||
module.exports.disableMouseHook = disableMouseHook
|
|
||||||
module.exports.getCursorPosWindowClassName = getCursorPosWindowClassName
|
|
||||||
module.exports.getClipboardFileList = getClipboardFileList
|
|
||||||
module.exports.clipboardHasBitmap = clipboardHasBitmap
|
|
||||||
module.exports.getClipboardBitmapBase64 = getClipboardBitmapBase64
|
|
||||||
module.exports.emptyRecycleBin = emptyRecycleBin
|
|
||||||
module.exports.removeWindowAnimation = removeWindowAnimation
|
|
||||||
module.exports.getAppxList = getAppxList
|
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
# `addon-win32-arm64-msvc`
|
|
||||||
|
|
||||||
This is the **aarch64-pc-windows-msvc** binary for `addon`
|
|
@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "addon-win32-arm64-msvc",
|
|
||||||
"version": "0.0.0",
|
|
||||||
"os": [
|
|
||||||
"win32"
|
|
||||||
],
|
|
||||||
"cpu": [
|
|
||||||
"arm64"
|
|
||||||
],
|
|
||||||
"main": "addon.win32-arm64-msvc.node",
|
|
||||||
"files": [
|
|
||||||
"addon.win32-arm64-msvc.node"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 10"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
# `addon-win32-x64-msvc`
|
|
||||||
|
|
||||||
This is the **x86_64-pc-windows-msvc** binary for `addon`
|
|
@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "addon-win32-x64-msvc",
|
|
||||||
"version": "0.0.0",
|
|
||||||
"os": [
|
|
||||||
"win32"
|
|
||||||
],
|
|
||||||
"cpu": [
|
|
||||||
"x64"
|
|
||||||
],
|
|
||||||
"main": "addon.win32-x64-msvc.node",
|
|
||||||
"files": [
|
|
||||||
"addon.win32-x64-msvc.node"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 10"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,36 +1,37 @@
|
|||||||
{
|
{
|
||||||
"name": "@dawn-launcher/addon",
|
"name": "@dawn-launcher/addon",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"main": "index.js",
|
"private": true,
|
||||||
"types": "index.d.ts",
|
"main": "index.js",
|
||||||
"napi": {
|
"types": "index.d.ts",
|
||||||
"name": "addon",
|
"napi": {
|
||||||
"triples": {
|
"name": "addon",
|
||||||
"defaults": false,
|
"triples": {
|
||||||
"additional": [
|
"defaults": false,
|
||||||
"aarch64-pc-windows-msvc",
|
"additional": [
|
||||||
"x86_64-pc-windows-msvc"
|
"aarch64-pc-windows-msvc",
|
||||||
]
|
"x86_64-pc-windows-msvc"
|
||||||
}
|
]
|
||||||
},
|
}
|
||||||
"license": "MIT",
|
},
|
||||||
"devDependencies": {
|
"license": "MIT",
|
||||||
"@napi-rs/cli": "^2.17.0",
|
"devDependencies": {
|
||||||
"ava": "^5.1.1"
|
"@napi-rs/cli": "^2.17.0",
|
||||||
},
|
"ava": "^5.1.1"
|
||||||
"ava": {
|
},
|
||||||
"timeout": "3m"
|
"ava": {
|
||||||
},
|
"timeout": "3m"
|
||||||
"engines": {
|
},
|
||||||
"node": ">= 10"
|
"engines": {
|
||||||
},
|
"node": ">= 10"
|
||||||
"scripts": {
|
},
|
||||||
"artifacts": "napi artifacts",
|
"scripts": {
|
||||||
"build": "napi build --platform --release",
|
"artifacts": "napi artifacts",
|
||||||
"build:debug": "napi build --platform",
|
"build": "napi build --release",
|
||||||
"prepublishOnly": "napi prepublish -t npm",
|
"build:debug": "napi build",
|
||||||
"test": "ava",
|
"prepublishOnly": "napi prepublish -t npm",
|
||||||
"universal": "napi universal",
|
"test": "ava",
|
||||||
"version": "napi version"
|
"universal": "napi universal",
|
||||||
}
|
"version": "napi version"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,13 @@
|
|||||||
asarUnpack: ["**/*.node"],
|
asarUnpack: ["**/*.node"],
|
||||||
npmRebuild: false,
|
npmRebuild: false,
|
||||||
files: ["dist", "dist-electron", "native", "!node_modules/**/*"],
|
files: ["dist", "dist-electron", "native", "!node_modules/**/*"],
|
||||||
|
"extraFiles": [
|
||||||
|
{
|
||||||
|
"from": "../addon/",
|
||||||
|
"to": "./resources/addon/",
|
||||||
|
"filter": ["*.node"]
|
||||||
|
}
|
||||||
|
],
|
||||||
win: {
|
win: {
|
||||||
appId: "com.dawnlauncher.application",
|
appId: "com.dawnlauncher.application",
|
||||||
target: [
|
target: [
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { app, BrowserWindow, dialog } from "electron";
|
import { app, BrowserWindow, dialog } from "electron";
|
||||||
import { release } from "node:os";
|
import { release } from "node:os";
|
||||||
import { join, dirname } from "node:path";
|
import { join, dirname } from "node:path";
|
||||||
|
import Addon from "@dawn-launcher/addon";
|
||||||
import indexIpcEvent from "./main/ipcEvent";
|
import indexIpcEvent from "./main/ipcEvent";
|
||||||
import classificationIpcEvent from "./classification/ipcEvent";
|
import classificationIpcEvent from "./classification/ipcEvent";
|
||||||
import { init as classificationDataInit } from "./classification/data";
|
import { init as classificationDataInit } from "./classification/data";
|
||||||
@ -55,7 +56,7 @@ if (!app.requestSingleInstanceLock()) {
|
|||||||
app.whenReady().then(() => {
|
app.whenReady().then(() => {
|
||||||
try {
|
try {
|
||||||
// addon
|
// addon
|
||||||
global.addon = require("@dawn-launcher/addon");
|
global.addon = Addon;
|
||||||
// 初始化数据
|
// 初始化数据
|
||||||
settingDataInit();
|
settingDataInit();
|
||||||
// 获取语言
|
// 获取语言
|
||||||
|
@ -7,7 +7,8 @@ import {
|
|||||||
import { CommonItem, Item } from "../../types/item";
|
import { CommonItem, Item } from "../../types/item";
|
||||||
import { parse, join, extname } from "node:path";
|
import { parse, join, extname } from "node:path";
|
||||||
import { readdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
|
import { readdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
|
||||||
import { execSync } from "node:child_process";
|
|
||||||
|
import Addon from "@dawn-launcher/addon";
|
||||||
import xml2js from "xml2js";
|
import xml2js from "xml2js";
|
||||||
import { newCommonItem, newCommonItemData } from "../../commons/utils/common";
|
import { newCommonItem, newCommonItemData } from "../../commons/utils/common";
|
||||||
import { ShortcutInfo } from "../../types/common";
|
import { ShortcutInfo } from "../../types/common";
|
||||||
@ -21,7 +22,7 @@ export interface AppxInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// addon
|
// addon
|
||||||
global.addon = require("@dawn-launcher/addon");
|
global.addon = Addon;
|
||||||
|
|
||||||
// 接收消息
|
// 接收消息
|
||||||
process.parentPort.once("message", async (event) => {
|
process.parentPort.once("message", async (event) => {
|
||||||
|
@ -19,10 +19,10 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vue-tsc --noEmit && vite build && electron-builder",
|
"build": "vue-tsc --noEmit && vite build && electron-builder",
|
||||||
|
"build:sqlite": "npx electron rebuild.js",
|
||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@dawn-launcher/addon": "workspace:*",
|
|
||||||
"@napi-rs/cli": "^2.16.3",
|
"@napi-rs/cli": "^2.16.3",
|
||||||
"@vicons/ionicons5": "^0.12.0",
|
"@vicons/ionicons5": "^0.12.0",
|
||||||
"@vicons/material": "^0.12.0",
|
"@vicons/material": "^0.12.0",
|
||||||
@ -39,12 +39,12 @@
|
|||||||
"tailwindcss": "^3.3.5",
|
"tailwindcss": "^3.3.5",
|
||||||
"typescript": "^5.2.2",
|
"typescript": "^5.2.2",
|
||||||
"vite": "^4.4.11",
|
"vite": "^4.4.11",
|
||||||
"vite-plugin-commonjs": "^0.10.1",
|
|
||||||
"vite-plugin-electron": "^0.15.4",
|
"vite-plugin-electron": "^0.15.4",
|
||||||
"vue": "^3.3.7",
|
"vue": "^3.3.7",
|
||||||
"vue-tsc": "^1.8.22"
|
"vue-tsc": "^1.8.22"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@dawn-launcher/addon": "workspace:*",
|
||||||
"@types/dompurify": "^3.0.3",
|
"@types/dompurify": "^3.0.3",
|
||||||
"@types/mime": "^3.0.2",
|
"@types/mime": "^3.0.2",
|
||||||
"@types/request": "^2.48.10",
|
"@types/request": "^2.48.10",
|
||||||
@ -66,5 +66,8 @@
|
|||||||
"urijs": "^1.19.11",
|
"urijs": "^1.19.11",
|
||||||
"vue-router": "^4.2.5",
|
"vue-router": "^4.2.5",
|
||||||
"xml2js": "^0.6.2"
|
"xml2js": "^0.6.2"
|
||||||
|
},
|
||||||
|
"installConfig": {
|
||||||
|
"hoistingLimits": "workspaces"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ import { resolve, join } from 'node:path'
|
|||||||
import { type Plugin, defineConfig, normalizePath } from 'vite'
|
import { type Plugin, defineConfig, normalizePath } from 'vite'
|
||||||
import vue from '@vitejs/plugin-vue'
|
import vue from '@vitejs/plugin-vue'
|
||||||
import electron from 'vite-plugin-electron'
|
import electron from 'vite-plugin-electron'
|
||||||
import commonjs from 'vite-plugin-commonjs'
|
|
||||||
import { notBundle } from 'vite-plugin-electron/plugin'
|
import { notBundle } from 'vite-plugin-electron/plugin'
|
||||||
import pkg from './package.json'
|
import pkg from './package.json'
|
||||||
|
|
||||||
@ -35,8 +34,8 @@ export default defineConfig(({ command }) => {
|
|||||||
ignoreDynamicRequires: true,
|
ignoreDynamicRequires: true,
|
||||||
},
|
},
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
plugins: [commonjs()],
|
plugins: [],
|
||||||
external: ['@dawn-launcher/addon'],
|
external: [/\.node$/],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
plugins: [isServe && notBundle()],
|
plugins: [isServe && notBundle()],
|
||||||
@ -73,7 +72,7 @@ export default defineConfig(({ command }) => {
|
|||||||
ignoreDynamicRequires: true,
|
ignoreDynamicRequires: true,
|
||||||
},
|
},
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
external: [],
|
external: [/\.node$/],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
plugins: [isServe && notBundle()],
|
plugins: [isServe && notBundle()],
|
||||||
|
Loading…
Reference in New Issue
Block a user