next-lovable 0.0.32 → 0.0.35
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/next-lovable +22 -39
- package/dist/next-lovable-linux +0 -0
- package/dist/next-lovable-macos +0 -0
- package/dist/next-lovable-macos-arm +0 -0
- package/dist/next-lovable-win.exe +0 -0
- package/package.json +6 -10
package/bin/next-lovable
CHANGED
|
@@ -1,64 +1,47 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// File: bin/next-lovable.js
|
|
3
|
-
|
|
4
2
|
const { spawn } = require('child_process');
|
|
5
3
|
const path = require('path');
|
|
6
4
|
const fs = require('fs');
|
|
7
5
|
const os = require('os');
|
|
8
6
|
|
|
9
|
-
// Determine the platform-specific executable
|
|
10
7
|
let binName;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
8
|
+
|
|
9
|
+
const platform = os.platform();
|
|
10
|
+
const arch = os.arch(); // 'x64', 'arm64', etc.
|
|
11
|
+
|
|
12
|
+
if (platform === 'win32') {
|
|
13
|
+
binName = 'next-lovable-win.exe';
|
|
14
|
+
} else if (platform === 'darwin') {
|
|
15
|
+
binName = arch === 'arm64' ? 'next-lovable-macos-arm' : 'next-lovable-macos';
|
|
16
|
+
} else if (platform === 'linux') {
|
|
17
|
+
binName = 'next-lovable-linux';
|
|
18
|
+
} else {
|
|
19
|
+
console.error(`❌ Unsupported platform: ${platform}`);
|
|
20
|
+
process.exit(1);
|
|
24
21
|
}
|
|
25
22
|
|
|
26
|
-
|
|
27
|
-
const binPath = path.join(__dirname, '..', 'dist', binName);
|
|
23
|
+
const binPath = path.resolve(__dirname, '..', 'dist', binName);
|
|
28
24
|
|
|
29
|
-
// Check if the binary exists and is executable
|
|
30
25
|
try {
|
|
31
26
|
fs.accessSync(binPath, fs.constants.X_OK);
|
|
32
27
|
} catch (err) {
|
|
33
|
-
if (
|
|
34
|
-
// Make binary executable if it's not Windows
|
|
28
|
+
if (platform !== 'win32') {
|
|
35
29
|
try {
|
|
36
|
-
fs.chmodSync(binPath,
|
|
30
|
+
fs.chmodSync(binPath, 0o755);
|
|
37
31
|
} catch (chmodErr) {
|
|
38
|
-
console.error(
|
|
32
|
+
console.error(`❌ Failed to make binary executable: ${chmodErr.message}`);
|
|
39
33
|
process.exit(1);
|
|
40
34
|
}
|
|
41
35
|
} else {
|
|
42
|
-
console.error(
|
|
36
|
+
console.error(`❌ Binary not accessible: ${err.message}`);
|
|
43
37
|
process.exit(1);
|
|
44
38
|
}
|
|
45
39
|
}
|
|
46
40
|
|
|
47
|
-
// Execute the binary with the same arguments
|
|
48
41
|
const child = spawn(binPath, process.argv.slice(2), {
|
|
49
|
-
stdio: 'inherit'
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
// Forward the exit code
|
|
53
|
-
child.on('close', (code) => {
|
|
54
|
-
process.exit(code);
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
// Forward SIGINT and SIGTERM
|
|
58
|
-
process.on('SIGINT', () => {
|
|
59
|
-
child.kill('SIGINT');
|
|
42
|
+
stdio: 'inherit',
|
|
60
43
|
});
|
|
61
44
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
45
|
+
child.on('close', (code) => process.exit(code));
|
|
46
|
+
process.on('SIGINT', () => child.kill('SIGINT'));
|
|
47
|
+
process.on('SIGTERM', () => child.kill('SIGTERM'));
|
package/dist/next-lovable-linux
CHANGED
|
Binary file
|
package/dist/next-lovable-macos
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-lovable",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.35",
|
|
4
4
|
"description": "Cross-platform tool to migrate Lovable React projects to Next.js",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"homepage": "https://nextlovable.com",
|
|
@@ -9,10 +9,7 @@
|
|
|
9
9
|
"post-publish": "node ./scripts/post-publish.js",
|
|
10
10
|
"prepublishOnly": "npm run build && npm run prepare-publish",
|
|
11
11
|
"postpublish": "npm run post-publish",
|
|
12
|
-
"build": "
|
|
13
|
-
"build:win": "npx @yao-pkg/pkg ./dist/index.js --targets node20-win-x64 --output dist/next-lovable-win.exe",
|
|
14
|
-
"build:macos": "npx @yao-pkg/pkg ./dist/index.js --targets node20-macos-x64 --output dist/next-lovable-macos",
|
|
15
|
-
"build:linux": "npx @yao-pkg/pkg ./dist/index.js --targets node20-linux-x64 --output dist/next-lovable-linux"
|
|
12
|
+
"build": "bash ./build.sh"
|
|
16
13
|
},
|
|
17
14
|
"engines": {
|
|
18
15
|
"node": ">=20.0.0"
|
|
@@ -21,11 +18,11 @@
|
|
|
21
18
|
"next-lovable": "./bin/next-lovable"
|
|
22
19
|
},
|
|
23
20
|
"files": [
|
|
24
|
-
"
|
|
25
|
-
"dist/next-lovable-macos",
|
|
21
|
+
"bin/next-lovable.js",
|
|
26
22
|
"dist/next-lovable-linux",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
23
|
+
"dist/next-lovable-macos",
|
|
24
|
+
"dist/next-lovable-macos-arm",
|
|
25
|
+
"dist/next-lovable-win.exe"
|
|
29
26
|
],
|
|
30
27
|
"keywords": [
|
|
31
28
|
"next.js",
|
|
@@ -46,7 +43,6 @@
|
|
|
46
43
|
"jscodeshift": "^17.3.0"
|
|
47
44
|
},
|
|
48
45
|
"devDependencies": {
|
|
49
|
-
"@yao-pkg/pkg": "^6.4.0",
|
|
50
46
|
"tsup": "^8.4.0"
|
|
51
47
|
}
|
|
52
48
|
}
|