mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-10-12 20:49:53 +08:00
refactor(electron): remove the configuration-preset system and read .env with dotenv
- delete electron/settings, the settings preload and window, the config-presets IPC channels, the Configuration menu and the preset watcher in scripts/electron-dev.mjs; config-manager.ts keeps only the user locale (still read from config-presets.json so the saved language survives) - electron/main/env-loader.ts parses .env with dotenv instead of a hand-written parser; electron:compile bundles dependencies - drop the unreachable development branches in port-manager.ts and next-server.ts, the duplicated locale normalisation in menu-i18n.ts, the unused electronAPI members, resources/entitlements.mac.plist - scripts/copy-dereferenced.cjs shared by afterPack and prepare-electron-build - CI: delete ci.yml, move type check and concurrency into test.yml, Node 24 everywhere, docker-build only on main - remove unused dependencies (@xmldom/xmldom, remark-gfm, @anthropic-ai/tokenizer, @testing-library/user-event, concurrently, wait-on, eslint, eslint-config-next, @vitest/coverage-v8, shx), .eslintrc.json and the vitest coverage block
This commit is contained in:
+2
-41
@@ -4,49 +4,10 @@
|
||||
* and ad-hoc signs macOS apps for offline draw.io bundle compatibility
|
||||
*/
|
||||
|
||||
const {
|
||||
copyFileSync,
|
||||
existsSync,
|
||||
lstatSync,
|
||||
mkdirSync,
|
||||
readdirSync,
|
||||
statSync,
|
||||
} = require("fs")
|
||||
const { existsSync } = require("fs")
|
||||
const path = require("path")
|
||||
const { execSync } = require("child_process")
|
||||
|
||||
/**
|
||||
* Copy directory recursively, converting symlinks to regular files/directories.
|
||||
* This is needed because cpSync with dereference:true does NOT convert symlinks.
|
||||
* macOS codesign fails if bundle contains symlinks pointing outside the bundle.
|
||||
*/
|
||||
function copyDereferenced(src, dst) {
|
||||
const lstat = lstatSync(src)
|
||||
|
||||
if (lstat.isSymbolicLink()) {
|
||||
// Follow symlink and check what it points to
|
||||
const stat = statSync(src)
|
||||
if (stat.isDirectory()) {
|
||||
// Symlink to directory: recursively copy the directory contents
|
||||
mkdirSync(dst, { recursive: true })
|
||||
for (const entry of readdirSync(src)) {
|
||||
copyDereferenced(path.join(src, entry), path.join(dst, entry))
|
||||
}
|
||||
} else {
|
||||
// Symlink to file: copy the actual file content
|
||||
mkdirSync(path.join(dst, ".."), { recursive: true })
|
||||
copyFileSync(src, dst)
|
||||
}
|
||||
} else if (lstat.isDirectory()) {
|
||||
mkdirSync(dst, { recursive: true })
|
||||
for (const entry of readdirSync(src)) {
|
||||
copyDereferenced(path.join(src, entry), path.join(dst, entry))
|
||||
}
|
||||
} else {
|
||||
mkdirSync(path.join(dst, ".."), { recursive: true })
|
||||
copyFileSync(src, dst)
|
||||
}
|
||||
}
|
||||
const copyDereferenced = require("./copy-dereferenced.cjs")
|
||||
|
||||
module.exports = async (context) => {
|
||||
const appOutDir = context.appOutDir
|
||||
|
||||
Reference in New Issue
Block a user