markpdfdown 0.1.3-tfour → 0.1.3-tthree
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +2 -14
- package/package.json +1 -9
package/bin/cli.js
CHANGED
|
@@ -14,27 +14,15 @@ const __filename = fileURLToPath(import.meta.url);
|
|
|
14
14
|
const __dirname = dirname(__filename);
|
|
15
15
|
const projectRoot = join(__dirname, '..');
|
|
16
16
|
|
|
17
|
-
// 从 package.json 读取 electron 版本要求
|
|
18
|
-
function getElectronVersion() {
|
|
19
|
-
const require = createRequire(import.meta.url);
|
|
20
|
-
const pkg = require('../package.json');
|
|
21
|
-
// 优先从 dependencies 读取,其次从 devDependencies,最后使用默认值
|
|
22
|
-
return pkg.dependencies?.electron
|
|
23
|
-
|| pkg.devDependencies?.electron
|
|
24
|
-
|| pkg.peerDependencies?.electron
|
|
25
|
-
|| '^35.0.0';
|
|
26
|
-
}
|
|
27
|
-
|
|
28
17
|
// 确保 Electron 已安装
|
|
29
18
|
async function ensureElectron() {
|
|
30
19
|
const electronBin = process.platform === 'win32' ? 'electron.cmd' : 'electron';
|
|
31
20
|
const electronPath = join(projectRoot, 'node_modules', '.bin', electronBin);
|
|
32
21
|
|
|
33
22
|
if (!existsSync(electronPath)) {
|
|
34
|
-
|
|
35
|
-
console.log(`📦 Electron not found. Installing electron@${electronVersion}...`);
|
|
23
|
+
console.log('📦 Electron not found. Installing...');
|
|
36
24
|
try {
|
|
37
|
-
execSync(
|
|
25
|
+
execSync('npm install electron --no-save', {
|
|
38
26
|
cwd: projectRoot,
|
|
39
27
|
stdio: 'inherit',
|
|
40
28
|
shell: true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markpdfdown",
|
|
3
|
-
"version": "0.1.3-
|
|
3
|
+
"version": "0.1.3-tthree",
|
|
4
4
|
"description": "A high-quality PDF to Markdown tool based on large language model visual recognition.",
|
|
5
5
|
"author": "MarkPDFdown",
|
|
6
6
|
"main": "dist/main/index.js",
|
|
@@ -126,14 +126,6 @@
|
|
|
126
126
|
"sharp": "^0.34.1",
|
|
127
127
|
"uuid": "^11.1.0"
|
|
128
128
|
},
|
|
129
|
-
"peerDependencies": {
|
|
130
|
-
"electron": "^35.0.0"
|
|
131
|
-
},
|
|
132
|
-
"peerDependenciesMeta": {
|
|
133
|
-
"electron": {
|
|
134
|
-
"optional": true
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
129
|
"devDependencies": {
|
|
138
130
|
"@eslint/js": "^9.21.0",
|
|
139
131
|
"@testing-library/jest-dom": "^6.1.5",
|