@tgrv/void-cli 1.0.6 → 1.0.7

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.
Files changed (2) hide show
  1. package/bin/void.js +12 -1
  2. package/package.json +1 -1
package/bin/void.js CHANGED
@@ -199,7 +199,7 @@ function runBuild(pluginPathArg) {
199
199
  }
200
200
  }
201
201
 
202
- // Write package.json if it does not already exist
202
+ // Write package.json if it does not already exist, or check version if it does
203
203
  const packageJsonPath = path.join(buildOutputDir, "package.json");
204
204
  if (!fs.existsSync(packageJsonPath)) {
205
205
  const pkgJson = {
@@ -215,6 +215,17 @@ function runBuild(pluginPathArg) {
215
215
  }
216
216
  };
217
217
  fs.writeFileSync(packageJsonPath, JSON.stringify(pkgJson, null, 2));
218
+ } else {
219
+ try {
220
+ const existingPkg = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
221
+ if (existingPkg.version !== manifest.version) {
222
+ console.log(`${info} Version mismatch detected in ${packageJsonPath}. Updating from ${existingPkg.version} to ${manifest.version} to match void.json.`);
223
+ existingPkg.version = manifest.version || "1.0.0";
224
+ fs.writeFileSync(packageJsonPath, JSON.stringify(existingPkg, null, 2));
225
+ }
226
+ } catch (err) {
227
+ console.warn(`${warning} Failed to check/update existing package.json version: ${err.message}`);
228
+ }
218
229
  }
219
230
 
220
231
  // Generate standard ESM index.js loader
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tgrv/void-cli",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "void": "./bin/void.js"