specli 0.0.15 → 0.0.17

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.
@@ -12,7 +12,7 @@ function parseKeyValue(input) {
12
12
  export async function compileCommand(spec, options) {
13
13
  // Derive name from spec if not provided
14
14
  const name = options.name ?? (await deriveBinaryName(spec));
15
- const outfile = options.outfile ?? `./dist/${name}`;
15
+ const outfile = options.outfile ?? `./out/${name}`;
16
16
  const target = options.target
17
17
  ? options.target
18
18
  : `bun-${process.platform}-${process.arch}`;
@@ -1,9 +1,13 @@
1
- import { join } from "node:path";
1
+ import { readFileSync } from "node:fs";
2
+ import { dirname, join } from "node:path";
3
+ import { fileURLToPath } from "node:url";
2
4
  /**
3
5
  * Bun macro: reads the version from package.json at bundle-time.
4
6
  */
5
7
  export function version() {
6
- const packageJsonPath = join(import.meta.dir, "../../package.json");
7
- const packageJson = require(packageJsonPath);
8
+ const currentDir = dirname(fileURLToPath(import.meta.url));
9
+ const packageJsonPath = join(currentDir, "../../package.json");
10
+ const content = readFileSync(packageJsonPath, "utf-8");
11
+ const packageJson = JSON.parse(content);
8
12
  return packageJson.version;
9
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specli",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "type": "module",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",