@thi.ng/wasm-api-bindgen
Advanced tools
Comparing version 0.2.1 to 0.2.2
# Change Log | ||
- **Last updated**: 2022-11-24T12:23:48Z | ||
- **Last updated**: 2022-11-30T22:27:37Z | ||
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub) | ||
@@ -12,2 +12,11 @@ | ||
### [0.2.2](https://github.com/thi-ng/umbrella/tree/@thi.ng/wasm-api-bindgen@0.2.2) (2022-11-30) | ||
#### ♻️ Refactoring | ||
- update Zig codegen default imports ([#368](https://github.com/thi-ng/umbrella/issues/368)) ([574af0f](https://github.com/thi-ng/umbrella/commit/574af0f)) | ||
- adopt unscoped JS pkg name also as Zig import | ||
- update fixtures | ||
- update readme | ||
## [0.2.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/wasm-api-bindgen@0.2.0) (2022-11-24) | ||
@@ -14,0 +23,0 @@ |
{ | ||
"name": "@thi.ng/wasm-api-bindgen", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Polyglot bindings code generators for hybrid JS & WebAssembly projects", | ||
@@ -39,19 +39,19 @@ "type": "module", | ||
"dependencies": { | ||
"@thi.ng/api": "^8.5.0", | ||
"@thi.ng/args": "^2.2.10", | ||
"@thi.ng/arrays": "^2.4.3", | ||
"@thi.ng/binary": "^3.3.11", | ||
"@thi.ng/checks": "^3.3.3", | ||
"@thi.ng/compare": "^2.1.17", | ||
"@thi.ng/defmulti": "^2.1.22", | ||
"@thi.ng/errors": "^2.2.4", | ||
"@thi.ng/file-io": "^0.3.20", | ||
"@thi.ng/logger": "^1.4.3", | ||
"@thi.ng/paths": "^5.1.23", | ||
"@thi.ng/strings": "^3.3.18", | ||
"@thi.ng/wasm-api": "^1.1.0" | ||
"@thi.ng/api": "^8.5.1", | ||
"@thi.ng/args": "^2.2.11", | ||
"@thi.ng/arrays": "^2.4.4", | ||
"@thi.ng/binary": "^3.3.12", | ||
"@thi.ng/checks": "^3.3.4", | ||
"@thi.ng/compare": "^2.1.18", | ||
"@thi.ng/defmulti": "^2.1.23", | ||
"@thi.ng/errors": "^2.2.5", | ||
"@thi.ng/file-io": "^0.3.21", | ||
"@thi.ng/logger": "^1.4.4", | ||
"@thi.ng/paths": "^5.1.24", | ||
"@thi.ng/strings": "^3.3.19", | ||
"@thi.ng/wasm-api": "^1.1.1" | ||
}, | ||
"devDependencies": { | ||
"@microsoft/api-extractor": "^7.33.5", | ||
"@thi.ng/testament": "^0.3.5", | ||
"@thi.ng/testament": "^0.3.6", | ||
"rimraf": "^3.0.2", | ||
@@ -122,3 +122,3 @@ "tools": "^0.0.1", | ||
}, | ||
"gitHead": "75ec32ff7f1b7b5e72e7a04ace24732cd5d6c774\n" | ||
"gitHead": "1fe40da507070653f420156d91e6b27cf682004f\n" | ||
} |
@@ -618,3 +618,3 @@ <!-- This file is generated - DO NOT EDIT! --> | ||
const std = @import("std"); | ||
const wasmtypes = @import("wasmapi-types"); | ||
const bindgen = @import("wasm-api-bindgen"); | ||
@@ -640,3 +640,3 @@ /// Supported event types | ||
/// Name of key which triggered event | ||
key: wasmtypes.ConstStringPtr, | ||
key: bindgen.ConstStringPtr, | ||
/// Bitmask of active modifier keys | ||
@@ -660,3 +660,3 @@ modifiers: u8, | ||
zig build-lib \ | ||
--pkg-begin wasmapi-types node_modules/@thi.ng/wasm-api-bindgen/zig/lib.zig --pkg-end \ | ||
--pkg-begin wasm-api-bindgen node_modules/@thi.ng/wasm-api-bindgen/zig/lib.zig --pkg-end \ | ||
-target wasm32-freestanding \ | ||
@@ -667,5 +667,5 @@ -O ReleaseSmall -dynamic \ | ||
Alternatively, use a [the setup used by various example | ||
projects](https://github.com/thi-ng/umbrella/blob/develop/examples/zig-canvas/build.zig) | ||
in this repo to use Zig's build system... | ||
Alternatively, use a [more elaborate setup used by various example | ||
projects](https://github.com/thi-ng/umbrella/blob/develop/examples/zig-todo-list/build.zig) | ||
in this repo, using Zig's native build system... | ||
@@ -744,3 +744,3 @@ ### Runtime example | ||
Package sizes (gzipped, pre-treeshake): ESM: 6.49 KB | ||
Package sizes (brotli'd, pre-treeshake): ESM: 5.93 KB | ||
@@ -747,0 +747,0 @@ ## Dependencies |
12
zig.js
@@ -25,3 +25,3 @@ import { isNumber } from "@thi.ng/checks"; | ||
`const std = @import("std");`, | ||
`const wasmtypes = @import("wasmapi-types");`, | ||
`const bindgen = @import("wasm-api-bindgen");`, | ||
]; | ||
@@ -31,3 +31,3 @@ for (let type of sliceTypes(coll)) { | ||
const name = capitalize(type); | ||
res.push(`\npub const ${name}Slice = wasmtypes.Slice([]${type}, [*]${type});`, `pub const Const${name}Slice = wasmtypes.Slice([]const ${type}, [*]const ${type});`); | ||
res.push(`\npub const ${name}Slice = bindgen.Slice([]${type}, [*]${type});`, `pub const Const${name}Slice = bindgen.Slice([]const ${type}, [*]const ${type});`); | ||
} | ||
@@ -88,3 +88,3 @@ } | ||
: fieldType({ name: "return", ...ptr.rtype }, ptr, coll, opts).type; | ||
acc.push(`pub const ${ptr.name} = *const fn(${args}) ${rtype};`, ""); | ||
acc.push(`pub const ${ptr.name} = *const fn (${args}) ${rtype};`, ""); | ||
}, | ||
@@ -139,4 +139,4 @@ }; | ||
type = isStringSlice(opts.stringType) | ||
? `wasmtypes.${$isConst}String` | ||
: `wasmtypes.${$isConst}StringPtr`; | ||
? `bindgen.${$isConst}String` | ||
: `bindgen.${$isConst}StringPtr`; | ||
switch (classifier) { | ||
@@ -161,3 +161,3 @@ case "strPtr": | ||
else if (isOpaque(f.type)) { | ||
type = `wasmtypes.${$isConst}OpaquePtr`; | ||
type = `bindgen.${$isConst}OpaquePtr`; | ||
switch (classifier) { | ||
@@ -164,0 +164,0 @@ case "opaquePtr": |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
133466
Updated@thi.ng/api@^8.5.1
Updated@thi.ng/args@^2.2.11
Updated@thi.ng/arrays@^2.4.4
Updated@thi.ng/binary@^3.3.12
Updated@thi.ng/checks@^3.3.4
Updated@thi.ng/compare@^2.1.18
Updated@thi.ng/defmulti@^2.1.23
Updated@thi.ng/errors@^2.2.5
Updated@thi.ng/file-io@^0.3.21
Updated@thi.ng/logger@^1.4.4
Updated@thi.ng/paths@^5.1.24
Updated@thi.ng/strings@^3.3.19
Updated@thi.ng/wasm-api@^1.1.1