Compare commits

..

No commits in common. "master" and "v0.1.1" have entirely different histories.

4 changed files with 652 additions and 2257 deletions

2884
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -20,10 +20,10 @@
"prepare": "jco guest-types wit/v0.1 -n plugin -o dist/bindings --name index" "prepare": "jco guest-types wit/v0.1 -n plugin -o dist/bindings --name index"
}, },
"dependencies": { "dependencies": {
"componentize-qjs": "^0.4.5", "@bytecodealliance/componentize-js": "^0.21.0",
"esbuild": "^0.28.2" "esbuild": "^0.28.0"
}, },
"devDependencies": { "devDependencies": {
"@bytecodealliance/jco": "^1.34.0" "@bytecodealliance/jco": "^1.19.0"
} }
} }

View File

@ -1,7 +1,10 @@
#! /usr/bin/env node #! /usr/bin/env node
import * as esbuild from "esbuild"; import * as esbuild from "esbuild";
import { componentize } from "componentize-qjs"; import {
componentize,
version as componentize_version,
} from "@bytecodealliance/componentize-js";
import * as path from "node:path"; import * as path from "node:path";
import * as fs from "node:fs"; import * as fs from "node:fs";
@ -19,14 +22,14 @@ async function buildPlugin(entryPath, outputPath, witDir) {
external: ["pumpkin:plugin/*"], external: ["pumpkin:plugin/*"],
}); });
console.log(`2. Running through \`componentize-qjs\`...`); console.log(
`2. Running through \`componentize-js\` ` + componentize_version + `...`,
);
try { try {
const { component } = await componentize({ const { component } = await componentize({
worldName: "plugin", worldName: "plugin",
witPath: witDir, witPath: witDir,
jsSource: fs.readFileSync(tempJs, "utf8"), sourcePath: tempJs
optSize: true,
minify: true,
}); });
fs.writeFileSync(outputPath, component); fs.writeFileSync(outputPath, component);
@ -51,7 +54,9 @@ if (args.length < 2) {
const entry = args[0]; const entry = args[0];
const output = args[1]; const output = args[1];
const wit = args[2] || path.join(import.meta.dirname, "../wit/v0.1"); const wit =
args[2] ||
path.join(import.meta.dirname, "../wit/v0.1");
buildPlugin(entry, output, wit).catch((err) => { buildPlugin(entry, output, wit).catch((err) => {
console.error(err); console.error(err);

2
wit

@ -1 +1 @@
Subproject commit 39bf330fa6aefc91c8ac61bd07d0fdbd5a5b95ac Subproject commit 4d7a501943bb99f0f02a339128833f58ed37d0cc