endform 0.0.1 → 0.2.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.
- package/bin/endform +1 -61
- package/package.json +14 -14
- package/tmp.json +0 -0
package/bin/endform
CHANGED
|
@@ -1,63 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* A simplified launcher for the Endform CLI.
|
|
4
|
-
*
|
|
5
|
-
* This script selects and executes the appropriate platform-specific binary.
|
|
6
|
-
* It supports only macOS and Linux on x86 (x64) or arm64.
|
|
7
|
-
*/
|
|
8
2
|
|
|
9
|
-
|
|
10
|
-
const path = require("path");
|
|
11
|
-
|
|
12
|
-
// Define supported platforms and architectures.
|
|
13
|
-
const supportedPlatforms = ["darwin", "linux"];
|
|
14
|
-
const supportedArchs = ["x64", "arm64"];
|
|
15
|
-
|
|
16
|
-
const platform = process.platform;
|
|
17
|
-
if (!supportedPlatforms.includes(platform)) {
|
|
18
|
-
console.error(
|
|
19
|
-
`Unsupported platform: ${platform}. This CLI supports only macOS and Linux.`,
|
|
20
|
-
);
|
|
21
|
-
process.exit(1);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const arch = process.arch;
|
|
25
|
-
if (!supportedArchs.includes(arch)) {
|
|
26
|
-
console.error(
|
|
27
|
-
`Unsupported architecture: ${arch}. This CLI supports only x86 and arm64.`,
|
|
28
|
-
);
|
|
29
|
-
process.exit(1);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// Map Node's "x64" to our package naming convention "x86"
|
|
33
|
-
const archSuffix = arch === "x64" ? "x86" : "arm64";
|
|
34
|
-
|
|
35
|
-
// Construct the package name.
|
|
36
|
-
// For example: "endform-darwin-x86" or "endform-linux-arm64"
|
|
37
|
-
const packageName = `endform-${platform}-${archSuffix}`;
|
|
38
|
-
|
|
39
|
-
// The binary is expected to reside at "bin/endform" inside the package.
|
|
40
|
-
const binaryRelativePath = "bin/endform";
|
|
41
|
-
|
|
42
|
-
let binaryPath;
|
|
43
|
-
try {
|
|
44
|
-
// Attempt to resolve the binary from the installed dependency.
|
|
45
|
-
binaryPath = require.resolve(`${packageName}/${binaryRelativePath}`);
|
|
46
|
-
} catch (err) {
|
|
47
|
-
console.error(
|
|
48
|
-
`Error: Could not find the Endform binary for ${platform} (${arch}).`,
|
|
49
|
-
);
|
|
50
|
-
console.error(
|
|
51
|
-
`Ensure that the package "${packageName}" is installed as an optional dependency.`,
|
|
52
|
-
);
|
|
53
|
-
process.exit(1);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Execute the binary and forward any command-line arguments.
|
|
57
|
-
try {
|
|
58
|
-
child_process.execFileSync(binaryPath, process.argv.slice(2), {
|
|
59
|
-
stdio: "inherit",
|
|
60
|
-
});
|
|
61
|
-
} catch (err) {
|
|
62
|
-
process.exit(err.status || 1);
|
|
63
|
-
}
|
|
3
|
+
console.log("hello from endform.js");
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
"name": "endform",
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "Endform CLI",
|
|
5
|
+
"repository": "https://github.com/endformdev/npm",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"bin": {
|
|
8
|
+
"endform": "./bin/endform"
|
|
9
|
+
},
|
|
10
|
+
"optionalDependencies": {
|
|
11
|
+
"endform-darwin-arm64": "0.0.1",
|
|
12
|
+
"endform-darwin-x86": "0.0.1",
|
|
13
|
+
"endform-linux-arm64": "0.0.1",
|
|
14
|
+
"endform-linux-x86": "0.0.1"
|
|
15
|
+
}
|
|
16
16
|
}
|
package/tmp.json
DELETED
|
File without changes
|