@bytecodealliance/jco 1.23.1 → 1.24.1
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.
|
Binary file
|
|
@@ -2632,7 +2632,7 @@ function _lowerImportBackwardsCompat(args) {
|
|
|
2632
2632
|
|
|
2633
2633
|
if (ctx.useDirectParams) {
|
|
2634
2634
|
if (ctx.params.length < 2) { throw new Error('expected at least two u32 arguments'); }
|
|
2635
|
-
|
|
2635
|
+
let offset = ctx.params[0];
|
|
2636
2636
|
if (typeof offset === 'bigint') { offset = Number(offset); }
|
|
2637
2637
|
if (!Number.isSafeInteger(offset)) { throw new Error('invalid offset'); }
|
|
2638
2638
|
const len = ctx.params[1];
|
package/obj/wasm-tools.js
CHANGED
|
@@ -2632,7 +2632,7 @@ function _lowerImportBackwardsCompat(args) {
|
|
|
2632
2632
|
|
|
2633
2633
|
if (ctx.useDirectParams) {
|
|
2634
2634
|
if (ctx.params.length < 2) { throw new Error('expected at least two u32 arguments'); }
|
|
2635
|
-
|
|
2635
|
+
let offset = ctx.params[0];
|
|
2636
2636
|
if (typeof offset === 'bigint') { offset = Number(offset); }
|
|
2637
2637
|
if (!Number.isSafeInteger(offset)) { throw new Error('invalid offset'); }
|
|
2638
2638
|
const len = ctx.params[1];
|
package/package.json
CHANGED
package/src/cmd/transpile.js
CHANGED
|
@@ -29,6 +29,8 @@ import { isWindows } from "../common.js";
|
|
|
29
29
|
// These re-exports exist to avoid breaking backwards compatibility
|
|
30
30
|
export { types, guestTypes, typesComponent } from "./types.js";
|
|
31
31
|
|
|
32
|
+
const SUPPORTED_P3_VERSIONS = ["0.3.0-rc-2026-03-15", "0.3.0"];
|
|
33
|
+
|
|
32
34
|
export async function transpile(witPath, opts, program) {
|
|
33
35
|
const varIdx = program?.parent.rawArgs.indexOf("--");
|
|
34
36
|
if (varIdx !== undefined && varIdx !== -1) {
|
|
@@ -134,25 +136,36 @@ export async function transpileComponent(component, opts = {}) {
|
|
|
134
136
|
}
|
|
135
137
|
|
|
136
138
|
if (opts.wasiShim !== false) {
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
)
|
|
139
|
+
const shims = {
|
|
140
|
+
"wasi:cli/*": "@bytecodealliance/preview2-shim/cli#*",
|
|
141
|
+
"wasi:clocks/*": "@bytecodealliance/preview2-shim/clocks#*",
|
|
142
|
+
"wasi:filesystem/*": "@bytecodealliance/preview2-shim/filesystem#*",
|
|
143
|
+
"wasi:http/*": "@bytecodealliance/preview2-shim/http#*",
|
|
144
|
+
"wasi:io/*": "@bytecodealliance/preview2-shim/io#*",
|
|
145
|
+
"wasi:random/*": "@bytecodealliance/preview2-shim/random#*",
|
|
146
|
+
"wasi:sockets/*": "@bytecodealliance/preview2-shim/sockets#*",
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
// To avoid breaking compatibility with earlier version of p3 (including draft versions),
|
|
150
|
+
// we over-populate the map with references to the *current* preview3-shim that has been
|
|
151
|
+
// imported.
|
|
152
|
+
//
|
|
153
|
+
// This implicitly upgrades versions of P3 in use (a component that asks for 0.3.0 will get 0.3.1 if that
|
|
154
|
+
// is the current version in preview3-shim0, but that should be acceptable as p3 should not have breaking
|
|
155
|
+
// changes going forward.
|
|
156
|
+
//
|
|
157
|
+
for (const version of SUPPORTED_P3_VERSIONS) {
|
|
158
|
+
Object.assign(shims, {
|
|
159
|
+
[`wasi:cli/*@${version}`]: "@bytecodealliance/preview3-shim/cli#*",
|
|
160
|
+
[`wasi:clocks/*@${version}`]: "@bytecodealliance/preview3-shim/clocks#*",
|
|
161
|
+
[`wasi:filesystem/*@${version}`]: "@bytecodealliance/preview3-shim/filesystem#*",
|
|
162
|
+
[`wasi:http/*@${version}`]: "@bytecodealliance/preview3-shim/http#*",
|
|
163
|
+
[`wasi:random/*@${version}`]: "@bytecodealliance/preview3-shim/random#*",
|
|
164
|
+
[`wasi:sockets/*@${version}`]: "@bytecodealliance/preview3-shim/sockets#*",
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
opts.map = Object.assign(shims, opts.map || {});
|
|
156
169
|
}
|
|
157
170
|
|
|
158
171
|
let instantiation = null;
|
package/src/jco.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transpile.d.ts","sourceRoot":"","sources":["../../src/cmd/transpile.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transpile.d.ts","sourceRoot":"","sources":["../../src/cmd/transpile.js"],"names":[],"mappings":"AAiCA,gFAuCC;AAmBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,8CA1BW,UAAU,SACV;IACN,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACjC,cAAc,CAAC,EAAE,IAAI,GAAG,WAAW,GAAG,QAAQ,GAAG,kBAAkB,CAAC;IACpE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,wBAAwB,CAAC,EAAE,IAAI,CAAC;IAChC,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,EAAE,CAAC,EAAE,IAAI,CAAC;IACV,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,iBAAi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