@ringozz/godot 4.7.2-616 → 4.7.2-626

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/README.md CHANGED
@@ -145,4 +145,4 @@ initDebug();
145
145
 
146
146
  `gen/` is generated (and gitignored) by `dev/codegen.ts` from `godot --dump-extension-api-with-docs`. From the repo root: `bun run prebuild` (codegen + typecheck), `bun run predev` (imports `dev/assets/` via the editor), `bun run build` (native addon), `bun run test`, and `bun run dev` (web dev server). See [`AGENTS.md`](../../AGENTS.md) for the full workflow.
147
147
 
148
- The package also ships a `godot` bin (`src/editor.ts`) used by the scripts: it resolves `GODOT_PATH` → a system `godot` on `PATH` → `~/.local/bin/godot`, and downloads the pinned official editor from [`godotengine/godot-builds`](https://github.com/godotengine/godot-builds) into `~/.local/bin/godot` when none is found.
148
+ The package also ships a `godot` bin (`src/editor.ts`) used by the scripts: it resolves `GODOT_PATH` → a system `godot` on `PATH` → `~/.local/bin/godot-<version>`, and downloads the pinned official editor from [`godotengine/godot-builds`](https://github.com/godotengine/godot-builds) into `~/.local/bin/godot-<version>` when none is found (the versioned filename makes a version bump re-provision).
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ringozz/godot",
3
3
  "author": "Vladimir Davidovich",
4
- "version": "4.7.2-616",
4
+ "version": "4.7.2-626",
5
5
  "description": "Node-API bindings for Godot Engine — call Godot classes from JavaScript",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -61,9 +61,9 @@
61
61
  "precision": "single"
62
62
  },
63
63
  "optionalDependencies": {
64
- "@ringozz/godot-macos-arm64": "^4.7.2-616",
65
- "@ringozz/godot-windows-x86_64": "^4.7.2-616",
66
- "@ringozz/godot-web-wasm32": "^4.7.2-616"
64
+ "@ringozz/godot-macos-arm64": "^4.7.2-626",
65
+ "@ringozz/godot-windows-x86_64": "^4.7.2-626",
66
+ "@ringozz/godot-web-wasm32": "^4.7.2-626"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "@types/bun": "*"
package/src/editor.ts CHANGED
@@ -12,12 +12,12 @@ import { fileURLToPath } from 'node:url';
12
12
  const SELF = realpathSync(fileURLToPath(import.meta.url));
13
13
  const IS_WINDOWS = process.platform === 'win32';
14
14
  const BIN_DIR = join(homedir(), '.local', 'bin');
15
- const MANAGED = join(BIN_DIR, `godot${IS_WINDOWS ? '.exe' : ''}`);
16
15
 
17
16
  const { version_major, version_minor, version_patch, version_status } = JSON.parse(
18
17
  readFileSync(join(dirname(SELF), '..', 'package.json'), 'utf-8'),
19
18
  ).godot;
20
19
  const TAG = `${version_major}.${version_minor}.${version_patch}-${version_status}`;
20
+ const MANAGED = join(BIN_DIR, `godot-${TAG}${IS_WINDOWS ? '.exe' : ''}`);
21
21
 
22
22
  const TARGETS: Record<string, { asset: string; exe: string }> = {
23
23
  'darwin-arm64': { asset: `Godot_v${TAG}_macos.universal.zip`, exe: 'Godot.app/Contents/MacOS/Godot' },
@@ -37,11 +37,15 @@ function systemGodot(): string | null {
37
37
  const path = (process.env.PATH ?? '')
38
38
  .split(delimiter)
39
39
  .filter((dir) => {
40
+ const candidate = join(resolve(dir), `godot${IS_WINDOWS ? '.exe' : ''}`);
40
41
  try {
41
- return realpathSync(join(resolve(dir), `godot${IS_WINDOWS ? '.exe' : ''}`)) !== SELF;
42
+ if (realpathSync(candidate) === SELF) return false;
42
43
  } catch {
43
44
  return true;
44
45
  }
46
+ // Bun's Windows bin is a compiled `godot.exe` shim beside a `godot.bunx`
47
+ // marker rather than a symlink, so realpath can't reveal the wrapper.
48
+ return !existsSync(join(resolve(dir), 'godot.bunx'));
45
49
  });
46
50
  return Bun.which('godot', { PATH: path.join(delimiter) });
47
51
  }
@@ -61,12 +65,12 @@ function install(stage: string, source: string): void {
61
65
  if (process.platform !== 'darwin') {
62
66
  copyFileSync(source, MANAGED);
63
67
  if (!IS_WINDOWS) chmodSync(MANAGED, 0o755);
64
- return;
68
+ } else {
69
+ const bundle = join(BIN_DIR, `Godot-${TAG}.app`);
70
+ rmSync(bundle, { recursive: true, force: true });
71
+ cpSync(join(stage, 'Godot.app'), bundle, { recursive: true });
72
+ symlinkSync(join(`Godot-${TAG}.app`, 'Contents', 'MacOS', 'Godot'), MANAGED);
65
73
  }
66
- const bundle = join(BIN_DIR, 'Godot.app');
67
- rmSync(bundle, { recursive: true, force: true });
68
- cpSync(join(stage, 'Godot.app'), bundle, { recursive: true });
69
- symlinkSync(join('Godot.app', 'Contents', 'MacOS', 'Godot'), MANAGED);
70
74
  }
71
75
 
72
76
  async function provision(): Promise<void> {