vibecoding-installer 0.1.26-5-g221dccd-dirty → 0.1.27-dirty

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/vibecoding ADDED
@@ -0,0 +1,125 @@
1
+ #!/usr/bin/env node
2
+
3
+ // Wrapper script that resolves and executes the platform-specific binary.
4
+ // When installed via `npm i -g vibecoding-installer`, this script finds the
5
+ // correct binary from the platform-specific optional dependency package.
6
+
7
+ const { execFileSync } = require('child_process');
8
+ const path = require('path');
9
+ const fs = require('fs');
10
+
11
+ // Map npm os/cpu to package name
12
+ const PLATFORM_MAP = {
13
+ 'linux-x64-glibc': 'vibecoding-installer-linux-x64',
14
+ 'linux-arm64-glibc': 'vibecoding-installer-linux-arm64',
15
+ 'linux-x64-musl': 'vibecoding-installer-linux-musl-x64',
16
+ 'darwin-x64': 'vibecoding-installer-darwin-x64',
17
+ 'darwin-arm64': 'vibecoding-installer-darwin-arm64',
18
+ 'win32-x64': 'vibecoding-installer-win32-x64',
19
+ 'win32-arm64': 'vibecoding-installer-win32-arm64',
20
+ };
21
+
22
+ function detectPlatform() {
23
+ const os = process.platform; // 'linux', 'darwin', 'win32'
24
+ const arch = process.arch; // 'x64', 'arm64'
25
+
26
+ if (os === 'linux') {
27
+ // Detect libc: musl or glibc
28
+ const isMusl = (() => {
29
+ try {
30
+ // Check for Alpine's musl
31
+ if (fs.existsSync('/etc/alpine-release')) return true;
32
+ // Check ldd output for musl
33
+ const { execSync } = require('child_process');
34
+ const output = execSync('ldd --version 2>&1 || true', { encoding: 'utf8' });
35
+ return output.includes('musl');
36
+ } catch {
37
+ return false;
38
+ }
39
+ })();
40
+
41
+ return `${os}-${arch}-${isMusl ? 'musl' : 'glibc'}`;
42
+ }
43
+
44
+ return `${os}-${arch}`;
45
+ }
46
+
47
+ function findBinary() {
48
+ const platform = detectPlatform();
49
+ const packageName = PLATFORM_MAP[platform];
50
+
51
+ if (!packageName) {
52
+ console.error(`Unsupported platform: ${platform}`);
53
+ console.error(`Supported platforms: ${Object.keys(PLATFORM_MAP).join(', ')}`);
54
+ process.exit(1);
55
+ }
56
+
57
+ const searchDirs = [];
58
+ const addSearchDir = (dir) => {
59
+ if (dir && !searchDirs.includes(dir)) {
60
+ searchDirs.push(dir);
61
+ }
62
+ };
63
+
64
+ try {
65
+ addSearchDir(path.dirname(require.resolve(`${packageName}/package.json`)));
66
+ } catch {
67
+ // Keep explicit fallbacks below for unusual npm layouts.
68
+ }
69
+
70
+ // npm usually installs dependencies under this package. Some global installs
71
+ // or package managers may hoist them as siblings, so check both layouts.
72
+ addSearchDir(path.join(__dirname, '..', 'node_modules', packageName));
73
+ addSearchDir(path.join(__dirname, '..', '..', packageName));
74
+
75
+ for (const pkgDir of searchDirs) {
76
+ const binName = process.platform === 'win32' ? 'vibecoding.exe' : 'vibecoding';
77
+ const binPath = path.join(pkgDir, 'bin', binName);
78
+
79
+ if (fs.existsSync(binPath)) {
80
+ return binPath;
81
+ }
82
+ }
83
+
84
+ // Fallback: check if there's a binary directly in the main package's bin/
85
+ // (old single-package layout, or development mode)
86
+ const fallbackBinName = (() => {
87
+ const suffix = process.platform === 'win32' ? '.exe' : '';
88
+ const osMap = { linux: 'linux', darwin: 'darwin', win32: 'windows' };
89
+ const archMap = { x64: 'amd64', arm64: 'arm64' };
90
+ return `vibecoding-${osMap[process.platform]}-${archMap[process.arch]}${suffix}`;
91
+ })();
92
+
93
+ const fallbackPath = path.join(__dirname, fallbackBinName);
94
+ if (fs.existsSync(fallbackPath)) {
95
+ return fallbackPath;
96
+ }
97
+
98
+ console.error(`Could not find VibeCoding binary for platform: ${detectPlatform()}`);
99
+ console.error(`Searched for package: ${packageName}`);
100
+ console.error(`Searched in: ${searchDirs.join(', ')}`);
101
+ console.error('');
102
+ console.error('If you installed globally, try reinstalling:');
103
+ console.error(' npm install -g vibecoding-installer');
104
+ console.error('');
105
+ console.error('If the problem persists, install via one-line script instead:');
106
+ console.error(' curl -fsSL https://raw.githubusercontent.com/startvibecoding/vibecoding/main/install.sh | bash');
107
+ process.exit(1);
108
+ }
109
+
110
+ // Main
111
+ const binaryPath = findBinary();
112
+ const args = process.argv.slice(2);
113
+
114
+ try {
115
+ execFileSync(binaryPath, args, { stdio: 'inherit' });
116
+ } catch (err) {
117
+ // Forward the exit code
118
+ if (err.status !== undefined) {
119
+ process.exit(err.status);
120
+ }
121
+ if (err.code) {
122
+ process.exit(1);
123
+ }
124
+ process.exit(1);
125
+ }
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "vibecoding-installer",
3
- "version": "v0.1.26-5-g221dccd-dirty",
3
+ "version": "v0.1.27-dirty",
4
4
  "description": "AI coding assistant for the terminal",
