ferrflow 0.4.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 (2) hide show
  1. package/bin/ferrflow.js +45 -0
  2. package/package.json +29 -0
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from "child_process";
3
+ import { existsSync } from "fs";
4
+ import { join, dirname } from "path";
5
+ import { fileURLToPath } from "url";
6
+ import { createRequire } from "module";
7
+
8
+ const __dirname = dirname(fileURLToPath(import.meta.url));
9
+ const require = createRequire(import.meta.url);
10
+
11
+ function getBinaryPath() {
12
+ const platform = process.platform;
13
+ const arch = process.arch;
14
+
15
+ const platformMap = {
16
+ "linux-x64": "ferrflow-linux-x64",
17
+ "linux-arm64": "ferrflow-linux-arm64",
18
+ "darwin-x64": "ferrflow-darwin-x64",
19
+ "darwin-arm64": "ferrflow-darwin-arm64",
20
+ "win32-x64": "ferrflow-windows-x64",
21
+ };
22
+
23
+ const key = `${platform}-${arch}`;
24
+ const pkgName = platformMap[key];
25
+
26
+ if (pkgName) {
27
+ try {
28
+ return require.resolve(`${pkgName}/bin/ferrflow`);
29
+ } catch {
30
+ // optional dep not installed
31
+ }
32
+ }
33
+
34
+ // Fallback: local dev build
35
+ const ext = platform === "win32" ? ".exe" : "";
36
+ const devBuild = join(__dirname, "..", "..", "target", "release", `ferrflow${ext}`);
37
+ if (existsSync(devBuild)) return devBuild;
38
+
39
+ // Hope it's in PATH
40
+ return platform === "win32" ? "ferrflow.exe" : "ferrflow";
41
+ }
42
+
43
+ const binary = getBinaryPath();
44
+ const result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" });
45
+ process.exit(result.status ?? 1);
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "bin": {
3
+ "ferrflow": "./bin/ferrflow.js"
4
+ },
5
+ "description": "Universal semantic versioning for monorepos and classic repos",
6
+ "homepage": "https://github.com/FerrFlow/FerrFlow",
7
+ "keywords": [
8
+ "semver",
9
+ "versioning",
10
+ "monorepo",
11
+ "changelog",
12
+ "release"
13
+ ],
14
+ "license": "MIT",
15
+ "name": "ferrflow",
16
+ "optionalDependencies": {
17
+ "ferrflow-darwin-arm64": "0.1.0",
18
+ "ferrflow-darwin-x64": "0.1.0",
19
+ "ferrflow-linux-arm64": "0.1.0",
20
+ "ferrflow-linux-x64": "0.1.0",
21
+ "ferrflow-windows-x64": "0.1.0"
22
+ },
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/FerrFlow/FerrFlow.git"
26
+ },
27
+ "type": "module",
28
+ "version": "0.4.0"
29
+ }