@goodfoot/git-mesh 1.0.73 → 1.0.78

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,6 @@
1
+ @goodfoot/git-mesh placeholder. scripts/postinstall.js replaces this file
2
+ with the native binary for your platform. The name ends in .exe and the
3
+ first line intentionally has NO "#!" shebang so npm/yarn/pnpm cmd-shim
4
+ generates a direct-exec wrapper that runs on Windows; Unix ignores the
5
+ .exe suffix and execs by mode bit. If you are seeing this text, the
6
+ postinstall step did not run.
package/man/git-mesh.1 CHANGED
@@ -1,6 +1,6 @@
1
1
  .ie \n(.g .ds Aq \(aq
2
2
  .el .ds Aq '
3
- .TH git-mesh 1 "git-mesh 1.0.73"
3
+ .TH git-mesh 1 "git-mesh 1.0.78"
4
4
  .ie \n(.g .ds Aq \(aq
5
5
  .el .ds Aq '
6
6
  .SH NAME
@@ -141,7 +141,7 @@ Print this message or the help of the given subcommand(s)
141
141
  .ie \n(.g .ds Aq \(aq
142
142
  .el .ds Aq '
143
143
  .SH VERSION
144
- v1.0.73
144
+ v1.0.78
145
145
  .SH EXAMPLES
146
146
  Anchor a new mesh alongside a code change:
147
147
  .PP
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@goodfoot/git-mesh",
3
- "version": "1.0.73",
4
- "bin": "bin/git-mesh",
3
+ "version": "1.0.78",
4
+ "bin": "bin/git-mesh.exe",
5
5
  "man": [
6
6
  "man/git-mesh.1"
7
7
  ],
@@ -18,16 +18,16 @@
18
18
  "udeps": "bash scripts/cleanup-stale-target.sh && env CARGO_TARGET_DIR=\"${GIT_MESH_CARGO_TARGET_ROOT:-./target-cache}/udeps\" cargo +nightly udeps"
19
19
  },
20
20
  "files": [
21
- "bin/",
21
+ "bin/git-mesh.exe",
22
22
  "man/",
23
23
  "scripts/postinstall.js"
24
24
  ],
25
25
  "optionalDependencies": {
26
- "@goodfoot/git-mesh-darwin-arm64": "1.0.73",
27
- "@goodfoot/git-mesh-darwin-x64": "1.0.73",
28
- "@goodfoot/git-mesh-linux-arm64": "1.0.73",
29
- "@goodfoot/git-mesh-linux-x64": "1.0.73",
30
- "@goodfoot/git-mesh-win32-x64": "1.0.73"
26
+ "@goodfoot/git-mesh-darwin-arm64": "1.0.78",
27
+ "@goodfoot/git-mesh-darwin-x64": "1.0.78",
28
+ "@goodfoot/git-mesh-linux-arm64": "1.0.78",
29
+ "@goodfoot/git-mesh-linux-x64": "1.0.78",
30
+ "@goodfoot/git-mesh-win32-x64": "1.0.78"
31
31
  },
32
32
  "repository": {
33
33
  "type": "git",
@@ -99,30 +99,44 @@ function main() {
99
99
  buildFromSource(sourceBinary, sourceBinaryName);
100
100
  }
101
101
 
102
- const binGitMesh = path.join(__dirname, '..', 'bin', 'git-mesh');
103
-
102
+ // Always write to bin/git-mesh.exe the package.json `bin` field points
103
+ // here on every platform. The `.exe` extension plus a no-shebang stub makes
104
+ // npm's cmd-shim (generated at install time, before this postinstall) emit
105
+ // a direct exec on Windows; Unix executes by mode bit + ELF/Mach-O header
106
+ // and ignores the `.exe` suffix entirely. No resident Node process — the
107
+ // `git-mesh` command execs the native binary directly. Same pattern as
108
+ // Bun's and Claude Code's npm packages.
109
+ const binGitMesh = path.join(__dirname, '..', 'bin', 'git-mesh.exe');
110
+
111
+ // Hardlink first (instant, zero extra disk for the ~16MB binary; src and
112
+ // dest are both under node_modules so same-filesystem is the common case),
113
+ // then fall back to copy across devices / on link-permission errors.
104
114
  try {
105
- fs.unlinkSync(binGitMesh);
106
- } catch (error) {
107
- if (error.code !== 'ENOENT') {
108
- fail(`@goodfoot/git-mesh: Could not remove existing binary at ${binGitMesh}.`, error);
109
- }
110
- }
111
-
112
- // Try symlink first, fall back to copy
113
- try {
114
- fs.symlinkSync(sourceBinary, binGitMesh);
115
- } catch (symlinkError) {
116
- try {
115
+ fs.linkSync(sourceBinary, binGitMesh);
116
+ } catch (linkError) {
117
+ if (linkError.code === 'EEXIST') {
118
+ try {
119
+ fs.unlinkSync(binGitMesh);
120
+ fs.linkSync(sourceBinary, binGitMesh);
121
+ } catch {
122
+ fs.copyFileSync(sourceBinary, binGitMesh);
123
+ }
124
+ } else if (linkError.code === 'EXDEV' || linkError.code === 'EPERM') {
117
125
  fs.copyFileSync(sourceBinary, binGitMesh);
118
- fs.chmodSync(binGitMesh, 0o755);
119
- } catch (copyError) {
120
- fail(
121
- `@goodfoot/git-mesh: Could not install binary from ${sourceBinary} to ${binGitMesh}.`,
122
- new Error(`symlink failed: ${symlinkError.message}\ncopy failed: ${copyError.message}`)
123
- );
126
+ } else {
127
+ try {
128
+ fs.copyFileSync(sourceBinary, binGitMesh);
129
+ } catch (copyError) {
130
+ fail(
131
+ `@goodfoot/git-mesh: Could not install binary from ${sourceBinary} to ${binGitMesh}.`,
132
+ new Error(`link failed: ${linkError.message}\ncopy failed: ${copyError.message}`)
133
+ );
134
+ }
124
135
  }
125
136
  }
137
+ if (process.platform !== 'win32') {
138
+ fs.chmodSync(binGitMesh, 0o755);
139
+ }
126
140
 
127
141
  console.log(`@goodfoot/git-mesh: Installed git-mesh from ${packageName}`);
128
142
  }
package/bin/.gitkeep DELETED
File without changes
package/bin/git-mesh DELETED
@@ -1,4 +0,0 @@
1
- #!/bin/sh
2
- # Replaced by postinstall with a symlink to the native binary.
3
- echo "@goodfoot/git-mesh: Installation incomplete. Run 'npm install @goodfoot/git-mesh' to finish setup." >&2
4
- exit 1