@dallay/cli-template 0.0.0-stage → 0.1.8

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.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const node_child_process_1 = require("node:child_process");
5
+ const node_path_1 = require("node:path");
6
+ const node_os_1 = require("node:os");
7
+ function getBinaryPath() {
8
+ const platformMap = {
9
+ linux: "linux",
10
+ darwin: "darwin",
11
+ win32: "win32",
12
+ };
13
+ const archMap = {
14
+ x64: "x64",
15
+ arm64: "arm64",
16
+ };
17
+ const os = platformMap[(0, node_os_1.platform)()];
18
+ const cpu = archMap[(0, node_os_1.arch)()];
19
+ if (!os || !cpu) {
20
+ throw new Error(`Unsupported platform: ${(0, node_os_1.platform)()} ${(0, node_os_1.arch)()}`);
21
+ }
22
+ const binaryName = process.platform === "win32" ? "cli-template.exe" : "cli-template";
23
+ const packageName = `@dallay/cli-template-${os}-${cpu}`;
24
+ // Try to resolve the binary from the platform-specific npm package
25
+ try {
26
+ const pkgPath = require.resolve(`${packageName}/package.json`, { paths: [__dirname] });
27
+ const pkgDir = (0, node_path_1.dirname)(pkgPath);
28
+ return (0, node_path_1.join)(pkgDir, "bin", binaryName);
29
+ }
30
+ catch {
31
+ throw new Error(`Cannot find binary for ${packageName}. ` +
32
+ `Please ensure the platform-specific package is installed.`);
33
+ }
34
+ }
35
+ function main() {
36
+ const binaryPath = getBinaryPath();
37
+ const args = process.argv.slice(2);
38
+ const result = (0, node_child_process_1.spawnSync)(binaryPath, args, {
39
+ stdio: "inherit",
40
+ encoding: "utf-8",
41
+ });
42
+ // Propagate the exit code from the binary
43
+ const exitCode = result.status ?? 1;
44
+ process.exit(exitCode);
45
+ }
46
+ main();
package/package.json CHANGED
@@ -1,6 +1,30 @@
1
1
  {
2
2
  "name": "@dallay/cli-template",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.8",
4
+ "description": "A Rust CLI template project",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "bin": {
8
+ "cli-template": "dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist"
12
+ ],
13
+ "scripts": {
14
+ "build": "tsc",
15
+ "check:package": "node scripts/check-package.mjs",
16
+ "prepublishOnly": "npm run build && npm run check:package"
17
+ },
18
+ "optionalDependencies": {
19
+ "@dallay/cli-template-darwin-arm64": "0.1.8",
20
+ "@dallay/cli-template-darwin-x64": "0.1.8",
21
+ "@dallay/cli-template-linux-arm64": "0.1.8",
22
+ "@dallay/cli-template-linux-x64": "0.1.8",
23
+ "@dallay/cli-template-win32-x64": "0.1.8"
24
+ },
25
+ "devDependencies": {
26
+ "@types/node": "26.6.6",
27
+ "typescript": "7.0.2"
28
+ },
29
+ "license": "MIT"
30
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.