@bobfrankston/msger 0.1.12 → 0.1.15
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.
|
Binary file
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { execSync } from 'child_process';
|
|
4
|
+
import { resolve } from 'path';
|
|
5
|
+
|
|
6
|
+
// Get the absolute path to msger-native directory
|
|
7
|
+
const msgerNativePath = resolve(import.meta.dirname);
|
|
8
|
+
|
|
9
|
+
// Convert Windows path to WSL path
|
|
10
|
+
// Example: Y:\dev\utils\msger\msger-native -> /mnt/y/dev/utils/msger/msger-native
|
|
11
|
+
function toWSLPath(winPath: string): string {
|
|
12
|
+
// Replace backslashes with forward slashes
|
|
13
|
+
let path = winPath.replace(/\\/g, '/');
|
|
14
|
+
|
|
15
|
+
// Convert drive letter (e.g., Y: -> /mnt/y)
|
|
16
|
+
path = path.replace(/^([A-Za-z]):/, (_, drive) => `/mnt/${drive.toLowerCase()}`);
|
|
17
|
+
|
|
18
|
+
return path;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const wslPath = toWSLPath(msgerNativePath);
|
|
22
|
+
|
|
23
|
+
console.log('🐧 Building Linux binary via WSL...');
|
|
24
|
+
console.log(`📍 WSL path: ${wslPath}`);
|
|
25
|
+
|
|
26
|
+
// Check if Rust/Cargo is installed in WSL, and install if not
|
|
27
|
+
console.log('🔍 Checking for Rust/Cargo in WSL...');
|
|
28
|
+
try {
|
|
29
|
+
execSync('wsl -e bash -c "command -v cargo"', { stdio: 'pipe' });
|
|
30
|
+
console.log('✅ Rust/Cargo found');
|
|
31
|
+
} catch {
|
|
32
|
+
console.log('⚠️ Rust/Cargo not found in WSL, installing...');
|
|
33
|
+
try {
|
|
34
|
+
execSync(
|
|
35
|
+
'wsl -e bash -c "curl --proto \'=https\' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && source ~/.cargo/env"',
|
|
36
|
+
{ stdio: 'inherit' }
|
|
37
|
+
);
|
|
38
|
+
console.log('✅ Rust installed successfully');
|
|
39
|
+
} catch (error: any) {
|
|
40
|
+
console.error('❌ Failed to install Rust:', error.message);
|
|
41
|
+
console.error('Please install Rust manually in WSL:');
|
|
42
|
+
console.error(' wsl');
|
|
43
|
+
console.error(' curl --proto \'=https\' --tlsv1.2 -sSf https://sh.rustup.rs | sh');
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Check if pkg-config and GTK dependencies are installed
|
|
49
|
+
console.log('🔍 Checking for build dependencies in WSL...');
|
|
50
|
+
try {
|
|
51
|
+
execSync('wsl -e bash -c "command -v pkg-config"', { stdio: 'pipe' });
|
|
52
|
+
console.log('✅ Build dependencies found');
|
|
53
|
+
} catch {
|
|
54
|
+
console.log('⚠️ Build dependencies not found, installing...');
|
|
55
|
+
console.log(' Installing: pkg-config, libgtk-3-dev, libwebkit2gtk-4.1-dev, libsoup-3.0-dev');
|
|
56
|
+
try {
|
|
57
|
+
execSync(
|
|
58
|
+
'wsl -e bash -c "sudo apt-get update && sudo apt-get install -y pkg-config libgtk-3-dev libwebkit2gtk-4.1-dev libsoup-3.0-dev"',
|
|
59
|
+
{ stdio: 'inherit' }
|
|
60
|
+
);
|
|
61
|
+
console.log('✅ Build dependencies installed successfully');
|
|
62
|
+
} catch (error: any) {
|
|
63
|
+
console.error('❌ Failed to install build dependencies:', error.message);
|
|
64
|
+
console.error('Please install manually in WSL:');
|
|
65
|
+
console.error(' wsl');
|
|
66
|
+
console.error(' sudo apt-get update');
|
|
67
|
+
console.error(' sudo apt-get install -y pkg-config libgtk-3-dev libwebkit2gtk-4.1-dev libsoup-3.0-dev');
|
|
68
|
+
process.exit(1);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
try {
|
|
73
|
+
execSync(`wsl -e bash -c "source ~/.cargo/env 2>/dev/null || true && cd '${wslPath}' && npm run build"`, {
|
|
74
|
+
stdio: 'inherit'
|
|
75
|
+
});
|
|
76
|
+
console.log('✅ WSL build completed');
|
|
77
|
+
} catch (error: any) {
|
|
78
|
+
console.error('❌ WSL build failed:', error.message);
|
|
79
|
+
process.exit(1);
|
|
80
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bobfrankston/msger",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"description": "Fast, lightweight, cross-platform message box - Rust-powered alternative to msgview",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"scripts": {
|
|
17
17
|
"build": "npm run build:ts && npm run build:native",
|
|
18
18
|
"build:native": "cd msger-native && npm run build",
|
|
19
|
-
"build:native:wsl": "
|
|
19
|
+
"build:native:wsl": "cd msger-native && npm run build:wsl",
|
|
20
20
|
"build:native:all": "npm run build:native && npm run build:native:wsl",
|
|
21
21
|
"build:ts": "tsc",
|
|
22
22
|
"watch": "tsc -w",
|