@nekutima/theforge 0.1.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.
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@nekutima/theforge",
3
+ "version": "0.1.0",
4
+ "description": "The Forge CLI — connect your repository to the Forge platform",
5
+ "keywords": ["theforge", "nekutima", "cli", "forge"],
6
+ "homepage": "https://github.com/nekutima/theforge-cli",
7
+ "license": "MIT",
8
+ "bin": {
9
+ "theforge": "src/index.js"
10
+ },
11
+ "scripts": {
12
+ "postinstall": "node src/install.js"
13
+ },
14
+ "optionalDependencies": {
15
+ "@nekutima/theforge-cli-linux-x64": "0.1.0",
16
+ "@nekutima/theforge-cli-linux-arm64": "0.1.0",
17
+ "@nekutima/theforge-cli-darwin-x64": "0.1.0",
18
+ "@nekutima/theforge-cli-darwin-arm64": "0.1.0",
19
+ "@nekutima/theforge-cli-win32-x64": "0.1.0",
20
+ "@nekutima/theforge-cli-freebsd-x64": "0.1.0"
21
+ },
22
+ "engines": {
23
+ "node": ">=16"
24
+ }
25
+ }
package/src/index.js ADDED
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const { execFileSync } = require('child_process');
5
+ const path = require('path');
6
+
7
+ const PLATFORM_MAP = {
8
+ 'linux-x64': '@nekutima/theforge-cli-linux-x64',
9
+ 'linux-arm64': '@nekutima/theforge-cli-linux-arm64',
10
+ 'darwin-x64': '@nekutima/theforge-cli-darwin-x64',
11
+ 'darwin-arm64': '@nekutima/theforge-cli-darwin-arm64',
12
+ 'win32-x64': '@nekutima/theforge-cli-win32-x64',
13
+ 'freebsd-x64': '@nekutima/theforge-cli-freebsd-x64',
14
+ };
15
+
16
+ const key = `${process.platform}-${process.arch}`;
17
+ const pkg = PLATFORM_MAP[key];
18
+
19
+ if (!pkg) {
20
+ process.stderr.write(`theforge: unsupported platform: ${key}\n`);
21
+ process.exit(1);
22
+ }
23
+
24
+ let binary;
25
+ try {
26
+ const ext = process.platform === 'win32' ? '.exe' : '';
27
+ binary = require.resolve(path.join(pkg, 'bin', `theforge${ext}`));
28
+ } catch (e) {
29
+ process.stderr.write(`theforge: platform package ${pkg} not installed.\n`);
30
+ process.stderr.write(`Run: npm install ${pkg}\n`);
31
+ process.exit(1);
32
+ }
33
+
34
+ try {
35
+ execFileSync(binary, process.argv.slice(2), { stdio: 'inherit' });
36
+ } catch (e) {
37
+ process.exit(e.status != null ? e.status : 1);
38
+ }
package/src/install.js ADDED
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ // Ensure the platform binary is executable after install on POSIX systems.
4
+ // On Windows, file permissions are not relevant, so this is a no-op there.
5
+ if (process.platform === 'win32') process.exit(0);
6
+
7
+ const fs = require('fs');
8
+ const path = require('path');
9
+
10
+ const PLATFORM_MAP = {
11
+ 'linux-x64': '@nekutima/theforge-cli-linux-x64',
12
+ 'linux-arm64': '@nekutima/theforge-cli-linux-arm64',
13
+ 'darwin-x64': '@nekutima/theforge-cli-darwin-x64',
14
+ 'darwin-arm64': '@nekutima/theforge-cli-darwin-arm64',
15
+ 'freebsd-x64': '@nekutima/theforge-cli-freebsd-x64',
16
+ };
17
+
18
+ const key = `${process.platform}-${process.arch}`;
19
+ const pkg = PLATFORM_MAP[key];
20
+ if (!pkg) process.exit(0);
21
+
22
+ try {
23
+ const binary = require.resolve(path.join(pkg, 'bin', 'theforge'));
24
+ fs.chmodSync(binary, 0o755);
25
+ } catch (_) {
26
+ // optional package not installed — skip silently
27
+ }