5
- "main": "index.js",
6
5
  "bin": {
7
6
  "vibecoding": "bin/vibecoding"
8
7
  },
9
- "scripts": {
10
- "postinstall": "node postinstall.js"
11
- },
8
+ "files": [
9
+ "bin/vibecoding",
10
+ "README.md"
11
+ ],
12
12
  "keywords": [
13
13
  "ai",
14
14
  "coding",
@@ -30,12 +30,12 @@
30
30
  "node": ">=14"
31
31
  },
32
32
  "optionalDependencies": {
33
- "vibecoding-installer-linux-x64": "v0.1.26-5-g221dccd-dirty",
34
- "vibecoding-installer-linux-arm64": "v0.1.26-5-g221dccd-dirty",
35
- "vibecoding-installer-linux-musl-x64": "v0.1.26-5-g221dccd-dirty",
36
- "vibecoding-installer-darwin-x64": "v0.1.26-5-g221dccd-dirty",
37
- "vibecoding-installer-darwin-arm64": "v0.1.26-5-g221dccd-dirty",
38
- "vibecoding-installer-win32-x64": "v0.1.26-5-g221dccd-dirty",
39
- "vibecoding-installer-win32-arm64": "v0.1.26-5-g221dccd-dirty"
33
+ "vibecoding-installer-linux-x64": "v0.1.27-dirty",
34
+ "vibecoding-installer-linux-arm64": "v0.1.27-dirty",
35
+ "vibecoding-installer-linux-musl-x64": "v0.1.27-dirty",
36
+ "vibecoding-installer-darwin-x64": "v0.1.27-dirty",
37
+ "vibecoding-installer-darwin-arm64": "v0.1.27-dirty",
38
+ "vibecoding-installer-win32-x64": "v0.1.27-dirty",
39
+ "vibecoding-installer-win32-arm64": "v0.1.27-dirty"
40
40
  }
41
41
  }
