cmux0 0.8.0-beta.1

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.
Files changed (2) hide show
  1. package/lib/postinstall.js +82 -0
  2. package/package.json +23 -0
@@ -0,0 +1,82 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Post-install script for cmux0 (test build)
4
+ * Copies the platform-specific binary to the bin directory
5
+ */
6
+
7
+ const fs = require('fs');
8
+ const path = require('path');
9
+
10
+ const PLATFORMS = {
11
+ 'darwin-arm64': 'cmux0-darwin-arm64',
12
+ 'darwin-x64': 'cmux0-darwin-x64',
13
+ 'linux-arm64': 'cmux0-linux-arm64',
14
+ 'linux-x64': 'cmux0-linux-x64',
15
+ 'win32-x64': 'cmux0-win32-x64',
16
+ };
17
+
18
+ function getPlatformPackage() {
19
+ const platform = process.platform;
20
+ const arch = process.arch;
21
+ let archName = arch;
22
+ if (arch === 'x64') archName = 'x64';
23
+ else if (arch === 'arm64') archName = 'arm64';
24
+ const key = `${platform}-${archName}`;
25
+ return PLATFORMS[key];
26
+ }
27
+
28
+ function findBinary(packageName) {
29
+ const binName = process.platform === 'win32' ? 'cmux0.exe' : 'cmux0';
30
+ const possiblePaths = [
31
+ path.join(__dirname, '..', '..', packageName, 'bin'),
32
+ path.join(__dirname, '..', 'node_modules', packageName, 'bin'),
33
+ path.join(__dirname, '..', '..', '..', packageName, 'bin'),
34
+ path.join(__dirname, '..', '..', '.pnpm', 'node_modules', packageName, 'bin'),
35
+ ];
36
+
37
+ try {
38
+ const pkgPath = require.resolve(`${packageName}/package.json`, { paths: [path.join(__dirname, '..')] });
39
+ const pkgBinPath = path.join(path.dirname(pkgPath), 'bin', binName);
40
+ possiblePaths.unshift(path.dirname(pkgBinPath));
41
+ } catch (e) {
42
+ // Package not resolvable
43
+ }
44
+
45
+ for (const p of possiblePaths) {
46
+ const binPath = path.join(p, binName);
47
+ if (fs.existsSync(binPath)) {
48
+ return binPath;
49
+ }
50
+ }
51
+ return null;
52
+ }
53
+
54
+ function main() {
55
+ const platformPackage = getPlatformPackage();
56
+ if (!platformPackage) {
57
+ console.error(`Unsupported platform: ${process.platform}-${process.arch}`);
58
+ process.exit(1);
59
+ }
60
+
61
+ const sourceBinary = findBinary(platformPackage);
62
+ if (!sourceBinary) {
63
+ console.error(`cmux0: Platform package ${platformPackage} not found`);
64
+ console.error(`cmux0: Please ensure the package installed correctly.`);
65
+ return;
66
+ }
67
+
68
+ const binDir = path.join(__dirname, '..', 'bin');
69
+ const destBinary = path.join(binDir, process.platform === 'win32' ? 'cmux0.exe' : 'cmux0');
70
+
71
+ if (!fs.existsSync(binDir)) {
72
+ fs.mkdirSync(binDir, { recursive: true });
73
+ }
74
+
75
+ fs.copyFileSync(sourceBinary, destBinary);
76
+ if (process.platform !== 'win32') {
77
+ fs.chmodSync(destBinary, 0o755);
78
+ }
79
+ console.log(`cmux0: Installed ${platformPackage} binary`);
80
+ }
81
+
82
+ main();
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "cmux0",
3
+ "version": "0.8.0-beta.1",
4
+ "description": "cmux test build with Daytona provider support (dev credentials)",
5
+ "keywords": ["cli", "devbox", "cloud", "sandbox", "development", "daytona", "e2b"],
6
+ "homepage": "https://cmux.sh",
7
+ "license": "MIT",
8
+ "author": "Manaflow",
9
+ "bin": {
10
+ "cmux0": "bin/cmux0"
11
+ },
12
+ "files": ["bin", "lib"],
13
+ "scripts": {
14
+ "postinstall": "node lib/postinstall.js"
15
+ },
16
+ "optionalDependencies": {
17
+ "cmux0-darwin-arm64": "0.8.0-beta.1",
18
+ "cmux0-darwin-x64": "0.8.0-beta.1"
19
+ },
20
+ "engines": {
21
+ "node": ">=16"
22
+ }
23
+ }