specli 0.0.7 → 0.0.9

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/specli.js +17 -0
  2. package/package.json +3 -2
package/bin/specli.js ADDED
@@ -0,0 +1,17 @@
1
+ // Runtime-aware CLI entry point
2
+ // - In Bun: runs cli.ts directly (TypeScript, full features including compile)
3
+ // - In Node.js: runs dist/cli.js (compiled JS, exec only)
4
+
5
+ import { dirname, join } from "node:path";
6
+ import { fileURLToPath } from "node:url";
7
+
8
+ const __dirname = dirname(fileURLToPath(import.meta.url));
9
+ const root = join(__dirname, "..");
10
+
11
+ if (typeof globalThis.Bun !== "undefined") {
12
+ // Running in Bun - import TypeScript directly
13
+ await import(join(root, "cli.ts"));
14
+ } else {
15
+ // Running in Node.js - use compiled JS
16
+ await import(join(root, "dist", "cli.js"));
17
+ }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "specli",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
8
  "bin": {
9
- "specli": "./dist/cli.js"
9
+ "specli": "./bin/specli.js"
10
10
  },
11
11
  "exports": {
12
12
  ".": {
@@ -26,6 +26,7 @@
26
26
  },
27
27
  "files": [
28
28
  "dist",
29
+ "bin",
29
30
  "cli.ts",
30
31
  "index.ts",
31
32
  "src",