package/index.js DELETED
@@ -1,31 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const { platform, arch } = require('os');
4
- const fs = require('fs');
5
- const path = require('path');
6
-
7
- // Platform/arch mapping to npm package name
8
- const PLATFORM_PACKAGES = {
9
- 'linux-x64': 'vibecoding-installer-linux-x64',
10
- 'linux-arm64': 'vibecoding-installer-linux-arm64',
11
- 'darwin-x64': 'vibecoding-installer-darwin-x64',
12
- 'darwin-arm64': 'vibecoding-installer-darwin-arm64',
13
- 'win32-x64': 'vibecoding-installer-win32-x64',
14
- 'win32-arm64': 'vibecoding-installer-win32-arm64',
15
- };
16
-
17
- const key = `${platform()}-${arch()}`;
18
- const pkgName = PLATFORM_PACKAGES[key];
19
-
20
- if (!pkgName) {
21
- throw new Error(
22
- `Unsupported platform: ${key}\n` +
23
- `Supported: ${Object.keys(PLATFORM_PACKAGES).join(', ')}`
24
- );
25
- }
26
-
27
- const isWindows = platform() === 'win32';
28
- const binaryName = isWindows ? 'vibecoding.exe' : 'vibecoding';
29
- const binPath = path.join(path.dirname(require.resolve(pkgName)), 'bin', binaryName);
30
-
31
- module.exports = binPath;
package/postinstall.js DELETED
@@ -1,91 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- // Since npm installs the correct platform package via optionalDependencies,
4
- // this script just finds the installed platform binary and links it to bin/.
5
-
6
- const { platform, arch } = require('os');
7
- const fs = require('fs');
8
- const path = require('path');
9
- const { execSync } = require('child_process');
10
-
11
- function isMusl() {
12
- try {
13
- const output = execSync('ldd --version 2>&1', { encoding: 'utf8', timeout: 3000 });
14
- return output.includes('musl');
15
- } catch {
16
- // ldd not found or error, check for musl library
17
- try {
18
- fs.readdirSync('/lib').some(f => f.startsWith('ld-musl'));
19
- return true;
20
- } catch {
21
- return false;
22
- }
23
- }
24
- }
25
-
26
- function getPlatformKey() {
27
- const p = platform();
28
- const a = arch();
29
- if (p === 'linux' && isMusl()) {
30
- return `linux-musl-${a}`;
31
- }
32
- return `${p}-${a}`;
33
- }
34
-
35
- const PLATFORM_PACKAGES = {
36
- 'linux-x64': 'vibecoding-installer-linux-x64',
37
- 'linux-arm64': 'vibecoding-installer-linux-arm64',
38
- 'linux-musl-x64': 'vibecoding-installer-linux-musl-x64',
39
- 'darwin-x64': 'vibecoding-installer-darwin-x64',
40
- 'darwin-arm64': 'vibecoding-installer-darwin-arm64',
41
- 'win32-x64': 'vibecoding-installer-win32-x64',
42
- 'win32-arm64': 'vibecoding-installer-win32-arm64',
43
- };
44
-
45
- function main() {
46
- const key = getPlatformKey();
47
- const pkgName = PLATFORM_PACKAGES[key];
48
-
49
- if (!pkgName) {
50
- console.error(`Error: Unsupported platform: ${key}`);
51
- console.error(`Supported: ${Object.keys(PLATFORM_PACKAGES).join(', ')}`);
52
- process.exit(1);
53
- }
54
-
55
- // Find the platform package in node_modules
56
- let platformPkgDir;
57
- try {
58
- platformPkgDir = path.dirname(require.resolve(pkgName + '/package.json'));
59
- } catch {
60
- console.error(`Error: Platform package '${pkgName}' not installed.`);
61
- console.error('Your platform may not be supported, or the optional dependency was skipped.');
62
- process.exit(1);
63
- }
64
-
65
- const isWindows = platform() === 'win32';
66
- const srcName = isWindows ? 'vibecoding.exe' : 'vibecoding';
67
- const destName = isWindows ? 'vibecoding.exe' : 'vibecoding';
68
-
69
- const srcPath = path.join(platformPkgDir, 'bin', srcName);
70
- const destPath = path.join(__dirname, 'bin', destName);
71
-
72
- if (!fs.existsSync(srcPath)) {
73
- console.error(`Error: Binary not found at ${srcPath}`);
74
- process.exit(1);
75
- }
76
-
77
- // Ensure bin directory exists
78
- const binDir = path.join(__dirname, 'bin');
79
- fs.mkdirSync(binDir, { recursive: true });
80
-
81
- // Copy binary
82
- fs.copyFileSync(srcPath, destPath);
83
-
84
- if (!isWindows) {
85
- fs.chmodSync(destPath, '755');
86
- }
87
-
88
- console.log(`VibeCoding installed successfully (${key})`);
89
- }
90
-
91
- main();