@tgrv/void-cli 1.1.2 → 1.1.3

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/bin/void.js CHANGED
@@ -350,8 +350,8 @@ function runBuild(pluginPathArg) {
350
350
  }
351
351
  // C++ plugin compilation
352
352
  else if (pluginType === "cpp") {
353
- console.log(`${info} Running: ${colors.blue}emcmake cmake -B build -DCMAKE_BUILD_TYPE=Release${colors.reset}`);
354
- const configSuccess = runCommand("emcmake cmake -B build -DCMAKE_BUILD_TYPE=Release", { cwd: absolutePluginDir });
353
+ console.log(`${info} Running: ${colors.blue}emcmake cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON${colors.reset}`);
354
+ const configSuccess = runCommand("emcmake cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON", { cwd: absolutePluginDir });
355
355
  if (!configSuccess) {
356
356
  console.error(`${cross} ${colors.red}Emscripten CMake configuration failed. Make sure emscripten SDK is active.${colors.reset}`);
357
357
  process.exit(1);
@@ -386,6 +386,17 @@ function runBuild(pluginPathArg) {
386
386
  process.exit(1);
387
387
  }
388
388
  builtWasmPath = wasmFile;
389
+
390
+ // Copy compile_commands.json to plugin root to enable editor autocomplete/intellisense
391
+ const compileCommandsSrc = path.join(absolutePluginDir, "build", "compile_commands.json");
392
+ const compileCommandsDest = path.join(absolutePluginDir, "compile_commands.json");
393
+ if (fs.existsSync(compileCommandsSrc)) {
394
+ try {
395
+ fs.copyFileSync(compileCommandsSrc, compileCommandsDest);
396
+ } catch (e) {
397
+ // Ignore
398
+ }
399
+ }
389
400
  } else {
390
401
  console.error(`${cross} ${colors.red}Unsupported plugin type: '${pluginType}' in void.json${colors.reset}`);
391
402
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tgrv/void-cli",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "void": "./bin/void.js"
@@ -5,7 +5,14 @@ A template for building WebAssembly (WASM) plugins for the **Void** framework us
5
5
  ## 🚀 Getting Started
6
6
 
7
7
  > [!IMPORTANT]
8
- > Before building your plugin, run **`npm install`** (or `npm i`) in this root directory to download the C++ SDK dependency (`@tgrv/void-sdk-cpp`). The `package.json` file in this root folder is only used for local development setup and resolving CMake dependencies; it is **not** the package that gets published. The final publishable package (with its own generated `package.json`) will be built inside your output directory (configured in `void.json` as `buildDir`).
8
+ > Before building your plugin, run **`npm install`** (or `npm i`) in this root directory to download the C++ SDK dependency (`@tgrv/void-sdk-cpp`).
9
+ >
10
+ > To enable C++ autocomplete, hovers, and syntax diagnostics in your editor, run the initialization script immediately after installing dependencies:
11
+ > ```bash
12
+ > npm run cpp-init
13
+ > ```
14
+ >
15
+ > *Note: The `package.json` file in this root folder is only used for local development setup and resolving CMake dependencies; it is **not** the package that gets published. The final publishable package (with its own generated `package.json`) will be built inside your output directory (configured in `void.json` as `buildDir`).*
9
16
 
10
17
 
11
18
  ### 1. Where to Start
@@ -3,9 +3,12 @@
3
3
  "version": "1.0.0",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
+ "scripts": {
7
+ "cpp-init": "cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON && node -e \"const fs=require('fs'); if (fs.existsSync('build/compile_commands.json')) fs.copyFileSync('build/compile_commands.json', 'compile_commands.json')\""
8
+ },
6
9
  "dependencies": {
7
- "@tgrv/void-runtime": "^1.0.0",
8
- "@tgrv/void-sdk-cpp": "^1.0.0"
10
+ "@tgrv/void-runtime": "latest",
11
+ "@tgrv/void-sdk-cpp": "latest"
9
12
  },
10
13
  "publishConfig": {
11
14
  "access": "public"