portkeeper 1.1.4 ā 1.1.5
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "portkeeper",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "A comprehensive port management tool for developers with CLI and GUI interfaces",
|
|
5
5
|
"main": "dist/cli/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"build": "npm run build:cli && npm run build:gui",
|
|
25
25
|
"build:npm": "npm run build:cli && npm run build:gui",
|
|
26
26
|
"prepublishOnly": "npm run build:npm",
|
|
27
|
-
"postinstall": "node scripts/postinstall.js",
|
|
27
|
+
"postinstall": "node scripts/postinstall-simple.js",
|
|
28
28
|
"fix:electron": "npm rebuild better-sqlite3 --runtime=electron --target=28.0.0 --dist-url=https://electronjs.org/headers --abi=119",
|
|
29
29
|
"fix:node": "npm rebuild better-sqlite3",
|
|
30
30
|
"build:cli": "tsc -p tsconfig.cli.json",
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { execSync } = require('child_process');
|
|
4
|
+
const { existsSync } = require('fs');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
|
|
7
|
+
console.log('š§ Setting up portkeeper...');
|
|
8
|
+
|
|
9
|
+
try {
|
|
10
|
+
// Get the installation directory
|
|
11
|
+
const installDir = process.env.INIT_CWD || process.cwd();
|
|
12
|
+
console.log('Installation directory:', installDir);
|
|
13
|
+
|
|
14
|
+
// Always rebuild for Node.js first
|
|
15
|
+
console.log('Rebuilding native modules for Node.js...');
|
|
16
|
+
execSync('npm rebuild better-sqlite3', {
|
|
17
|
+
stdio: 'inherit',
|
|
18
|
+
cwd: installDir
|
|
19
|
+
});
|
|
20
|
+
console.log('ā
Native modules prepared for CLI');
|
|
21
|
+
|
|
22
|
+
// Check if Electron is installed
|
|
23
|
+
const electronPath = path.join(installDir, 'node_modules', 'electron');
|
|
24
|
+
const hasElectron = existsSync(electronPath);
|
|
25
|
+
|
|
26
|
+
if (hasElectron) {
|
|
27
|
+
console.log('\nElectron detected. Preparing GUI support...');
|
|
28
|
+
try {
|
|
29
|
+
// Create a separate build for Electron
|
|
30
|
+
execSync(
|
|
31
|
+
'npm rebuild better-sqlite3 --runtime=electron --target=28.0.0 --dist-url=https://electronjs.org/headers --abi=119',
|
|
32
|
+
{
|
|
33
|
+
stdio: 'inherit',
|
|
34
|
+
cwd: installDir
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
console.log('ā
Native modules prepared for GUI');
|
|
38
|
+
} catch (electronError) {
|
|
39
|
+
console.log('ā ļø Could not prepare Electron modules. GUI may require manual setup.');
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
console.log('\n⨠Portkeeper installation complete!');
|
|
44
|
+
console.log('\nUsage:');
|
|
45
|
+
console.log(' portman --help Show all available commands');
|
|
46
|
+
console.log(' portman list List all managed ports');
|
|
47
|
+
console.log(' portman gui Launch the GUI (requires Electron)');
|
|
48
|
+
|
|
49
|
+
} catch (error) {
|
|
50
|
+
console.error('ā Setup failed:', error.message);
|
|
51
|
+
console.log('\nYou may need to manually rebuild native modules:');
|
|
52
|
+
console.log(' npm rebuild better-sqlite3');
|
|
53
|
+
// Don't exit with error as this might cause npm install to fail
|
|
54
|
+
}
|