diff --git a/packages/cli/src/lib/defaults/build-strategies/wasm/golang/local/local.sh b/packages/cli/src/lib/defaults/build-strategies/wasm/golang/local/local.sh index c958a3389..743e311e2 100644 --- a/packages/cli/src/lib/defaults/build-strategies/wasm/golang/local/local.sh +++ b/packages/cli/src/lib/defaults/build-strategies/wasm/golang/local/local.sh @@ -23,6 +23,7 @@ EXTRA_EXPORTS=$( if [ -z "$EXTRA_EXPORTS" ] then echo "No extra exports to remove" + cp ./build-staging/module.wasm ./build-staging/module_exports.wasm else echo "Removing extra exports: $EXTRA_EXPORTS" # Remove these extra exports from the wasm module via wasm-snip @@ -43,6 +44,7 @@ EXTRA_IMPORTS=$( if [ -z "$EXTRA_IMPORTS" ] then echo "No extra imports to remove" + cp ./build-staging/module_exports.wasm ./build-staging/module_exports_imports.wasm else echo "Removing extra imports: $EXTRA_IMPORTS" # Remove these extra imports from the wasm module via wasm-snip diff --git a/packages/schema/bind/src/bindings/golang/transforms/index.ts b/packages/schema/bind/src/bindings/golang/transforms/index.ts index 7533ca018..c1d98bed8 100644 --- a/packages/schema/bind/src/bindings/golang/transforms/index.ts +++ b/packages/schema/bind/src/bindings/golang/transforms/index.ts @@ -1 +1,2 @@ export * from "./moduleNeedsTypes"; +export * from "./moduleNeedsImportedTypes"; diff --git a/packages/schema/bind/src/bindings/golang/transforms/moduleNeedsImportedTypes.ts b/packages/schema/bind/src/bindings/golang/transforms/moduleNeedsImportedTypes.ts new file mode 100644 index 000000000..05b6d37d6 --- /dev/null +++ b/packages/schema/bind/src/bindings/golang/transforms/moduleNeedsImportedTypes.ts @@ -0,0 +1,129 @@ +/* eslint-disable @typescript-eslint/naming-convention */ +import { + Abi, + ImportedEnumDefinition, + ImportedEnvDefinition, + ImportedModuleDefinition, + ImportedObjectDefinition, + MethodDefinition, + ModuleDefinition, +} from "@polywrap/wrap-manifest-types-js"; +import { AbiTransforms } from "@polywrap/schema-parse"; + +interface ImportedTypesState { + importedTypes: Map; +} + +interface ModuleNeedsImportedTypesState extends ImportedTypesState { + needsImportedNamespaces: Set; +} + +export function extractImportedTypes(): AbiTransforms { + const state: ImportedTypesState = { + importedTypes: new Map(), + }; + + return { + enter: { + ImportedEnumDefinition: (def: ImportedEnumDefinition) => { + state.importedTypes = state.importedTypes.set(def.type, def.namespace); + return def; + }, + ImportedEnvDefinition: (def: ImportedEnvDefinition) => { + state.importedTypes = state.importedTypes.set(def.type, def.namespace); + return def; + }, + ImportedModuleDefinition: (def: ImportedModuleDefinition) => { + state.importedTypes = state.importedTypes.set(def.type, def.namespace); + return def; + }, + ImportedObjectDefinition: (def: ImportedObjectDefinition) => { + state.importedTypes = state.importedTypes.set(def.type, def.namespace); + return def; + }, + }, + leave: { + Abi(abi: Abi) { + return { + ...abi, + _importedTypes: state.importedTypes, + }; + }, + }, + }; +} + +export function extractNeededImportedNamespaces(): AbiTransforms { + const state: ModuleNeedsImportedTypesState = { + importedTypes: new Map(), + needsImportedNamespaces: new Set(), + }; + + return { + enter: { + Abi: (abi: Abi) => { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + state.importedTypes = abi._importedTypes; + return abi; + }, + MethodDefinition: (def: MethodDefinition) => { + if (def.arguments && def.arguments.length > 0) { + for (const arg of def.arguments) { + const argType = arg.type; + const importNamespace = state.importedTypes?.get(argType); + if (importNamespace) { + state.needsImportedNamespaces?.add(importNamespace); + } + } + } + + if (def.return) { + const returnType = def.return.type; + const importNamespace = state.importedTypes?.get(returnType); + if (importNamespace) { + state.needsImportedNamespaces?.add(importNamespace); + } + } + return def; + }, + }, + leave: { + Abi: (abi: Abi) => { + return { + ...abi, + _needsImportedNamespaces: state.needsImportedNamespaces, + }; + }, + }, + }; +} + +export function needsImportedNamespaces(): AbiTransforms { + const state: ModuleNeedsImportedTypesState = { + importedTypes: new Map(), + needsImportedNamespaces: new Set(), + }; + + return { + enter: { + Abi: (abi: Abi) => { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + state.needsImportedNamespaces = abi._needsImportedNamespaces; + return abi; + }, + }, + leave: { + ModuleDefinition: (def: ModuleDefinition) => { + const needsImportedNamespaces = Array.from( + state.needsImportedNamespaces + ); + return { + ...def, + needsImportedNamespaces, + }; + }, + }, + }; +} diff --git a/packages/schema/bind/src/bindings/golang/transforms/moduleNeedsTypes.ts b/packages/schema/bind/src/bindings/golang/transforms/moduleNeedsTypes.ts index 060a8f993..766010c8a 100644 --- a/packages/schema/bind/src/bindings/golang/transforms/moduleNeedsTypes.ts +++ b/packages/schema/bind/src/bindings/golang/transforms/moduleNeedsTypes.ts @@ -10,6 +10,7 @@ import { AbiTransforms } from "@polywrap/schema-parse"; interface ModuleNeedsTypesState { moduleDefinition?: ModuleDefinition; needsTypes?: boolean; + importedTypes?: Map; } export function moduleNeedsTypes(): AbiTransforms { @@ -17,6 +18,12 @@ export function moduleNeedsTypes(): AbiTransforms { return { enter: { + Abi: (abi) => { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + state.importedTypes = abi._importedTypes; + return abi; + }, ModuleDefinition: (def: ModuleDefinition) => { state.moduleDefinition = def; state.needsTypes = false; @@ -29,7 +36,11 @@ export function moduleNeedsTypes(): AbiTransforms { if (def.return) { const returnType = def.return.type; - if (!isBaseType(returnType) && !isBuiltInType(returnType)) { + if ( + !isBaseType(returnType) && + !isBuiltInType(returnType) && + !state.importedTypes?.has(returnType) + ) { state.needsTypes = true; } } diff --git a/packages/schema/bind/src/bindings/golang/wasm/index.ts b/packages/schema/bind/src/bindings/golang/wasm/index.ts index c6a5e8994..4c3faf5a7 100644 --- a/packages/schema/bind/src/bindings/golang/wasm/index.ts +++ b/packages/schema/bind/src/bindings/golang/wasm/index.ts @@ -271,6 +271,9 @@ function applyTransforms(abi: Abi): Abi { extendType(Functions), addFirstLast, toPrefixedGraphQLType, + Transforms.extractImportedTypes(), + Transforms.extractNeededImportedNamespaces(), + Transforms.needsImportedNamespaces(), Transforms.moduleNeedsTypes(), ]; diff --git a/packages/schema/bind/src/bindings/golang/wasm/templates/env-type/Env%type%Serialization-go.mustache b/packages/schema/bind/src/bindings/golang/wasm/templates/env-type/Env%type%Serialization-go.mustache index 03f0b548f..d10f2f3c5 100644 --- a/packages/schema/bind/src/bindings/golang/wasm/templates/env-type/Env%type%Serialization-go.mustache +++ b/packages/schema/bind/src/bindings/golang/wasm/templates/env-type/Env%type%Serialization-go.mustache @@ -12,8 +12,8 @@ func serialize{{#toUpper}}{{type}}{{/toUpper}}(value *{{#toUpper}}{{type}}{{/toU func write{{#toUpper}}{{type}}{{/toUpper}}(writer msgpack.Write, value *{{#toUpper}}{{type}}{{/toUpper}}) { writer.WriteMapLength({{properties.length}}) {{#properties}} - writer.Context().Push("{{#toUpper}}{{#handleKeywords}}{{name}}{{/handleKeywords}}{{/toUpper}}", "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "writing property") - writer.WriteString("{{#toUpper}}{{#handleKeywords}}{{name}}{{/handleKeywords}}{{/toUpper}}") + writer.Context().Push("{{#handleKeywords}}{{name}}{{/handleKeywords}}", "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "writing property") + writer.WriteString("{{#handleKeywords}}{{name}}{{/handleKeywords}}") {{#scalar}} {{> serialize_scalar}} {{/scalar}} diff --git a/packages/schema/bind/src/bindings/golang/wasm/templates/imported/env-type/Env%type%Serialization-go.mustache b/packages/schema/bind/src/bindings/golang/wasm/templates/imported/env-type/Env%type%Serialization-go.mustache index 0b03fc04e..e05528ffa 100644 --- a/packages/schema/bind/src/bindings/golang/wasm/templates/imported/env-type/Env%type%Serialization-go.mustache +++ b/packages/schema/bind/src/bindings/golang/wasm/templates/imported/env-type/Env%type%Serialization-go.mustache @@ -15,8 +15,8 @@ func serialize{{#toUpper}}{{type}}{{/toUpper}}(value *{{#toUpper}}{{type}}{{/toU func write{{#toUpper}}{{type}}{{/toUpper}}(writer msgpack.Write, value *{{#toUpper}}{{type}}{{/toUpper}}) { writer.WriteMapLength({{properties.length}}) {{#properties}} - writer.Context().Push("{{#toUpper}}{{#handleKeywords}}{{name}}{{/handleKeywords}}{{/toUpper}}", "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "writing property") - writer.WriteString("{{#toUpper}}{{#handleKeywords}}{{name}}{{/handleKeywords}}{{/toUpper}}") + writer.Context().Push("{{#handleKeywords}}{{name}}{{/handleKeywords}}", "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "writing property") + writer.WriteString("{{#handleKeywords}}{{name}}{{/handleKeywords}}") {{#scalar}} {{> serialize_scalar}} {{/scalar}} diff --git a/packages/schema/bind/src/bindings/golang/wasm/templates/imported/module-type/%type%Serialization-go.mustache b/packages/schema/bind/src/bindings/golang/wasm/templates/imported/module-type/%type%Serialization-go.mustache index 24e8033ed..f3487aee8 100644 --- a/packages/schema/bind/src/bindings/golang/wasm/templates/imported/module-type/%type%Serialization-go.mustache +++ b/packages/schema/bind/src/bindings/golang/wasm/templates/imported/module-type/%type%Serialization-go.mustache @@ -6,7 +6,7 @@ package {{#pkgName}}{{#toSnakeCase}}{{namespace}}{{/toSnakeCase}}{{/pkgName}} {{/arguments}} {{/makeImports}} {{#methods}} -type Args{{#toUpper}}{{name}}{{/toUpper}} struct { +type {{#toUpper}}{{namespace}}{{/toUpper}}_Args{{#toUpper}}{{name}}{{/toUpper}} struct { {{#stuctProps}} {{#arguments}} {{#toUpper}}{{#handleKeywords}}{{name}}{{/handleKeywords}}{{/toUpper}} {{#toWasm}}{{toGraphQLType}}{{/toWasm}} `json:"{{name}}"` @@ -14,14 +14,14 @@ type Args{{#toUpper}}{{name}}{{/toUpper}} struct { {{/stuctProps}} } -func Serialize{{#toUpper}}{{name}}{{/toUpper}}Args(value *Args{{#toUpper}}{{name}}{{/toUpper}}) []byte { +func Serialize{{#toUpper}}{{namespace}}{{/toUpper}}_{{#toUpper}}{{name}}{{/toUpper}}Args(value *{{#toUpper}}{{namespace}}{{/toUpper}}_Args{{#toUpper}}{{name}}{{/toUpper}}) []byte { ctx := msgpack.NewContext("Serializing module-type: {{#toUpper}}{{name}}{{/toUpper}}") encoder := msgpack.NewWriteEncoder(ctx) - Write{{#toUpper}}{{name}}{{/toUpper}}Args(encoder, value) + Write{{#toUpper}}{{namespace}}{{/toUpper}}_{{#toUpper}}{{name}}{{/toUpper}}Args(encoder, value) return encoder.Buffer() } -func Write{{#toUpper}}{{name}}{{/toUpper}}Args(writer msgpack.Write, value *Args{{#toUpper}}{{name}}{{/toUpper}}) { +func Write{{#toUpper}}{{namespace}}{{/toUpper}}_{{#toUpper}}{{name}}{{/toUpper}}Args(writer msgpack.Write, value *{{#toUpper}}{{namespace}}{{/toUpper}}_Args{{#toUpper}}{{name}}{{/toUpper}}) { {{#arguments.length}} writer.WriteMapLength({{arguments.length}}) {{/arguments.length}} @@ -54,7 +54,7 @@ func Write{{#toUpper}}{{name}}{{/toUpper}}Args(writer msgpack.Write, value *Args {{/arguments}} } -func Deserialize{{#toUpper}}{{name}}{{/toUpper}}Result(argsBuf []byte) {{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}} { +func Deserialize{{#toUpper}}{{namespace}}{{/toUpper}}_{{#toUpper}}{{name}}{{/toUpper}}Result(argsBuf []byte) {{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}} { ctx := msgpack.NewContext("Deserializing module-type: {{#toUpper}}{{name}}{{/toUpper}}") reader := msgpack.NewReadDecoder(ctx, argsBuf) diff --git a/packages/schema/bind/src/bindings/golang/wasm/templates/imported/module-type/%type%Wrapped-go.mustache b/packages/schema/bind/src/bindings/golang/wasm/templates/imported/module-type/%type%Wrapped-go.mustache index 72c3adf3c..86c2153a7 100644 --- a/packages/schema/bind/src/bindings/golang/wasm/templates/imported/module-type/%type%Wrapped-go.mustache +++ b/packages/schema/bind/src/bindings/golang/wasm/templates/imported/module-type/%type%Wrapped-go.mustache @@ -8,8 +8,8 @@ import ( {{^isInterface}} {{#methods}} -func {{#toUpper}}{{name}}{{/toUpper}}(args *Args{{#toUpper}}{{name}}{{/toUpper}}) ({{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, error) { - argsBuf := Serialize{{#toUpper}}{{name}}{{/toUpper}}Args(args) +func {{#toUpper}}{{namespace}}{{/toUpper}}_{{#toUpper}}{{name}}{{/toUpper}}(args *{{#toUpper}}{{namespace}}{{/toUpper}}_Args{{#toUpper}}{{name}}{{/toUpper}}) ({{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, error) { + argsBuf := Serialize{{#toUpper}}{{namespace}}{{/toUpper}}_{{#toUpper}}{{name}}{{/toUpper}}Args(args) var ( err error raw []byte @@ -17,7 +17,7 @@ func {{#toUpper}}{{name}}{{/toUpper}}(args *Args{{#toUpper}}{{name}}{{/toUpper}} ) raw, err = wrap.WrapSubinvoke("{{uri}}", "{{name}}", argsBuf) if err == nil { - data = Deserialize{{#toUpper}}{{name}}{{/toUpper}}Result(raw) + data = Deserialize{{#toUpper}}{{namespace}}{{/toUpper}}_{{#toUpper}}{{name}}{{/toUpper}}Result(raw) } return data, err } @@ -28,8 +28,8 @@ func {{#toUpper}}{{name}}{{/toUpper}}(args *Args{{#toUpper}}{{name}}{{/toUpper}} {{/isInterface}} {{#isInterface}} {{#methods}} -func {{#toUpper}}{{name}}{{/toUpper}}(uri string, args *Args{{#toUpper}}{{name}}{{/toUpper}}) ({{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, error) { - argsBuf := Serialize{{#toUpper}}{{name}}{{/toUpper}}Args(args) +func {{#toUpper}}{{namespace}}{{/toUpper}}_{{#toUpper}}{{name}}{{/toUpper}}(uri string, args *{{#toUpper}}{{namespace}}{{/toUpper}}_Args{{#toUpper}}{{name}}{{/toUpper}}) ({{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, error) { + argsBuf := Serialize{{#toUpper}}{{namespace}}{{/toUpper}}_{{#toUpper}}{{name}}{{/toUpper}}Args(args) var ( err error raw []byte @@ -37,7 +37,7 @@ func {{#toUpper}}{{name}}{{/toUpper}}(uri string, args *Args{{#toUpper}}{{name}} ) raw, err = wrap.WrapSubinvokeImplementation("{{uri}}", uri, "{{name}}", argsBuf) if err == nil { - data = Deserialize{{#toUpper}}{{name}}{{/toUpper}}Result(raw) + data = Deserialize{{#toUpper}}{{namespace}}{{/toUpper}}_{{#toUpper}}{{name}}{{/toUpper}}Result(raw) } return data, err } diff --git a/packages/schema/bind/src/bindings/golang/wasm/templates/imported/object-type/Object%type%Serialization-go.mustache b/packages/schema/bind/src/bindings/golang/wasm/templates/imported/object-type/Object%type%Serialization-go.mustache index 4620a8e95..c467df492 100644 --- a/packages/schema/bind/src/bindings/golang/wasm/templates/imported/object-type/Object%type%Serialization-go.mustache +++ b/packages/schema/bind/src/bindings/golang/wasm/templates/imported/object-type/Object%type%Serialization-go.mustache @@ -15,8 +15,8 @@ func serialize{{#toUpper}}{{type}}{{/toUpper}}(value *{{#toUpper}}{{type}}{{/toU func write{{#toUpper}}{{type}}{{/toUpper}}(writer msgpack.Write, value *{{#toUpper}}{{type}}{{/toUpper}}) { writer.WriteMapLength({{properties.length}}) {{#properties}} - writer.Context().Push("{{#toUpper}}{{#handleKeywords}}{{name}}{{/handleKeywords}}{{/toUpper}}", "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "writing property") - writer.WriteString("{{#toUpper}}{{#handleKeywords}}{{name}}{{/handleKeywords}}{{/toUpper}}") + writer.Context().Push("{{#handleKeywords}}{{name}}{{/handleKeywords}}", "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "writing property") + writer.WriteString("{{#handleKeywords}}{{name}}{{/handleKeywords}}") {{#scalar}} {{> serialize_scalar}} {{/scalar}} diff --git a/packages/schema/bind/src/bindings/golang/wasm/templates/interface-type/%type%-go.mustache b/packages/schema/bind/src/bindings/golang/wasm/templates/interface-type/%type%-go.mustache index a3fa1c1a6..953c66a21 100644 --- a/packages/schema/bind/src/bindings/golang/wasm/templates/interface-type/%type%-go.mustache +++ b/packages/schema/bind/src/bindings/golang/wasm/templates/interface-type/%type%-go.mustache @@ -11,7 +11,7 @@ import "github.com/polywrap/go-wrap/wrap" {{#capabilities}} {{#getImplementations}} {{#enabled}} -func {{#toUpper}}{{namespace}}{{/toUpper}}Implementations() []string { +func {{#toUpper}}{{namespace}}{{/toUpper}}_GetImplementations() []string { return wrap.WrapGetImplementations("{{uri}}") } {{/enabled}} diff --git a/packages/schema/bind/src/bindings/golang/wasm/templates/module-type/module_wrapped/%type%Serialization-go.mustache b/packages/schema/bind/src/bindings/golang/wasm/templates/module-type/module_wrapped/%type%Serialization-go.mustache index 9f6defac5..57d8c176e 100644 --- a/packages/schema/bind/src/bindings/golang/wasm/templates/module-type/module_wrapped/%type%Serialization-go.mustache +++ b/packages/schema/bind/src/bindings/golang/wasm/templates/module-type/module_wrapped/%type%Serialization-go.mustache @@ -4,9 +4,9 @@ package module_wrapped {{#needsTypes}} . {{goImport}}/module/wrap/types, {{/needsTypes}} - {{#importedTypes}} - . {{goImport}}/module/wrap/imported/{{#pkgName}}{{#toSnakeCase}}{{namespace}}{{/toSnakeCase}}{{/pkgName}}, - {{/importedTypes}} + {{#needsImportedNamespaces}} + . {{goImport}}/module/wrap/imported/{{#pkgName}}{{#toSnakeCase}}{{.}}{{/toSnakeCase}}{{/pkgName}}, + {{/needsImportedNamespaces}} {{#methods}} {{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, {{/methods}} diff --git a/packages/schema/bind/src/bindings/golang/wasm/templates/module-type/module_wrapped/%type%Wrapped-go.mustache b/packages/schema/bind/src/bindings/golang/wasm/templates/module-type/module_wrapped/%type%Wrapped-go.mustache index cd6794431..9e19e28d8 100644 --- a/packages/schema/bind/src/bindings/golang/wasm/templates/module-type/module_wrapped/%type%Wrapped-go.mustache +++ b/packages/schema/bind/src/bindings/golang/wasm/templates/module-type/module_wrapped/%type%Wrapped-go.mustache @@ -1,6 +1,6 @@ package module_wrapped {{#makeImports}} - {{#methods}}{{#env}}github.com/polywrap/go-wrap/wrap,{{#needsTypes}}. {{goImport}}/module/wrap/types,{{/needsTypes}}{{/env}}{{/methods}} + {{#methods}}{{#env}}github.com/polywrap/go-wrap/wrap,. {{goImport}}/module/wrap/types,{{/env}}{{/methods}} {{goImport}}/module as methods, {{/makeImports}} {{#methods}} diff --git a/packages/schema/bind/src/bindings/golang/wasm/templates/object-type/Object%type%Serialization-go.mustache b/packages/schema/bind/src/bindings/golang/wasm/templates/object-type/Object%type%Serialization-go.mustache index b858842c7..0aef83eee 100644 --- a/packages/schema/bind/src/bindings/golang/wasm/templates/object-type/Object%type%Serialization-go.mustache +++ b/packages/schema/bind/src/bindings/golang/wasm/templates/object-type/Object%type%Serialization-go.mustache @@ -15,8 +15,8 @@ func serialize{{#toUpper}}{{type}}{{/toUpper}}(value *{{#toUpper}}{{type}}{{/toU func write{{#toUpper}}{{type}}{{/toUpper}}(writer msgpack.Write, value *{{#toUpper}}{{type}}{{/toUpper}}) { writer.WriteMapLength({{properties.length}}) {{#properties}} - writer.Context().Push("{{#toUpper}}{{#handleKeywords}}{{name}}{{/handleKeywords}}{{/toUpper}}", "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "writing property") - writer.WriteString("{{#toUpper}}{{#handleKeywords}}{{name}}{{/handleKeywords}}{{/toUpper}}") + writer.Context().Push("{{#handleKeywords}}{{name}}{{/handleKeywords}}", "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "writing property") + writer.WriteString("{{#handleKeywords}}{{name}}{{/handleKeywords}}") {{#scalar}} {{> serialize_scalar}} {{/scalar}} diff --git a/packages/templates/polywrap.wasm-golang-linked.build.yaml b/packages/templates/polywrap.wasm-golang-linked.build.yaml new file mode 100644 index 000000000..754488910 --- /dev/null +++ b/packages/templates/polywrap.wasm-golang-linked.build.yaml @@ -0,0 +1,4 @@ +format: 0.3.0 +strategies: + image: + name: template-wasm-go diff --git a/packages/templates/polywrap.wasm-golang-linked.yaml b/packages/templates/polywrap.wasm-golang-linked.yaml new file mode 100644 index 000000000..014ae3dfc --- /dev/null +++ b/packages/templates/polywrap.wasm-golang-linked.yaml @@ -0,0 +1,9 @@ +format: 0.3.0 +project: + name: template-wasm-go + type: wasm/golang +source: + module: ./go.mod + schema: ./polywrap.graphql +extensions: + build: ./polywrap.wasm-golang-linked.build.yaml \ No newline at end of file diff --git a/packages/templates/wasm/golang/build-staging/module.wasm b/packages/templates/wasm/golang/build-staging/module.wasm new file mode 100755 index 000000000..749b174e7 Binary files /dev/null and b/packages/templates/wasm/golang/build-staging/module.wasm differ diff --git a/packages/templates/wasm/golang/go.mod b/packages/templates/wasm/golang/go.mod index 87625c864..78573cf70 100644 --- a/packages/templates/wasm/golang/go.mod +++ b/packages/templates/wasm/golang/go.mod @@ -2,6 +2,6 @@ module example.com/template-wasm-go go 1.18 -require github.com/polywrap/go-wrap wrap-0.1 +require github.com/polywrap/go-wrap wrap-0.1 require github.com/valyala/fastjson v1.6.3 // indirect diff --git a/packages/templates/wasm/golang/go.sum b/packages/templates/wasm/golang/go.sum new file mode 100644 index 000000000..8df2badd7 --- /dev/null +++ b/packages/templates/wasm/golang/go.sum @@ -0,0 +1,4 @@ +github.com/polywrap/go-wrap v0.0.0-20230712212127-6895977d63c2 h1:+O3G/996rX4SMlJNFA9AIjPSyrInzOEVb7PFOT96G9A= +github.com/polywrap/go-wrap v0.0.0-20230712212127-6895977d63c2/go.mod h1:rxqhIFKUzn/M46+zjnA1RHlCzLGQn2BiLWalezhLj/k= +github.com/valyala/fastjson v1.6.3 h1:tAKFnnwmeMGPbwJ7IwxcTPCNr3uIzoIj3/Fh90ra4xc= +github.com/valyala/fastjson v1.6.3/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY= diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs b/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs index db0deb793..fc34f4f43 100644 --- a/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs +++ b/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs @@ -2,8 +2,21 @@ /// All modifications will be overwritten. use std::sync::Arc; -use polywrap_core::invoke::Invoker; +use polywrap_core::invoker::Invoker; use polywrap_plugin::{error::PluginError, module::PluginModule}; +use polywrap_msgpack_serde::{ + to_vec, + from_slice, + BigInt, + BigNumber, + JSON, + bytes, + wrappers::{ + polywrap_bigint as bigint, + polywrap_json as json + } +}; +use std::collections::BTreeMap; use serde::{Serialize, Deserialize}; use super::types::*; @@ -19,15 +32,15 @@ pub struct ArgsModuleMethod { pub enum_array: Vec, #[serde(rename = "optEnumArray")] pub opt_enum_array: Option>>, - pub map: Map, + pub map: BTreeMap, #[serde(rename = "mapOfArr")] - pub map_of_arr: Map>, + pub map_of_arr: BTreeMap>, #[serde(rename = "mapOfMap")] - pub map_of_map: Map>, + pub map_of_map: BTreeMap>, #[serde(rename = "mapOfObj")] - pub map_of_obj: Map, + pub map_of_obj: BTreeMap, #[serde(rename = "mapOfArrOfObj")] - pub map_of_arr_of_obj: Map>, + pub map_of_arr_of_obj: BTreeMap>, } #[derive(Clone, Debug, Deserialize, Serialize)] diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-rs/types.rs b/packages/test-cases/cases/bind/sanity/output/plugin-rs/types.rs index fe3c18556..a673af695 100644 --- a/packages/test-cases/cases/bind/sanity/output/plugin-rs/types.rs +++ b/packages/test-cases/cases/bind/sanity/output/plugin-rs/types.rs @@ -3,9 +3,21 @@ // NOTE: This is an auto-generated file. // All modifications will be overwritten. -use polywrap_core::{invoke::Invoker, uri::Uri}; -use polywrap_msgpack::{decode, serialize}; -use polywrap_plugin::{error::PluginError, BigInt, BigNumber, Map, JSON}; +use polywrap_core::{invoker::Invoker, uri::Uri}; +use polywrap_plugin::error::PluginError; +use polywrap_msgpack_serde::{ + to_vec, + from_slice, + BigInt, + BigNumber, + JSON, + bytes, + wrappers::{ + polywrap_bigint as bigint, + polywrap_json as json + } +}; +use std::collections::BTreeMap; use serde::{Serialize, Deserialize}; use std::sync::Arc; @@ -17,7 +29,7 @@ pub struct Env { #[serde(rename = "optProp")] pub opt_prop: Option, #[serde(rename = "optMap")] - pub opt_map: Option>>, + pub opt_map: Option>>, } // Env END // @@ -38,18 +50,22 @@ pub struct CustomType { pub i8: i8, pub i16: i16, pub i32: i32, + #[serde(with = "bigint")] pub bigint: BigInt, + #[serde(with = "bigint")] #[serde(rename = "optBigint")] pub opt_bigint: Option, pub bignumber: BigNumber, #[serde(rename = "optBignumber")] pub opt_bignumber: Option, + #[serde(with = "json")] pub json: JSON::Value, + #[serde(with = "json")] #[serde(rename = "optJson")] pub opt_json: Option, - #[serde(with = "serde_bytes")] + #[serde(with = "bytes")] pub bytes: Vec, - #[serde(with = "serde_bytes")] + #[serde(with = "bytes")] #[serde(rename = "optBytes")] pub opt_bytes: Option>, pub boolean: bool, @@ -84,15 +100,15 @@ pub struct CustomType { pub enum_array: Vec, #[serde(rename = "optEnumArray")] pub opt_enum_array: Option>>, - pub map: Map, + pub map: BTreeMap, #[serde(rename = "mapOfArr")] - pub map_of_arr: Map>, + pub map_of_arr: BTreeMap>, #[serde(rename = "mapOfObj")] - pub map_of_obj: Map, + pub map_of_obj: BTreeMap, #[serde(rename = "mapOfArrOfObj")] - pub map_of_arr_of_obj: Map>, + pub map_of_arr_of_obj: BTreeMap>, #[serde(rename = "mapCustomValue")] - pub map_custom_value: Map>, + pub map_custom_value: BTreeMap>, } #[derive(Clone, Debug, Deserialize, Serialize)] pub struct AnotherType { @@ -228,7 +244,7 @@ impl<'a> TestImportModule<'a> { pub fn imported_method(&self, args: &TestImportModuleArgsImportedMethod) -> Result, PluginError> { let uri = self.uri; - let serialized_args = serialize(args.clone()).unwrap(); + let serialized_args = to_vec(args.clone()).unwrap(); let result = invoker.invoke_raw( uri, "importedMethod", @@ -243,12 +259,12 @@ impl<'a> TestImportModule<'a> { exception: e.to_string(), })?; - Ok(Some(decode(result.as_slice())?)) + Ok(Some(from_slice(result.as_slice())?)) } pub fn another_method(&self, args: &TestImportModuleArgsAnotherMethod) -> Result { let uri = self.uri; - let serialized_args = serialize(args.clone()).unwrap(); + let serialized_args = to_vec(args.clone()).unwrap(); let result = invoker.invoke_raw( uri, "anotherMethod", @@ -263,12 +279,12 @@ impl<'a> TestImportModule<'a> { exception: e.to_string(), })?; - Ok(decode(result.as_slice())?) + Ok(from_slice(result.as_slice())?) } pub fn returns_array_of_enums(&self, args: &TestImportModuleArgsReturnsArrayOfEnums) -> Result>, PluginError> { let uri = self.uri; - let serialized_args = serialize(args.clone()).unwrap(); + let serialized_args = to_vec(args.clone()).unwrap(); let result = invoker.invoke_raw( uri, "returnsArrayOfEnums", @@ -283,7 +299,7 @@ impl<'a> TestImportModule<'a> { exception: e.to_string(), })?; - Ok(decode(result.as_slice())?) + Ok(from_slice(result.as_slice())?) } } // Imported Modules END // diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-go/imported/test_import/test_import__module_serialization.go b/packages/test-cases/cases/bind/sanity/output/wrap-go/imported/test_import/test_import__module_serialization.go index 461da72df..661c0fc8d 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-go/imported/test_import/test_import__module_serialization.go +++ b/packages/test-cases/cases/bind/sanity/output/wrap-go/imported/test_import/test_import__module_serialization.go @@ -4,7 +4,7 @@ import ( "github.com/polywrap/go-wrap/msgpack" ) -type ArgsImportedMethod struct { +type TestImport_ArgsImportedMethod struct { Str string `json:"str"` OptStr *string `json:"optStr"` U uint32 `json:"u"` @@ -20,14 +20,14 @@ type ArgsImportedMethod struct { OptEnumArray []*TestImport_Enum `json:"optEnumArray"` } -func SerializeImportedMethodArgs(value *ArgsImportedMethod) []byte { +func SerializeTestImport_ImportedMethodArgs(value *TestImport_ArgsImportedMethod) []byte { ctx := msgpack.NewContext("Serializing module-type: ImportedMethod") encoder := msgpack.NewWriteEncoder(ctx) - WriteImportedMethodArgs(encoder, value) + WriteTestImport_ImportedMethodArgs(encoder, value) return encoder.Buffer() } -func WriteImportedMethodArgs(writer msgpack.Write, value *ArgsImportedMethod) { +func WriteTestImport_ImportedMethodArgs(writer msgpack.Write, value *TestImport_ArgsImportedMethod) { writer.WriteMapLength(13) writer.Context().Push("str", "string", "writing property") writer.WriteString("str") @@ -196,7 +196,7 @@ func WriteImportedMethodArgs(writer msgpack.Write, value *ArgsImportedMethod) { writer.Context().Pop() } -func DeserializeImportedMethodResult(argsBuf []byte) *TestImport_Object { +func DeserializeTestImport_ImportedMethodResult(argsBuf []byte) *TestImport_Object { ctx := msgpack.NewContext("Deserializing module-type: ImportedMethod") reader := msgpack.NewReadDecoder(ctx, argsBuf) @@ -209,18 +209,18 @@ func DeserializeImportedMethodResult(argsBuf []byte) *TestImport_Object { return value } -type ArgsAnotherMethod struct { +type TestImport_ArgsAnotherMethod struct { Arg []string `json:"arg"` } -func SerializeAnotherMethodArgs(value *ArgsAnotherMethod) []byte { +func SerializeTestImport_AnotherMethodArgs(value *TestImport_ArgsAnotherMethod) []byte { ctx := msgpack.NewContext("Serializing module-type: AnotherMethod") encoder := msgpack.NewWriteEncoder(ctx) - WriteAnotherMethodArgs(encoder, value) + WriteTestImport_AnotherMethodArgs(encoder, value) return encoder.Buffer() } -func WriteAnotherMethodArgs(writer msgpack.Write, value *ArgsAnotherMethod) { +func WriteTestImport_AnotherMethodArgs(writer msgpack.Write, value *TestImport_ArgsAnotherMethod) { writer.WriteMapLength(1) writer.Context().Push("arg", "[]string", "writing property") writer.WriteString("arg") @@ -240,7 +240,7 @@ func WriteAnotherMethodArgs(writer msgpack.Write, value *ArgsAnotherMethod) { writer.Context().Pop() } -func DeserializeAnotherMethodResult(argsBuf []byte) int32 { +func DeserializeTestImport_AnotherMethodResult(argsBuf []byte) int32 { ctx := msgpack.NewContext("Deserializing module-type: AnotherMethod") reader := msgpack.NewReadDecoder(ctx, argsBuf) @@ -251,18 +251,18 @@ func DeserializeAnotherMethodResult(argsBuf []byte) int32 { return value } -type ArgsReturnsArrayOfEnums struct { +type TestImport_ArgsReturnsArrayOfEnums struct { Arg string `json:"arg"` } -func SerializeReturnsArrayOfEnumsArgs(value *ArgsReturnsArrayOfEnums) []byte { +func SerializeTestImport_ReturnsArrayOfEnumsArgs(value *TestImport_ArgsReturnsArrayOfEnums) []byte { ctx := msgpack.NewContext("Serializing module-type: ReturnsArrayOfEnums") encoder := msgpack.NewWriteEncoder(ctx) - WriteReturnsArrayOfEnumsArgs(encoder, value) + WriteTestImport_ReturnsArrayOfEnumsArgs(encoder, value) return encoder.Buffer() } -func WriteReturnsArrayOfEnumsArgs(writer msgpack.Write, value *ArgsReturnsArrayOfEnums) { +func WriteTestImport_ReturnsArrayOfEnumsArgs(writer msgpack.Write, value *TestImport_ArgsReturnsArrayOfEnums) { writer.WriteMapLength(1) writer.Context().Push("arg", "string", "writing property") writer.WriteString("arg") @@ -273,7 +273,7 @@ func WriteReturnsArrayOfEnumsArgs(writer msgpack.Write, value *ArgsReturnsArrayO writer.Context().Pop() } -func DeserializeReturnsArrayOfEnumsResult(argsBuf []byte) []*TestImport_Enum_Return { +func DeserializeTestImport_ReturnsArrayOfEnumsResult(argsBuf []byte) []*TestImport_Enum_Return { ctx := msgpack.NewContext("Deserializing module-type: ReturnsArrayOfEnums") reader := msgpack.NewReadDecoder(ctx, argsBuf) diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-go/imported/test_import/test_import__module_wrapped.go b/packages/test-cases/cases/bind/sanity/output/wrap-go/imported/test_import/test_import__module_wrapped.go index 54e30e516..2b97c088d 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-go/imported/test_import/test_import__module_wrapped.go +++ b/packages/test-cases/cases/bind/sanity/output/wrap-go/imported/test_import/test_import__module_wrapped.go @@ -4,8 +4,8 @@ import ( "github.com/polywrap/go-wrap/wrap" ) -func ImportedMethod(uri string, args *ArgsImportedMethod) (*TestImport_Object, error) { - argsBuf := SerializeImportedMethodArgs(args) +func TestImport_ImportedMethod(uri string, args *TestImport_ArgsImportedMethod) (*TestImport_Object, error) { + argsBuf := SerializeTestImport_ImportedMethodArgs(args) var ( err error raw []byte @@ -13,13 +13,13 @@ func ImportedMethod(uri string, args *ArgsImportedMethod) (*TestImport_Object, e ) raw, err = wrap.WrapSubinvokeImplementation("testimport.uri.eth", uri, "importedMethod", argsBuf) if err == nil { - data = DeserializeImportedMethodResult(raw) + data = DeserializeTestImport_ImportedMethodResult(raw) } return data, err } -func AnotherMethod(uri string, args *ArgsAnotherMethod) (int32, error) { - argsBuf := SerializeAnotherMethodArgs(args) +func TestImport_AnotherMethod(uri string, args *TestImport_ArgsAnotherMethod) (int32, error) { + argsBuf := SerializeTestImport_AnotherMethodArgs(args) var ( err error raw []byte @@ -27,13 +27,13 @@ func AnotherMethod(uri string, args *ArgsAnotherMethod) (int32, error) { ) raw, err = wrap.WrapSubinvokeImplementation("testimport.uri.eth", uri, "anotherMethod", argsBuf) if err == nil { - data = DeserializeAnotherMethodResult(raw) + data = DeserializeTestImport_AnotherMethodResult(raw) } return data, err } -func ReturnsArrayOfEnums(uri string, args *ArgsReturnsArrayOfEnums) ([]*TestImport_Enum_Return, error) { - argsBuf := SerializeReturnsArrayOfEnumsArgs(args) +func TestImport_ReturnsArrayOfEnums(uri string, args *TestImport_ArgsReturnsArrayOfEnums) ([]*TestImport_Enum_Return, error) { + argsBuf := SerializeTestImport_ReturnsArrayOfEnumsArgs(args) var ( err error raw []byte @@ -41,7 +41,7 @@ func ReturnsArrayOfEnums(uri string, args *ArgsReturnsArrayOfEnums) ([]*TestImpo ) raw, err = wrap.WrapSubinvokeImplementation("testimport.uri.eth", uri, "returnsArrayOfEnums", argsBuf) if err == nil { - data = DeserializeReturnsArrayOfEnumsResult(raw) + data = DeserializeTestImport_ReturnsArrayOfEnumsResult(raw) } return data, err } diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-go/interfaces/test_import.go b/packages/test-cases/cases/bind/sanity/output/wrap-go/interfaces/test_import.go index 7ae06bfb2..a2ce917ff 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-go/interfaces/test_import.go +++ b/packages/test-cases/cases/bind/sanity/output/wrap-go/interfaces/test_import.go @@ -2,6 +2,6 @@ package interfaces import "github.com/polywrap/go-wrap/wrap" -func TestImportImplementations() []string { +func TestImport_GetImplementations() []string { return wrap.WrapGetImplementations("testimport.uri.eth") } diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-go/module_wrapped/module_serialization.go b/packages/test-cases/cases/bind/sanity/output/wrap-go/module_wrapped/module_serialization.go index 346056af8..77627d724 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-go/module_wrapped/module_serialization.go +++ b/packages/test-cases/cases/bind/sanity/output/wrap-go/module_wrapped/module_serialization.go @@ -1,6 +1,7 @@ package module_wrapped import ( + . "github.com/testorg/testrepo/module/wrap/imported/test_import" . "github.com/testorg/testrepo/module/wrap/types" "github.com/polywrap/go-wrap/msgpack" ) diff --git a/yarn.lock b/yarn.lock index 2415cf732..23fd59664 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3232,6 +3232,18 @@ array.prototype.reduce@^1.0.5: es-array-method-boxes-properly "^1.0.0" is-string "^1.0.7" +arraybuffer.prototype.slice@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.1.tgz#9b5ea3868a6eebc30273da577eb888381c0044bb" + integrity sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw== + dependencies: + array-buffer-byte-length "^1.0.0" + call-bind "^1.0.2" + define-properties "^1.2.0" + get-intrinsic "^1.2.1" + is-array-buffer "^3.0.2" + is-shared-array-buffer "^1.0.2" + arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" @@ -3661,9 +3673,9 @@ camelcase@^6.0.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001503: - version "1.0.30001515" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001515.tgz#418aefeed9d024cd3129bfae0ccc782d4cb8f12b" - integrity sha512-eEFDwUOZbE24sb+Ecsx3+OvNETqjWIdabMy52oOkIgcUtAsQifjUG9q4U9dgTHJM2mfk4uEPxc0+xuFdJ629QA== + version "1.0.30001516" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001516.tgz#621b1be7d85a8843ee7d210fd9d87b52e3daab3a" + integrity sha512-Wmec9pCBY8CWbmI4HsjBeQLqDTqV91nFVR83DnZpYyRnPI1wePDsTg0bGLPC5VU/3OIZV1fmxEea1b+tFKe86g== capture-exit@^2.0.0: version "2.0.0" @@ -4438,9 +4450,9 @@ ecc-jsbn@~0.1.1: safer-buffer "^2.1.0" electron-to-chromium@^1.4.431: - version "1.4.460" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.460.tgz#f360a5059c039c4a5fb4dfa99680ad8129dd9f84" - integrity sha512-kKiHnbrHME7z8E6AYaw0ehyxY5+hdaRmeUbjBO22LZMdqTYCO29EvF0T1cQ3pJ1RN5fyMcHl1Lmcsdt9WWJpJQ== + version "1.4.461" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.461.tgz#6b14af66042732bf883ab63a4d82cac8f35eb252" + integrity sha512-1JkvV2sgEGTDXjdsaQCeSwYYuhLRphRpc+g6EHTFELJXEiznLt3/0pZ9JuAOQ5p2rI3YxKTbivtvajirIfhrEQ== elliptic@6.5.4: version "6.5.4" @@ -4514,11 +4526,12 @@ error-ex@^1.2.0, error-ex@^1.3.1: is-arrayish "^0.2.1" es-abstract@^1.19.0, es-abstract@^1.20.4, es-abstract@^1.21.2: - version "1.21.3" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.21.3.tgz#8aaa0ffc080e8a6fef6ace72631dc1ec5d47bf94" - integrity sha512-ZU4miiY1j3sGPFLJ34VJXEqhpmL+HGByCinGHv4HC+Fxl2fI2Z4yR6tl0mORnDr6PA8eihWo4LmSWDbvhALckg== + version "1.22.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.22.1.tgz#8b4e5fc5cefd7f1660f0f8e1a52900dfbc9d9ccc" + integrity sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw== dependencies: array-buffer-byte-length "^1.0.0" + arraybuffer.prototype.slice "^1.0.1" available-typed-arrays "^1.0.5" call-bind "^1.0.2" es-set-tostringtag "^2.0.1" @@ -4545,10 +4558,13 @@ es-abstract@^1.19.0, es-abstract@^1.20.4, es-abstract@^1.21.2: object-keys "^1.1.1" object.assign "^4.1.4" regexp.prototype.flags "^1.5.0" + safe-array-concat "^1.0.0" safe-regex-test "^1.0.0" string.prototype.trim "^1.2.7" string.prototype.trimend "^1.0.6" string.prototype.trimstart "^1.0.6" + typed-array-buffer "^1.0.0" + typed-array-byte-length "^1.0.0" typed-array-byte-offset "^1.0.0" typed-array-length "^1.0.4" unbox-primitive "^1.0.2" @@ -9732,6 +9748,25 @@ type@^2.7.2: resolved "https://registry.yarnpkg.com/type/-/type-2.7.2.tgz#2376a15a3a28b1efa0f5350dcf72d24df6ef98d0" integrity sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw== +typed-array-buffer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz#18de3e7ed7974b0a729d3feecb94338d1472cd60" + integrity sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.1" + is-typed-array "^1.1.10" + +typed-array-byte-length@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz#d787a24a995711611fb2b87a4052799517b230d0" + integrity sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA== + dependencies: + call-bind "^1.0.2" + for-each "^0.3.3" + has-proto "^1.0.1" + is-typed-array "^1.1.10" + typed-array-byte-offset@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz#cbbe89b51fdef9cd6aaf07ad4707340abbc4ea0b"