@pumpkin-plugins/build 0.1.1 → 0.1.2
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/README.md +4 -0
- package/dist/cli.js +3 -17
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -10,6 +10,10 @@ This package is configured for public npm publication as `@pumpkin-plugins/build
|
|
|
10
10
|
publish its packed tarball; see [CI and releases](../../docs/ci-and-releases.md#releases) and the
|
|
11
11
|
[build guide](../../docs/building.md).
|
|
12
12
|
|
|
13
|
+
The builder and migration codemod share the dependency-free
|
|
14
|
+
[`@pumpkin-plugins/wasi-capabilities`](../wasi-capabilities/README.md) package for WASI names and
|
|
15
|
+
interface mapping.
|
|
16
|
+
|
|
13
17
|
<!-- docs:begin reference -->
|
|
14
18
|
<!-- Generated by pumpkin-plugins-docs from package, action, extension, and component docs metadata. Run `pnpm readme`. -->
|
|
15
19
|
|
package/dist/cli.js
CHANGED
|
@@ -8,6 +8,7 @@ import * as path9 from "node:path";
|
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
9
9
|
import { Command } from "@commander-js/extra-typings";
|
|
10
10
|
import { ensurePumpkinWit } from "@pumpkin-plugins/pumpkin-api/wit";
|
|
11
|
+
import { wasiInterfaces } from "@pumpkin-plugins/wasi-capabilities";
|
|
11
12
|
import { CommanderError } from "commander";
|
|
12
13
|
|
|
13
14
|
// src/bundle.ts
|
|
@@ -857,23 +858,6 @@ function isReplaceError(error) {
|
|
|
857
858
|
return typeof error === "object" && error !== null && "code" in error && (error.code === "EEXIST" || error.code === "EPERM" || error.code === "EACCES");
|
|
858
859
|
}
|
|
859
860
|
|
|
860
|
-
// src/capabilities.ts
|
|
861
|
-
var WASI_VERSION = "0.2.3";
|
|
862
|
-
var CAPABILITIES = {
|
|
863
|
-
http: ["http/types", "http/outgoing-handler"],
|
|
864
|
-
filesystem: ["filesystem/types", "filesystem/preopens"],
|
|
865
|
-
sockets: ["sockets/network", "sockets/instance-network", "sockets/tcp", "sockets/tcp-create-socket"],
|
|
866
|
-
udp: ["sockets/network", "sockets/instance-network", "sockets/udp", "sockets/udp-create-socket"]
|
|
867
|
-
};
|
|
868
|
-
var SUPPORT_IMPORTS = ["io/poll", "io/streams", "clocks/monotonic-clock"];
|
|
869
|
-
function isCapability(name) {
|
|
870
|
-
return Object.hasOwn(CAPABILITIES, name);
|
|
871
|
-
}
|
|
872
|
-
function wasiInterfaces(capabilities) {
|
|
873
|
-
if (capabilities.length === 0) return [];
|
|
874
|
-
return [.../* @__PURE__ */ new Set([...capabilities.flatMap((c) => CAPABILITIES[c]), ...SUPPORT_IMPORTS])];
|
|
875
|
-
}
|
|
876
|
-
|
|
877
861
|
// ../minecraft-colors/src/index.ts
|
|
878
862
|
var COLORS = {
|
|
879
863
|
black: "0",
|
|
@@ -1052,6 +1036,7 @@ function formatSelectionOption(option, selection, omittedValue) {
|
|
|
1052
1036
|
// src/plugin-config.ts
|
|
1053
1037
|
import * as fs5 from "node:fs";
|
|
1054
1038
|
import * as path5 from "node:path";
|
|
1039
|
+
import { CAPABILITIES, isCapability } from "@pumpkin-plugins/wasi-capabilities";
|
|
1055
1040
|
function readPluginConfig(pluginDir) {
|
|
1056
1041
|
let pkg;
|
|
1057
1042
|
try {
|
|
@@ -1509,6 +1494,7 @@ async function writeAtomically(file, bytes, expectedHash, stagingDirectory) {
|
|
|
1509
1494
|
// src/wit.ts
|
|
1510
1495
|
import * as fs8 from "node:fs";
|
|
1511
1496
|
import * as path8 from "node:path";
|
|
1497
|
+
import { WASI_VERSION } from "@pumpkin-plugins/wasi-capabilities";
|
|
1512
1498
|
function injectWasiImports(pluginWit, interfaces) {
|
|
1513
1499
|
const firstExport = /^[ \t]*export /m.exec(pluginWit);
|
|
1514
1500
|
if (!firstExport) throw new BuildError("could not find the exports in plugin.wit; the API layout changed");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pumpkin-plugins/build",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Shared build tool for the plugins",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"minecraft",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"contributors": [
|
|
36
36
|
"Filiph Sandström <filfat@hotmail.se> (https://github.com/filiphsps)"
|
|
37
37
|
],
|
|
38
|
+
"sideEffects": false,
|
|
38
39
|
"type": "module",
|
|
39
40
|
"bin": {
|
|
40
41
|
"pumpkin-plugins-build": "dist/cli.js"
|
|
@@ -51,7 +52,8 @@
|
|
|
51
52
|
"@di-framework/componentize-qjs": "0.4.4-di.3",
|
|
52
53
|
"@pumpkin-plugins/minecraft-colors": "0.1.0",
|
|
53
54
|
"@pumpkin-plugins/pumpkin-api": "0.1.0",
|
|
54
|
-
"@pumpkin-plugins/static-hermes-runtime": "0.1.
|
|
55
|
+
"@pumpkin-plugins/static-hermes-runtime": "0.1.1",
|
|
56
|
+
"@pumpkin-plugins/wasi-capabilities": "0.1.0",
|
|
55
57
|
"commander": "15.0.0",
|
|
56
58
|
"esbuild": "0.28.2",
|
|
57
59
|
"typescript": "6.0.3"
|
|
@@ -69,7 +71,7 @@
|
|
|
69
71
|
"access": "public"
|
|
70
72
|
},
|
|
71
73
|
"scripts": {
|
|
72
|
-
"build": "esbuild src/cli.ts --bundle --platform=node --format=esm --target=node24 --packages=external --alias:@pumpkin-plugins/minecraft-colors=../minecraft-colors/src/index.ts --
|
|
74
|
+
"build": "esbuild src/cli.ts --bundle --platform=node --format=esm --target=node24 --packages=external --alias:@pumpkin-plugins/minecraft-colors=../minecraft-colors/src/index.ts --outdir=dist",
|
|
73
75
|
"readme": "pumpkin-plugins-docs generate docs.ts",
|
|
74
76
|
"readme:check": "pumpkin-plugins-docs generate docs.ts --check",
|
|
75
77
|
"test": "vitest run",
|