@adhdev/ghostty-vt-node 0.7.31 → 0.7.33

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/CMakeLists.txt CHANGED
@@ -54,6 +54,22 @@ set_target_properties(${PROJECT_NAME} PROPERTIES
54
54
  SUFFIX ".node"
55
55
  )
56
56
 
57
+ if(MSVC)
58
+ # cmake-js injects CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded (/MT) globally.
59
+ # Node.js addons must use /MD (dynamic CRT) to match node.exe.
60
+ # Override to MultiThreadedDLL, suppress static CRT, and explicitly link the
61
+ # three dynamic-CRT import libs (msvcrt/vcruntime/ucrt) that the auto-link
62
+ # mechanism may not pick up when cmake-js has overridden the global setting.
63
+ set_target_properties(${PROJECT_NAME} PROPERTIES
64
+ MSVC_RUNTIME_LIBRARY "MultiThreadedDLL"
65
+ )
66
+ target_link_options(${PROJECT_NAME} PRIVATE
67
+ /NODEFAULTLIB:LIBCMT
68
+ /NODEFAULTLIB:LIBCMTD
69
+ )
70
+ target_link_libraries(${PROJECT_NAME} PRIVATE msvcrt vcruntime ucrt)
71
+ endif()
72
+
57
73
  if(APPLE)
58
74
  set_target_properties(${PROJECT_NAME} PROPERTIES
59
75
  BUILD_RPATH "@loader_path"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/ghostty-vt-node",
3
- "version": "0.7.31",
3
+ "version": "0.7.33",
4
4
  "description": "Native Node binding for libghostty-vt",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -40,11 +40,20 @@ if (installPrebuiltIfPresent()) {
40
40
  process.exit(0);
41
41
  }
42
42
 
43
- const npx = process.platform === 'win32' ? 'npx.cmd' : 'npx';
44
- const result = spawnSync(npx, ['cmake-js', 'compile'], {
43
+ const isWindows = process.platform === 'win32';
44
+ const command = isWindows ? (process.env.ComSpec || 'cmd.exe') : 'npm';
45
+ const args = isWindows
46
+ ? ['/d', '/s', '/c', 'npm exec -- cmake-js compile']
47
+ : ['exec', '--', 'cmake-js', 'compile'];
48
+ console.log(`[ghostty-vt-node] compiling ${triplet} via ${command} ${args.join(' ')}`);
49
+ const result = spawnSync(command, args, {
45
50
  cwd: packageDir,
46
51
  env: process.env,
47
52
  stdio: 'inherit',
48
53
  });
49
54
 
55
+ if (result.error) {
56
+ console.error(`[ghostty-vt-node] failed to launch native build for ${triplet}:`, result.error);
57
+ }
58
+
50
59
  process.exit(result.status ?? 1);