@tgrv/void-cli 1.0.3 → 1.0.4
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 +25 -13
- package/package.json +1 -1
package/bin/void.js
CHANGED
|
@@ -189,20 +189,32 @@ function runBuild(pluginPathArg) {
|
|
|
189
189
|
// Copy WASM
|
|
190
190
|
fs.copyFileSync(builtWasmPath, path.join(buildOutputDir, "plugin.wasm"));
|
|
191
191
|
|
|
192
|
-
//
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
dependencies: {
|
|
199
|
-
"@tgrv/void-runtime": "^1.0.0",
|
|
200
|
-
},
|
|
201
|
-
publishConfig: {
|
|
202
|
-
access: "public"
|
|
192
|
+
// Clean up temporary compiled WASM
|
|
193
|
+
if (path.dirname(builtWasmPath) === absolutePluginDir) {
|
|
194
|
+
try {
|
|
195
|
+
fs.unlinkSync(builtWasmPath);
|
|
196
|
+
} catch (e) {
|
|
197
|
+
// Ignore
|
|
203
198
|
}
|
|
204
|
-
}
|
|
205
|
-
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// Write package.json if it does not already exist
|
|
202
|
+
const packageJsonPath = path.join(buildOutputDir, "package.json");
|
|
203
|
+
if (!fs.existsSync(packageJsonPath)) {
|
|
204
|
+
const pkgJson = {
|
|
205
|
+
name: pluginName,
|
|
206
|
+
version: manifest.version || "1.0.0",
|
|
207
|
+
type: "module",
|
|
208
|
+
main: "index.js",
|
|
209
|
+
dependencies: {
|
|
210
|
+
"@tgrv/void-runtime": "^1.0.0",
|
|
211
|
+
},
|
|
212
|
+
publishConfig: {
|
|
213
|
+
access: "public"
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
fs.writeFileSync(packageJsonPath, JSON.stringify(pkgJson, null, 2));
|
|
217
|
+
}
|
|
206
218
|
|
|
207
219
|
// Generate standard ESM index.js loader
|
|
208
220
|
const indexJsContent = `import { runtime } from "@tgrv/void-runtime";
|