@codella-software/cli 2.0.0

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 (3) hide show
  1. package/bin/cli.js +50 -0
  2. package/bin/codella +0 -0
  3. package/package.json +37 -0
package/bin/cli.js ADDED
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env node
2
+
3
+ // Wrapper script to run the Go CLI binary
4
+ // In production, this would download and execute the appropriate binary for the platform
5
+
6
+ const { spawn } = require('child_process');
7
+ const path = require('path');
8
+ const os = require('os');
9
+
10
+ // Map Node.js platform/arch to Go binary naming
11
+ const platformMap = {
12
+ 'darwin': {
13
+ 'x64': 'codella-darwin-x64',
14
+ 'arm64': 'codella-darwin-arm64'
15
+ },
16
+ 'linux': {
17
+ 'x64': 'codella-linux-x64',
18
+ 'arm64': 'codella-linux-arm64'
19
+ },
20
+ 'win32': {
21
+ 'x64': 'codella-win32-x64.exe'
22
+ }
23
+ };
24
+
25
+ const platform = os.platform();
26
+ const arch = os.arch() === 'x64' ? 'x64' : os.arch();
27
+
28
+ const binaryName = platformMap[platform]?.[arch];
29
+ if (!binaryName) {
30
+ console.error(`Unsupported platform: ${platform} ${arch}`);
31
+ process.exit(1);
32
+ }
33
+
34
+ // For now, just show a message since Go binary isn't built yet
35
+ // In production, this would execute: path.join(__dirname, '..', 'bin', binaryName)
36
+ console.error(`
37
+ ┌─────────────────────────────────────────────────────────────┐
38
+ │ │
39
+ │ Codella CLI v2.0.0 │
40
+ │ │
41
+ │ The Go CLI binary is not yet built for your platform. │
42
+ │ Please compile the CLI from source: │
43
+ │ │
44
+ │ cd packages/cli │
45
+ │ go build -o ../cli-npm/bin/codella ./cmd/codella │
46
+ │ │
47
+ └─────────────────────────────────────────────────────────────┘
48
+ `);
49
+
50
+ process.exit(1);
package/bin/codella ADDED
Binary file
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@codella-software/cli",
3
+ "version": "2.0.0",
4
+ "description": "CLI for scaffolding Codella components into React projects",
5
+ "keywords": [
6
+ "cli",
7
+ "scaffold",
8
+ "components",
9
+ "react",
10
+ "tailwind"
11
+ ],
12
+ "homepage": "https://github.com/CodellaSoftware/codella-utils#readme",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/CodellaSoftware/codella-utils.git",
16
+ "directory": "packages/cli-npm"
17
+ },
18
+ "license": "MIT",
19
+ "type": "module",
20
+ "bin": {
21
+ "codella": "./bin/cli.js"
22
+ },
23
+ "files": [
24
+ "bin",
25
+ "dist"
26
+ ],
27
+ "scripts": {
28
+ "build": "echo 'Build Go binary and copy to bin/'",
29
+ "postinstall": "node scripts/postinstall.js",
30
+ "test": "echo 'CLI package: no tests to run'",
31
+ "test:run": "echo 'CLI package: no tests to run'",
32
+ "typecheck": "echo 'CLI package: no TypeScript to check'"
33
+ },
34
+ "engines": {
35
+ "node": ">=16.0.0"
36
+ }
37
+ }