From 5b302c143916e6ae638772a155a931c1fa42e9d5 Mon Sep 17 00:00:00 2001 From: krisbitney Date: Thu, 7 Sep 2023 17:08:52 +0300 Subject: [PATCH 01/22] added "embed" option to codegen --- packages/cli/lang/en.json | 3 +- packages/cli/lang/es.json | 3 +- .../cli/src/__tests__/e2e/p2/codegen.spec.ts | 1 + packages/cli/src/commands/build.ts | 5 +- packages/cli/src/commands/codegen.ts | 17 ++++++- packages/cli/src/lib/Compiler.ts | 7 ++- packages/cli/src/lib/codegen/CodeGenerator.ts | 18 +++++-- .../src/lib/codegen/ScriptCodeGenerator.ts | 8 ++-- packages/cli/src/lib/codegen/WasmEmbed.ts | 47 +++++++++++++++++++ packages/cli/src/lib/codegen/index.ts | 1 + 10 files changed, 89 insertions(+), 21 deletions(-) create mode 100644 packages/cli/src/lib/codegen/WasmEmbed.ts diff --git a/packages/cli/lang/en.json b/packages/cli/lang/en.json index 0e32cb952e..adc30d6737 100644 --- a/packages/cli/lang/en.json +++ b/packages/cli/lang/en.json @@ -83,8 +83,7 @@ "commands_codegen_error_domain": "domain", "commands_codegen_error_optionMissingArgument": "{option} option missing {argument} argument", "commands_codegen_options_codegen": "Output directory for the generated code (default: {default})", - "commands_codegen_options_e": "ENS address to lookup external schemas (default: 0x0000...2e1e)", - "commands_codegen_options_e_address": "address", + "commands_codegen_options_e": "Locally embed Wasm wraps", "commands_codegen_options_h": "Show usage information", "commands_codegen_options_s": "Path to a custom generation script (JavaScript | TypeScript)", "commands_codegen_options_i": "IPFS node to load external schemas (default: ipfs.io & localhost)", diff --git a/packages/cli/lang/es.json b/packages/cli/lang/es.json index 0e32cb952e..adc30d6737 100644 --- a/packages/cli/lang/es.json +++ b/packages/cli/lang/es.json @@ -83,8 +83,7 @@ "commands_codegen_error_domain": "domain", "commands_codegen_error_optionMissingArgument": "{option} option missing {argument} argument", "commands_codegen_options_codegen": "Output directory for the generated code (default: {default})", - "commands_codegen_options_e": "ENS address to lookup external schemas (default: 0x0000...2e1e)", - "commands_codegen_options_e_address": "address", + "commands_codegen_options_e": "Locally embed Wasm wraps", "commands_codegen_options_h": "Show usage information", "commands_codegen_options_s": "Path to a custom generation script (JavaScript | TypeScript)", "commands_codegen_options_i": "IPFS node to load external schemas (default: ipfs.io & localhost)", diff --git a/packages/cli/src/__tests__/e2e/p2/codegen.spec.ts b/packages/cli/src/__tests__/e2e/p2/codegen.spec.ts index ba388daa40..06f4f71452 100644 --- a/packages/cli/src/__tests__/e2e/p2/codegen.spec.ts +++ b/packages/cli/src/__tests__/e2e/p2/codegen.spec.ts @@ -19,6 +19,7 @@ Options: -b, --bindgen Uri for custom bindgen wrap (must implement wrap-abi-bindgen interface; see https://github.com/polywrap/wrap-abi-bindgen) + -e, --embed Locally embed Wasm wraps -s, --script Path to a custom generation script (JavaScript | TypeScript) -c, --client-config Add custom configuration to the diff --git a/packages/cli/src/commands/build.ts b/packages/cli/src/commands/build.ts index 5b457c3766..e315be7227 100644 --- a/packages/cli/src/commands/build.ts +++ b/packages/cli/src/commands/build.ts @@ -242,11 +242,12 @@ async function run(options: Required) { project, client, }); + const abi = await schemaComposer.getComposedAbis(); if (canRunCodegen && !noCodegen) { const codeGenerator = new CodeGenerator({ project, - schemaComposer, + abi, codegenDirAbs: codegenDir || undefined, bindgenUri, }); @@ -261,7 +262,7 @@ async function run(options: Required) { const compiler = new Compiler({ project: project as PolywrapProject, outputDir, - schemaComposer, + abi, buildStrategy, }); diff --git a/packages/cli/src/commands/codegen.ts b/packages/cli/src/commands/codegen.ts index e2d4e739f6..426de334a9 100644 --- a/packages/cli/src/commands/codegen.ts +++ b/packages/cli/src/commands/codegen.ts @@ -14,6 +14,8 @@ import { defaultPolywrapManifestFiles, parseLogFileOption, parseWrapperEnvsOption, + WasmEmbed, + getWasmEmbeds, } from "../lib"; import { ScriptCodegenerator } from "../lib/codegen/ScriptCodeGenerator"; import { DEFAULT_CODEGEN_DIR } from "../lib/defaults"; @@ -29,6 +31,7 @@ export interface CodegenCommandOptions extends BaseCommandOptions { manifestFile: string; codegenDir: string | false; bindgen: string | false; + embed: boolean | false; script: string | false; clientConfig: string | false; wrapperEnvs: string | false; @@ -54,6 +57,7 @@ export const codegen: Command = { })}` ) .option(`-b, --bindgen `, `${intlMsg.commands_codegen_options_b()}`) + .option(`-e, --embed`, `${intlMsg.commands_codegen_options_e()}`) .option( `-s, --script <${pathStr}>`, `${intlMsg.commands_codegen_options_s()}` @@ -81,6 +85,7 @@ export const codegen: Command = { ), codegenDir: parseDirOptionNoDefault(options.codegenDir), bindgen: options.bindgen || false, + embed: options.embed || false, script: parseCodegenScriptOption(options.script), clientConfig: options.clientConfig || false, wrapperEnvs: options.wrapperEnvs || false, @@ -100,6 +105,7 @@ async function run(options: Required) { wrapperEnvs, codegenDir, bindgen, + embed, script, verbose, quiet, @@ -133,21 +139,28 @@ async function run(options: Required) { project, client, }); + const abi = await schemaComposer.getComposedAbis(); + + const embeds: WasmEmbed[] | undefined = + embed && abi.importedModuleTypes + ? await getWasmEmbeds(abi.importedModuleTypes, client, logger) + : undefined; const codeGenerator = script ? new ScriptCodegenerator({ codegenDirAbs: codegenDir || undefined, script, - schemaComposer, + abi, project, omitHeader: false, mustacheView: undefined, }) : new CodeGenerator({ codegenDirAbs: codegenDir || undefined, - schemaComposer, + abi, project, bindgenUri, + embeds, }); const execute = async (): Promise => { diff --git a/packages/cli/src/lib/Compiler.ts b/packages/cli/src/lib/Compiler.ts index bc41d306f3..fa4d245575 100644 --- a/packages/cli/src/lib/Compiler.ts +++ b/packages/cli/src/lib/Compiler.ts @@ -8,7 +8,6 @@ import { PolywrapProject, PluginProject, resetDir, - SchemaComposer, logActivity, loadDocsManifest, } from "./"; @@ -21,12 +20,13 @@ import fs from "fs"; import fse from "fs-extra"; import path from "path"; import { DocsManifest } from "@polywrap/polywrap-manifest-types-js"; +import { Abi } from "@polywrap/schema-parse"; export interface CompilerConfig { outputDir: string; project: PolywrapProject | PluginProject; buildStrategy?: BuildStrategy; - schemaComposer: SchemaComposer; + abi: Abi; } export class Compiler { @@ -111,13 +111,12 @@ export class Compiler { } private async _outputWrapManifest(): Promise { - const { outputDir, project, schemaComposer } = this._config; + const { outputDir, project, abi } = this._config; const manifestPath = `${outputDir}/wrap.info`; const run = async () => { const manifest = await project.getManifest(); const type = manifest.project.type.split("/")[0]; - const abi = await schemaComposer.getComposedAbis(); await generateWrapFile( abi, manifest.project.name, diff --git a/packages/cli/src/lib/codegen/CodeGenerator.ts b/packages/cli/src/lib/codegen/CodeGenerator.ts index bc4865dd16..e0d9b8c352 100644 --- a/packages/cli/src/lib/codegen/CodeGenerator.ts +++ b/packages/cli/src/lib/codegen/CodeGenerator.ts @@ -15,19 +15,21 @@ import { Project, } from "../project"; import { resetDir } from "../system"; -import { SchemaComposer } from "../SchemaComposer"; import { CodegenOverrides, tryGetCodegenOverrides } from "./CodegenOverrides"; +import { WasmEmbed } from "./WasmEmbed"; import path from "path"; import { BindLanguage } from "@polywrap/schema-bind"; import { writeDirectorySync } from "@polywrap/os-js"; import { Uri } from "@polywrap/core-js"; +import { Abi } from "@polywrap/schema-parse"; export interface CodeGeneratorConfig { project: Project; - schemaComposer: SchemaComposer; + abi: Abi; codegenDirAbs?: string; bindgenUri?: Uri; + embeds?: WasmEmbed[]; } export class CodeGenerator { @@ -88,13 +90,19 @@ export class CodeGenerator { ) : undefined; - const bindConfig = overrides + let bindConfig = overrides ? await overrides.getSchemaBindConfig(this._config.project) : {}; - const abi = await this._config.schemaComposer.getComposedAbis(); + if (this._config.embeds) { + bindConfig = { + ...bindConfig, + embeds: this._config.embeds, + }; + } + const binding = await this._config.project.generateSchemaBindings( - abi, + this._config.abi, codegenDir, this._config.bindgenUri?.toString(), bindConfig diff --git a/packages/cli/src/lib/codegen/ScriptCodeGenerator.ts b/packages/cli/src/lib/codegen/ScriptCodeGenerator.ts index c5487b6142..8002bf4ed7 100644 --- a/packages/cli/src/lib/codegen/ScriptCodeGenerator.ts +++ b/packages/cli/src/lib/codegen/ScriptCodeGenerator.ts @@ -1,7 +1,6 @@ import { intlMsg } from "../intl"; import { AnyProjectManifest, Project } from "../project"; import { isTypescriptFile, importTypescriptModule, resetDir } from "../system"; -import { SchemaComposer } from "../SchemaComposer"; import { CodeGenerator } from "./CodeGenerator"; import { writeDirectorySync } from "@polywrap/os-js"; @@ -14,6 +13,7 @@ import { readFileSync } from "fs-extra"; import Mustache from "mustache"; import path from "path"; import { latestWrapManifestVersion } from "@polywrap/wrap-manifest-types-js"; +import { Abi } from "@polywrap/schema-parse"; export class ScriptCodegenerator extends CodeGenerator { private readonly _script: string; @@ -23,7 +23,7 @@ export class ScriptCodegenerator extends CodeGenerator { constructor(config: { project: Project; - schemaComposer: SchemaComposer; + abi: Abi; codegenDirAbs?: string; script: string; mustacheView: Record | undefined; @@ -32,7 +32,7 @@ export class ScriptCodegenerator extends CodeGenerator { }) { super({ project: config.project, - schemaComposer: config.schemaComposer, + abi: config.abi, codegenDirAbs: config.codegenDirAbs, }); @@ -72,7 +72,7 @@ export class ScriptCodegenerator extends CodeGenerator { version: latestWrapManifestVersion, name: await this._config.project.getName(), type: bindLanguageToWrapInfoType(bindLanguage), - abi: await this._config.schemaComposer.getComposedAbis(), + abi: this._config.abi, }, config: this._mustacheView, outputDirAbs, diff --git a/packages/cli/src/lib/codegen/WasmEmbed.ts b/packages/cli/src/lib/codegen/WasmEmbed.ts new file mode 100644 index 0000000000..c209b22068 --- /dev/null +++ b/packages/cli/src/lib/codegen/WasmEmbed.ts @@ -0,0 +1,47 @@ +import { Logger } from "../logging"; + +import { ImportedModuleDefinition } from "@polywrap/wrap-manifest-types-js"; +import { PolywrapClient } from "@polywrap/client-js"; + +export interface WasmEmbed { + uri: string; + namespace: string; + manifest: Uint8Array; + module: Uint8Array; +} + +export async function getWasmEmbeds( + importedModules: ImportedModuleDefinition[], + client: PolywrapClient, + logger: Logger +): Promise { + const embeds: WasmEmbed[] = []; + + for (const importedModule of importedModules ?? []) { + if (importedModule.isInterface) { + continue; + } + const uri = importedModule.uri; + + const manifest = await client.getFile(uri, { path: "wrap.info" }); + if (!manifest.ok) { + logger.error(JSON.stringify(manifest.error, null, 2)); + process.exit(1); + } + + const module = await client.getFile(uri, { path: "wrap.wasm" }); + if (!module.ok) { + // The error is ignored because getFile is expected to fail for plugins and interfaces + continue; + } + + embeds.push({ + uri, + namespace: importedModule.namespace, + manifest: manifest.value as Uint8Array, + module: module.value as Uint8Array, + }); + } + + return embeds; +} diff --git a/packages/cli/src/lib/codegen/index.ts b/packages/cli/src/lib/codegen/index.ts index cd95e5446c..cb44cf62d8 100644 --- a/packages/cli/src/lib/codegen/index.ts +++ b/packages/cli/src/lib/codegen/index.ts @@ -1,3 +1,4 @@ export * from "./CodeGenerator"; export * from "./CodegenOverrides"; export * from "./ScriptCodeGenerator"; +export * from "./WasmEmbed"; From fef8d91ee4d0d229f17cdd12b394c3edf4dc6c4b Mon Sep 17 00:00:00 2001 From: krisbitney Date: Thu, 7 Sep 2023 20:19:43 +0300 Subject: [PATCH 02/22] added check for app project --- packages/cli/lang/en.json | 1 + packages/cli/lang/es.json | 1 + packages/cli/src/commands/codegen.ts | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/packages/cli/lang/en.json b/packages/cli/lang/en.json index adc30d6737..b025c57f78 100644 --- a/packages/cli/lang/en.json +++ b/packages/cli/lang/en.json @@ -82,6 +82,7 @@ "commands_codegen_description": "Generate Code For Polywrap Projects", "commands_codegen_error_domain": "domain", "commands_codegen_error_optionMissingArgument": "{option} option missing {argument} argument", + "commands_codegen_error_embedAppOnly": "The --embed option is currently only available for app projects", "commands_codegen_options_codegen": "Output directory for the generated code (default: {default})", "commands_codegen_options_e": "Locally embed Wasm wraps", "commands_codegen_options_h": "Show usage information", diff --git a/packages/cli/lang/es.json b/packages/cli/lang/es.json index adc30d6737..b025c57f78 100644 --- a/packages/cli/lang/es.json +++ b/packages/cli/lang/es.json @@ -82,6 +82,7 @@ "commands_codegen_description": "Generate Code For Polywrap Projects", "commands_codegen_error_domain": "domain", "commands_codegen_error_optionMissingArgument": "{option} option missing {argument} argument", + "commands_codegen_error_embedAppOnly": "The --embed option is currently only available for app projects", "commands_codegen_options_codegen": "Output directory for the generated code (default: {default})", "commands_codegen_options_e": "Locally embed Wasm wraps", "commands_codegen_options_h": "Show usage information", diff --git a/packages/cli/src/commands/codegen.ts b/packages/cli/src/commands/codegen.ts index 426de334a9..b8c8c60b4f 100644 --- a/packages/cli/src/commands/codegen.ts +++ b/packages/cli/src/commands/codegen.ts @@ -141,6 +141,12 @@ async function run(options: Required) { }); const abi = await schemaComposer.getComposedAbis(); + const projectLang = await project.getManifestLanguage(); + if (embed && !projectLang.startsWith("app")) { + logger.error(intlMsg.commands_codegen_error_embedAppOnly()); + process.exit(1); + } + const embeds: WasmEmbed[] | undefined = embed && abi.importedModuleTypes ? await getWasmEmbeds(abi.importedModuleTypes, client, logger) From ae74ad3eb71b31d8a8f7846a11bc18b0e7b23902 Mon Sep 17 00:00:00 2001 From: krisbitney Date: Fri, 8 Sep 2023 16:54:58 +0300 Subject: [PATCH 03/22] changed WasmEmbed types --- packages/cli/src/lib/codegen/WasmEmbed.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/cli/src/lib/codegen/WasmEmbed.ts b/packages/cli/src/lib/codegen/WasmEmbed.ts index c209b22068..0f9bf80eaa 100644 --- a/packages/cli/src/lib/codegen/WasmEmbed.ts +++ b/packages/cli/src/lib/codegen/WasmEmbed.ts @@ -6,8 +6,8 @@ import { PolywrapClient } from "@polywrap/client-js"; export interface WasmEmbed { uri: string; namespace: string; - manifest: Uint8Array; - module: Uint8Array; + wrapInfo: Array; + wrapWasm: Array; } export async function getWasmEmbeds( @@ -38,8 +38,8 @@ export async function getWasmEmbeds( embeds.push({ uri, namespace: importedModule.namespace, - manifest: manifest.value as Uint8Array, - module: module.value as Uint8Array, + wrapInfo: Array.from(manifest.value as Uint8Array), + wrapWasm: Array.from(module.value as Uint8Array), }); } From 2e77d93725038cb8dfe8f50a041b4603ccbcce7a Mon Sep 17 00:00:00 2001 From: krisbitney Date: Mon, 11 Sep 2023 16:01:27 +0300 Subject: [PATCH 04/22] made sure bindConfig is passed to bindgen in AppProject and PluginProject --- packages/cli/src/lib/project/AppProject.ts | 1 + packages/cli/src/lib/project/PluginProject.ts | 4 +++- packages/schema/bind/src/bindings/index.ts | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/lib/project/AppProject.ts b/packages/cli/src/lib/project/AppProject.ts index c7d48e7b0b..6e11ce3922 100644 --- a/packages/cli/src/lib/project/AppProject.ts +++ b/packages/cli/src/lib/project/AppProject.ts @@ -131,6 +131,7 @@ export class AppProject extends Project { abi, }, outputDirAbs: await this.getGenerationDirectory(codegenDir), + config: bindConfig, }; return bindSchema(options, bindgenUri); } diff --git a/packages/cli/src/lib/project/PluginProject.ts b/packages/cli/src/lib/project/PluginProject.ts index 583f5d9046..9868453b8d 100644 --- a/packages/cli/src/lib/project/PluginProject.ts +++ b/packages/cli/src/lib/project/PluginProject.ts @@ -118,7 +118,8 @@ export class PluginProject extends Project { public async generateSchemaBindings( abi: WrapAbi, generationSubPath?: string, - bindgenUri?: string + bindgenUri?: string, + bindConfig?: Record ): Promise { const moduleDirectory = await this.getGenerationDirectory( generationSubPath @@ -140,6 +141,7 @@ export class PluginProject extends Project { abi, }, outputDirAbs: moduleDirectory, + config: bindConfig, }; return bindSchema(options, bindgenUri); diff --git a/packages/schema/bind/src/bindings/index.ts b/packages/schema/bind/src/bindings/index.ts index a330b9aa23..244e5b3b56 100644 --- a/packages/schema/bind/src/bindings/index.ts +++ b/packages/schema/bind/src/bindings/index.ts @@ -51,7 +51,7 @@ export function getGenerateBindingFn( ); case "app-rs": return WrapBindgen.getGenerateBindingFn( - "wrapscan.io/polywrap/app-rust-abi-bindgen@1" + "wrap://ipfs/QmWLKXoVckfWTcEby3wgRc3E1VBb1VC4ftWG9sUdWFLbfy" ); case "app-swift": return WrapBindgen.getGenerateBindingFn( From 2298155365ef4caf002ab9855f0fcda6cc55c019 Mon Sep 17 00:00:00 2001 From: krisbitney Date: Mon, 11 Sep 2023 16:47:22 +0300 Subject: [PATCH 05/22] reverted accidental commit of change in app-rs bindgen uri --- packages/schema/bind/src/bindings/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/schema/bind/src/bindings/index.ts b/packages/schema/bind/src/bindings/index.ts index 244e5b3b56..a330b9aa23 100644 --- a/packages/schema/bind/src/bindings/index.ts +++ b/packages/schema/bind/src/bindings/index.ts @@ -51,7 +51,7 @@ export function getGenerateBindingFn( ); case "app-rs": return WrapBindgen.getGenerateBindingFn( - "wrap://ipfs/QmWLKXoVckfWTcEby3wgRc3E1VBb1VC4ftWG9sUdWFLbfy" + "wrapscan.io/polywrap/app-rust-abi-bindgen@1" ); case "app-swift": return WrapBindgen.getGenerateBindingFn( From 81c89dd7c20a3028ef3241d579bc2562734f585a Mon Sep 17 00:00:00 2001 From: krisbitney Date: Thu, 14 Sep 2023 11:03:24 +0300 Subject: [PATCH 06/22] removed bindConfig passthrough for PluginProject --- packages/cli/src/lib/project/PluginProject.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/cli/src/lib/project/PluginProject.ts b/packages/cli/src/lib/project/PluginProject.ts index 9868453b8d..583f5d9046 100644 --- a/packages/cli/src/lib/project/PluginProject.ts +++ b/packages/cli/src/lib/project/PluginProject.ts @@ -118,8 +118,7 @@ export class PluginProject extends Project { public async generateSchemaBindings( abi: WrapAbi, generationSubPath?: string, - bindgenUri?: string, - bindConfig?: Record + bindgenUri?: string ): Promise { const moduleDirectory = await this.getGenerationDirectory( generationSubPath @@ -141,7 +140,6 @@ export class PluginProject extends Project { abi, }, outputDirAbs: moduleDirectory, - config: bindConfig, }; return bindSchema(options, bindgenUri); From 45d5af948f59822944c8827e62031e109e078604 Mon Sep 17 00:00:00 2001 From: krisbitney Date: Tue, 19 Sep 2023 19:56:21 +0300 Subject: [PATCH 07/22] updated manifests and added defaults for manifest module and schema locations --- packages/cli/src/lib/project/AppProject.ts | 5 + packages/cli/src/lib/project/PluginProject.ts | 5 + .../cli/src/lib/project/PolywrapProject.ts | 5 + .../src/lib/project/manifests/app/defaults.ts | 13 +++ .../cli/src/lib/project/manifests/app/load.ts | 4 +- .../cli/src/lib/project/manifests/defaults.ts | 16 ++++ .../lib/project/manifests/plugin/defaults.ts | 53 ++++++++++ .../src/lib/project/manifests/plugin/load.ts | 4 +- .../project/manifests/polywrap/defaults.ts | 51 ++++++++++ .../lib/project/manifests/polywrap/load.ts | 4 +- .../src/formats/polywrap.app/0.5.0.ts | 51 ++++++++++ .../src/formats/polywrap.app/index.ts | 11 ++- .../polywrap.app/migrators/0.4.0_to_0.5.0.ts | 9 ++ .../formats/polywrap.app/migrators/index.ts | 6 ++ .../src/formats/polywrap.app/validate.ts | 2 + .../src/formats/polywrap.plugin/0.5.0.ts | 55 +++++++++++ .../src/formats/polywrap.plugin/index.ts | 11 ++- .../migrators/0.4.0_to_0.5.0.ts | 9 ++ .../polywrap.plugin/migrators/index.ts | 6 ++ .../src/formats/polywrap.plugin/validate.ts | 2 + .../polywrap/src/formats/polywrap/0.6.0.ts | 72 ++++++++++++++ .../polywrap/src/formats/polywrap/index.ts | 11 ++- .../polywrap/migrators/0.5.0_to_0.6.0.ts | 9 ++ .../src/formats/polywrap/migrators/index.ts | 8 +- .../polywrap/src/formats/polywrap/validate.ts | 2 + .../polywrap/formats/polywrap.app/0.5.0.json | 69 +++++++++++++ .../formats/polywrap.plugin/0.5.0.json | 74 ++++++++++++++ .../polywrap/formats/polywrap/0.6.0.json | 96 +++++++++++++++++++ 28 files changed, 653 insertions(+), 10 deletions(-) create mode 100644 packages/cli/src/lib/project/manifests/app/defaults.ts create mode 100644 packages/cli/src/lib/project/manifests/defaults.ts create mode 100644 packages/cli/src/lib/project/manifests/plugin/defaults.ts create mode 100644 packages/cli/src/lib/project/manifests/polywrap/defaults.ts create mode 100644 packages/js/manifests/polywrap/src/formats/polywrap.app/0.5.0.ts create mode 100644 packages/js/manifests/polywrap/src/formats/polywrap.app/migrators/0.4.0_to_0.5.0.ts create mode 100644 packages/js/manifests/polywrap/src/formats/polywrap.plugin/0.5.0.ts create mode 100644 packages/js/manifests/polywrap/src/formats/polywrap.plugin/migrators/0.4.0_to_0.5.0.ts create mode 100644 packages/js/manifests/polywrap/src/formats/polywrap/0.6.0.ts create mode 100644 packages/js/manifests/polywrap/src/formats/polywrap/migrators/0.5.0_to_0.6.0.ts create mode 100644 packages/manifests/polywrap/formats/polywrap.app/0.5.0.json create mode 100644 packages/manifests/polywrap/formats/polywrap.plugin/0.5.0.json create mode 100644 packages/manifests/polywrap/formats/polywrap/0.6.0.json diff --git a/packages/cli/src/lib/project/AppProject.ts b/packages/cli/src/lib/project/AppProject.ts index c7d48e7b0b..255cf7c302 100644 --- a/packages/cli/src/lib/project/AppProject.ts +++ b/packages/cli/src/lib/project/AppProject.ts @@ -97,6 +97,11 @@ export class AppProject extends Project { public async getSchemaNamedPath(): Promise { const manifest = await this.getManifest(); const dir = this.getManifestDir(); + if (!manifest.source.schema) { + throw new Error( + `No schema path specified in project manifest with name "${manifest.project.name}". This should never happen.` + ); + } return path.join(dir, manifest.source.schema); } diff --git a/packages/cli/src/lib/project/PluginProject.ts b/packages/cli/src/lib/project/PluginProject.ts index 583f5d9046..605827a7ec 100644 --- a/packages/cli/src/lib/project/PluginProject.ts +++ b/packages/cli/src/lib/project/PluginProject.ts @@ -98,6 +98,11 @@ export class PluginProject extends Project { public async getSchemaNamedPath(): Promise { const manifest = await this.getManifest(); const dir = this.getManifestDir(); + if (!manifest.source.schema) { + throw new Error( + `No schema path specified in project manifest with name "${manifest.project.name}". This should never happen.` + ); + } return path.join(dir, manifest.source.schema); } diff --git a/packages/cli/src/lib/project/PolywrapProject.ts b/packages/cli/src/lib/project/PolywrapProject.ts index 299cc69205..1eb0437209 100644 --- a/packages/cli/src/lib/project/PolywrapProject.ts +++ b/packages/cli/src/lib/project/PolywrapProject.ts @@ -147,6 +147,11 @@ export class PolywrapProject extends Project { public async getSchemaNamedPath(): Promise { const manifest = await this.getManifest(); const dir = this.getManifestDir(); + if (!manifest.source.schema) { + throw new Error( + `No schema path specified in project manifest with name "${manifest.project.name}". This should never happen.` + ); + } return path.join(dir, manifest.source.schema); } diff --git a/packages/cli/src/lib/project/manifests/app/defaults.ts b/packages/cli/src/lib/project/manifests/app/defaults.ts new file mode 100644 index 0000000000..0dd5e889dc --- /dev/null +++ b/packages/cli/src/lib/project/manifests/app/defaults.ts @@ -0,0 +1,13 @@ +import { defaultSchemaPath } from "../defaults"; + +import { AppManifest } from "@polywrap/polywrap-manifest-types-js"; + +export function applyAppManifestDefaults( + manifest: AppManifest, + manifestPath: string +): AppManifest { + if (!manifest.source.schema) { + manifest.source.schema = defaultSchemaPath(manifestPath); + } + return manifest; +} diff --git a/packages/cli/src/lib/project/manifests/app/load.ts b/packages/cli/src/lib/project/manifests/app/load.ts index 26f80d22ef..552095e0ed 100644 --- a/packages/cli/src/lib/project/manifests/app/load.ts +++ b/packages/cli/src/lib/project/manifests/app/load.ts @@ -1,4 +1,5 @@ import { displayPath, Logger, logActivity, intlMsg } from "../../../"; +import { applyAppManifestDefaults } from "./defaults"; import { AppManifest, @@ -22,7 +23,8 @@ export async function loadAppManifest( } try { - const result = deserializeAppManifest(manifest, { logger: logger }); + const decoded = deserializeAppManifest(manifest, { logger: logger }); + const result = applyAppManifestDefaults(decoded, manifestPath); return Promise.resolve(result); } catch (e) { return Promise.reject(e); diff --git a/packages/cli/src/lib/project/manifests/defaults.ts b/packages/cli/src/lib/project/manifests/defaults.ts new file mode 100644 index 0000000000..3ffe95cdaa --- /dev/null +++ b/packages/cli/src/lib/project/manifests/defaults.ts @@ -0,0 +1,16 @@ +import path from "path"; +import fs from "fs"; + +export function defaultSchemaPath(manifestPath: string): string { + const defaultSchemaPaths = ["polywrap.graphql", "src/polywrap.graphql"]; + for (const relPath of defaultSchemaPaths) { + const absPath = path.resolve(manifestPath, relPath); + if (fs.existsSync(absPath)) { + return absPath; + } + } + + throw Error( + "Couldn't find schema in default paths. Please specify the schema location in the project manifest." + ); +} diff --git a/packages/cli/src/lib/project/manifests/plugin/defaults.ts b/packages/cli/src/lib/project/manifests/plugin/defaults.ts new file mode 100644 index 0000000000..b56e3fd356 --- /dev/null +++ b/packages/cli/src/lib/project/manifests/plugin/defaults.ts @@ -0,0 +1,53 @@ +import { defaultSchemaPath } from "../defaults"; +import { isPluginManifestLanguage } from "./languages"; + +import fs from "fs"; +import path from "path"; +import { PluginManifest } from "@polywrap/polywrap-manifest-types-js"; + +export function applyPluginManifestDefaults( + manifest: PluginManifest, + manifestPath: string +): PluginManifest { + if (!manifest.source.module) { + const language = manifest.project.type; + manifest.source.module = defaultModulePath(language, manifestPath); + } + if (!manifest.source.schema) { + manifest.source.schema = defaultSchemaPath(manifestPath); + } + return manifest; +} + +function defaultModulePath( + language: string, + manifestPath: string +): string | undefined { + if (!isPluginManifestLanguage(language)) { + throw Error(`Unsupported language: ${language}`); + } + + let relEntryPoint: string; + if (language === "plugin/typescript") { + relEntryPoint = "src/index.ts"; + } else if (language == "plugin/rust") { + relEntryPoint = "Cargo.toml"; + } else if (language == "plugin/python") { + relEntryPoint = "src/__init__.py"; + } else if (language == "plugin/swift") { + relEntryPoint = "Package.swift"; + } else if (language == "plugin/kotlin") { + relEntryPoint = "src/main/kotlin/Main.kt"; + } else { + throw Error(`Unsupported language: ${language}`); + } + + const absEntryPoint = path.resolve(manifestPath, relEntryPoint); + if (fs.existsSync(absEntryPoint)) { + return absEntryPoint; + } + + throw Error( + "Couldn't find module entry point in default paths. Please specify the module entry point in the project manifest." + ); +} diff --git a/packages/cli/src/lib/project/manifests/plugin/load.ts b/packages/cli/src/lib/project/manifests/plugin/load.ts index 62650124f9..8add1a7ecb 100644 --- a/packages/cli/src/lib/project/manifests/plugin/load.ts +++ b/packages/cli/src/lib/project/manifests/plugin/load.ts @@ -1,4 +1,5 @@ import { displayPath, Logger, logActivity, intlMsg } from "../../../"; +import { applyPluginManifestDefaults } from "./defaults"; import { PluginManifest, @@ -26,7 +27,8 @@ export async function loadPluginManifest( } try { - const result = deserializePluginManifest(manifest, { logger: logger }); + const decoded = deserializePluginManifest(manifest, { logger: logger }); + const result = applyPluginManifestDefaults(decoded, manifestPath); return Promise.resolve(result); } catch (e) { return Promise.reject(e); diff --git a/packages/cli/src/lib/project/manifests/polywrap/defaults.ts b/packages/cli/src/lib/project/manifests/polywrap/defaults.ts new file mode 100644 index 0000000000..59fe964db3 --- /dev/null +++ b/packages/cli/src/lib/project/manifests/polywrap/defaults.ts @@ -0,0 +1,51 @@ +import { isPolywrapManifestLanguage } from "./languages"; +import { defaultSchemaPath } from "../defaults"; + +import fs from "fs"; +import path from "path"; +import { PolywrapManifest } from "@polywrap/polywrap-manifest-types-js"; + +export function applyPolywrapManifestDefaults( + manifest: PolywrapManifest, + manifestPath: string +): PolywrapManifest { + if (!manifest.source.module) { + const language = manifest.project.type; + manifest.source.module = defaultModulePath(language, manifestPath); + } + if (!manifest.source.schema) { + manifest.source.schema = defaultSchemaPath(manifestPath); + } + return manifest; +} + +function defaultModulePath( + language: string, + manifestPath: string +): string | undefined { + if (!isPolywrapManifestLanguage(language)) { + throw Error(`Unsupported language: ${language}`); + } + + let relEntryPoint: string; + if (language === "wasm/typescript" || language === "wasm/assemblyscript") { + relEntryPoint = "src/index.ts"; + } else if (language == "wasm/rust") { + relEntryPoint = "Cargo.toml"; + } else if (language == "wasm/golang") { + relEntryPoint = "go.mod"; + } else if (language == "interface") { + return undefined; + } else { + throw Error(`Unsupported language: ${language}`); + } + + const absEntryPoint = path.resolve(manifestPath, relEntryPoint); + if (fs.existsSync(absEntryPoint)) { + return absEntryPoint; + } + + throw Error( + "Couldn't find module entry point in default paths. Please specify the module entry point in the project manifest." + ); +} diff --git a/packages/cli/src/lib/project/manifests/polywrap/load.ts b/packages/cli/src/lib/project/manifests/polywrap/load.ts index c5f226e0c2..0bb85e245f 100644 --- a/packages/cli/src/lib/project/manifests/polywrap/load.ts +++ b/packages/cli/src/lib/project/manifests/polywrap/load.ts @@ -6,6 +6,7 @@ import { logActivity, PolywrapBuildLanguage, } from "../../../"; +import { applyPolywrapManifestDefaults } from "./defaults"; import { PolywrapManifest, @@ -42,7 +43,8 @@ export async function loadPolywrapManifest( } try { - const result = deserializePolywrapManifest(manifest, { logger: logger }); + const decoded = deserializePolywrapManifest(manifest, { logger: logger }); + const result = applyPolywrapManifestDefaults(decoded, manifestPath); return Promise.resolve(result); } catch (e) { return Promise.reject(e); diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.app/0.5.0.ts b/packages/js/manifests/polywrap/src/formats/polywrap.app/0.5.0.ts new file mode 100644 index 0000000000..4923c82848 --- /dev/null +++ b/packages/js/manifests/polywrap/src/formats/polywrap.app/0.5.0.ts @@ -0,0 +1,51 @@ +/* eslint-disable @typescript-eslint/naming-convention */ +/* tslint:disable */ +/** + * This file was automatically generated by json-schema-to-typescript. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run json-schema-to-typescript to regenerate this file. + */ + +export interface AppManifest { + /** + * Polywrap manifest format version. + */ + format: "0.5.0"; + /** + * Basic project properties. + */ + project: { + /** + * Name of this project. + */ + name: string; + /** + * Type of this project. + */ + type: string; + }; + /** + * Project source files. + */ + source: { + /** + * Path to the project's graphql schema. + */ + schema?: string; + /** + * Specify ABIs to be used for the import URIs within your schema. + */ + import_abis?: ImportAbis[]; + }; + __type: "AppManifest"; +} +export interface ImportAbis { + /** + * One of the schema's import URI. + */ + uri: string; + /** + * Path to a local ABI (or schema). Supported file formats: [*.graphql, *.info, *.json, *.yaml] + */ + abi: string; +} diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.app/index.ts b/packages/js/manifests/polywrap/src/formats/polywrap.app/index.ts index fbcbcca317..f84da24cd8 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.app/index.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.app/index.ts @@ -17,12 +17,16 @@ import { import { AppManifest as AppManifest_0_4_0, } from "./0.4.0"; +import { + AppManifest as AppManifest_0_5_0, +} from "./0.5.0"; export { AppManifest_0_1_0, AppManifest_0_2_0, AppManifest_0_3_0, AppManifest_0_4_0, + AppManifest_0_5_0, }; export enum AppManifestFormats { @@ -32,6 +36,7 @@ export enum AppManifestFormats { "v0.2.0" = "0.2.0", "v0.3.0" = "0.3.0", "v0.4.0" = "0.4.0", + "v0.5.0" = "0.5.0", } export const AppManifestSchemaFiles: Record = { @@ -41,6 +46,7 @@ export const AppManifestSchemaFiles: Record = { "0.2.0": "formats/polywrap.app/0.2.0.json", "0.3.0": "formats/polywrap.app/0.3.0.json", "0.4.0": "formats/polywrap.app/0.4.0.json", + "0.5.0": "formats/polywrap.app/0.5.0.json", } export type AnyAppManifest = @@ -48,11 +54,12 @@ export type AnyAppManifest = | AppManifest_0_2_0 | AppManifest_0_3_0 | AppManifest_0_4_0 + | AppManifest_0_5_0 -export type AppManifest = AppManifest_0_4_0; +export type AppManifest = AppManifest_0_5_0; -export const latestAppManifestFormat = AppManifestFormats["v0.4.0"] +export const latestAppManifestFormat = AppManifestFormats["v0.5.0"] export { migrateAppManifest } from "./migrate"; diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.app/migrators/0.4.0_to_0.5.0.ts b/packages/js/manifests/polywrap/src/formats/polywrap.app/migrators/0.4.0_to_0.5.0.ts new file mode 100644 index 0000000000..fb0562f1c8 --- /dev/null +++ b/packages/js/manifests/polywrap/src/formats/polywrap.app/migrators/0.4.0_to_0.5.0.ts @@ -0,0 +1,9 @@ +import { AppManifest as OldManifest } from "../0.4.0"; +import { AppManifest as NewManifest } from "../0.5.0"; + +export function migrate(migrate: OldManifest): NewManifest { + return { + ...migrate, + format: "0.5.0", + }; +} diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.app/migrators/index.ts b/packages/js/manifests/polywrap/src/formats/polywrap.app/migrators/index.ts index cc377561c0..41aaf3ab49 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.app/migrators/index.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.app/migrators/index.ts @@ -2,6 +2,7 @@ import { Migrator } from "../../../migrations"; import { migrate as migrate_0_1_0_to_0_2_0 } from "./0.1.0_to_0.2.0"; import { migrate as migrate_0_2_0_to_0_3_0 } from "./0.2.0_to_0.3.0"; import { migrate as migrate_0_3_0_to_0_4_0 } from "./0.3.0_to_0.4.0"; +import { migrate as migrate_0_4_0_to_0_5_0 } from "./0.4.0_to_0.5.0"; export const migrators: Migrator[] = [ { @@ -24,4 +25,9 @@ export const migrators: Migrator[] = [ to: "0.4.0", migrate: migrate_0_3_0_to_0_4_0, }, + { + from: "0.4.0", + to: "0.5.0", + migrate: migrate_0_4_0_to_0_5_0, + }, ]; diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.app/validate.ts b/packages/js/manifests/polywrap/src/formats/polywrap.app/validate.ts index b787856ce3..eb590b4ed2 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.app/validate.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.app/validate.ts @@ -13,6 +13,7 @@ import AppManifestSchema_0_1_0 from "@polywrap/polywrap-manifest-schemas/formats import AppManifestSchema_0_2_0 from "@polywrap/polywrap-manifest-schemas/formats/polywrap.app/0.2.0.json"; import AppManifestSchema_0_3_0 from "@polywrap/polywrap-manifest-schemas/formats/polywrap.app/0.3.0.json"; import AppManifestSchema_0_4_0 from "@polywrap/polywrap-manifest-schemas/formats/polywrap.app/0.4.0.json"; +import AppManifestSchema_0_5_0 from "@polywrap/polywrap-manifest-schemas/formats/polywrap.app/0.5.0.json"; import { Schema, @@ -32,6 +33,7 @@ const schemas: AppManifestSchemas = { "0.2.0": AppManifestSchema_0_2_0, "0.3.0": AppManifestSchema_0_3_0, "0.4.0": AppManifestSchema_0_4_0, + "0.5.0": AppManifestSchema_0_5_0, }; const validator = new Validator(); diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.plugin/0.5.0.ts b/packages/js/manifests/polywrap/src/formats/polywrap.plugin/0.5.0.ts new file mode 100644 index 0000000000..15baa43a07 --- /dev/null +++ b/packages/js/manifests/polywrap/src/formats/polywrap.plugin/0.5.0.ts @@ -0,0 +1,55 @@ +/* eslint-disable @typescript-eslint/naming-convention */ +/* tslint:disable */ +/** + * This file was automatically generated by json-schema-to-typescript. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run json-schema-to-typescript to regenerate this file. + */ + +export interface PluginManifest { + /** + * Polywrap manifest format version. + */ + format: "0.5.0"; + /** + * Basic project properties. + */ + project: { + /** + * Name of this project. + */ + name: string; + /** + * Type of this project. + */ + type: string; + }; + /** + * Project source files. + */ + source: { + /** + * Path to the project's entry point. + */ + module?: string; + /** + * Path to the project's graphql schema. + */ + schema?: string; + /** + * Specify ABIs to be used for the import URIs within your schema. + */ + import_abis?: ImportAbis[]; + }; + __type: "PluginManifest"; +} +export interface ImportAbis { + /** + * One of the schema's import URI. + */ + uri: string; + /** + * Path to a local ABI (or schema). Supported file formats: [*.graphql, *.info, *.json, *.yaml] + */ + abi: string; +} diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.plugin/index.ts b/packages/js/manifests/polywrap/src/formats/polywrap.plugin/index.ts index 1d473b447f..ee12750725 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.plugin/index.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.plugin/index.ts @@ -17,12 +17,16 @@ import { import { PluginManifest as PluginManifest_0_4_0, } from "./0.4.0"; +import { + PluginManifest as PluginManifest_0_5_0, +} from "./0.5.0"; export { PluginManifest_0_1_0, PluginManifest_0_2_0, PluginManifest_0_3_0, PluginManifest_0_4_0, + PluginManifest_0_5_0, }; export enum PluginManifestFormats { @@ -32,6 +36,7 @@ export enum PluginManifestFormats { "v0.2.0" = "0.2.0", "v0.3.0" = "0.3.0", "v0.4.0" = "0.4.0", + "v0.5.0" = "0.5.0", } export const PluginManifestSchemaFiles: Record = { @@ -41,6 +46,7 @@ export const PluginManifestSchemaFiles: Record = { "0.2.0": "formats/polywrap.plugin/0.2.0.json", "0.3.0": "formats/polywrap.plugin/0.3.0.json", "0.4.0": "formats/polywrap.plugin/0.4.0.json", + "0.5.0": "formats/polywrap.plugin/0.5.0.json", } export type AnyPluginManifest = @@ -48,11 +54,12 @@ export type AnyPluginManifest = | PluginManifest_0_2_0 | PluginManifest_0_3_0 | PluginManifest_0_4_0 + | PluginManifest_0_5_0 -export type PluginManifest = PluginManifest_0_4_0; +export type PluginManifest = PluginManifest_0_5_0; -export const latestPluginManifestFormat = PluginManifestFormats["v0.4.0"] +export const latestPluginManifestFormat = PluginManifestFormats["v0.5.0"] export { migratePluginManifest } from "./migrate"; diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.plugin/migrators/0.4.0_to_0.5.0.ts b/packages/js/manifests/polywrap/src/formats/polywrap.plugin/migrators/0.4.0_to_0.5.0.ts new file mode 100644 index 0000000000..bfec121fa0 --- /dev/null +++ b/packages/js/manifests/polywrap/src/formats/polywrap.plugin/migrators/0.4.0_to_0.5.0.ts @@ -0,0 +1,9 @@ +import { PluginManifest as OldManifest } from "../0.4.0"; +import { PluginManifest as NewManifest } from "../0.5.0"; + +export function migrate(migrate: OldManifest): NewManifest { + return { + ...migrate, + format: "0.5.0", + }; +} diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.plugin/migrators/index.ts b/packages/js/manifests/polywrap/src/formats/polywrap.plugin/migrators/index.ts index cc377561c0..41aaf3ab49 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.plugin/migrators/index.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.plugin/migrators/index.ts @@ -2,6 +2,7 @@ import { Migrator } from "../../../migrations"; import { migrate as migrate_0_1_0_to_0_2_0 } from "./0.1.0_to_0.2.0"; import { migrate as migrate_0_2_0_to_0_3_0 } from "./0.2.0_to_0.3.0"; import { migrate as migrate_0_3_0_to_0_4_0 } from "./0.3.0_to_0.4.0"; +import { migrate as migrate_0_4_0_to_0_5_0 } from "./0.4.0_to_0.5.0"; export const migrators: Migrator[] = [ { @@ -24,4 +25,9 @@ export const migrators: Migrator[] = [ to: "0.4.0", migrate: migrate_0_3_0_to_0_4_0, }, + { + from: "0.4.0", + to: "0.5.0", + migrate: migrate_0_4_0_to_0_5_0, + }, ]; diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.plugin/validate.ts b/packages/js/manifests/polywrap/src/formats/polywrap.plugin/validate.ts index 2824b4afcc..5bf5f7ebeb 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.plugin/validate.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.plugin/validate.ts @@ -13,6 +13,7 @@ import PluginManifestSchema_0_1_0 from "@polywrap/polywrap-manifest-schemas/form import PluginManifestSchema_0_2_0 from "@polywrap/polywrap-manifest-schemas/formats/polywrap.plugin/0.2.0.json"; import PluginManifestSchema_0_3_0 from "@polywrap/polywrap-manifest-schemas/formats/polywrap.plugin/0.3.0.json"; import PluginManifestSchema_0_4_0 from "@polywrap/polywrap-manifest-schemas/formats/polywrap.plugin/0.4.0.json"; +import PluginManifestSchema_0_5_0 from "@polywrap/polywrap-manifest-schemas/formats/polywrap.plugin/0.5.0.json"; import { Schema, @@ -32,6 +33,7 @@ const schemas: PluginManifestSchemas = { "0.2.0": PluginManifestSchema_0_2_0, "0.3.0": PluginManifestSchema_0_3_0, "0.4.0": PluginManifestSchema_0_4_0, + "0.5.0": PluginManifestSchema_0_5_0, }; const validator = new Validator(); diff --git a/packages/js/manifests/polywrap/src/formats/polywrap/0.6.0.ts b/packages/js/manifests/polywrap/src/formats/polywrap/0.6.0.ts new file mode 100644 index 0000000000..2c299e3bd0 --- /dev/null +++ b/packages/js/manifests/polywrap/src/formats/polywrap/0.6.0.ts @@ -0,0 +1,72 @@ +/* eslint-disable @typescript-eslint/naming-convention */ +/* tslint:disable */ +/** + * This file was automatically generated by json-schema-to-typescript. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run json-schema-to-typescript to regenerate this file. + */ + +export interface PolywrapManifest { + /** + * Polywrap manifest format version. + */ + format: "0.6.0"; + /** + * Basic project properties. + */ + project: { + /** + * Name of this project. + */ + name: string; + /** + * Type of this project. + */ + type: string; + }; + /** + * Project source files. + */ + source: { + /** + * Path to the project's entry point. + */ + module?: string; + /** + * Path to the project's graphql schema. + */ + schema?: string; + /** + * Specify ABIs to be used for the import URIs within your schema. + */ + import_abis?: ImportAbis[]; + }; + /** + * Project resources folder + */ + resources?: string; + /** + * Project extension manifest files. + */ + extensions?: { + /** + * Path to the project build manifest file. + */ + build?: string; + /** + * Path to the project docs manifest file. + */ + docs?: string; + }; + __type: "PolywrapManifest"; +} +export interface ImportAbis { + /** + * One of the schema's import URI. + */ + uri: string; + /** + * Path to a local ABI (or schema). Supported file formats: [*.graphql, *.info, *.json, *.yaml] + */ + abi: string; +} diff --git a/packages/js/manifests/polywrap/src/formats/polywrap/index.ts b/packages/js/manifests/polywrap/src/formats/polywrap/index.ts index 921461bdde..b545d9b238 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap/index.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap/index.ts @@ -20,6 +20,9 @@ import { import { PolywrapManifest as PolywrapManifest_0_5_0, } from "./0.5.0"; +import { + PolywrapManifest as PolywrapManifest_0_6_0, +} from "./0.6.0"; export { PolywrapManifest_0_1_0, @@ -27,6 +30,7 @@ export { PolywrapManifest_0_3_0, PolywrapManifest_0_4_0, PolywrapManifest_0_5_0, + PolywrapManifest_0_6_0, }; export enum PolywrapManifestFormats { @@ -37,6 +41,7 @@ export enum PolywrapManifestFormats { "v0.3.0" = "0.3.0", "v0.4.0" = "0.4.0", "v0.5.0" = "0.5.0", + "v0.6.0" = "0.6.0", } export const PolywrapManifestSchemaFiles: Record = { @@ -47,6 +52,7 @@ export const PolywrapManifestSchemaFiles: Record = { "0.3.0": "formats/polywrap/0.3.0.json", "0.4.0": "formats/polywrap/0.4.0.json", "0.5.0": "formats/polywrap/0.5.0.json", + "0.6.0": "formats/polywrap/0.6.0.json", } export type AnyPolywrapManifest = @@ -55,11 +61,12 @@ export type AnyPolywrapManifest = | PolywrapManifest_0_3_0 | PolywrapManifest_0_4_0 | PolywrapManifest_0_5_0 + | PolywrapManifest_0_6_0 -export type PolywrapManifest = PolywrapManifest_0_5_0; +export type PolywrapManifest = PolywrapManifest_0_6_0; -export const latestPolywrapManifestFormat = PolywrapManifestFormats["v0.5.0"] +export const latestPolywrapManifestFormat = PolywrapManifestFormats["v0.6.0"] export { migratePolywrapManifest } from "./migrate"; diff --git a/packages/js/manifests/polywrap/src/formats/polywrap/migrators/0.5.0_to_0.6.0.ts b/packages/js/manifests/polywrap/src/formats/polywrap/migrators/0.5.0_to_0.6.0.ts new file mode 100644 index 0000000000..bc91c67e75 --- /dev/null +++ b/packages/js/manifests/polywrap/src/formats/polywrap/migrators/0.5.0_to_0.6.0.ts @@ -0,0 +1,9 @@ +import { PolywrapManifest as OldManifest } from "../0.5.0"; +import { PolywrapManifest as NewManifest } from "../0.6.0"; + +export function migrate(migrate: OldManifest): NewManifest { + return { + ...migrate, + format: "0.6.0", + }; +} diff --git a/packages/js/manifests/polywrap/src/formats/polywrap/migrators/index.ts b/packages/js/manifests/polywrap/src/formats/polywrap/migrators/index.ts index 51bcb41727..a7a2dcf27f 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap/migrators/index.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap/migrators/index.ts @@ -3,6 +3,7 @@ import { migrate as migrate_0_1_0_to_0_2_0 } from "./0.1.0_to_0.2.0"; import { migrate as migrate_0_2_0_to_0_3_0 } from "./0.2.0_to_0.3.0"; import { migrate as migrate_0_3_0_to_0_4_0 } from "./0.3.0_to_0.4.0"; import { migrate as migrate_0_4_0_to_0_5_0 } from "./0.4.0_to_0.5.0"; +import { migrate as migrate_0_5_0_to_0_6_0 } from "./0.5.0_to_0.6.0"; export const migrators: Migrator[] = [ { @@ -29,5 +30,10 @@ export const migrators: Migrator[] = [ from: "0.4.0", to: "0.5.0", migrate: migrate_0_4_0_to_0_5_0, - } + }, + { + from: "0.5.0", + to: "0.6.0", + migrate: migrate_0_5_0_to_0_6_0, + }, ]; diff --git a/packages/js/manifests/polywrap/src/formats/polywrap/validate.ts b/packages/js/manifests/polywrap/src/formats/polywrap/validate.ts index cb58b80c19..e26bad2ce7 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap/validate.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap/validate.ts @@ -14,6 +14,7 @@ import PolywrapManifestSchema_0_2_0 from "@polywrap/polywrap-manifest-schemas/fo import PolywrapManifestSchema_0_3_0 from "@polywrap/polywrap-manifest-schemas/formats/polywrap/0.3.0.json"; import PolywrapManifestSchema_0_4_0 from "@polywrap/polywrap-manifest-schemas/formats/polywrap/0.4.0.json"; import PolywrapManifestSchema_0_5_0 from "@polywrap/polywrap-manifest-schemas/formats/polywrap/0.5.0.json"; +import PolywrapManifestSchema_0_6_0 from "@polywrap/polywrap-manifest-schemas/formats/polywrap/0.6.0.json"; import { Schema, @@ -34,6 +35,7 @@ const schemas: PolywrapManifestSchemas = { "0.3.0": PolywrapManifestSchema_0_3_0, "0.4.0": PolywrapManifestSchema_0_4_0, "0.5.0": PolywrapManifestSchema_0_5_0, + "0.6.0": PolywrapManifestSchema_0_6_0, }; const validator = new Validator(); diff --git a/packages/manifests/polywrap/formats/polywrap.app/0.5.0.json b/packages/manifests/polywrap/formats/polywrap.app/0.5.0.json new file mode 100644 index 0000000000..ac6330b668 --- /dev/null +++ b/packages/manifests/polywrap/formats/polywrap.app/0.5.0.json @@ -0,0 +1,69 @@ +{ + "id": "AppManifest", + "type": "object", + "additionalProperties": false, + "required": ["format", "project", "source"], + "properties": { + "format": { + "description": "Polywrap manifest format version.", + "type": "string", + "enum": ["0.5.0"] + }, + "project": { + "description": "Basic project properties.", + "type": "object", + "additionalProperties": false, + "required": ["name", "type"], + "properties": { + "name": { + "description": "Name of this project.", + "type": "string", + "pattern": "^[a-zA-Z0-9\\-\\_]+$" + }, + "type": { + "description": "Type of this project.", + "type": "string", + "pattern": "^app\\/[a-z0-9]+$" + } + } + }, + "source": { + "description": "Project source files.", + "type": "object", + "additionalProperties": false, + "required": [], + "properties": { + "schema": { + "description": "Path to the project's graphql schema.", + "type": "string", + "pattern": "^\\.?\\.?\\/?((\\/[\\w\\-\\.@]+|\\/\\.\\.|\\/\\.)+\\/)?[\\w\\-\\.]+\\.graphql$" + }, + "import_abis": { + "description": "Specify ABIs to be used for the import URIs within your schema.", + "type": "array", + "items": { + "$ref": "#/definitions/import_abis" + } + } + } + } + }, + "definitions": { + "import_abis": { + "type": "object", + "additionalProperties": false, + "properties": { + "uri": { + "description": "One of the schema's import URI.", + "type": "string" + }, + "abi": { + "description": "Path to a local ABI (or schema). Supported file formats: [*.graphql, *.info, *.json, *.yaml]", + "type": "string", + "pattern": "^\\.?\\.?\\/?((\\/[\\w\\-\\.@]+|\\/\\.\\.|\\/\\.)+\\/)?[\\w\\-\\.]+\\.(info|graphql|json|yaml)$" + } + }, + "required": ["uri", "abi"] + } + } +} diff --git a/packages/manifests/polywrap/formats/polywrap.plugin/0.5.0.json b/packages/manifests/polywrap/formats/polywrap.plugin/0.5.0.json new file mode 100644 index 0000000000..7f5346ae78 --- /dev/null +++ b/packages/manifests/polywrap/formats/polywrap.plugin/0.5.0.json @@ -0,0 +1,74 @@ +{ + "id": "PluginManifest", + "type": "object", + "additionalProperties": false, + "required": ["format", "project", "source"], + "properties": { + "format": { + "description": "Polywrap manifest format version.", + "type": "string", + "enum": ["0.5.0"] + }, + "project": { + "description": "Basic project properties.", + "type": "object", + "additionalProperties": false, + "required": ["name", "type"], + "properties": { + "name": { + "description": "Name of this project.", + "type": "string", + "pattern": "^[a-zA-Z0-9\\-\\_]+$" + }, + "type": { + "description": "Type of this project.", + "type": "string", + "pattern": "^plugin\\/[a-z0-9]+$" + } + } + }, + "source": { + "description": "Project source files.", + "type": "object", + "additionalProperties": false, + "required": [], + "properties": { + "module": { + "description": "Path to the project's entry point.", + "type": "string", + "pattern": "^\\.?\\.?\\/?((\\/[\\w\\-\\.@]+|\\/\\.\\.|\\/\\.)+\\/)?[\\w\\-\\.]+\\.?[\\w\\-\\.]*$" + }, + "schema": { + "description": "Path to the project's graphql schema.", + "type": "string", + "pattern": "^\\.?\\.?\\/?((\\/[\\w\\-\\.@]+|\\/\\.\\.|\\/\\.)+\\/)?[\\w\\-\\.]+\\.graphql$" + }, + "import_abis": { + "description": "Specify ABIs to be used for the import URIs within your schema.", + "type": "array", + "items": { + "$ref": "#/definitions/import_abis" + } + } + } + } + }, + "definitions": { + "import_abis": { + "type": "object", + "additionalProperties": false, + "properties": { + "uri": { + "description": "One of the schema's import URI.", + "type": "string" + }, + "abi": { + "description": "Path to a local ABI (or schema). Supported file formats: [*.graphql, *.info, *.json, *.yaml]", + "type": "string", + "pattern": "^\\.?\\.?\\/?((\\/[\\w\\-\\.@]+|\\/\\.\\.|\\/\\.)+\\/)?[\\w\\-\\.]+\\.(info|graphql|json|yaml)$" + } + }, + "required": ["uri", "abi"] + } + } +} diff --git a/packages/manifests/polywrap/formats/polywrap/0.6.0.json b/packages/manifests/polywrap/formats/polywrap/0.6.0.json new file mode 100644 index 0000000000..b8c93e7735 --- /dev/null +++ b/packages/manifests/polywrap/formats/polywrap/0.6.0.json @@ -0,0 +1,96 @@ +{ + "id": "PolywrapManifest", + "type": "object", + "additionalProperties": false, + "required": ["format", "project", "source"], + "properties": { + "format": { + "description": "Polywrap manifest format version.", + "type": "string", + "enum": ["0.6.0"] + }, + "project": { + "description": "Basic project properties.", + "type": "object", + "additionalProperties": false, + "required": ["name", "type"], + "properties": { + "name": { + "description": "Name of this project.", + "type": "string", + "pattern": "^[a-zA-Z0-9\\-\\_]+$" + }, + "type": { + "description": "Type of this project.", + "type": "string", + "pattern": "^((interface)|(wasm\\/[a-z0-9]+))$" + } + } + }, + "source": { + "description": "Project source files.", + "type": "object", + "additionalProperties": false, + "required": [], + "properties": { + "module": { + "description": "Path to the project's entry point.", + "type": "string", + "pattern": "^\\.?\\.?\\/?((\\/[\\w\\-\\.@]+|\\/\\.\\.|\\/\\.)+\\/)?[\\w\\-\\.]+\\.?[\\w\\-\\.]*$" + }, + "schema": { + "description": "Path to the project's graphql schema.", + "type": "string", + "pattern": "^\\.?\\.?\\/?((\\/[\\w\\-\\.@]+|\\/\\.\\.|\\/\\.)+\\/)?[\\w\\-\\.]+\\.graphql$" + }, + "import_abis": { + "description": "Specify ABIs to be used for the import URIs within your schema.", + "type": "array", + "items": { + "$ref": "#/definitions/import_abis" + } + } + } + }, + "resources": { + "description": "Project resources folder", + "type": "string", + "pattern": "^\\.?\\.?\\/?((\\/[\\w\\-\\.@]+|\\/\\.\\.|\\/\\.)+\\/)?[\\w\\-\\.]+\\.?[\\w\\-\\.]*\\/?$" + }, + "extensions": { + "description": "Project extension manifest files.", + "type": "object", + "additionalProperties": false, + "properties": { + "build": { + "description": "Path to the project build manifest file.", + "type": "string", + "pattern": "^\\.?\\.?(\\/[\\w\\-\\.@]+|\\/\\.\\.|\\/\\.)*\\/[\\w\\-\\.]+\\.(yaml|json)$" + }, + "docs": { + "description": "Path to the project docs manifest file.", + "type": "string", + "pattern": "^\\.?\\.?(\\/[\\w\\-\\.@]+|\\/\\.\\.|\\/\\.)*\\/[\\w\\-\\.]+\\.(yaml|json)$" + } + } + } + }, + "definitions": { + "import_abis": { + "type": "object", + "additionalProperties": false, + "properties": { + "uri": { + "description": "One of the schema's import URI.", + "type": "string" + }, + "abi": { + "description": "Path to a local ABI (or schema). Supported file formats: [*.graphql, *.info, *.json, *.yaml]", + "type": "string", + "pattern": "^\\.?\\.?\\/?((\\/[\\w\\-\\.@]+|\\/\\.\\.|\\/\\.)+\\/)?[\\w\\-\\.]+\\.(info|graphql|json|yaml)$" + } + }, + "required": ["uri", "abi"] + } + } +} From edf98734ad55c6b9d1953b2665f20cd3f6a9f43d Mon Sep 17 00:00:00 2001 From: krisbitney Date: Wed, 20 Sep 2023 18:02:37 +0300 Subject: [PATCH 08/22] updated plugin manifest kotlin module default --- .../lib/project/manifests/plugin/defaults.ts | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/lib/project/manifests/plugin/defaults.ts b/packages/cli/src/lib/project/manifests/plugin/defaults.ts index b56e3fd356..b1fc5d49d3 100644 --- a/packages/cli/src/lib/project/manifests/plugin/defaults.ts +++ b/packages/cli/src/lib/project/manifests/plugin/defaults.ts @@ -27,7 +27,7 @@ function defaultModulePath( throw Error(`Unsupported language: ${language}`); } - let relEntryPoint: string; + let relEntryPoint = ""; if (language === "plugin/typescript") { relEntryPoint = "src/index.ts"; } else if (language == "plugin/rust") { @@ -37,7 +37,30 @@ function defaultModulePath( } else if (language == "plugin/swift") { relEntryPoint = "Package.swift"; } else if (language == "plugin/kotlin") { - relEntryPoint = "src/main/kotlin/Main.kt"; + // traverse src dir and find first .kt file within kotlin src dir + const kotlinSrcDirs = [ + "src/commonMain/kotlin", + "src/main/kotlin", + "src/jvmMain/kotlin", + "src/androidMain/kotlin", + ]; + for (const dir of kotlinSrcDirs) { + const absDir = path.resolve(manifestPath, dir); + if (fs.existsSync(absDir)) { + const files = fs.readdirSync(absDir); + for (const file of files) { + if (file.endsWith(".kt")) { + relEntryPoint = path.resolve(absDir, file); + break; + } + } + // If no kotlin files exist yet, use Main.kt as virtual entry point + // Main.kt does not need to exist because it is only a reference for the wrap dir location + if (!relEntryPoint) { + return path.resolve(absDir, "Main.kt"); + } + } + } } else { throw Error(`Unsupported language: ${language}`); } From ea223c12970f5e609620b4c95d920ba23bcb33c6 Mon Sep 17 00:00:00 2001 From: krisbitney Date: Wed, 20 Sep 2023 18:10:43 +0300 Subject: [PATCH 09/22] updated plugin manifest kotlin module default --- .../lib/project/manifests/plugin/defaults.ts | 27 ++----------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/packages/cli/src/lib/project/manifests/plugin/defaults.ts b/packages/cli/src/lib/project/manifests/plugin/defaults.ts index b1fc5d49d3..2350a0064f 100644 --- a/packages/cli/src/lib/project/manifests/plugin/defaults.ts +++ b/packages/cli/src/lib/project/manifests/plugin/defaults.ts @@ -27,7 +27,7 @@ function defaultModulePath( throw Error(`Unsupported language: ${language}`); } - let relEntryPoint = ""; + let relEntryPoint: string; if (language === "plugin/typescript") { relEntryPoint = "src/index.ts"; } else if (language == "plugin/rust") { @@ -37,30 +37,7 @@ function defaultModulePath( } else if (language == "plugin/swift") { relEntryPoint = "Package.swift"; } else if (language == "plugin/kotlin") { - // traverse src dir and find first .kt file within kotlin src dir - const kotlinSrcDirs = [ - "src/commonMain/kotlin", - "src/main/kotlin", - "src/jvmMain/kotlin", - "src/androidMain/kotlin", - ]; - for (const dir of kotlinSrcDirs) { - const absDir = path.resolve(manifestPath, dir); - if (fs.existsSync(absDir)) { - const files = fs.readdirSync(absDir); - for (const file of files) { - if (file.endsWith(".kt")) { - relEntryPoint = path.resolve(absDir, file); - break; - } - } - // If no kotlin files exist yet, use Main.kt as virtual entry point - // Main.kt does not need to exist because it is only a reference for the wrap dir location - if (!relEntryPoint) { - return path.resolve(absDir, "Main.kt"); - } - } - } + relEntryPoint = "src/commonMain/kotlin"; } else { throw Error(`Unsupported language: ${language}`); } From e062f41f4b44264edce1961aad2d86728f7b0d86 Mon Sep 17 00:00:00 2001 From: Jordan Ellis <5522128+dOrgJelli@users.noreply.github.com> Date: Wed, 20 Sep 2023 11:33:42 -0400 Subject: [PATCH 10/22] chore: Update CODEOWNERS From: https://hackmd.io/@polywrap-dao/S1JaXp3Cn NOTE: need to update branch policies. Would suggest `1 approval from a codeowner`. --- .github/CODEOWNERS | 63 +--------------------------------------------- 1 file changed, 1 insertion(+), 62 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 33b3a71cdc..8c3e3646c5 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,62 +1 @@ -# Default -* @dOrgJelli @namesty - -# Wasm Runtime -packages/wasm/as @dOrgJelli @krisbitney @namesty @Niraj-Kamdar -packages/wasm/rs @namesty @dOrgJelli - -# Wrapper Test-Cases -packages/test-cases/cases/wrappers/wasm-as @cbrzn @namesty @nerfZael @krisbitney @Niraj-Kamdar -packages/test-cases/cases/wrappers/wasm-rs @cbrzn @namesty @nerfZael @krisbitney @Niraj-Kamdar - -# Schema -packages/schema/parse @dOrgJelli @namesty @nerfZael @Niraj-Kamdar -packages/schema/compose @dOrgJelli @namesty @nerfZael @Niraj-Kamdar -packages/schema/bind @dOrgJelli @krisbitney @nerfZael @Niraj-Kamdar @cbrzn - -# Schema Test-Cases -packages/test-cases/cases/parse @dOrgJelli @namesty @nerfZael @Niraj-Kamdar -packages/test-cases/cases/compose @dOrgJelli @namesty @nerfZael @Niraj-Kamdar -packages/test-cases/cases/bind @dOrgJelli @krisbitney @nerfZael @Niraj-Kamdar @cbrzn - -# Project Manifests -packages/manifests/ @dOrgJelli @namesty @cbrzn @Niraj-Kamdar - -# CLI -packages/js/cli @dOrgJelli @krisbitney @namesty @nerfZael @Niraj-Kamdar - -# CLI Test-Cases -packages/test-cases/cases/cli @dOrgJelli @krisbitney @namesty @nerfZael @Niraj-Kamdar - -# Interfaces -packages/interfaces @dOrgJelli @krisbitney @cbrzn - -# JS Client -packages/js @dOrgJelli @nerfZael -packages/js/asyncify @namesty @dOrgJelli -packages/js/client @dOrgJelli @krisbitney @namesty @nerfZael -packages/js/client-config-builder @pileks @nerfZael -packages/js/core @dOrgJelli @krisbitney @namesty @nerfZael -packages/js/manifests @dOrgJelli @namesty @nerfZael @pileks @Niraj-Kamdar -packages/js/msgpack @dOrgJelli @Niraj-Kamdar -packages/js/os @dOrgJelli -packages/js/plugin @nerfZael @dOrgJelli -packages/js/react @dOrgJelli @nerfZael -packages/js/result @nerfZael -packages/js/test-env @dOrgJelli @krisbitney @cbrzn @namesty -packages/js/tracing @dOrgJelli @Niraj-Kamdar @fetsorn -packages/js/uri-resolver-extensions @nerfZael -packages/js/uri-resolvers @nerfZael -packages/js/validation @nerfZael @cbrzn -packages/js/wasm @nerfZael @dOrgJelli - -# JS Plugins -packages/js/plugins/ethereum @dOrgJelli @krisbitney @namesty -packages/js/plugins/file-system @krisbitney @dOrgJelli @Niraj-Kamdar @cbrzn -packages/js/plugins/http @dOrgJelli @ramilexe @cbrzn @namesty @krisbitney -packages/js/plugins/ipfs @dOrgJelli @krisbitney @nerfZael -packages/js/plugins/ws @dOrgJelli @nerfZael @fetsorn -packages/js/plugins/uri-resolvers/ens-resolver @nerfZael @pileks @krisbitney @cbrzn @dOrgJelli -packages/js/plugins/uri-resolvers/file-system-resolver @pileks @dOrgJelli @nerfZael @cbrzn @krisbitney -packages/js/plugins/uri-resolvers/http-resolver @namesty @krisbitney @nerfZael -packages/js/plugins/uri-resolvers/ipfs-resolver @pileks @nerfZael @dOrgJelli @cbrzn +* @dOrgJelli @namesty @pileks From fd6a1dee5531a33ca2346ae571829683b020cb5d Mon Sep 17 00:00:00 2001 From: krisbitney Date: Fri, 22 Sep 2023 14:23:41 +0300 Subject: [PATCH 11/22] added tests and fixed some bugs in manifest defaults --- packages/cli/package.json | 2 +- packages/cli/src/commands/build.ts | 4 +- packages/cli/src/lib/SchemaComposer.ts | 6 +- .../language-overrides/wasm/golang/index.ts | 2 +- .../language-overrides/wasm/rust/index.ts | 2 +- packages/cli/src/lib/project/AppProject.ts | 8 +- packages/cli/src/lib/project/PluginProject.ts | 8 +- .../cli/src/lib/project/PolywrapProject.ts | 10 +- packages/cli/src/lib/project/Project.ts | 2 +- .../src/lib/project/manifests/app/defaults.ts | 3 + .../cli/src/lib/project/manifests/defaults.ts | 10 +- .../lib/project/manifests/plugin/defaults.ts | 8 +- .../project/manifests/polywrap/defaults.ts | 6 +- .../src/formats/polywrap.app/0.5.0.ts | 2 +- .../src/formats/polywrap.plugin/0.5.0.ts | 2 +- .../polywrap/src/formats/polywrap/0.6.0.ts | 2 +- .../polywrap/formats/polywrap.app/0.5.0.json | 2 +- .../formats/polywrap.plugin/0.5.0.json | 2 +- .../polywrap/formats/polywrap/0.6.0.json | 2 +- .../assemblyscript/001-sanity/polywrap.yaml | 2 +- .../002-invalid-manifest-1/polywrap.yaml | 2 +- .../003-invalid-manifest-2/polywrap.yaml | 2 +- .../004-default-build/polywrap.yaml | 2 +- .../005-default-dockerfile/polywrap.yaml | 2 +- .../006-custom-dockerfile/polywrap.yaml | 2 +- .../007-linked-packages/polywrap.yaml | 2 +- .../009-docker-buildx/polywrap.yaml | 2 +- .../010-custom-config/polywrap.yaml | 2 +- .../polywrap.yaml | 2 +- .../014-override-config/polywrap.yaml | 2 +- .../015-resource-files/polywrap.yaml | 2 +- .../016-local-import-uri/polywrap.yaml | 2 +- .../wasm/golang/001-sanity/polywrap.yaml | 2 +- .../wasm/rust/001-sanity/polywrap.yaml | 2 +- .../wasm/typescript/001-sanity/polywrap.yaml | 2 +- .../expected/stdout.json | 8 + .../006-manifest-defaults/polywrap.app.yaml | 4 + .../app/006-manifest-defaults/schema.graphql | 1 + .../plugin/009-manifest-defaults/.gitignore | 1 + .../expected/stdout.json | 8 + .../expected/wrap/index.ts | 8 + .../expected/wrap/module.ts | 32 + .../expected/wrap/types.ts | 619 ++++ .../expected/wrap/wrap.info.ts | 2513 +++++++++++++++++ .../009-manifest-defaults/polywrap.yaml | 4 + .../009-manifest-defaults/schema.graphql | 22 + .../plugin/009-manifest-defaults/src/index.ts | 1 + .../001-sanity-assemblyscript/polywrap.yaml | 2 +- .../wasm/002-sanity-rust/polywrap.yaml | 2 +- .../003-invalid-codegen-script/polywrap.yaml | 2 +- .../wasm/004-codegen-script/polywrap.yaml | 2 +- .../wasm/005-custom-config/polywrap.yaml | 2 +- .../wasm/007-override-config/polywrap.yaml | 2 +- .../wasm/008-sanity-golang/polywrap.yaml | 2 +- .../expected/stdout.json | 4 + .../wasm/009-manifest-defaults/package.json | 15 + .../polywrap-norun.gen.js | 0 .../009-manifest-defaults/polywrap.build.yaml | 10 + .../wasm/009-manifest-defaults/polywrap.yaml | 6 + .../wasm/009-manifest-defaults/schema.graphql | 5 + .../wasm/009-manifest-defaults/src/index.ts | 5 + .../cli/test/run-test-wrapper/polywrap.yaml | 2 +- yarn.lock | 311 +- 63 files changed, 3506 insertions(+), 202 deletions(-) create mode 100644 packages/test-cases/cases/cli/codegen/app/006-manifest-defaults/expected/stdout.json create mode 100644 packages/test-cases/cases/cli/codegen/app/006-manifest-defaults/polywrap.app.yaml create mode 100644 packages/test-cases/cases/cli/codegen/app/006-manifest-defaults/schema.graphql create mode 100644 packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/.gitignore create mode 100644 packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/expected/stdout.json create mode 100644 packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/expected/wrap/index.ts create mode 100644 packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/expected/wrap/module.ts create mode 100644 packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/expected/wrap/types.ts create mode 100644 packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/expected/wrap/wrap.info.ts create mode 100644 packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/polywrap.yaml create mode 100644 packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/schema.graphql create mode 100644 packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/src/index.ts create mode 100644 packages/test-cases/cases/cli/codegen/wasm/009-manifest-defaults/expected/stdout.json create mode 100644 packages/test-cases/cases/cli/codegen/wasm/009-manifest-defaults/package.json create mode 100644 packages/test-cases/cases/cli/codegen/wasm/009-manifest-defaults/polywrap-norun.gen.js create mode 100644 packages/test-cases/cases/cli/codegen/wasm/009-manifest-defaults/polywrap.build.yaml create mode 100644 packages/test-cases/cases/cli/codegen/wasm/009-manifest-defaults/polywrap.yaml create mode 100644 packages/test-cases/cases/cli/codegen/wasm/009-manifest-defaults/schema.graphql create mode 100644 packages/test-cases/cases/cli/codegen/wasm/009-manifest-defaults/src/index.ts diff --git a/packages/cli/package.json b/packages/cli/package.json index 4bb9b85ba5..b7fdc26546 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -30,7 +30,7 @@ "test:cmd": "jest --passWithNoTests --runInBand --verbose --forceExit", "test:unit": "yarn test:cmd -- ./src/__tests__/unit/**/*.spec.ts", "test:e2e:p1": "yarn test:cmd -- ./src/__tests__/e2e/p1/*.spec.ts", - "test:e2e:p2": "yarn test:cmd -- ./src/__tests__/e2e/p2/*.spec.ts", + "test:e2e:p2": "yarn test:cmd -- ./src/__tests__/e2e/p2/codegen*.spec.ts", "test:rust": "yarn test:cmd -- --config ./jest.rs.config.js", "test:golang": "yarn test:cmd -- --config ./jest.go.config.js", "test:typescript": "yarn test:cmd -- --config ./jest.ts.config.js", diff --git a/packages/cli/src/commands/build.ts b/packages/cli/src/commands/build.ts index 5b457c3766..41a71b4730 100644 --- a/packages/cli/src/commands/build.ts +++ b/packages/cli/src/commands/build.ts @@ -132,7 +132,7 @@ export const build: Command = { async function validateManifestModules(polywrapManifest: PolywrapManifest) { if ( polywrapManifest.project.type !== "interface" && - !polywrapManifest.source.module + !polywrapManifest.source?.module ) { const missingModuleMessage = intlMsg.lib_compiler_missingModule(); throw Error(missingModuleMessage); @@ -140,7 +140,7 @@ async function validateManifestModules(polywrapManifest: PolywrapManifest) { if ( polywrapManifest.project.type === "interface" && - polywrapManifest.source.module + polywrapManifest.source?.module ) { const noInterfaceModule = intlMsg.lib_compiler_noInterfaceModule(); throw Error(noInterfaceModule); diff --git a/packages/cli/src/lib/SchemaComposer.ts b/packages/cli/src/lib/SchemaComposer.ts index ae192f3f87..9e88eaf1f2 100644 --- a/packages/cli/src/lib/SchemaComposer.ts +++ b/packages/cli/src/lib/SchemaComposer.ts @@ -73,7 +73,7 @@ export class SchemaComposer { private _abiResolver( schemaFile: SchemaFile, importFrom: string, - import_abis?: PolywrapManifest["source"]["import_abis"] + import_abis?: NonNullable["import_abis"] ): Promise { if (Uri.isValidUri(importFrom)) { return this._resolveUri(importFrom, import_abis); @@ -97,7 +97,7 @@ export class SchemaComposer { private async _resolveUri( uri: string, - import_abis?: PolywrapManifest["source"]["import_abis"] + import_abis?: NonNullable["import_abis"] ): Promise { // Check to see if we have any import redirects that match if (import_abis) { @@ -155,7 +155,7 @@ export class SchemaComposer { private async _loadGraphqlAbi( path: string, - import_abis: PolywrapManifest["source"]["import_abis"] + import_abis: NonNullable["import_abis"] ): Promise { const schema = fs.readFileSync(path, "utf-8"); diff --git a/packages/cli/src/lib/defaults/language-overrides/wasm/golang/index.ts b/packages/cli/src/lib/defaults/language-overrides/wasm/golang/index.ts index 16f31636c1..62d9e7bd1c 100644 --- a/packages/cli/src/lib/defaults/language-overrides/wasm/golang/index.ts +++ b/packages/cli/src/lib/defaults/language-overrides/wasm/golang/index.ts @@ -32,7 +32,7 @@ export function getCodegenOverrides(): CodegenOverrides { function getGoModulePath(manifest: PolywrapManifest): string { // Ensure `module: ...` is pointing to a `go.mod` file - const module = manifest.source.module; + const module = manifest.source?.module; if (!module || module.indexOf("go.mod") === -1) { throw Error( intlMsg.lib_wasm_golang_invalidModule({ path: module || "N/A" }) diff --git a/packages/cli/src/lib/defaults/language-overrides/wasm/rust/index.ts b/packages/cli/src/lib/defaults/language-overrides/wasm/rust/index.ts index 948da95d1a..9fb7ed747e 100644 --- a/packages/cli/src/lib/defaults/language-overrides/wasm/rust/index.ts +++ b/packages/cli/src/lib/defaults/language-overrides/wasm/rust/index.ts @@ -6,7 +6,7 @@ import { PolywrapManifest } from "@polywrap/polywrap-manifest-types-js"; export function getBuildOverrides(): BuildOverrides { return { validateManifest: (manifest: PolywrapManifest) => { - const module = manifest.source.module; + const module = manifest.source?.module; if (module && module.indexOf("Cargo.toml") === -1) { throw Error(intlMsg.lib_wasm_rust_invalidModule({ path: module })); diff --git a/packages/cli/src/lib/project/AppProject.ts b/packages/cli/src/lib/project/AppProject.ts index 255cf7c302..20c2b696e0 100644 --- a/packages/cli/src/lib/project/AppProject.ts +++ b/packages/cli/src/lib/project/AppProject.ts @@ -97,7 +97,7 @@ export class AppProject extends Project { public async getSchemaNamedPath(): Promise { const manifest = await this.getManifest(); const dir = this.getManifestDir(); - if (!manifest.source.schema) { + if (!manifest.source?.schema) { throw new Error( `No schema path specified in project manifest with name "${manifest.project.name}". This should never happen.` ); @@ -105,9 +105,11 @@ export class AppProject extends Project { return path.join(dir, manifest.source.schema); } - public async getImportAbis(): Promise { + public async getImportAbis(): Promise< + NonNullable["import_abis"] + > { const manifest = await this.getManifest(); - return manifest.source.import_abis || []; + return manifest.source?.import_abis || []; } public async getGenerationDirectory( diff --git a/packages/cli/src/lib/project/PluginProject.ts b/packages/cli/src/lib/project/PluginProject.ts index 605827a7ec..781b1768f5 100644 --- a/packages/cli/src/lib/project/PluginProject.ts +++ b/packages/cli/src/lib/project/PluginProject.ts @@ -98,7 +98,7 @@ export class PluginProject extends Project { public async getSchemaNamedPath(): Promise { const manifest = await this.getManifest(); const dir = this.getManifestDir(); - if (!manifest.source.schema) { + if (!manifest.source?.schema) { throw new Error( `No schema path specified in project manifest with name "${manifest.project.name}". This should never happen.` ); @@ -107,10 +107,10 @@ export class PluginProject extends Project { } public async getImportAbis(): Promise< - PluginManifest["source"]["import_abis"] + NonNullable["import_abis"] > { const manifest = await this.getManifest(); - return manifest.source.import_abis || []; + return manifest.source?.import_abis || []; } public async getGenerationDirectory( @@ -163,7 +163,7 @@ export class PluginProject extends Project { manifest.project.type as PluginManifestLanguage ) || // 3. If a module path exists, generate within a "wrap" dir next to it - (manifest.source.module && + (manifest.source?.module && path.join(path.dirname(manifest.source.module), "wrap")) || // 4. Use the default defaultDir; diff --git a/packages/cli/src/lib/project/PolywrapProject.ts b/packages/cli/src/lib/project/PolywrapProject.ts index 1eb0437209..47b749e91c 100644 --- a/packages/cli/src/lib/project/PolywrapProject.ts +++ b/packages/cli/src/lib/project/PolywrapProject.ts @@ -147,7 +147,7 @@ export class PolywrapProject extends Project { public async getSchemaNamedPath(): Promise { const manifest = await this.getManifest(); const dir = this.getManifestDir(); - if (!manifest.source.schema) { + if (!manifest.source?.schema) { throw new Error( `No schema path specified in project manifest with name "${manifest.project.name}". This should never happen.` ); @@ -156,10 +156,10 @@ export class PolywrapProject extends Project { } public async getImportAbis(): Promise< - PolywrapManifest["source"]["import_abis"] + NonNullable["import_abis"] > { const manifest = await this.getManifest(); - return manifest.source.import_abis || []; + return manifest.source?.import_abis || []; } public async getGenerationDirectory( @@ -371,7 +371,7 @@ export class PolywrapProject extends Project { > { const manifest = await this.getManifest(); - if (manifest.source.module) { + if (manifest.source?.module) { return { moduleFilePath: manifest.source.module, dir: path.dirname(manifest.source.module).replace("./", ""), @@ -394,7 +394,7 @@ export class PolywrapProject extends Project { manifest.project.type as PolywrapManifestLanguage ) || // 3. If a module path exists, generate within a "wrap" dir next to it - (manifest.source.module && + (manifest.source?.module && path.join(path.dirname(manifest.source.module), "wrap")) || // 4. Use the default defaultDir; diff --git a/packages/cli/src/lib/project/Project.ts b/packages/cli/src/lib/project/Project.ts index 8fc8903153..d5bf5329c1 100644 --- a/packages/cli/src/lib/project/Project.ts +++ b/packages/cli/src/lib/project/Project.ts @@ -63,7 +63,7 @@ export abstract class Project { public abstract getSchemaNamedPath(): Promise; public abstract getImportAbis(): Promise< - PolywrapManifest["source"]["import_abis"] + NonNullable["import_abis"] >; public abstract getGenerationDirectory( diff --git a/packages/cli/src/lib/project/manifests/app/defaults.ts b/packages/cli/src/lib/project/manifests/app/defaults.ts index 0dd5e889dc..92e772cf5e 100644 --- a/packages/cli/src/lib/project/manifests/app/defaults.ts +++ b/packages/cli/src/lib/project/manifests/app/defaults.ts @@ -6,6 +6,9 @@ export function applyAppManifestDefaults( manifest: AppManifest, manifestPath: string ): AppManifest { + if (!manifest.source) { + manifest.source = {}; + } if (!manifest.source.schema) { manifest.source.schema = defaultSchemaPath(manifestPath); } diff --git a/packages/cli/src/lib/project/manifests/defaults.ts b/packages/cli/src/lib/project/manifests/defaults.ts index 3ffe95cdaa..8391a02f3a 100644 --- a/packages/cli/src/lib/project/manifests/defaults.ts +++ b/packages/cli/src/lib/project/manifests/defaults.ts @@ -2,9 +2,15 @@ import path from "path"; import fs from "fs"; export function defaultSchemaPath(manifestPath: string): string { - const defaultSchemaPaths = ["polywrap.graphql", "src/polywrap.graphql"]; + const defaultSchemaPaths = [ + "polywrap.graphql", + "src/polywrap.graphql", + "schema.graphql", + "src/schema.graphql", + ]; + const manifestDir = path.dirname(manifestPath); for (const relPath of defaultSchemaPaths) { - const absPath = path.resolve(manifestPath, relPath); + const absPath = path.resolve(manifestDir, relPath); if (fs.existsSync(absPath)) { return absPath; } diff --git a/packages/cli/src/lib/project/manifests/plugin/defaults.ts b/packages/cli/src/lib/project/manifests/plugin/defaults.ts index 2350a0064f..77ecdfc8ed 100644 --- a/packages/cli/src/lib/project/manifests/plugin/defaults.ts +++ b/packages/cli/src/lib/project/manifests/plugin/defaults.ts @@ -9,7 +9,10 @@ export function applyPluginManifestDefaults( manifest: PluginManifest, manifestPath: string ): PluginManifest { - if (!manifest.source.module) { + if (!manifest.source) { + manifest.source = {}; + } + if (!manifest.source?.module) { const language = manifest.project.type; manifest.source.module = defaultModulePath(language, manifestPath); } @@ -42,7 +45,8 @@ function defaultModulePath( throw Error(`Unsupported language: ${language}`); } - const absEntryPoint = path.resolve(manifestPath, relEntryPoint); + const manifestDir = path.dirname(manifestPath); + const absEntryPoint = path.resolve(manifestDir, relEntryPoint); if (fs.existsSync(absEntryPoint)) { return absEntryPoint; } diff --git a/packages/cli/src/lib/project/manifests/polywrap/defaults.ts b/packages/cli/src/lib/project/manifests/polywrap/defaults.ts index 59fe964db3..e47849cabf 100644 --- a/packages/cli/src/lib/project/manifests/polywrap/defaults.ts +++ b/packages/cli/src/lib/project/manifests/polywrap/defaults.ts @@ -9,6 +9,9 @@ export function applyPolywrapManifestDefaults( manifest: PolywrapManifest, manifestPath: string ): PolywrapManifest { + if (!manifest.source) { + manifest.source = {}; + } if (!manifest.source.module) { const language = manifest.project.type; manifest.source.module = defaultModulePath(language, manifestPath); @@ -40,7 +43,8 @@ function defaultModulePath( throw Error(`Unsupported language: ${language}`); } - const absEntryPoint = path.resolve(manifestPath, relEntryPoint); + const manifestDir = path.dirname(manifestPath); + const absEntryPoint = path.resolve(manifestDir, relEntryPoint); if (fs.existsSync(absEntryPoint)) { return absEntryPoint; } diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.app/0.5.0.ts b/packages/js/manifests/polywrap/src/formats/polywrap.app/0.5.0.ts index 4923c82848..61cbed642f 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.app/0.5.0.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.app/0.5.0.ts @@ -27,7 +27,7 @@ export interface AppManifest { /** * Project source files. */ - source: { + source?: { /** * Path to the project's graphql schema. */ diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.plugin/0.5.0.ts b/packages/js/manifests/polywrap/src/formats/polywrap.plugin/0.5.0.ts index 15baa43a07..948134cdac 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.plugin/0.5.0.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.plugin/0.5.0.ts @@ -27,7 +27,7 @@ export interface PluginManifest { /** * Project source files. */ - source: { + source?: { /** * Path to the project's entry point. */ diff --git a/packages/js/manifests/polywrap/src/formats/polywrap/0.6.0.ts b/packages/js/manifests/polywrap/src/formats/polywrap/0.6.0.ts index 2c299e3bd0..0e8475b6f0 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap/0.6.0.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap/0.6.0.ts @@ -27,7 +27,7 @@ export interface PolywrapManifest { /** * Project source files. */ - source: { + source?: { /** * Path to the project's entry point. */ diff --git a/packages/manifests/polywrap/formats/polywrap.app/0.5.0.json b/packages/manifests/polywrap/formats/polywrap.app/0.5.0.json index ac6330b668..36fe72866b 100644 --- a/packages/manifests/polywrap/formats/polywrap.app/0.5.0.json +++ b/packages/manifests/polywrap/formats/polywrap.app/0.5.0.json @@ -2,7 +2,7 @@ "id": "AppManifest", "type": "object", "additionalProperties": false, - "required": ["format", "project", "source"], + "required": ["format", "project"], "properties": { "format": { "description": "Polywrap manifest format version.", diff --git a/packages/manifests/polywrap/formats/polywrap.plugin/0.5.0.json b/packages/manifests/polywrap/formats/polywrap.plugin/0.5.0.json index 7f5346ae78..af5c31472e 100644 --- a/packages/manifests/polywrap/formats/polywrap.plugin/0.5.0.json +++ b/packages/manifests/polywrap/formats/polywrap.plugin/0.5.0.json @@ -2,7 +2,7 @@ "id": "PluginManifest", "type": "object", "additionalProperties": false, - "required": ["format", "project", "source"], + "required": ["format", "project"], "properties": { "format": { "description": "Polywrap manifest format version.", diff --git a/packages/manifests/polywrap/formats/polywrap/0.6.0.json b/packages/manifests/polywrap/formats/polywrap/0.6.0.json index b8c93e7735..01f96145b4 100644 --- a/packages/manifests/polywrap/formats/polywrap/0.6.0.json +++ b/packages/manifests/polywrap/formats/polywrap/0.6.0.json @@ -2,7 +2,7 @@ "id": "PolywrapManifest", "type": "object", "additionalProperties": false, - "required": ["format", "project", "source"], + "required": ["format", "project"], "properties": { "format": { "description": "Polywrap manifest format version.", diff --git a/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/001-sanity/polywrap.yaml b/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/001-sanity/polywrap.yaml index e537c7844c..4461b4fad2 100644 --- a/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/001-sanity/polywrap.yaml +++ b/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/001-sanity/polywrap.yaml @@ -1,4 +1,4 @@ -format: 0.4.0 +format: 0.5.0 project: name: test-project type: wasm/assemblyscript diff --git a/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/002-invalid-manifest-1/polywrap.yaml b/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/002-invalid-manifest-1/polywrap.yaml index 12ce534366..3f47a9adf4 100644 --- a/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/002-invalid-manifest-1/polywrap.yaml +++ b/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/002-invalid-manifest-1/polywrap.yaml @@ -1,4 +1,4 @@ -format: 0.4.0 +format: 0.5.0 project: name: invalid-manifest type: wasm/assemblyscript diff --git a/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/003-invalid-manifest-2/polywrap.yaml b/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/003-invalid-manifest-2/polywrap.yaml index c3c259ff1a..f1fe46ba7d 100644 --- a/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/003-invalid-manifest-2/polywrap.yaml +++ b/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/003-invalid-manifest-2/polywrap.yaml @@ -1,4 +1,4 @@ -format: 0.4.0 +format: 0.5.0 project: name: invalid-manifest-2 type: wasm/assemblyscript diff --git a/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/004-default-build/polywrap.yaml b/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/004-default-build/polywrap.yaml index a2a7f4c1ac..e51c894ff9 100644 --- a/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/004-default-build/polywrap.yaml +++ b/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/004-default-build/polywrap.yaml @@ -1,4 +1,4 @@ -format: 0.4.0 +format: 0.5.0 project: name: test-project type: wasm/assemblyscript diff --git a/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/005-default-dockerfile/polywrap.yaml b/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/005-default-dockerfile/polywrap.yaml index 64a2c32485..98ae40632a 100644 --- a/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/005-default-dockerfile/polywrap.yaml +++ b/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/005-default-dockerfile/polywrap.yaml @@ -1,4 +1,4 @@ -format: 0.4.0 +format: 0.5.0 project: name: default-dockerfile type: wasm/assemblyscript diff --git a/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/006-custom-dockerfile/polywrap.yaml b/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/006-custom-dockerfile/polywrap.yaml index 1c73218399..ed573a698a 100644 --- a/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/006-custom-dockerfile/polywrap.yaml +++ b/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/006-custom-dockerfile/polywrap.yaml @@ -1,4 +1,4 @@ -format: 0.4.0 +format: 0.5.0 project: name: custom-dockerfile type: wasm/assemblyscript diff --git a/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/007-linked-packages/polywrap.yaml b/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/007-linked-packages/polywrap.yaml index 505ebab0d8..681c1673ae 100644 --- a/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/007-linked-packages/polywrap.yaml +++ b/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/007-linked-packages/polywrap.yaml @@ -1,4 +1,4 @@ -format: 0.4.0 +format: 0.5.0 project: name: linked-packages type: wasm/assemblyscript diff --git a/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/009-docker-buildx/polywrap.yaml b/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/009-docker-buildx/polywrap.yaml index a2a7f4c1ac..e51c894ff9 100644 --- a/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/009-docker-buildx/polywrap.yaml +++ b/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/009-docker-buildx/polywrap.yaml @@ -1,4 +1,4 @@ -format: 0.4.0 +format: 0.5.0 project: name: test-project type: wasm/assemblyscript diff --git a/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/010-custom-config/polywrap.yaml b/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/010-custom-config/polywrap.yaml index db31dc5f91..bee969d718 100644 --- a/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/010-custom-config/polywrap.yaml +++ b/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/010-custom-config/polywrap.yaml @@ -1,4 +1,4 @@ -format: 0.4.0 +format: 0.5.0 project: name: test-project type: wasm/assemblyscript diff --git a/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/013-wrong-language-specific-config/polywrap.yaml b/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/013-wrong-language-specific-config/polywrap.yaml index e537c7844c..4461b4fad2 100644 --- a/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/013-wrong-language-specific-config/polywrap.yaml +++ b/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/013-wrong-language-specific-config/polywrap.yaml @@ -1,4 +1,4 @@ -format: 0.4.0 +format: 0.5.0 project: name: test-project type: wasm/assemblyscript diff --git a/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/014-override-config/polywrap.yaml b/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/014-override-config/polywrap.yaml index db31dc5f91..bee969d718 100644 --- a/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/014-override-config/polywrap.yaml +++ b/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/014-override-config/polywrap.yaml @@ -1,4 +1,4 @@ -format: 0.4.0 +format: 0.5.0 project: name: test-project type: wasm/assemblyscript diff --git a/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/015-resource-files/polywrap.yaml b/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/015-resource-files/polywrap.yaml index 1f4c23fde0..02101dd630 100644 --- a/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/015-resource-files/polywrap.yaml +++ b/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/015-resource-files/polywrap.yaml @@ -1,4 +1,4 @@ -format: 0.4.0 +format: 0.5.0 project: name: test-project type: wasm/assemblyscript diff --git a/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/016-local-import-uri/polywrap.yaml b/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/016-local-import-uri/polywrap.yaml index db31dc5f91..bee969d718 100644 --- a/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/016-local-import-uri/polywrap.yaml +++ b/packages/test-cases/cases/cli/build-cmd/wasm/assemblyscript/016-local-import-uri/polywrap.yaml @@ -1,4 +1,4 @@ -format: 0.4.0 +format: 0.5.0 project: name: test-project type: wasm/assemblyscript diff --git a/packages/test-cases/cases/cli/build-cmd/wasm/golang/001-sanity/polywrap.yaml b/packages/test-cases/cases/cli/build-cmd/wasm/golang/001-sanity/polywrap.yaml index be21a65d27..630eaa21fa 100644 --- a/packages/test-cases/cases/cli/build-cmd/wasm/golang/001-sanity/polywrap.yaml +++ b/packages/test-cases/cases/cli/build-cmd/wasm/golang/001-sanity/polywrap.yaml @@ -1,4 +1,4 @@ -format: 0.5.0 +format: 0.6.0 project: name: ObjectTypes type: wasm/golang diff --git a/packages/test-cases/cases/cli/build-cmd/wasm/rust/001-sanity/polywrap.yaml b/packages/test-cases/cases/cli/build-cmd/wasm/rust/001-sanity/polywrap.yaml index 55eecfe9bc..205ad778fb 100644 --- a/packages/test-cases/cases/cli/build-cmd/wasm/rust/001-sanity/polywrap.yaml +++ b/packages/test-cases/cases/cli/build-cmd/wasm/rust/001-sanity/polywrap.yaml @@ -1,4 +1,4 @@ -format: 0.4.0 +format: 0.5.0 project: name: ObjectTypes type: wasm/rust diff --git a/packages/test-cases/cases/cli/build-cmd/wasm/typescript/001-sanity/polywrap.yaml b/packages/test-cases/cases/cli/build-cmd/wasm/typescript/001-sanity/polywrap.yaml index 14bc8c3e33..9cd485734a 100644 --- a/packages/test-cases/cases/cli/build-cmd/wasm/typescript/001-sanity/polywrap.yaml +++ b/packages/test-cases/cases/cli/build-cmd/wasm/typescript/001-sanity/polywrap.yaml @@ -1,4 +1,4 @@ -format: 0.5.0 +format: 0.6.0 project: name: ObjectTypes type: wasm/typescript diff --git a/packages/test-cases/cases/cli/codegen/app/006-manifest-defaults/expected/stdout.json b/packages/test-cases/cases/cli/codegen/app/006-manifest-defaults/expected/stdout.json new file mode 100644 index 0000000000..eac628d9ba --- /dev/null +++ b/packages/test-cases/cases/cli/codegen/app/006-manifest-defaults/expected/stdout.json @@ -0,0 +1,8 @@ +{ + "stdout": [ + "Manifest loaded from ./polywrap.app.yaml", + "Generate types", + "Types were generated successfully" + ], + "exitCode": 0 +} diff --git a/packages/test-cases/cases/cli/codegen/app/006-manifest-defaults/polywrap.app.yaml b/packages/test-cases/cases/cli/codegen/app/006-manifest-defaults/polywrap.app.yaml new file mode 100644 index 0000000000..960b26e132 --- /dev/null +++ b/packages/test-cases/cases/cli/codegen/app/006-manifest-defaults/polywrap.app.yaml @@ -0,0 +1,4 @@ +format: 0.5.0 +project: + name: test-app + type: app/typescript diff --git a/packages/test-cases/cases/cli/codegen/app/006-manifest-defaults/schema.graphql b/packages/test-cases/cases/cli/codegen/app/006-manifest-defaults/schema.graphql new file mode 100644 index 0000000000..5dc50f6bfb --- /dev/null +++ b/packages/test-cases/cases/cli/codegen/app/006-manifest-defaults/schema.graphql @@ -0,0 +1 @@ +#import * into Ethereum from "wrap://ens/wraps.eth:ethereum@1.0.0" diff --git a/packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/.gitignore b/packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/.gitignore new file mode 100644 index 0000000000..3386731da9 --- /dev/null +++ b/packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/.gitignore @@ -0,0 +1 @@ +!expected/** diff --git a/packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/expected/stdout.json b/packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/expected/stdout.json new file mode 100644 index 0000000000..68824dd5a2 --- /dev/null +++ b/packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/expected/stdout.json @@ -0,0 +1,8 @@ +{ + "stdout": [ + "Manifest loaded from ./polywrap.yaml", + "Generate types", + "Types were generated successfully" + ], + "exitCode": 0 +} diff --git a/packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/expected/wrap/index.ts b/packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/expected/wrap/index.ts new file mode 100644 index 0000000000..4f5ca809d5 --- /dev/null +++ b/packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/expected/wrap/index.ts @@ -0,0 +1,8 @@ +/// NOTE: This is an auto-generated file. +/// All modifications will be overwritten. + +export * from "./wrap.info"; +export * from "./module"; +export * from "./types"; + +export { CoreClient } from "@polywrap/core-js"; diff --git a/packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/expected/wrap/module.ts b/packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/expected/wrap/module.ts new file mode 100644 index 0000000000..cde1572906 --- /dev/null +++ b/packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/expected/wrap/module.ts @@ -0,0 +1,32 @@ +/// NOTE: This is an auto-generated file. +/// All modifications will be overwritten. + +// @ts-ignore +import * as Types from "./types"; + +// @ts-ignore +import { CoreClient, MaybeAsync } from "@polywrap/core-js"; +import { PluginModule } from "@polywrap/plugin-js"; + +export interface Args_methodOne { + str: Types.String; + optStr?: Types.String | null; +} + +export interface Args_methodTwo { + arg: Types.UInt32; +} + +export abstract class Module extends PluginModule { + abstract methodOne( + args: Args_methodOne, + client: CoreClient, + env?: null + ): MaybeAsync; + + abstract methodTwo( + args: Args_methodTwo, + client: CoreClient, + env?: null + ): MaybeAsync; +} diff --git a/packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/expected/wrap/types.ts b/packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/expected/wrap/types.ts new file mode 100644 index 0000000000..aa17008742 --- /dev/null +++ b/packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/expected/wrap/types.ts @@ -0,0 +1,619 @@ +/// NOTE: This is an auto-generated file. +/// All modifications will be overwritten. + +// @ts-ignore +import * as Types from "./"; + +// @ts-ignore +import { + CoreClient, + InvokeResult, + Uri, +} from "@polywrap/core-js"; + +export type UInt = number; +export type UInt8 = number; +export type UInt16 = number; +export type UInt32 = number; +export type Int = number; +export type Int8 = number; +export type Int16 = number; +export type Int32 = number; +export type Bytes = Uint8Array; +export type BigInt = string; +export type BigNumber = string; +export type Json = string; +export type String = string; +export type Boolean = boolean; + +/// Env START /// +export interface Env extends Record { + arg1: Types.String; +} +/// Env END /// + +/// Objects START /// +export interface Object { + u: Types.UInt; + array: Array; + bytes?: Types.Bytes | null; +} + +/// Objects END /// + +/// Enums START /// +/// Enums END /// + +/// Imported Objects START /// + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Connection { + node?: Types.String | null; + networkNameOrChainId?: Types.String | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_TxOptions { + gasLimit?: Types.BigInt | null; + maxFeePerGas?: Types.BigInt | null; + maxPriorityFeePerGas?: Types.BigInt | null; + gasPrice?: Types.BigInt | null; + value?: Types.BigInt | null; + nonce?: Types.UInt32 | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_StaticTxResult { + result: Types.String; + error: Types.Boolean; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Eip1559FeesEstimate { + maxFeePerGas: Types.BigInt; + maxPriorityFeePerGas: Types.BigInt; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_TxRequest { + to?: Types.String | null; + from?: Types.String | null; + data?: Types.String | null; + type?: Types.UInt32 | null; + chainId?: Types.BigInt | null; + accessList?: Array | null; + gasLimit?: Types.BigInt | null; + maxFeePerGas?: Types.BigInt | null; + maxPriorityFeePerGas?: Types.BigInt | null; + gasPrice?: Types.BigInt | null; + value?: Types.BigInt | null; + nonce?: Types.UInt32 | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_AccessItem { + address: Types.String; + storageKeys: Array; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_TxReceipt { + to: Types.String; + from: Types.String; + contractAddress: Types.String; + transactionIndex: Types.UInt32; + root?: Types.String | null; + gasUsed: Types.BigInt; + logsBloom: Types.String; + transactionHash: Types.String; + logs: Array; + blockNumber: Types.BigInt; + blockHash: Types.String; + confirmations: Types.UInt32; + cumulativeGasUsed: Types.BigInt; + effectiveGasPrice: Types.BigInt; + type: Types.UInt32; + status?: Types.UInt32 | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Log { + blockNumber: Types.BigInt; + blockHash: Types.String; + transactionIndex: Types.UInt32; + removed: Types.Boolean; + address: Types.String; + data: Types.String; + topics: Array; + transactionHash: Types.String; + logIndex: Types.UInt32; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_TxResponse { + hash: Types.String; + to?: Types.String | null; + from: Types.String; + nonce: Types.UInt32; + gasLimit: Types.BigInt; + maxFeePerGas?: Types.BigInt | null; + maxPriorityFeePerGas?: Types.BigInt | null; + gasPrice?: Types.BigInt | null; + value: Types.BigInt; + chainId: Types.BigInt; + blockNumber?: Types.BigInt | null; + blockHash?: Types.String | null; + timestamp?: Types.UInt32 | null; + r?: Types.String | null; + s?: Types.String | null; + v?: Types.UInt32 | null; + type?: Types.UInt32 | null; + accessList?: Array | null; +} + +/// Imported Objects END /// + +/// Imported Modules START /// + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Module_Args_getChainId { + connection?: Types.Ethereum_Connection | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Module_Args_callContractView { + address: Types.String; + method: Types.String; + args?: Array | null; + connection?: Types.Ethereum_Connection | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Module_Args_callContractStatic { + address: Types.String; + method: Types.String; + args?: Array | null; + options?: Types.Ethereum_TxOptions | null; + connection?: Types.Ethereum_Connection | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Module_Args_encodeParams { + types: Array; + values: Array; + connection?: Types.Ethereum_Connection | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Module_Args_encodeFunction { + method: Types.String; + args?: Array | null; + connection?: Types.Ethereum_Connection | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Module_Args_decodeFunction { + method: Types.String; + data: Types.String; + connection?: Types.Ethereum_Connection | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Module_Args_getSignerAddress { + connection?: Types.Ethereum_Connection | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Module_Args_getSignerBalance { + blockTag?: Types.BigInt | null; + connection?: Types.Ethereum_Connection | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Module_Args_getBalance { + address: Types.String; + blockTag?: Types.BigInt | null; + connection?: Types.Ethereum_Connection | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Module_Args_getGasPrice { + connection?: Types.Ethereum_Connection | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Module_Args_estimateEip1559Fees { + connection?: Types.Ethereum_Connection | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Module_Args_sendRpc { + method: Types.String; + params: Array; + connection?: Types.Ethereum_Connection | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Module_Args_getSignerTransactionCount { + blockTag?: Types.BigInt | null; + connection?: Types.Ethereum_Connection | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Module_Args_checkAddress { + address: Types.String; + connection?: Types.Ethereum_Connection | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Module_Args_toWei { + eth: Types.String; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Module_Args_toEth { + wei: Types.String; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Module_Args_estimateTransactionGas { + tx: Types.Ethereum_TxRequest; + connection?: Types.Ethereum_Connection | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Module_Args_awaitTransaction { + txHash: Types.String; + connection?: Types.Ethereum_Connection | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Module_Args_sendTransaction { + tx: Types.Ethereum_TxRequest; + connection?: Types.Ethereum_Connection | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Module_Args_sendTransactionAndWait { + tx: Types.Ethereum_TxRequest; + connection?: Types.Ethereum_Connection | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Module_Args_deployContract { + abi: Types.String; + bytecode: Types.String; + args?: Array | null; + options?: Types.Ethereum_TxOptions | null; + connection?: Types.Ethereum_Connection | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Module_Args_estimateContractCallGas { + address: Types.String; + method: Types.String; + args?: Array | null; + options?: Types.Ethereum_TxOptions | null; + connection?: Types.Ethereum_Connection | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Module_Args_callContractMethod { + address: Types.String; + method: Types.String; + args?: Array | null; + options?: Types.Ethereum_TxOptions | null; + connection?: Types.Ethereum_Connection | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Module_Args_callContractMethodAndWait { + address: Types.String; + method: Types.String; + args?: Array | null; + options?: Types.Ethereum_TxOptions | null; + connection?: Types.Ethereum_Connection | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Module_Args_signMessage { + message: Types.String; + connection?: Types.Ethereum_Connection | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export interface Ethereum_Module_Args_signMessageBytes { + bytes: Types.Bytes; + connection?: Types.Ethereum_Connection | null; +} + +/* URI: "ens/wraps.eth:ethereum@1.0.0" */ +export const Ethereum_Module = { + getChainId: async ( + args: Ethereum_Module_Args_getChainId, + client: CoreClient + ): Promise> => { + return client.invoke({ + uri: Uri.from("ens/wraps.eth:ethereum@1.0.0"), + method: "getChainId", + args: (args as unknown) as Record, + }); + }, + + callContractView: async ( + args: Ethereum_Module_Args_callContractView, + client: CoreClient + ): Promise> => { + return client.invoke({ + uri: Uri.from("ens/wraps.eth:ethereum@1.0.0"), + method: "callContractView", + args: (args as unknown) as Record, + }); + }, + + callContractStatic: async ( + args: Ethereum_Module_Args_callContractStatic, + client: CoreClient + ): Promise> => { + return client.invoke({ + uri: Uri.from("ens/wraps.eth:ethereum@1.0.0"), + method: "callContractStatic", + args: (args as unknown) as Record, + }); + }, + + encodeParams: async ( + args: Ethereum_Module_Args_encodeParams, + client: CoreClient + ): Promise> => { + return client.invoke({ + uri: Uri.from("ens/wraps.eth:ethereum@1.0.0"), + method: "encodeParams", + args: (args as unknown) as Record, + }); + }, + + encodeFunction: async ( + args: Ethereum_Module_Args_encodeFunction, + client: CoreClient + ): Promise> => { + return client.invoke({ + uri: Uri.from("ens/wraps.eth:ethereum@1.0.0"), + method: "encodeFunction", + args: (args as unknown) as Record, + }); + }, + + decodeFunction: async ( + args: Ethereum_Module_Args_decodeFunction, + client: CoreClient + ): Promise>> => { + return client.invoke>({ + uri: Uri.from("ens/wraps.eth:ethereum@1.0.0"), + method: "decodeFunction", + args: (args as unknown) as Record, + }); + }, + + getSignerAddress: async ( + args: Ethereum_Module_Args_getSignerAddress, + client: CoreClient + ): Promise> => { + return client.invoke({ + uri: Uri.from("ens/wraps.eth:ethereum@1.0.0"), + method: "getSignerAddress", + args: (args as unknown) as Record, + }); + }, + + getSignerBalance: async ( + args: Ethereum_Module_Args_getSignerBalance, + client: CoreClient + ): Promise> => { + return client.invoke({ + uri: Uri.from("ens/wraps.eth:ethereum@1.0.0"), + method: "getSignerBalance", + args: (args as unknown) as Record, + }); + }, + + getBalance: async ( + args: Ethereum_Module_Args_getBalance, + client: CoreClient + ): Promise> => { + return client.invoke({ + uri: Uri.from("ens/wraps.eth:ethereum@1.0.0"), + method: "getBalance", + args: (args as unknown) as Record, + }); + }, + + getGasPrice: async ( + args: Ethereum_Module_Args_getGasPrice, + client: CoreClient + ): Promise> => { + return client.invoke({ + uri: Uri.from("ens/wraps.eth:ethereum@1.0.0"), + method: "getGasPrice", + args: (args as unknown) as Record, + }); + }, + + estimateEip1559Fees: async ( + args: Ethereum_Module_Args_estimateEip1559Fees, + client: CoreClient + ): Promise> => { + return client.invoke({ + uri: Uri.from("ens/wraps.eth:ethereum@1.0.0"), + method: "estimateEip1559Fees", + args: (args as unknown) as Record, + }); + }, + + sendRpc: async ( + args: Ethereum_Module_Args_sendRpc, + client: CoreClient + ): Promise> => { + return client.invoke({ + uri: Uri.from("ens/wraps.eth:ethereum@1.0.0"), + method: "sendRpc", + args: (args as unknown) as Record, + }); + }, + + getSignerTransactionCount: async ( + args: Ethereum_Module_Args_getSignerTransactionCount, + client: CoreClient + ): Promise> => { + return client.invoke({ + uri: Uri.from("ens/wraps.eth:ethereum@1.0.0"), + method: "getSignerTransactionCount", + args: (args as unknown) as Record, + }); + }, + + checkAddress: async ( + args: Ethereum_Module_Args_checkAddress, + client: CoreClient + ): Promise> => { + return client.invoke({ + uri: Uri.from("ens/wraps.eth:ethereum@1.0.0"), + method: "checkAddress", + args: (args as unknown) as Record, + }); + }, + + toWei: async ( + args: Ethereum_Module_Args_toWei, + client: CoreClient + ): Promise> => { + return client.invoke({ + uri: Uri.from("ens/wraps.eth:ethereum@1.0.0"), + method: "toWei", + args: (args as unknown) as Record, + }); + }, + + toEth: async ( + args: Ethereum_Module_Args_toEth, + client: CoreClient + ): Promise> => { + return client.invoke({ + uri: Uri.from("ens/wraps.eth:ethereum@1.0.0"), + method: "toEth", + args: (args as unknown) as Record, + }); + }, + + estimateTransactionGas: async ( + args: Ethereum_Module_Args_estimateTransactionGas, + client: CoreClient + ): Promise> => { + return client.invoke({ + uri: Uri.from("ens/wraps.eth:ethereum@1.0.0"), + method: "estimateTransactionGas", + args: (args as unknown) as Record, + }); + }, + + awaitTransaction: async ( + args: Ethereum_Module_Args_awaitTransaction, + client: CoreClient + ): Promise> => { + return client.invoke({ + uri: Uri.from("ens/wraps.eth:ethereum@1.0.0"), + method: "awaitTransaction", + args: (args as unknown) as Record, + }); + }, + + sendTransaction: async ( + args: Ethereum_Module_Args_sendTransaction, + client: CoreClient + ): Promise> => { + return client.invoke({ + uri: Uri.from("ens/wraps.eth:ethereum@1.0.0"), + method: "sendTransaction", + args: (args as unknown) as Record, + }); + }, + + sendTransactionAndWait: async ( + args: Ethereum_Module_Args_sendTransactionAndWait, + client: CoreClient + ): Promise> => { + return client.invoke({ + uri: Uri.from("ens/wraps.eth:ethereum@1.0.0"), + method: "sendTransactionAndWait", + args: (args as unknown) as Record, + }); + }, + + deployContract: async ( + args: Ethereum_Module_Args_deployContract, + client: CoreClient + ): Promise> => { + return client.invoke({ + uri: Uri.from("ens/wraps.eth:ethereum@1.0.0"), + method: "deployContract", + args: (args as unknown) as Record, + }); + }, + + estimateContractCallGas: async ( + args: Ethereum_Module_Args_estimateContractCallGas, + client: CoreClient + ): Promise> => { + return client.invoke({ + uri: Uri.from("ens/wraps.eth:ethereum@1.0.0"), + method: "estimateContractCallGas", + args: (args as unknown) as Record, + }); + }, + + callContractMethod: async ( + args: Ethereum_Module_Args_callContractMethod, + client: CoreClient + ): Promise> => { + return client.invoke({ + uri: Uri.from("ens/wraps.eth:ethereum@1.0.0"), + method: "callContractMethod", + args: (args as unknown) as Record, + }); + }, + + callContractMethodAndWait: async ( + args: Ethereum_Module_Args_callContractMethodAndWait, + client: CoreClient + ): Promise> => { + return client.invoke({ + uri: Uri.from("ens/wraps.eth:ethereum@1.0.0"), + method: "callContractMethodAndWait", + args: (args as unknown) as Record, + }); + }, + + signMessage: async ( + args: Ethereum_Module_Args_signMessage, + client: CoreClient + ): Promise> => { + return client.invoke({ + uri: Uri.from("ens/wraps.eth:ethereum@1.0.0"), + method: "signMessage", + args: (args as unknown) as Record, + }); + }, + + signMessageBytes: async ( + args: Ethereum_Module_Args_signMessageBytes, + client: CoreClient + ): Promise> => { + return client.invoke({ + uri: Uri.from("ens/wraps.eth:ethereum@1.0.0"), + method: "signMessageBytes", + args: (args as unknown) as Record, + }); + } +} + +/// Imported Modules END /// diff --git a/packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/expected/wrap/wrap.info.ts b/packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/expected/wrap/wrap.info.ts new file mode 100644 index 0000000000..f72abef20c --- /dev/null +++ b/packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/expected/wrap/wrap.info.ts @@ -0,0 +1,2513 @@ +/// NOTE: This is an auto-generated file. +/// All modifications will be overwritten. +import { WrapManifest } from "@polywrap/wrap-manifest-types-js" + +export const manifest: WrapManifest = { + name: "Test", + type: "plugin", + version: "0.1", + abi: { + "envType": { + "kind": 65536, + "properties": [ + { + "kind": 34, + "name": "arg1", + "required": true, + "scalar": { + "kind": 4, + "name": "arg1", + "required": true, + "type": "String" + }, + "type": "String" + } + ], + "type": "Env" + }, + "importedModuleTypes": [ + { + "isInterface": false, + "kind": 256, + "methods": [ + { + "arguments": [ + { + "kind": 34, + "name": "connection", + "object": { + "kind": 8192, + "name": "connection", + "type": "Ethereum_Connection" + }, + "type": "Ethereum_Connection" + } + ], + "kind": 64, + "name": "getChainId", + "required": true, + "return": { + "kind": 34, + "name": "getChainId", + "required": true, + "scalar": { + "kind": 4, + "name": "getChainId", + "required": true, + "type": "String" + }, + "type": "String" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "address", + "required": true, + "scalar": { + "kind": 4, + "name": "address", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "method", + "required": true, + "scalar": { + "kind": 4, + "name": "method", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "array": { + "item": { + "kind": 4, + "name": "args", + "required": true, + "type": "String" + }, + "kind": 18, + "name": "args", + "scalar": { + "kind": 4, + "name": "args", + "required": true, + "type": "String" + }, + "type": "[String]" + }, + "kind": 34, + "name": "args", + "type": "[String]" + }, + { + "kind": 34, + "name": "connection", + "object": { + "kind": 8192, + "name": "connection", + "type": "Ethereum_Connection" + }, + "type": "Ethereum_Connection" + } + ], + "kind": 64, + "name": "callContractView", + "required": true, + "return": { + "kind": 34, + "name": "callContractView", + "required": true, + "scalar": { + "kind": 4, + "name": "callContractView", + "required": true, + "type": "String" + }, + "type": "String" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "address", + "required": true, + "scalar": { + "kind": 4, + "name": "address", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "method", + "required": true, + "scalar": { + "kind": 4, + "name": "method", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "array": { + "item": { + "kind": 4, + "name": "args", + "required": true, + "type": "String" + }, + "kind": 18, + "name": "args", + "scalar": { + "kind": 4, + "name": "args", + "required": true, + "type": "String" + }, + "type": "[String]" + }, + "kind": 34, + "name": "args", + "type": "[String]" + }, + { + "kind": 34, + "name": "options", + "object": { + "kind": 8192, + "name": "options", + "type": "Ethereum_TxOptions" + }, + "type": "Ethereum_TxOptions" + }, + { + "kind": 34, + "name": "connection", + "object": { + "kind": 8192, + "name": "connection", + "type": "Ethereum_Connection" + }, + "type": "Ethereum_Connection" + } + ], + "kind": 64, + "name": "callContractStatic", + "required": true, + "return": { + "kind": 34, + "name": "callContractStatic", + "object": { + "kind": 8192, + "name": "callContractStatic", + "required": true, + "type": "Ethereum_StaticTxResult" + }, + "required": true, + "type": "Ethereum_StaticTxResult" + }, + "type": "Method" + }, + { + "arguments": [ + { + "array": { + "item": { + "kind": 4, + "name": "types", + "required": true, + "type": "String" + }, + "kind": 18, + "name": "types", + "required": true, + "scalar": { + "kind": 4, + "name": "types", + "required": true, + "type": "String" + }, + "type": "[String]" + }, + "kind": 34, + "name": "types", + "required": true, + "type": "[String]" + }, + { + "array": { + "item": { + "kind": 4, + "name": "values", + "required": true, + "type": "String" + }, + "kind": 18, + "name": "values", + "required": true, + "scalar": { + "kind": 4, + "name": "values", + "required": true, + "type": "String" + }, + "type": "[String]" + }, + "kind": 34, + "name": "values", + "required": true, + "type": "[String]" + }, + { + "kind": 34, + "name": "connection", + "object": { + "kind": 8192, + "name": "connection", + "type": "Ethereum_Connection" + }, + "type": "Ethereum_Connection" + } + ], + "kind": 64, + "name": "encodeParams", + "required": true, + "return": { + "kind": 34, + "name": "encodeParams", + "required": true, + "scalar": { + "kind": 4, + "name": "encodeParams", + "required": true, + "type": "String" + }, + "type": "String" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "method", + "required": true, + "scalar": { + "kind": 4, + "name": "method", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "array": { + "item": { + "kind": 4, + "name": "args", + "required": true, + "type": "String" + }, + "kind": 18, + "name": "args", + "scalar": { + "kind": 4, + "name": "args", + "required": true, + "type": "String" + }, + "type": "[String]" + }, + "kind": 34, + "name": "args", + "type": "[String]" + }, + { + "kind": 34, + "name": "connection", + "object": { + "kind": 8192, + "name": "connection", + "type": "Ethereum_Connection" + }, + "type": "Ethereum_Connection" + } + ], + "kind": 64, + "name": "encodeFunction", + "required": true, + "return": { + "kind": 34, + "name": "encodeFunction", + "required": true, + "scalar": { + "kind": 4, + "name": "encodeFunction", + "required": true, + "type": "String" + }, + "type": "String" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "method", + "required": true, + "scalar": { + "kind": 4, + "name": "method", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "data", + "required": true, + "scalar": { + "kind": 4, + "name": "data", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "connection", + "object": { + "kind": 8192, + "name": "connection", + "type": "Ethereum_Connection" + }, + "type": "Ethereum_Connection" + } + ], + "kind": 64, + "name": "decodeFunction", + "required": true, + "return": { + "array": { + "item": { + "kind": 4, + "name": "decodeFunction", + "required": true, + "type": "String" + }, + "kind": 18, + "name": "decodeFunction", + "required": true, + "scalar": { + "kind": 4, + "name": "decodeFunction", + "required": true, + "type": "String" + }, + "type": "[String]" + }, + "kind": 34, + "name": "decodeFunction", + "required": true, + "type": "[String]" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "connection", + "object": { + "kind": 8192, + "name": "connection", + "type": "Ethereum_Connection" + }, + "type": "Ethereum_Connection" + } + ], + "kind": 64, + "name": "getSignerAddress", + "required": true, + "return": { + "kind": 34, + "name": "getSignerAddress", + "required": true, + "scalar": { + "kind": 4, + "name": "getSignerAddress", + "required": true, + "type": "String" + }, + "type": "String" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "blockTag", + "scalar": { + "kind": 4, + "name": "blockTag", + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "kind": 34, + "name": "connection", + "object": { + "kind": 8192, + "name": "connection", + "type": "Ethereum_Connection" + }, + "type": "Ethereum_Connection" + } + ], + "kind": 64, + "name": "getSignerBalance", + "required": true, + "return": { + "kind": 34, + "name": "getSignerBalance", + "required": true, + "scalar": { + "kind": 4, + "name": "getSignerBalance", + "required": true, + "type": "BigInt" + }, + "type": "BigInt" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "address", + "required": true, + "scalar": { + "kind": 4, + "name": "address", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "blockTag", + "scalar": { + "kind": 4, + "name": "blockTag", + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "kind": 34, + "name": "connection", + "object": { + "kind": 8192, + "name": "connection", + "type": "Ethereum_Connection" + }, + "type": "Ethereum_Connection" + } + ], + "kind": 64, + "name": "getBalance", + "required": true, + "return": { + "kind": 34, + "name": "getBalance", + "required": true, + "scalar": { + "kind": 4, + "name": "getBalance", + "required": true, + "type": "BigInt" + }, + "type": "BigInt" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "connection", + "object": { + "kind": 8192, + "name": "connection", + "type": "Ethereum_Connection" + }, + "type": "Ethereum_Connection" + } + ], + "kind": 64, + "name": "getGasPrice", + "required": true, + "return": { + "kind": 34, + "name": "getGasPrice", + "required": true, + "scalar": { + "kind": 4, + "name": "getGasPrice", + "required": true, + "type": "BigInt" + }, + "type": "BigInt" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "connection", + "object": { + "kind": 8192, + "name": "connection", + "type": "Ethereum_Connection" + }, + "type": "Ethereum_Connection" + } + ], + "kind": 64, + "name": "estimateEip1559Fees", + "required": true, + "return": { + "kind": 34, + "name": "estimateEip1559Fees", + "object": { + "kind": 8192, + "name": "estimateEip1559Fees", + "required": true, + "type": "Ethereum_Eip1559FeesEstimate" + }, + "required": true, + "type": "Ethereum_Eip1559FeesEstimate" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "method", + "required": true, + "scalar": { + "kind": 4, + "name": "method", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "array": { + "item": { + "kind": 4, + "name": "params", + "required": true, + "type": "String" + }, + "kind": 18, + "name": "params", + "required": true, + "scalar": { + "kind": 4, + "name": "params", + "required": true, + "type": "String" + }, + "type": "[String]" + }, + "kind": 34, + "name": "params", + "required": true, + "type": "[String]" + }, + { + "kind": 34, + "name": "connection", + "object": { + "kind": 8192, + "name": "connection", + "type": "Ethereum_Connection" + }, + "type": "Ethereum_Connection" + } + ], + "kind": 64, + "name": "sendRpc", + "required": true, + "return": { + "kind": 34, + "name": "sendRpc", + "required": true, + "scalar": { + "kind": 4, + "name": "sendRpc", + "required": true, + "type": "String" + }, + "type": "String" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "blockTag", + "scalar": { + "kind": 4, + "name": "blockTag", + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "kind": 34, + "name": "connection", + "object": { + "kind": 8192, + "name": "connection", + "type": "Ethereum_Connection" + }, + "type": "Ethereum_Connection" + } + ], + "kind": 64, + "name": "getSignerTransactionCount", + "required": true, + "return": { + "kind": 34, + "name": "getSignerTransactionCount", + "required": true, + "scalar": { + "kind": 4, + "name": "getSignerTransactionCount", + "required": true, + "type": "BigInt" + }, + "type": "BigInt" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "address", + "required": true, + "scalar": { + "kind": 4, + "name": "address", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "connection", + "object": { + "kind": 8192, + "name": "connection", + "type": "Ethereum_Connection" + }, + "type": "Ethereum_Connection" + } + ], + "kind": 64, + "name": "checkAddress", + "required": true, + "return": { + "kind": 34, + "name": "checkAddress", + "required": true, + "scalar": { + "kind": 4, + "name": "checkAddress", + "required": true, + "type": "Boolean" + }, + "type": "Boolean" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "eth", + "required": true, + "scalar": { + "kind": 4, + "name": "eth", + "required": true, + "type": "String" + }, + "type": "String" + } + ], + "kind": 64, + "name": "toWei", + "required": true, + "return": { + "kind": 34, + "name": "toWei", + "required": true, + "scalar": { + "kind": 4, + "name": "toWei", + "required": true, + "type": "String" + }, + "type": "String" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "wei", + "required": true, + "scalar": { + "kind": 4, + "name": "wei", + "required": true, + "type": "String" + }, + "type": "String" + } + ], + "kind": 64, + "name": "toEth", + "required": true, + "return": { + "kind": 34, + "name": "toEth", + "required": true, + "scalar": { + "kind": 4, + "name": "toEth", + "required": true, + "type": "String" + }, + "type": "String" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "tx", + "object": { + "kind": 8192, + "name": "tx", + "required": true, + "type": "Ethereum_TxRequest" + }, + "required": true, + "type": "Ethereum_TxRequest" + }, + { + "kind": 34, + "name": "connection", + "object": { + "kind": 8192, + "name": "connection", + "type": "Ethereum_Connection" + }, + "type": "Ethereum_Connection" + } + ], + "kind": 64, + "name": "estimateTransactionGas", + "required": true, + "return": { + "kind": 34, + "name": "estimateTransactionGas", + "required": true, + "scalar": { + "kind": 4, + "name": "estimateTransactionGas", + "required": true, + "type": "BigInt" + }, + "type": "BigInt" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "txHash", + "required": true, + "scalar": { + "kind": 4, + "name": "txHash", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "connection", + "object": { + "kind": 8192, + "name": "connection", + "type": "Ethereum_Connection" + }, + "type": "Ethereum_Connection" + } + ], + "kind": 64, + "name": "awaitTransaction", + "required": true, + "return": { + "kind": 34, + "name": "awaitTransaction", + "object": { + "kind": 8192, + "name": "awaitTransaction", + "required": true, + "type": "Ethereum_TxReceipt" + }, + "required": true, + "type": "Ethereum_TxReceipt" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "tx", + "object": { + "kind": 8192, + "name": "tx", + "required": true, + "type": "Ethereum_TxRequest" + }, + "required": true, + "type": "Ethereum_TxRequest" + }, + { + "kind": 34, + "name": "connection", + "object": { + "kind": 8192, + "name": "connection", + "type": "Ethereum_Connection" + }, + "type": "Ethereum_Connection" + } + ], + "kind": 64, + "name": "sendTransaction", + "required": true, + "return": { + "kind": 34, + "name": "sendTransaction", + "object": { + "kind": 8192, + "name": "sendTransaction", + "required": true, + "type": "Ethereum_TxResponse" + }, + "required": true, + "type": "Ethereum_TxResponse" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "tx", + "object": { + "kind": 8192, + "name": "tx", + "required": true, + "type": "Ethereum_TxRequest" + }, + "required": true, + "type": "Ethereum_TxRequest" + }, + { + "kind": 34, + "name": "connection", + "object": { + "kind": 8192, + "name": "connection", + "type": "Ethereum_Connection" + }, + "type": "Ethereum_Connection" + } + ], + "kind": 64, + "name": "sendTransactionAndWait", + "required": true, + "return": { + "kind": 34, + "name": "sendTransactionAndWait", + "object": { + "kind": 8192, + "name": "sendTransactionAndWait", + "required": true, + "type": "Ethereum_TxReceipt" + }, + "required": true, + "type": "Ethereum_TxReceipt" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "abi", + "required": true, + "scalar": { + "kind": 4, + "name": "abi", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "bytecode", + "required": true, + "scalar": { + "kind": 4, + "name": "bytecode", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "array": { + "item": { + "kind": 4, + "name": "args", + "required": true, + "type": "String" + }, + "kind": 18, + "name": "args", + "scalar": { + "kind": 4, + "name": "args", + "required": true, + "type": "String" + }, + "type": "[String]" + }, + "kind": 34, + "name": "args", + "type": "[String]" + }, + { + "kind": 34, + "name": "options", + "object": { + "kind": 8192, + "name": "options", + "type": "Ethereum_TxOptions" + }, + "type": "Ethereum_TxOptions" + }, + { + "kind": 34, + "name": "connection", + "object": { + "kind": 8192, + "name": "connection", + "type": "Ethereum_Connection" + }, + "type": "Ethereum_Connection" + } + ], + "kind": 64, + "name": "deployContract", + "required": true, + "return": { + "kind": 34, + "name": "deployContract", + "required": true, + "scalar": { + "kind": 4, + "name": "deployContract", + "required": true, + "type": "String" + }, + "type": "String" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "address", + "required": true, + "scalar": { + "kind": 4, + "name": "address", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "method", + "required": true, + "scalar": { + "kind": 4, + "name": "method", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "array": { + "item": { + "kind": 4, + "name": "args", + "required": true, + "type": "String" + }, + "kind": 18, + "name": "args", + "scalar": { + "kind": 4, + "name": "args", + "required": true, + "type": "String" + }, + "type": "[String]" + }, + "kind": 34, + "name": "args", + "type": "[String]" + }, + { + "kind": 34, + "name": "options", + "object": { + "kind": 8192, + "name": "options", + "type": "Ethereum_TxOptions" + }, + "type": "Ethereum_TxOptions" + }, + { + "kind": 34, + "name": "connection", + "object": { + "kind": 8192, + "name": "connection", + "type": "Ethereum_Connection" + }, + "type": "Ethereum_Connection" + } + ], + "kind": 64, + "name": "estimateContractCallGas", + "required": true, + "return": { + "kind": 34, + "name": "estimateContractCallGas", + "required": true, + "scalar": { + "kind": 4, + "name": "estimateContractCallGas", + "required": true, + "type": "BigInt" + }, + "type": "BigInt" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "address", + "required": true, + "scalar": { + "kind": 4, + "name": "address", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "method", + "required": true, + "scalar": { + "kind": 4, + "name": "method", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "array": { + "item": { + "kind": 4, + "name": "args", + "required": true, + "type": "String" + }, + "kind": 18, + "name": "args", + "scalar": { + "kind": 4, + "name": "args", + "required": true, + "type": "String" + }, + "type": "[String]" + }, + "kind": 34, + "name": "args", + "type": "[String]" + }, + { + "kind": 34, + "name": "options", + "object": { + "kind": 8192, + "name": "options", + "type": "Ethereum_TxOptions" + }, + "type": "Ethereum_TxOptions" + }, + { + "kind": 34, + "name": "connection", + "object": { + "kind": 8192, + "name": "connection", + "type": "Ethereum_Connection" + }, + "type": "Ethereum_Connection" + } + ], + "kind": 64, + "name": "callContractMethod", + "required": true, + "return": { + "kind": 34, + "name": "callContractMethod", + "object": { + "kind": 8192, + "name": "callContractMethod", + "required": true, + "type": "Ethereum_TxResponse" + }, + "required": true, + "type": "Ethereum_TxResponse" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "address", + "required": true, + "scalar": { + "kind": 4, + "name": "address", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "method", + "required": true, + "scalar": { + "kind": 4, + "name": "method", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "array": { + "item": { + "kind": 4, + "name": "args", + "required": true, + "type": "String" + }, + "kind": 18, + "name": "args", + "scalar": { + "kind": 4, + "name": "args", + "required": true, + "type": "String" + }, + "type": "[String]" + }, + "kind": 34, + "name": "args", + "type": "[String]" + }, + { + "kind": 34, + "name": "options", + "object": { + "kind": 8192, + "name": "options", + "type": "Ethereum_TxOptions" + }, + "type": "Ethereum_TxOptions" + }, + { + "kind": 34, + "name": "connection", + "object": { + "kind": 8192, + "name": "connection", + "type": "Ethereum_Connection" + }, + "type": "Ethereum_Connection" + } + ], + "kind": 64, + "name": "callContractMethodAndWait", + "required": true, + "return": { + "kind": 34, + "name": "callContractMethodAndWait", + "object": { + "kind": 8192, + "name": "callContractMethodAndWait", + "required": true, + "type": "Ethereum_TxReceipt" + }, + "required": true, + "type": "Ethereum_TxReceipt" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "message", + "required": true, + "scalar": { + "kind": 4, + "name": "message", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "connection", + "object": { + "kind": 8192, + "name": "connection", + "type": "Ethereum_Connection" + }, + "type": "Ethereum_Connection" + } + ], + "kind": 64, + "name": "signMessage", + "required": true, + "return": { + "kind": 34, + "name": "signMessage", + "required": true, + "scalar": { + "kind": 4, + "name": "signMessage", + "required": true, + "type": "String" + }, + "type": "String" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "bytes", + "required": true, + "scalar": { + "kind": 4, + "name": "bytes", + "required": true, + "type": "Bytes" + }, + "type": "Bytes" + }, + { + "kind": 34, + "name": "connection", + "object": { + "kind": 8192, + "name": "connection", + "type": "Ethereum_Connection" + }, + "type": "Ethereum_Connection" + } + ], + "kind": 64, + "name": "signMessageBytes", + "required": true, + "return": { + "kind": 34, + "name": "signMessageBytes", + "required": true, + "scalar": { + "kind": 4, + "name": "signMessageBytes", + "required": true, + "type": "String" + }, + "type": "String" + }, + "type": "Method" + } + ], + "namespace": "Ethereum", + "nativeType": "Module", + "type": "Ethereum_Module", + "uri": "ens/wraps.eth:ethereum@1.0.0" + } + ], + "importedObjectTypes": [ + { + "kind": 1025, + "namespace": "Ethereum", + "nativeType": "Connection", + "properties": [ + { + "kind": 34, + "name": "node", + "scalar": { + "kind": 4, + "name": "node", + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "networkNameOrChainId", + "scalar": { + "kind": 4, + "name": "networkNameOrChainId", + "type": "String" + }, + "type": "String" + } + ], + "type": "Ethereum_Connection", + "uri": "ens/wraps.eth:ethereum@1.0.0" + }, + { + "kind": 1025, + "namespace": "Ethereum", + "nativeType": "TxOptions", + "properties": [ + { + "comment": "Gas supplied for the transaction", + "kind": 34, + "name": "gasLimit", + "scalar": { + "kind": 4, + "name": "gasLimit", + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "comment": " The max total fee to pay per unit of gas.\nThe difference between maxFeePerGas and baseFeePerGas + maxPriorityFeePerGas is “refunded” to the user.\nThis property is ignored when gasPrice is not null.", + "kind": 34, + "name": "maxFeePerGas", + "scalar": { + "kind": 4, + "name": "maxFeePerGas", + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "comment": " The gas price paid is baseFeePerGas + maxPriorityFeePerGas.\nThe difference between maxFeePerGas and baseFeePerGas + maxPriorityFeePerGas is “refunded” to the user.\nThis property is ignored when gasPrice is not null.", + "kind": 34, + "name": "maxPriorityFeePerGas", + "scalar": { + "kind": 4, + "name": "maxPriorityFeePerGas", + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "comment": " The gas price for legacy transactions.\nIf this property is not null, a legacy transaction will be sent and maxFeePerGas and maxPriorityFeePerGas will be ignored.", + "kind": 34, + "name": "gasPrice", + "scalar": { + "kind": 4, + "name": "gasPrice", + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "comment": "Ether value sent with transaction", + "kind": 34, + "name": "value", + "scalar": { + "kind": 4, + "name": "value", + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "comment": "Override default nonce", + "kind": 34, + "name": "nonce", + "scalar": { + "kind": 4, + "name": "nonce", + "type": "UInt32" + }, + "type": "UInt32" + } + ], + "type": "Ethereum_TxOptions", + "uri": "ens/wraps.eth:ethereum@1.0.0" + }, + { + "kind": 1025, + "namespace": "Ethereum", + "nativeType": "StaticTxResult", + "properties": [ + { + "kind": 34, + "name": "result", + "required": true, + "scalar": { + "kind": 4, + "name": "result", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "error", + "required": true, + "scalar": { + "kind": 4, + "name": "error", + "required": true, + "type": "Boolean" + }, + "type": "Boolean" + } + ], + "type": "Ethereum_StaticTxResult", + "uri": "ens/wraps.eth:ethereum@1.0.0" + }, + { + "kind": 1025, + "namespace": "Ethereum", + "nativeType": "Eip1559FeesEstimate", + "properties": [ + { + "kind": 34, + "name": "maxFeePerGas", + "required": true, + "scalar": { + "kind": 4, + "name": "maxFeePerGas", + "required": true, + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "kind": 34, + "name": "maxPriorityFeePerGas", + "required": true, + "scalar": { + "kind": 4, + "name": "maxPriorityFeePerGas", + "required": true, + "type": "BigInt" + }, + "type": "BigInt" + } + ], + "type": "Ethereum_Eip1559FeesEstimate", + "uri": "ens/wraps.eth:ethereum@1.0.0" + }, + { + "kind": 1025, + "namespace": "Ethereum", + "nativeType": "TxRequest", + "properties": [ + { + "kind": 34, + "name": "to", + "scalar": { + "kind": 4, + "name": "to", + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "from", + "scalar": { + "kind": 4, + "name": "from", + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "data", + "scalar": { + "kind": 4, + "name": "data", + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "type", + "scalar": { + "kind": 4, + "name": "type", + "type": "UInt32" + }, + "type": "UInt32" + }, + { + "kind": 34, + "name": "chainId", + "scalar": { + "kind": 4, + "name": "chainId", + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "array": { + "item": { + "kind": 8192, + "name": "accessList", + "required": true, + "type": "Ethereum_AccessItem" + }, + "kind": 18, + "name": "accessList", + "object": { + "kind": 8192, + "name": "accessList", + "required": true, + "type": "Ethereum_AccessItem" + }, + "type": "[Ethereum_AccessItem]" + }, + "kind": 34, + "name": "accessList", + "type": "[Ethereum_AccessItem]" + }, + { + "comment": "Gas supplied for the transaction", + "kind": 34, + "name": "gasLimit", + "scalar": { + "kind": 4, + "name": "gasLimit", + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "comment": " The max total fee to pay per unit of gas.\nThe difference between maxFeePerGas and baseFeePerGas + maxPriorityFeePerGas is “refunded” to the user.\nThis property is ignored when gasPrice is not null.", + "kind": 34, + "name": "maxFeePerGas", + "scalar": { + "kind": 4, + "name": "maxFeePerGas", + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "comment": " The gas price paid is baseFeePerGas + maxPriorityFeePerGas.\nThe difference between maxFeePerGas and baseFeePerGas + maxPriorityFeePerGas is “refunded” to the user.\nThis property is ignored when gasPrice is not null.", + "kind": 34, + "name": "maxPriorityFeePerGas", + "scalar": { + "kind": 4, + "name": "maxPriorityFeePerGas", + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "comment": " The gas price for legacy transactions.\nIf this property is not null, a legacy transaction will be sent and maxFeePerGas and maxPriorityFeePerGas will be ignored.", + "kind": 34, + "name": "gasPrice", + "scalar": { + "kind": 4, + "name": "gasPrice", + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "comment": "Ether value sent with transaction", + "kind": 34, + "name": "value", + "scalar": { + "kind": 4, + "name": "value", + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "comment": "Override default nonce", + "kind": 34, + "name": "nonce", + "scalar": { + "kind": 4, + "name": "nonce", + "type": "UInt32" + }, + "type": "UInt32" + } + ], + "type": "Ethereum_TxRequest", + "uri": "ens/wraps.eth:ethereum@1.0.0" + }, + { + "kind": 1025, + "namespace": "Ethereum", + "nativeType": "AccessItem", + "properties": [ + { + "kind": 34, + "name": "address", + "required": true, + "scalar": { + "kind": 4, + "name": "address", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "array": { + "item": { + "kind": 4, + "name": "storageKeys", + "required": true, + "type": "String" + }, + "kind": 18, + "name": "storageKeys", + "required": true, + "scalar": { + "kind": 4, + "name": "storageKeys", + "required": true, + "type": "String" + }, + "type": "[String]" + }, + "kind": 34, + "name": "storageKeys", + "required": true, + "type": "[String]" + } + ], + "type": "Ethereum_AccessItem", + "uri": "ens/wraps.eth:ethereum@1.0.0" + }, + { + "kind": 1025, + "namespace": "Ethereum", + "nativeType": "TxReceipt", + "properties": [ + { + "kind": 34, + "name": "to", + "required": true, + "scalar": { + "kind": 4, + "name": "to", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "from", + "required": true, + "scalar": { + "kind": 4, + "name": "from", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "contractAddress", + "required": true, + "scalar": { + "kind": 4, + "name": "contractAddress", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "transactionIndex", + "required": true, + "scalar": { + "kind": 4, + "name": "transactionIndex", + "required": true, + "type": "UInt32" + }, + "type": "UInt32" + }, + { + "kind": 34, + "name": "root", + "scalar": { + "kind": 4, + "name": "root", + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "gasUsed", + "required": true, + "scalar": { + "kind": 4, + "name": "gasUsed", + "required": true, + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "kind": 34, + "name": "logsBloom", + "required": true, + "scalar": { + "kind": 4, + "name": "logsBloom", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "transactionHash", + "required": true, + "scalar": { + "kind": 4, + "name": "transactionHash", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "array": { + "item": { + "kind": 8192, + "name": "logs", + "required": true, + "type": "Ethereum_Log" + }, + "kind": 18, + "name": "logs", + "object": { + "kind": 8192, + "name": "logs", + "required": true, + "type": "Ethereum_Log" + }, + "required": true, + "type": "[Ethereum_Log]" + }, + "kind": 34, + "name": "logs", + "required": true, + "type": "[Ethereum_Log]" + }, + { + "kind": 34, + "name": "blockNumber", + "required": true, + "scalar": { + "kind": 4, + "name": "blockNumber", + "required": true, + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "kind": 34, + "name": "blockHash", + "required": true, + "scalar": { + "kind": 4, + "name": "blockHash", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "confirmations", + "required": true, + "scalar": { + "kind": 4, + "name": "confirmations", + "required": true, + "type": "UInt32" + }, + "type": "UInt32" + }, + { + "kind": 34, + "name": "cumulativeGasUsed", + "required": true, + "scalar": { + "kind": 4, + "name": "cumulativeGasUsed", + "required": true, + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "kind": 34, + "name": "effectiveGasPrice", + "required": true, + "scalar": { + "kind": 4, + "name": "effectiveGasPrice", + "required": true, + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "kind": 34, + "name": "type", + "required": true, + "scalar": { + "kind": 4, + "name": "type", + "required": true, + "type": "UInt32" + }, + "type": "UInt32" + }, + { + "kind": 34, + "name": "status", + "scalar": { + "kind": 4, + "name": "status", + "type": "UInt32" + }, + "type": "UInt32" + } + ], + "type": "Ethereum_TxReceipt", + "uri": "ens/wraps.eth:ethereum@1.0.0" + }, + { + "kind": 1025, + "namespace": "Ethereum", + "nativeType": "Log", + "properties": [ + { + "kind": 34, + "name": "blockNumber", + "required": true, + "scalar": { + "kind": 4, + "name": "blockNumber", + "required": true, + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "kind": 34, + "name": "blockHash", + "required": true, + "scalar": { + "kind": 4, + "name": "blockHash", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "transactionIndex", + "required": true, + "scalar": { + "kind": 4, + "name": "transactionIndex", + "required": true, + "type": "UInt32" + }, + "type": "UInt32" + }, + { + "kind": 34, + "name": "removed", + "required": true, + "scalar": { + "kind": 4, + "name": "removed", + "required": true, + "type": "Boolean" + }, + "type": "Boolean" + }, + { + "kind": 34, + "name": "address", + "required": true, + "scalar": { + "kind": 4, + "name": "address", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "data", + "required": true, + "scalar": { + "kind": 4, + "name": "data", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "array": { + "item": { + "kind": 4, + "name": "topics", + "required": true, + "type": "String" + }, + "kind": 18, + "name": "topics", + "required": true, + "scalar": { + "kind": 4, + "name": "topics", + "required": true, + "type": "String" + }, + "type": "[String]" + }, + "kind": 34, + "name": "topics", + "required": true, + "type": "[String]" + }, + { + "kind": 34, + "name": "transactionHash", + "required": true, + "scalar": { + "kind": 4, + "name": "transactionHash", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "logIndex", + "required": true, + "scalar": { + "kind": 4, + "name": "logIndex", + "required": true, + "type": "UInt32" + }, + "type": "UInt32" + } + ], + "type": "Ethereum_Log", + "uri": "ens/wraps.eth:ethereum@1.0.0" + }, + { + "kind": 1025, + "namespace": "Ethereum", + "nativeType": "TxResponse", + "properties": [ + { + "kind": 34, + "name": "hash", + "required": true, + "scalar": { + "kind": 4, + "name": "hash", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "to", + "scalar": { + "kind": 4, + "name": "to", + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "from", + "required": true, + "scalar": { + "kind": 4, + "name": "from", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "nonce", + "required": true, + "scalar": { + "kind": 4, + "name": "nonce", + "required": true, + "type": "UInt32" + }, + "type": "UInt32" + }, + { + "kind": 34, + "name": "gasLimit", + "required": true, + "scalar": { + "kind": 4, + "name": "gasLimit", + "required": true, + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "kind": 34, + "name": "maxFeePerGas", + "scalar": { + "kind": 4, + "name": "maxFeePerGas", + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "kind": 34, + "name": "maxPriorityFeePerGas", + "scalar": { + "kind": 4, + "name": "maxPriorityFeePerGas", + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "kind": 34, + "name": "gasPrice", + "scalar": { + "kind": 4, + "name": "gasPrice", + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "kind": 34, + "name": "value", + "required": true, + "scalar": { + "kind": 4, + "name": "value", + "required": true, + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "kind": 34, + "name": "chainId", + "required": true, + "scalar": { + "kind": 4, + "name": "chainId", + "required": true, + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "kind": 34, + "name": "blockNumber", + "scalar": { + "kind": 4, + "name": "blockNumber", + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "kind": 34, + "name": "blockHash", + "scalar": { + "kind": 4, + "name": "blockHash", + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "timestamp", + "scalar": { + "kind": 4, + "name": "timestamp", + "type": "UInt32" + }, + "type": "UInt32" + }, + { + "kind": 34, + "name": "r", + "scalar": { + "kind": 4, + "name": "r", + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "s", + "scalar": { + "kind": 4, + "name": "s", + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "v", + "scalar": { + "kind": 4, + "name": "v", + "type": "UInt32" + }, + "type": "UInt32" + }, + { + "kind": 34, + "name": "type", + "scalar": { + "kind": 4, + "name": "type", + "type": "UInt32" + }, + "type": "UInt32" + }, + { + "array": { + "item": { + "kind": 8192, + "name": "accessList", + "required": true, + "type": "Ethereum_AccessItem" + }, + "kind": 18, + "name": "accessList", + "object": { + "kind": 8192, + "name": "accessList", + "required": true, + "type": "Ethereum_AccessItem" + }, + "type": "[Ethereum_AccessItem]" + }, + "kind": 34, + "name": "accessList", + "type": "[Ethereum_AccessItem]" + } + ], + "type": "Ethereum_TxResponse", + "uri": "ens/wraps.eth:ethereum@1.0.0" + } + ], + "moduleType": { + "imports": [ + { + "type": "Ethereum_Module" + }, + { + "type": "Ethereum_Connection" + }, + { + "type": "Ethereum_TxOptions" + }, + { + "type": "Ethereum_StaticTxResult" + }, + { + "type": "Ethereum_Eip1559FeesEstimate" + }, + { + "type": "Ethereum_TxRequest" + }, + { + "type": "Ethereum_AccessItem" + }, + { + "type": "Ethereum_TxReceipt" + }, + { + "type": "Ethereum_Log" + }, + { + "type": "Ethereum_TxResponse" + } + ], + "kind": 128, + "methods": [ + { + "arguments": [ + { + "kind": 34, + "name": "str", + "required": true, + "scalar": { + "kind": 4, + "name": "str", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "optStr", + "scalar": { + "kind": 4, + "name": "optStr", + "type": "String" + }, + "type": "String" + } + ], + "kind": 64, + "name": "methodOne", + "required": true, + "return": { + "kind": 34, + "name": "methodOne", + "object": { + "kind": 8192, + "name": "methodOne", + "required": true, + "type": "Object" + }, + "required": true, + "type": "Object" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "arg", + "required": true, + "scalar": { + "kind": 4, + "name": "arg", + "required": true, + "type": "UInt32" + }, + "type": "UInt32" + } + ], + "kind": 64, + "name": "methodTwo", + "required": true, + "return": { + "kind": 34, + "name": "methodTwo", + "required": true, + "scalar": { + "kind": 4, + "name": "methodTwo", + "required": true, + "type": "String" + }, + "type": "String" + }, + "type": "Method" + } + ], + "type": "Module" + }, + "objectTypes": [ + { + "kind": 1, + "properties": [ + { + "kind": 34, + "name": "u", + "required": true, + "scalar": { + "kind": 4, + "name": "u", + "required": true, + "type": "UInt" + }, + "type": "UInt" + }, + { + "array": { + "item": { + "kind": 4, + "name": "array", + "required": true, + "type": "Boolean" + }, + "kind": 18, + "name": "array", + "required": true, + "scalar": { + "kind": 4, + "name": "array", + "required": true, + "type": "Boolean" + }, + "type": "[Boolean]" + }, + "kind": 34, + "name": "array", + "required": true, + "type": "[Boolean]" + }, + { + "kind": 34, + "name": "bytes", + "scalar": { + "kind": 4, + "name": "bytes", + "type": "Bytes" + }, + "type": "Bytes" + } + ], + "type": "Object" + } + ], + "version": "0.1" +} +} diff --git a/packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/polywrap.yaml b/packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/polywrap.yaml new file mode 100644 index 0000000000..40837fd943 --- /dev/null +++ b/packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/polywrap.yaml @@ -0,0 +1,4 @@ +format: 0.5.0 +project: + name: Test + type: plugin/typescript diff --git a/packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/schema.graphql b/packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/schema.graphql new file mode 100644 index 0000000000..4406bc74ce --- /dev/null +++ b/packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/schema.graphql @@ -0,0 +1,22 @@ +#import { Module } into Ethereum from "ens/wraps.eth:ethereum@1.0.0" + +type Module { + methodOne( + str: String! + optStr: String + ): Object! + + methodTwo( + arg: UInt32! + ): String! +} + +type Object { + u: UInt! + array: [Boolean!]! + bytes: Bytes +} + +type Env { + arg1: String! +} diff --git a/packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/src/index.ts b/packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/src/index.ts new file mode 100644 index 0000000000..5bb85ff3e4 --- /dev/null +++ b/packages/test-cases/cases/cli/codegen/plugin/009-manifest-defaults/src/index.ts @@ -0,0 +1 @@ +export * from "./wrap"; diff --git a/packages/test-cases/cases/cli/codegen/wasm/001-sanity-assemblyscript/polywrap.yaml b/packages/test-cases/cases/cli/codegen/wasm/001-sanity-assemblyscript/polywrap.yaml index 59f654c7b3..d5eb746cd0 100644 --- a/packages/test-cases/cases/cli/codegen/wasm/001-sanity-assemblyscript/polywrap.yaml +++ b/packages/test-cases/cases/cli/codegen/wasm/001-sanity-assemblyscript/polywrap.yaml @@ -1,4 +1,4 @@ -format: 0.5.0 +format: 0.6.0 project: name: test-project type: wasm/assemblyscript diff --git a/packages/test-cases/cases/cli/codegen/wasm/002-sanity-rust/polywrap.yaml b/packages/test-cases/cases/cli/codegen/wasm/002-sanity-rust/polywrap.yaml index ae4b4ebd7a..cf5a5cba4a 100644 --- a/packages/test-cases/cases/cli/codegen/wasm/002-sanity-rust/polywrap.yaml +++ b/packages/test-cases/cases/cli/codegen/wasm/002-sanity-rust/polywrap.yaml @@ -1,4 +1,4 @@ -format: 0.5.0 +format: 0.6.0 project: name: ObjectTypes type: wasm/rust diff --git a/packages/test-cases/cases/cli/codegen/wasm/003-invalid-codegen-script/polywrap.yaml b/packages/test-cases/cases/cli/codegen/wasm/003-invalid-codegen-script/polywrap.yaml index ee9034f333..59f654c7b3 100644 --- a/packages/test-cases/cases/cli/codegen/wasm/003-invalid-codegen-script/polywrap.yaml +++ b/packages/test-cases/cases/cli/codegen/wasm/003-invalid-codegen-script/polywrap.yaml @@ -1,4 +1,4 @@ -format: 0.4.0 +format: 0.5.0 project: name: test-project type: wasm/assemblyscript diff --git a/packages/test-cases/cases/cli/codegen/wasm/004-codegen-script/polywrap.yaml b/packages/test-cases/cases/cli/codegen/wasm/004-codegen-script/polywrap.yaml index 24250643cf..42c178a22c 100644 --- a/packages/test-cases/cases/cli/codegen/wasm/004-codegen-script/polywrap.yaml +++ b/packages/test-cases/cases/cli/codegen/wasm/004-codegen-script/polywrap.yaml @@ -1,4 +1,4 @@ -format: 0.4.0 +format: 0.5.0 project: name: test-project type: wasm/assemblyscript diff --git a/packages/test-cases/cases/cli/codegen/wasm/005-custom-config/polywrap.yaml b/packages/test-cases/cases/cli/codegen/wasm/005-custom-config/polywrap.yaml index ee9034f333..59f654c7b3 100644 --- a/packages/test-cases/cases/cli/codegen/wasm/005-custom-config/polywrap.yaml +++ b/packages/test-cases/cases/cli/codegen/wasm/005-custom-config/polywrap.yaml @@ -1,4 +1,4 @@ -format: 0.4.0 +format: 0.5.0 project: name: test-project type: wasm/assemblyscript diff --git a/packages/test-cases/cases/cli/codegen/wasm/007-override-config/polywrap.yaml b/packages/test-cases/cases/cli/codegen/wasm/007-override-config/polywrap.yaml index ee9034f333..59f654c7b3 100644 --- a/packages/test-cases/cases/cli/codegen/wasm/007-override-config/polywrap.yaml +++ b/packages/test-cases/cases/cli/codegen/wasm/007-override-config/polywrap.yaml @@ -1,4 +1,4 @@ -format: 0.4.0 +format: 0.5.0 project: name: test-project type: wasm/assemblyscript diff --git a/packages/test-cases/cases/cli/codegen/wasm/008-sanity-golang/polywrap.yaml b/packages/test-cases/cases/cli/codegen/wasm/008-sanity-golang/polywrap.yaml index 07650dd125..be21a65d27 100644 --- a/packages/test-cases/cases/cli/codegen/wasm/008-sanity-golang/polywrap.yaml +++ b/packages/test-cases/cases/cli/codegen/wasm/008-sanity-golang/polywrap.yaml @@ -1,4 +1,4 @@ -format: 0.4.0 +format: 0.5.0 project: name: ObjectTypes type: wasm/golang diff --git a/packages/test-cases/cases/cli/codegen/wasm/009-manifest-defaults/expected/stdout.json b/packages/test-cases/cases/cli/codegen/wasm/009-manifest-defaults/expected/stdout.json new file mode 100644 index 0000000000..735a6dca2c --- /dev/null +++ b/packages/test-cases/cases/cli/codegen/wasm/009-manifest-defaults/expected/stdout.json @@ -0,0 +1,4 @@ +{ + "stdout": "Types were generated successfully", + "exitCode": 0 +} diff --git a/packages/test-cases/cases/cli/codegen/wasm/009-manifest-defaults/package.json b/packages/test-cases/cases/cli/codegen/wasm/009-manifest-defaults/package.json new file mode 100644 index 0000000000..e5fdea3933 --- /dev/null +++ b/packages/test-cases/cases/cli/codegen/wasm/009-manifest-defaults/package.json @@ -0,0 +1,15 @@ +{ + "name": "@polywrap/test-project", + "version": "0.1.0", + "license": "MIT", + "private": true, + "scripts": { + "build": "polywrap build" + }, + "dependencies": { + "@polywrap/wasm-as": "^0.11.0" + }, + "devDependencies": { + "assemblyscript": "0.19.23" + } +} diff --git a/packages/test-cases/cases/cli/codegen/wasm/009-manifest-defaults/polywrap-norun.gen.js b/packages/test-cases/cases/cli/codegen/wasm/009-manifest-defaults/polywrap-norun.gen.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/test-cases/cases/cli/codegen/wasm/009-manifest-defaults/polywrap.build.yaml b/packages/test-cases/cases/cli/codegen/wasm/009-manifest-defaults/polywrap.build.yaml new file mode 100644 index 0000000000..42190a0512 --- /dev/null +++ b/packages/test-cases/cases/cli/codegen/wasm/009-manifest-defaults/polywrap.build.yaml @@ -0,0 +1,10 @@ +format: 0.2.0 +strategies: + image: + node_version: "14.16.0" + include: + - ./src + - ./package.json +linked_packages: + - name: "@polywrap/wasm-as" + path: ../../../../../../wasm/as diff --git a/packages/test-cases/cases/cli/codegen/wasm/009-manifest-defaults/polywrap.yaml b/packages/test-cases/cases/cli/codegen/wasm/009-manifest-defaults/polywrap.yaml new file mode 100644 index 0000000000..289323dedc --- /dev/null +++ b/packages/test-cases/cases/cli/codegen/wasm/009-manifest-defaults/polywrap.yaml @@ -0,0 +1,6 @@ +format: 0.6.0 +project: + name: test-project + type: wasm/assemblyscript +extensions: + build: ./polywrap.build.yaml diff --git a/packages/test-cases/cases/cli/codegen/wasm/009-manifest-defaults/schema.graphql b/packages/test-cases/cases/cli/codegen/wasm/009-manifest-defaults/schema.graphql new file mode 100644 index 0000000000..325e224971 --- /dev/null +++ b/packages/test-cases/cases/cli/codegen/wasm/009-manifest-defaults/schema.graphql @@ -0,0 +1,5 @@ +type Module { + method( + arg: String! + ): String! +} diff --git a/packages/test-cases/cases/cli/codegen/wasm/009-manifest-defaults/src/index.ts b/packages/test-cases/cases/cli/codegen/wasm/009-manifest-defaults/src/index.ts new file mode 100644 index 0000000000..862d4cb226 --- /dev/null +++ b/packages/test-cases/cases/cli/codegen/wasm/009-manifest-defaults/src/index.ts @@ -0,0 +1,5 @@ +import { Args_method } from "./wrap"; + +export function method(args: Args_method): string { + return args.arg; +} diff --git a/packages/test-cases/cases/cli/test/run-test-wrapper/polywrap.yaml b/packages/test-cases/cases/cli/test/run-test-wrapper/polywrap.yaml index a2a7f4c1ac..e51c894ff9 100644 --- a/packages/test-cases/cases/cli/test/run-test-wrapper/polywrap.yaml +++ b/packages/test-cases/cases/cli/test/run-test-wrapper/polywrap.yaml @@ -1,4 +1,4 @@ -format: 0.4.0 +format: 0.5.0 project: name: test-project type: wasm/assemblyscript diff --git a/yarn.lock b/yarn.lock index a387616f36..a289de26e0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -115,25 +115,25 @@ chalk "^2.4.2" "@babel/compat-data@^7.22.9": - version "7.22.9" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.22.9.tgz#71cdb00a1ce3a329ce4cbec3a44f9fef35669730" - integrity sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ== + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.22.20.tgz#8df6e96661209623f1975d66c35ffca66f3306d0" + integrity sha512-BQYjKbpXjoXwFW5jGqiizJQQT/aC7pFm9Ok1OWssonuguICi264lbgMzRp2ZMmRSlfkX6DsWDDcsrctK8Rwfiw== "@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.5": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.22.15.tgz#15d4fd03f478a459015a4b94cfbb3bd42c48d2f4" - integrity sha512-PtZqMmgRrvj8ruoEOIwVA3yoF91O+Hgw9o7DAUTNBA6Mo2jpu31clx9a7Nz/9JznqetTR6zwfC4L3LAjKQXUwA== + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.22.20.tgz#e3d0eed84c049e2a2ae0a64d27b6a37edec385b7" + integrity sha512-Y6jd1ahLubuYweD/zJH+vvOY141v4f9igNQAQ+MBgq9JlHS2iTsZKn1aMsb3vGccZsXI16VzTBw52Xx0DWmtnA== dependencies: "@ampproject/remapping" "^2.2.0" "@babel/code-frame" "^7.22.13" "@babel/generator" "^7.22.15" "@babel/helper-compilation-targets" "^7.22.15" - "@babel/helper-module-transforms" "^7.22.15" + "@babel/helper-module-transforms" "^7.22.20" "@babel/helpers" "^7.22.15" - "@babel/parser" "^7.22.15" + "@babel/parser" "^7.22.16" "@babel/template" "^7.22.15" - "@babel/traverse" "^7.22.15" - "@babel/types" "^7.22.15" + "@babel/traverse" "^7.22.20" + "@babel/types" "^7.22.19" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" @@ -170,10 +170,10 @@ lru-cache "^5.1.1" semver "^6.3.1" -"@babel/helper-environment-visitor@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz#f06dd41b7c1f44e1f8da6c4055b41ab3a09a7e98" - integrity sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q== +"@babel/helper-environment-visitor@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" + integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== "@babel/helper-function-name@^7.22.5": version "7.22.5" @@ -197,16 +197,16 @@ dependencies: "@babel/types" "^7.22.15" -"@babel/helper-module-transforms@^7.22.15": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.22.15.tgz#40ad2f6950f143900e9c1c72363c0b431a606082" - integrity sha512-l1UiX4UyHSFsYt17iQ3Se5pQQZZHa22zyIXURmvkmLCD4t/aU+dvNWHatKac/D9Vm9UES7nvIqHs4jZqKviUmQ== +"@babel/helper-module-transforms@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.22.20.tgz#da9edc14794babbe7386df438f3768067132f59e" + integrity sha512-dLT7JVWIUUxKOs1UnJUBR3S70YK+pKX6AbJgB2vMIvEkZkrfJDbYDJesnPshtKV4LhDOR3Oc5YULeDizRek+5A== dependencies: - "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-environment-visitor" "^7.22.20" "@babel/helper-module-imports" "^7.22.15" "@babel/helper-simple-access" "^7.22.5" "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/helper-validator-identifier" "^7.22.15" + "@babel/helper-validator-identifier" "^7.22.20" "@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.8.0": version "7.22.5" @@ -232,10 +232,10 @@ resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f" integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== -"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.22.15", "@babel/helper-validator-identifier@^7.22.5": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.15.tgz#601fa28e4cc06786c18912dca138cec73b882044" - integrity sha512-4E/F9IIEi8WR94324mbDUMo074YTheJmd7eZF5vITTeYchqAi6sYXRLHUVsmkdmY4QjfKTcB2jB7dVP3NaBElQ== +"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.22.19", "@babel/helper-validator-identifier@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" + integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== "@babel/helper-validator-option@^7.22.15": version "7.22.15" @@ -252,11 +252,11 @@ "@babel/types" "^7.22.15" "@babel/highlight@^7.22.13": - version "7.22.13" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.13.tgz#9cda839e5d3be9ca9e8c26b6dd69e7548f0cbf16" - integrity sha512-C/BaXcnnvBCmHTpz/VGZ8jgtE2aYlW4hxDhseJAWZb7gqGM/qtCK6iZUb0TyKFf7BOUsBH7Q7fkRsDRhg1XklQ== + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.20.tgz#4ca92b71d80554b01427815e06f2df965b9c1f54" + integrity sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg== dependencies: - "@babel/helper-validator-identifier" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.20" chalk "^2.4.2" js-tokens "^4.0.0" @@ -265,7 +265,7 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.4.tgz#6774231779dd700e0af29f6ad8d479582d7ce5ef" integrity sha512-FDge0dFazETFcxGw/EXzOkN8uJp0PC7Qbm+Pe9T+av2zlBpOgunFHkQPPn+eRuClU73JF+98D531UgayY89tow== -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.22.15": +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.22.15", "@babel/parser@^7.22.16": version "7.22.16" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.16.tgz#180aead7f247305cce6551bea2720934e2fa2c95" integrity sha512-+gPfKv8UWeKKeJTUxe59+OobVcrYHETCsORl61EmSkmgymguYk/X5bp7GuUIXaFsc6y++v8ZxPsLSSuujqDphA== @@ -363,19 +363,19 @@ "@babel/parser" "^7.22.15" "@babel/types" "^7.22.15" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.22.15": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.22.15.tgz#75be4d2d6e216e880e93017f4e2389aeb77ef2d9" - integrity sha512-DdHPwvJY0sEeN4xJU5uRLmZjgMMDIvMPniLuYzUVXj/GGzysPl0/fwt44JBkyUIzGJPV8QgHMcQdQ34XFuKTYQ== +"@babel/traverse@^7.1.0", "@babel/traverse@^7.22.15", "@babel/traverse@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.22.20.tgz#db572d9cb5c79e02d83e5618b82f6991c07584c9" + integrity sha512-eU260mPZbU7mZ0N+X10pxXhQFMGTeLb9eFS0mxehS8HZp9o1uSnFeWQuG1UPrlxgA7QoUzFhOnilHDp0AXCyHw== dependencies: "@babel/code-frame" "^7.22.13" "@babel/generator" "^7.22.15" - "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-environment-visitor" "^7.22.20" "@babel/helper-function-name" "^7.22.5" "@babel/helper-hoist-variables" "^7.22.5" "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/parser" "^7.22.15" - "@babel/types" "^7.22.15" + "@babel/parser" "^7.22.16" + "@babel/types" "^7.22.19" debug "^4.1.0" globals "^11.1.0" @@ -388,13 +388,13 @@ "@babel/helper-validator-identifier" "^7.18.6" to-fast-properties "^2.0.0" -"@babel/types@^7.0.0", "@babel/types@^7.18.2", "@babel/types@^7.20.7", "@babel/types@^7.22.15", "@babel/types@^7.22.5", "@babel/types@^7.3.3": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.22.15.tgz#266cb21d2c5fd0b3931e7a91b6dd72d2f617d282" - integrity sha512-X+NLXr0N8XXmN5ZsaQdm9U2SSC3UbIYq/doL++sueHOTisgZHoKaQtZxGuV2cUPQHMfjKEfg/g6oy7Hm6SKFtA== +"@babel/types@^7.0.0", "@babel/types@^7.18.2", "@babel/types@^7.20.7", "@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.3.3": + version "7.22.19" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.22.19.tgz#7425343253556916e440e662bb221a93ddb75684" + integrity sha512-P7LAw/LbojPzkgp5oznjE6tQEIWbp4PkkfrZDINTro9zgBRtI324/EYsiSI7lhPbpIQ+DCeR2NNmMWANGGfZsg== dependencies: "@babel/helper-string-parser" "^7.22.5" - "@babel/helper-validator-identifier" "^7.22.15" + "@babel/helper-validator-identifier" "^7.22.19" to-fast-properties "^2.0.0" "@bcherny/json-schema-ref-parser@9.0.9": @@ -2082,9 +2082,9 @@ integrity sha512-0nBr+VZNKm9tvNDZFstI3Pq1fCTEDK5OZTnVKNvBNAKgd0yIvmwsP4m61rEv7ZP+tOUjWJhROpxK5MsnlF911g== "@opentelemetry/api@^1.0.0": - version "1.4.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.4.1.tgz#ff22eb2e5d476fbc2450a196e40dd243cc20c28f" - integrity sha512-O2yRJce1GOc6PAy3QxFM4NzFiWzvScDC1/5ihYBL6BUEVdq0XMWN01sppE+H6bBXbaFYipjwFLEWLg5PaSOThA== + version "1.6.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.6.0.tgz#de2c6823203d6f319511898bb5de7e70f5267e19" + integrity sha512-OWlrQAnWn9577PhVgqjUvMr1pg57Bc4jv0iL4w0PRuOSRvq67rvHW9Ie/dZVMvCzhSCB+UxhcY/PmCmFj33Q+g== "@opentelemetry/core@1.6.0": version "1.6.0" @@ -2494,9 +2494,9 @@ "@types/node" "*" "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.7": - version "7.20.1" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.1.tgz#916ecea274b0c776fec721e333e55762d3a9614b" - integrity sha512-aACu/U/omhdk15O4Nfb+fHgH/z3QsfQzpnvRZhYhThms83ZnAOZz7zZAWO7mn2yyNQaA4xTO8GLK3uqFU4bYYw== + version "7.20.2" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.2.tgz#215db4f4a35d710256579784a548907237728756" + integrity sha512-pNpr1T1xLUc2l3xJKuPtsEky3ybxN3m4fJkknfIpTCTfIZCDW57oAg+EfCgIIp2rvCe0Wn++/FfodDS4YXxBwA== dependencies: "@babel/parser" "^7.20.7" "@babel/types" "^7.20.7" @@ -2505,24 +2505,24 @@ "@types/babel__traverse" "*" "@types/babel__generator@*": - version "7.6.4" - resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.4.tgz#1f20ce4c5b1990b37900b63f050182d28c2439b7" - integrity sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg== + version "7.6.5" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.5.tgz#281f4764bcbbbc51fdded0f25aa587b4ce14da95" + integrity sha512-h9yIuWbJKdOPLJTbmSpPzkF67e659PbQDba7ifWm5BJ8xTv+sDmS7rFmywkWOvXedGTivCdeGSIIX8WLcRTz8w== dependencies: "@babel/types" "^7.0.0" "@types/babel__template@*": - version "7.4.1" - resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.1.tgz#3d1a48fd9d6c0edfd56f2ff578daed48f36c8969" - integrity sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g== + version "7.4.2" + resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.2.tgz#843e9f1f47c957553b0c374481dc4772921d6a6b" + integrity sha512-/AVzPICMhMOMYoSx9MoKpGDKdBRsIXMNByh1PXSZoa+v6ZoLa8xxtsT/uLQ/NJm0XVAWl/BvId4MlDeXJaeIZQ== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.4", "@types/babel__traverse@^7.0.6": - version "7.20.1" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.20.1.tgz#dd6f1d2411ae677dcb2db008c962598be31d6acf" - integrity sha512-MitHFXnhtgwsGZWtT68URpOvLN4EREih1u3QtQiN4VdAxWKRVvGCSvw/Qth0M0Qq3pJpnGOu5JaM/ydK7OGbqg== + version "7.20.2" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.20.2.tgz#4ddf99d95cfdd946ff35d2b65c978d9c9bf2645d" + integrity sha512-ojlGK1Hsfce93J0+kn3H5R73elidKUaZonirN33GSmgTUMpzI/MIFfSpF3haANe3G1bEBS9/9/QEqwTzwqFsKw== dependencies: "@babel/types" "^7.20.7" @@ -2578,9 +2578,9 @@ "@types/node" "*" "@types/graceful-fs@^4.1.2": - version "4.1.6" - resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.6.tgz#e14b2576a1c25026b7f02ede1de3b84c3a1efeae" - integrity sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw== + version "4.1.7" + resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.7.tgz#30443a2e64fd51113bc3e2ba0914d47109695e2a" + integrity sha512-MhzcwU8aUygZroVwL2jeYk6JisJrPl/oov/gsgGCue9mkgl9wjGbzReYQClxiUgFDnib9FuHqTndccKeZKxTRw== dependencies: "@types/node" "*" @@ -2620,9 +2620,9 @@ pretty-format "^25.2.1" "@types/json-schema@*", "@types/json-schema@^7.0.11", "@types/json-schema@^7.0.3", "@types/json-schema@^7.0.6": - version "7.0.12" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.12.tgz#d70faba7039d5fca54c83c7dbab41051d2b6f6cb" - integrity sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA== + version "7.0.13" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.13.tgz#02c24f4363176d2d18fc8b70b9f3c54aba178a85" + integrity sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ== "@types/json5@^0.0.29": version "0.0.29" @@ -2685,9 +2685,9 @@ integrity sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA== "@types/prop-types@*": - version "15.7.5" - resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf" - integrity sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w== + version "15.7.6" + resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.6.tgz#bbf819813d6be21011b8f5801058498bec555572" + integrity sha512-RK/kBbYOQQHLYj9Z95eh7S6t7gq4Ojt/NT8HTk8bWVhA5DaF+5SMnxHKkP4gPNN3wAZkKP+VjAf0ebtYzf+fxg== "@types/react-dom@16.9.0": version "16.9.0" @@ -3135,7 +3135,7 @@ array.prototype.reduce@^1.0.6: es-array-method-boxes-properly "^1.0.0" is-string "^1.0.7" -arraybuffer.prototype.slice@^1.0.1: +arraybuffer.prototype.slice@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz#98bd561953e3e74bb34938e77647179dfe6e9f12" integrity sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw== @@ -3455,14 +3455,14 @@ browser-process-hrtime@^1.0.0: integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== browserslist@^4.21.9: - version "4.21.10" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.10.tgz#dbbac576628c13d3b2231332cb2ec5a46e015bb0" - integrity sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ== + version "4.21.11" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.11.tgz#35f74a3e51adc4d193dcd76ea13858de7b8fecb8" + integrity sha512-xn1UXOKUz7DjdGlg9RrUr0GGiWzI97UQJnugHtH0OLDfJB7jMgoIkYvRIEO1l9EeEERVqeqLYOcFBW9ldjypbQ== dependencies: - caniuse-lite "^1.0.30001517" - electron-to-chromium "^1.4.477" + caniuse-lite "^1.0.30001538" + electron-to-chromium "^1.4.526" node-releases "^2.0.13" - update-browserslist-db "^1.0.11" + update-browserslist-db "^1.0.13" bs-logger@0.x: version "0.2.6" @@ -3597,10 +3597,10 @@ camelcase@^6.0.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001517: - version "1.0.30001527" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001527.tgz#813826554828245ccee776c850566dce12bdeaba" - integrity sha512-YkJi7RwPgWtXVSgK4lG9AHH57nSzvvOp9MesgXmw4Q7n0C3H04L0foHqfxcmSAm5AcWb8dW9AYj2tR7/5GnddQ== +caniuse-lite@^1.0.30001538: + version "1.0.30001538" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001538.tgz#9dbc6b9af1ff06b5eb12350c2012b3af56744f3f" + integrity sha512-HWJnhnID+0YMtGlzcp3T9drmBJUVDchPJ08tpUGFLs9CYlwWPH2uLgpHn8fND5pCgXVtnGS3H4QR9XLMHVNkHw== capture-exit@^2.0.0: version "2.0.0" @@ -4217,11 +4217,21 @@ defaults@^1.0.3: dependencies: clone "^1.0.2" +define-data-property@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.0.tgz#0db13540704e1d8d479a0656cf781267531b9451" + integrity sha512-UzGwzcjyv3OtAvolTj1GoyNYzfFR+iqbGjcnBEENZVCpM4/Ng1yhGNvS3lR/xDS74Tb2wGG9WzNSNIOS9UVb2g== + dependencies: + get-intrinsic "^1.2.1" + gopd "^1.0.1" + has-property-descriptors "^1.0.0" + define-properties@^1.1.3, define-properties@^1.1.4, define-properties@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.0.tgz#52988570670c9eacedd8064f4a990f2405849bd5" - integrity sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA== + version "1.2.1" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c" + integrity sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg== dependencies: + define-data-property "^1.0.1" has-property-descriptors "^1.0.0" object-keys "^1.1.1" @@ -4391,10 +4401,10 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" -electron-to-chromium@^1.4.477: - version "1.4.509" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.509.tgz#9e276f8fcd70e1dfac541390da56a1ed7eea43d1" - integrity sha512-G5KlSWY0zzhANtX15tkikHl4WB7zil2Y65oT52EZUL194abjUXBZym12Ht7Bhuwm/G3LJFEqMADyv2Cks56dmg== +electron-to-chromium@^1.4.526: + version "1.4.527" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.527.tgz#5acf0bcc5bf015eb31dd2279989a3712e341a554" + integrity sha512-EafxEiEDzk2aLrdbtVczylHflHdHkNrpGNHIgDyA63sUQLQVS2ayj2hPw3RsVB42qkwURH+T2OxV7kGPUuYszA== elliptic@6.5.4: version "6.5.4" @@ -4468,18 +4478,18 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.20.4, es-abstract@^1.22.1: - 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== +es-abstract@^1.22.1: + version "1.22.2" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.22.2.tgz#90f7282d91d0ad577f505e423e52d4c1d93c1b8a" + integrity sha512-YoxfFcDmhjOgWPWsV13+2RNjq1F6UQnfs+8TftwNqtzlmFzEXvlUwdrNrYeaizfjQzRMxkZ6ElWMOJIFKdVqwA== dependencies: array-buffer-byte-length "^1.0.0" - arraybuffer.prototype.slice "^1.0.1" + arraybuffer.prototype.slice "^1.0.2" available-typed-arrays "^1.0.5" call-bind "^1.0.2" es-set-tostringtag "^2.0.1" es-to-primitive "^1.2.1" - function.prototype.name "^1.1.5" + function.prototype.name "^1.1.6" get-intrinsic "^1.2.1" get-symbol-description "^1.0.0" globalthis "^1.0.3" @@ -4495,23 +4505,23 @@ es-abstract@^1.20.4, es-abstract@^1.22.1: is-regex "^1.1.4" is-shared-array-buffer "^1.0.2" is-string "^1.0.7" - is-typed-array "^1.1.10" + is-typed-array "^1.1.12" is-weakref "^1.0.2" object-inspect "^1.12.3" object-keys "^1.1.1" object.assign "^4.1.4" - regexp.prototype.flags "^1.5.0" - safe-array-concat "^1.0.0" + regexp.prototype.flags "^1.5.1" + safe-array-concat "^1.0.1" safe-regex-test "^1.0.0" - string.prototype.trim "^1.2.7" - string.prototype.trimend "^1.0.6" - string.prototype.trimstart "^1.0.6" + string.prototype.trim "^1.2.8" + string.prototype.trimend "^1.0.7" + string.prototype.trimstart "^1.0.7" 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" - which-typed-array "^1.1.10" + which-typed-array "^1.1.11" es-array-method-boxes-properly@^1.0.0: version "1.0.0" @@ -5110,14 +5120,14 @@ flat-cache@^3.0.4: rimraf "^3.0.2" flatted@^3.2.7: - version "3.2.7" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" - integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== + version "3.2.9" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.9.tgz#7eb4c67ca1ba34232ca9d2d93e9886e611ad7daf" + integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ== follow-redirects@^1.14.0, follow-redirects@^1.15.0: - version "1.15.2" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" - integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== + version "1.15.3" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a" + integrity sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q== for-each@^0.3.3: version "0.3.3" @@ -5232,7 +5242,7 @@ function-bind@^1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== -function.prototype.name@^1.1.5: +function.prototype.name@^1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.6.tgz#cdf315b7d90ee77a4c6ee216c3c3362da07533fd" integrity sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg== @@ -6190,7 +6200,7 @@ is-text-path@^1.0.1: dependencies: text-extensions "^1.0.0" -is-typed-array@^1.1.10, is-typed-array@^1.1.9: +is-typed-array@^1.1.10, is-typed-array@^1.1.12, is-typed-array@^1.1.9: version "1.1.12" resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.12.tgz#d0bab5686ef4a76f7a73097b95470ab199c57d4a" integrity sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg== @@ -8793,14 +8803,14 @@ regex-parser@2.2.11: resolved "https://registry.yarnpkg.com/regex-parser/-/regex-parser-2.2.11.tgz#3b37ec9049e19479806e878cabe7c1ca83ccfe58" integrity sha512-jbD/FT0+9MBU2XAZluI7w2OBs1RBi6p9M83nkoZayQXXU9e8Robt69FcZc7wU4eJD/YFTjn1JdCk3rbMJajz8Q== -regexp.prototype.flags@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz#fe7ce25e7e4cca8db37b6634c8a2c7009199b9cb" - integrity sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA== +regexp.prototype.flags@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz#90ce989138db209f81492edd734183ce99f9677e" + integrity sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg== dependencies: call-bind "^1.0.2" define-properties "^1.2.0" - functions-have-names "^1.2.3" + set-function-name "^2.0.0" regexpp@^3.0.0, regexpp@^3.1.0: version "3.2.0" @@ -8891,9 +8901,9 @@ resolve-url@^0.2.1: integrity sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg== resolve@^1.1.6, resolve@^1.10.0, resolve@^1.17.0, resolve@^1.18.1, resolve@^1.22.0, resolve@^1.22.1, resolve@^1.22.4: - version "1.22.4" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.4.tgz#1dc40df46554cdaf8948a486a10f6ba1e2026c34" - integrity sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg== + version "1.22.6" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.6.tgz#dd209739eca3aef739c626fea1b4f3c506195362" + integrity sha512-njhxM7mV12JfufShqGy3Rz8j11RPdLy4xi15UurGJeoHLfJpVXKdh3ueuOqbYUcDZnffr6X739JBo5LzyahEsw== dependencies: is-core-module "^2.13.0" path-parse "^1.0.7" @@ -8937,9 +8947,9 @@ rimraf@^2.6.3: glob "^7.1.3" rollup@^3.28.0: - version "3.29.0" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.29.0.tgz#1b40e64818afc979c7e5bef93de675829288986b" - integrity sha512-nszM8DINnx1vSS+TpbWKMkxem0CDWk3cSit/WWCBVs9/JZ1I/XLwOsiUglYuYReaeWWSsW9kge5zE5NZtf/a4w== + version "3.29.2" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.29.2.tgz#cbc76cd5b03b9f9e93be991d23a1dff9c6d5b740" + integrity sha512-CJouHoZ27v6siztc21eEQGo0kIcE5D1gVPA571ez0mMYb25LGYGKnVNXpEj5MGlepmDWGXNjDB5q7uNiPHC11A== optionalDependencies: fsevents "~2.3.2" @@ -8967,7 +8977,7 @@ rxjs@^6.6.0: dependencies: tslib "^1.9.0" -safe-array-concat@^1.0.0: +safe-array-concat@^1.0.0, safe-array-concat@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.0.1.tgz#91686a63ce3adbea14d61b14c99572a8ff84754c" integrity sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q== @@ -9071,6 +9081,15 @@ set-blocking@^2.0.0, set-blocking@~2.0.0: resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== +set-function-name@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-function-name/-/set-function-name-2.0.1.tgz#12ce38b7954310b9f61faa12701620a0c882793a" + integrity sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA== + dependencies: + define-data-property "^1.0.1" + functions-have-names "^1.2.3" + has-property-descriptors "^1.0.0" + set-value@^2.0.0, set-value@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" @@ -9184,9 +9203,9 @@ smart-buffer@^4.2.0: integrity sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg== smob@^1.0.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/smob/-/smob-1.4.0.tgz#ac9751fe54b1fc1fc8286a628d4e7f824273b95a" - integrity sha512-MqR3fVulhjWuRNSMydnTlweu38UhQ0HXM4buStD/S3mc/BzX3CuM9OmhyQpmtYCvoYdl5ris6TI0ZqH355Ymqg== + version "1.4.1" + resolved "https://registry.yarnpkg.com/smob/-/smob-1.4.1.tgz#66270e7df6a7527664816c5b577a23f17ba6f5b5" + integrity sha512-9LK+E7Hv5R9u4g4C3p+jjLstaLe11MDsL21UpYaCNmapvMkYhqCV4A/f/3gyH8QjMyh6l68q9xC85vihY9ahMQ== snapdragon-node@^2.0.1: version "2.1.1" @@ -9324,9 +9343,9 @@ spdx-expression-parse@^3.0.0: spdx-license-ids "^3.0.0" spdx-license-ids@^3.0.0: - version "3.0.13" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz#7189a474c46f8d47c7b0da4b987bb45e908bd2d5" - integrity sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w== + version "3.0.15" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.15.tgz#142460aabaca062bc7cd4cc87b7d50725ed6a4ba" + integrity sha512-lpT8hSQp9jAKp9mhtBU4Xjon8LPGBvLIuBiSVhMEtmLecTh2mO0tlqrAMp47tBXzMr13NJMQ2lf7RpQGLJ3HsQ== split-on-first@^1.0.0: version "1.1.0" @@ -9434,25 +9453,25 @@ string-width@^1.0.1: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string.prototype.trim@^1.2.7: - version "1.2.7" - resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz#a68352740859f6893f14ce3ef1bb3037f7a90533" - integrity sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg== +string.prototype.trim@^1.2.8: + version "1.2.8" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz#f9ac6f8af4bd55ddfa8895e6aea92a96395393bd" + integrity sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + define-properties "^1.2.0" + es-abstract "^1.22.1" -string.prototype.trimend@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz#c4a27fa026d979d79c04f17397f250a462944533" - integrity sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ== +string.prototype.trimend@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz#1bb3afc5008661d73e2dc015cd4853732d6c471e" + integrity sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + define-properties "^1.2.0" + es-abstract "^1.22.1" -string.prototype.trimstart@^1.0.6: +string.prototype.trimstart@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz#d4cdb44b83a4737ffbac2d406e405d43d0184298" integrity sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg== @@ -9654,9 +9673,9 @@ terminal-link@^2.0.0: supports-hyperlinks "^2.0.0" terser@^5.17.4: - version "5.19.4" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.19.4.tgz#941426fa482bf9b40a0308ab2b3cd0cf7c775ebd" - integrity sha512-6p1DjHeuluwxDXcuT9VR8p64klWJKo1ILiy19s6C9+0Bh2+NWTX6nD9EPppiER4ICkHDVB1RkVpin/YW2nQn/g== + version "5.20.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.20.0.tgz#ea42aea62578703e33def47d5c5b93c49772423e" + integrity sha512-e56ETryaQDyebBwJIWYB2TT6f2EZ0fL0sW/JRXNMN26zZdKi2u/E/5my5lG6jNxym6qsrVXfFRmOdV42zlAgLQ== dependencies: "@jridgewell/source-map" "^0.3.3" acorn "^8.8.2" @@ -10106,10 +10125,10 @@ upath@^2.0.1: resolved "https://registry.yarnpkg.com/upath/-/upath-2.0.1.tgz#50c73dea68d6f6b990f51d279ce6081665d61a8b" integrity sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w== -update-browserslist-db@^1.0.11: - version "1.0.11" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz#9a2a641ad2907ae7b3616506f4b977851db5b940" - integrity sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA== +update-browserslist-db@^1.0.13: + version "1.0.13" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz#3c5e4f5c083661bd38ef64b6328c26ed6c8248c4" + integrity sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg== dependencies: escalade "^3.1.1" picocolors "^1.0.0" @@ -10234,9 +10253,9 @@ vscode-languageserver-textdocument@^1.0.3: integrity sha512-1bonkGqQs5/fxGT5UchTgjGVnfysL0O8v1AYMBjqTbWQTFn721zaPGDYFkOKtfDgFiSgXM3KwaG3FMGfW4Ed9Q== vscode-languageserver-types@^3.16.0: - version "3.17.3" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz#72d05e47b73be93acb84d6e311b5786390f13f64" - integrity sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA== + version "3.17.4" + resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.4.tgz#0b422ecbc305f364f6579ba9e32b1d7ddb7ca789" + integrity sha512-9YXi5pA3XF2V+NUQg6g+lulNS0ncRCKASYdK3Cs7kiH9sVFXWq27prjkC/B8M/xJLRPPRSPCHVMuBTgRNFh2sQ== vscode-nls@^5.0.0: version "5.2.0" @@ -10336,7 +10355,7 @@ which-module@^2.0.0: resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.1.tgz#776b1fe35d90aebe99e8ac15eb24093389a4a409" integrity sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ== -which-typed-array@^1.1.10, which-typed-array@^1.1.11: +which-typed-array@^1.1.11: version "1.1.11" resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.11.tgz#99d691f23c72aab6768680805a271b69761ed61a" integrity sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew== From 70a3f528a96211a429867cfa9ae0c7f56587b680 Mon Sep 17 00:00:00 2001 From: krisbitney Date: Fri, 22 Sep 2023 15:05:42 +0300 Subject: [PATCH 12/22] tests passing for manifest source defaults --- packages/cli/lang/en.json | 2 ++ packages/cli/lang/es.json | 2 ++ packages/cli/src/lib/project/AppProject.ts | 4 +++- packages/cli/src/lib/project/PluginProject.ts | 5 +++-- .../cli/src/lib/project/PolywrapProject.ts | 4 +++- .../cli/src/lib/project/manifests/defaults.ts | 6 +++--- .../lib/project/manifests/plugin/defaults.ts | 18 +++++++++++------- .../project/manifests/polywrap/defaults.ts | 19 +++++++++++++------ 8 files changed, 40 insertions(+), 20 deletions(-) diff --git a/packages/cli/lang/en.json b/packages/cli/lang/en.json index 0e32cb952e..72d23975e1 100644 --- a/packages/cli/lang/en.json +++ b/packages/cli/lang/en.json @@ -272,6 +272,8 @@ "lib_project_app_uri_support": "The app command supports only filesystem URIs for plugins. Examples:", "lib_project_imported_plugin_manifest_not_found": "No manifest found for imported plugin namespace `{namespace}` at path `{path}`", "lib_project_invalid_uri": "Invalid URI Received:", + "lib_project_no_default_schema": "Couldn't find schema in default paths. Please specify the schema location in the project manifest.", + "lib_project_no_default_module": "Couldn't find module entry point in default paths. Please specify the module entry point in the project manifest.", "lib_typescript_notInstalled": "Your project uses typescript, but it's not installed", "lib_typescript_tsNodeNotInstalled": "Your project uses typescript, but ts-node is not installed", "lib_watcher_alreadyWatching": "Watcher session is already in progress. Directory: {dir}", diff --git a/packages/cli/lang/es.json b/packages/cli/lang/es.json index 0e32cb952e..72d23975e1 100644 --- a/packages/cli/lang/es.json +++ b/packages/cli/lang/es.json @@ -272,6 +272,8 @@ "lib_project_app_uri_support": "The app command supports only filesystem URIs for plugins. Examples:", "lib_project_imported_plugin_manifest_not_found": "No manifest found for imported plugin namespace `{namespace}` at path `{path}`", "lib_project_invalid_uri": "Invalid URI Received:", + "lib_project_no_default_schema": "Couldn't find schema in default paths. Please specify the schema location in the project manifest.", + "lib_project_no_default_module": "Couldn't find module entry point in default paths. Please specify the module entry point in the project manifest.", "lib_typescript_notInstalled": "Your project uses typescript, but it's not installed", "lib_typescript_tsNodeNotInstalled": "Your project uses typescript, but ts-node is not installed", "lib_watcher_alreadyWatching": "Watcher session is already in progress. Directory: {dir}", diff --git a/packages/cli/src/lib/project/AppProject.ts b/packages/cli/src/lib/project/AppProject.ts index 20c2b696e0..16f2c62340 100644 --- a/packages/cli/src/lib/project/AppProject.ts +++ b/packages/cli/src/lib/project/AppProject.ts @@ -102,7 +102,9 @@ export class AppProject extends Project { `No schema path specified in project manifest with name "${manifest.project.name}". This should never happen.` ); } - return path.join(dir, manifest.source.schema); + return path.isAbsolute(manifest.source.schema) + ? manifest.source.schema + : path.join(dir, manifest.source.schema); } public async getImportAbis(): Promise< diff --git a/packages/cli/src/lib/project/PluginProject.ts b/packages/cli/src/lib/project/PluginProject.ts index 781b1768f5..71f6f95e39 100644 --- a/packages/cli/src/lib/project/PluginProject.ts +++ b/packages/cli/src/lib/project/PluginProject.ts @@ -103,7 +103,9 @@ export class PluginProject extends Project { `No schema path specified in project manifest with name "${manifest.project.name}". This should never happen.` ); } - return path.join(dir, manifest.source.schema); + return path.isAbsolute(manifest.source.schema) + ? manifest.source.schema + : path.join(dir, manifest.source.schema); } public async getImportAbis(): Promise< @@ -128,7 +130,6 @@ export class PluginProject extends Project { const moduleDirectory = await this.getGenerationDirectory( generationSubPath ); - // Clean the code generation resetDir(moduleDirectory); diff --git a/packages/cli/src/lib/project/PolywrapProject.ts b/packages/cli/src/lib/project/PolywrapProject.ts index 47b749e91c..16cd87c762 100644 --- a/packages/cli/src/lib/project/PolywrapProject.ts +++ b/packages/cli/src/lib/project/PolywrapProject.ts @@ -152,7 +152,9 @@ export class PolywrapProject extends Project { `No schema path specified in project manifest with name "${manifest.project.name}". This should never happen.` ); } - return path.join(dir, manifest.source.schema); + return path.isAbsolute(manifest.source.schema) + ? manifest.source.schema + : path.join(dir, manifest.source.schema); } public async getImportAbis(): Promise< diff --git a/packages/cli/src/lib/project/manifests/defaults.ts b/packages/cli/src/lib/project/manifests/defaults.ts index 8391a02f3a..a70e198589 100644 --- a/packages/cli/src/lib/project/manifests/defaults.ts +++ b/packages/cli/src/lib/project/manifests/defaults.ts @@ -1,3 +1,5 @@ +import { intlMsg } from "../../intl"; + import path from "path"; import fs from "fs"; @@ -16,7 +18,5 @@ export function defaultSchemaPath(manifestPath: string): string { } } - throw Error( - "Couldn't find schema in default paths. Please specify the schema location in the project manifest." - ); + throw Error(intlMsg.lib_project_no_default_schema()); } diff --git a/packages/cli/src/lib/project/manifests/plugin/defaults.ts b/packages/cli/src/lib/project/manifests/plugin/defaults.ts index 77ecdfc8ed..addd92338e 100644 --- a/packages/cli/src/lib/project/manifests/plugin/defaults.ts +++ b/packages/cli/src/lib/project/manifests/plugin/defaults.ts @@ -1,5 +1,6 @@ import { defaultSchemaPath } from "../defaults"; -import { isPluginManifestLanguage } from "./languages"; +import { isPluginManifestLanguage, pluginManifestLanguages } from "./languages"; +import { intlMsg } from "../../../intl"; import fs from "fs"; import path from "path"; @@ -27,7 +28,12 @@ function defaultModulePath( manifestPath: string ): string | undefined { if (!isPluginManifestLanguage(language)) { - throw Error(`Unsupported language: ${language}`); + throw Error( + intlMsg.lib_language_unsupportedManifestLanguage({ + language: language, + supported: Object.keys(pluginManifestLanguages).join(", "), + }) + ); } let relEntryPoint: string; @@ -42,16 +48,14 @@ function defaultModulePath( } else if (language == "plugin/kotlin") { relEntryPoint = "src/commonMain/kotlin"; } else { - throw Error(`Unsupported language: ${language}`); + throw Error(intlMsg.lib_project_no_default_module()); } const manifestDir = path.dirname(manifestPath); const absEntryPoint = path.resolve(manifestDir, relEntryPoint); if (fs.existsSync(absEntryPoint)) { - return absEntryPoint; + return relEntryPoint; } - throw Error( - "Couldn't find module entry point in default paths. Please specify the module entry point in the project manifest." - ); + throw Error(intlMsg.lib_project_no_default_module()); } diff --git a/packages/cli/src/lib/project/manifests/polywrap/defaults.ts b/packages/cli/src/lib/project/manifests/polywrap/defaults.ts index e47849cabf..698785c22a 100644 --- a/packages/cli/src/lib/project/manifests/polywrap/defaults.ts +++ b/packages/cli/src/lib/project/manifests/polywrap/defaults.ts @@ -1,5 +1,9 @@ -import { isPolywrapManifestLanguage } from "./languages"; +import { + isPolywrapManifestLanguage, + polywrapManifestLanguages, +} from "./languages"; import { defaultSchemaPath } from "../defaults"; +import { intlMsg } from "../../../intl"; import fs from "fs"; import path from "path"; @@ -27,7 +31,12 @@ function defaultModulePath( manifestPath: string ): string | undefined { if (!isPolywrapManifestLanguage(language)) { - throw Error(`Unsupported language: ${language}`); + throw Error( + intlMsg.lib_language_unsupportedManifestLanguage({ + language: language, + supported: Object.keys(polywrapManifestLanguages).join(", "), + }) + ); } let relEntryPoint: string; @@ -40,7 +49,7 @@ function defaultModulePath( } else if (language == "interface") { return undefined; } else { - throw Error(`Unsupported language: ${language}`); + throw Error(intlMsg.lib_project_no_default_module()); } const manifestDir = path.dirname(manifestPath); @@ -49,7 +58,5 @@ function defaultModulePath( return absEntryPoint; } - throw Error( - "Couldn't find module entry point in default paths. Please specify the module entry point in the project manifest." - ); + throw Error(intlMsg.lib_project_no_default_module()); } From c30a76f6f567a9b2c76a194ae5e0ae7099dc6155 Mon Sep 17 00:00:00 2001 From: krisbitney Date: Fri, 22 Sep 2023 17:49:55 +0300 Subject: [PATCH 13/22] updated polywrap-wasm-rs version in rust template --- packages/templates/wasm/rust/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/templates/wasm/rust/Cargo.toml b/packages/templates/wasm/rust/Cargo.toml index 457be6b146..a3a471c4ac 100644 --- a/packages/templates/wasm/rust/Cargo.toml +++ b/packages/templates/wasm/rust/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" include = ["src"] [dependencies] -polywrap-wasm-rs = { version = "~0.11.2" } +polywrap-wasm-rs = { version = "0.12.0" } polywrap_msgpack_serde = "0.0.2-beta.7" serde = { version = "1.0", features = ["derive"] } From 4dd0fc4b1f2f8214e4a2c8d70188e352baf49b93 Mon Sep 17 00:00:00 2001 From: nerfZael Date: Fri, 29 Sep 2023 15:45:48 +0200 Subject: [PATCH 14/22] using default ipfs providers from the default config --- packages/cli/src/lib/test-env/client-config.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/cli/src/lib/test-env/client-config.ts b/packages/cli/src/lib/test-env/client-config.ts index 7b5f67312d..66e4183430 100644 --- a/packages/cli/src/lib/test-env/client-config.ts +++ b/packages/cli/src/lib/test-env/client-config.ts @@ -29,12 +29,19 @@ export function getTestEnvClientConfig(): Partial { const ensAddress = ETH_ENS_IPFS_MODULE_CONSTANTS.ensAddresses.ensAddress; const testnetEnsResolverUri = "proxy/testnet-ens-contenthash-uri-resolver"; - const builder = new PolywrapClientConfigBuilder() - .addDefaults() + const builder = new PolywrapClientConfigBuilder().addDefaults(); + + const ipfsResolverEnv = builder.config.envs[Sys.bundle.ipfsResolver.uri]; + + builder .addEnvs({ [Sys.bundle.ipfsResolver.uri]: { provider: ipfsProvider, - retries: { tryResolveUri: 1, getFile: 1 }, + fallbackProviders: [ + ipfsResolverEnv.provider, + ipfsResolverEnv.fallbackProviders, + ], + retries: { tryResolveUri: 2, getFile: 2 }, }, [testnetEnsResolverUri]: { registryAddress: ensAddress, From c111edf97b42b9c5ac2736230f4ea55f6d48f2a7 Mon Sep 17 00:00:00 2001 From: nerfZael Date: Fri, 29 Sep 2023 19:03:31 +0200 Subject: [PATCH 15/22] formatting the ipfs resolver uri --- packages/cli/src/lib/test-env/client-config.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/lib/test-env/client-config.ts b/packages/cli/src/lib/test-env/client-config.ts index 66e4183430..999bca5a55 100644 --- a/packages/cli/src/lib/test-env/client-config.ts +++ b/packages/cli/src/lib/test-env/client-config.ts @@ -13,7 +13,7 @@ import { Connections, Connection, } from "@polywrap/ethereum-wallet-js"; -import { IWrapPackage } from "@polywrap/core-js"; +import { IWrapPackage, Uri } from "@polywrap/core-js"; export function getTestEnvClientConfig(): Partial { // TODO: move this into its own package, since it's being used everywhere? @@ -31,7 +31,8 @@ export function getTestEnvClientConfig(): Partial { const builder = new PolywrapClientConfigBuilder().addDefaults(); - const ipfsResolverEnv = builder.config.envs[Sys.bundle.ipfsResolver.uri]; + const ipfsResolverEnv = + builder.config.envs[Uri.from(Sys.bundle.ipfsResolver.uri).toString()]; builder .addEnvs({ From fc2667aacf30d6516167ec0e56d64f61754816f9 Mon Sep 17 00:00:00 2001 From: nerfZael Date: Sat, 30 Sep 2023 02:55:00 +0200 Subject: [PATCH 16/22] fixed not adding array properly --- packages/cli/src/lib/test-env/client-config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/src/lib/test-env/client-config.ts b/packages/cli/src/lib/test-env/client-config.ts index 999bca5a55..7128b2f9ae 100644 --- a/packages/cli/src/lib/test-env/client-config.ts +++ b/packages/cli/src/lib/test-env/client-config.ts @@ -40,7 +40,7 @@ export function getTestEnvClientConfig(): Partial { provider: ipfsProvider, fallbackProviders: [ ipfsResolverEnv.provider, - ipfsResolverEnv.fallbackProviders, + ...(ipfsResolverEnv.fallbackProviders as string[]), ], retries: { tryResolveUri: 2, getFile: 2 }, }, From a409897fadd5a7e2a91923b13c63b059240bd5f7 Mon Sep 17 00:00:00 2001 From: Jordan Ellis <5522128+dOrgJelli@users.noreply.github.com> Date: Mon, 2 Oct 2023 17:58:29 -0400 Subject: [PATCH 17/22] Update package.json --- packages/cli/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index b7fdc26546..4bb9b85ba5 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -30,7 +30,7 @@ "test:cmd": "jest --passWithNoTests --runInBand --verbose --forceExit", "test:unit": "yarn test:cmd -- ./src/__tests__/unit/**/*.spec.ts", "test:e2e:p1": "yarn test:cmd -- ./src/__tests__/e2e/p1/*.spec.ts", - "test:e2e:p2": "yarn test:cmd -- ./src/__tests__/e2e/p2/codegen*.spec.ts", + "test:e2e:p2": "yarn test:cmd -- ./src/__tests__/e2e/p2/*.spec.ts", "test:rust": "yarn test:cmd -- --config ./jest.rs.config.js", "test:golang": "yarn test:cmd -- --config ./jest.go.config.js", "test:typescript": "yarn test:cmd -- --config ./jest.ts.config.js", From 0926a92416e8e054d2a2e4ea1b4ff24860b49df5 Mon Sep 17 00:00:00 2001 From: Jordan Ellis <5522128+dOrgJelli@users.noreply.github.com> Date: Mon, 2 Oct 2023 18:23:09 -0400 Subject: [PATCH 18/22] Update index.ts --- packages/schema/bind/src/bindings/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/schema/bind/src/bindings/index.ts b/packages/schema/bind/src/bindings/index.ts index a330b9aa23..dc471b2626 100644 --- a/packages/schema/bind/src/bindings/index.ts +++ b/packages/schema/bind/src/bindings/index.ts @@ -51,7 +51,7 @@ export function getGenerateBindingFn( ); case "app-rs": return WrapBindgen.getGenerateBindingFn( - "wrapscan.io/polywrap/app-rust-abi-bindgen@1" + "wrapscan.io/polywrap/app-rust-abi-bindgen@2" ); case "app-swift": return WrapBindgen.getGenerateBindingFn( From 774b0b7e7c22ac7b25885af2efb76b62ec725132 Mon Sep 17 00:00:00 2001 From: dOrgJelli Date: Tue, 3 Oct 2023 00:37:41 +0200 Subject: [PATCH 19/22] chore: update WRAP_TEST_HARNESS --- WRAP_TEST_HARNESS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WRAP_TEST_HARNESS b/WRAP_TEST_HARNESS index 6c883bfdae..1f7391f92b 100644 --- a/WRAP_TEST_HARNESS +++ b/WRAP_TEST_HARNESS @@ -1 +1 @@ -kris/test-wrap-rust-2 +master From ba86766662b3aacd617f6c898de81bd95062a1c6 Mon Sep 17 00:00:00 2001 From: dOrgJelli Date: Tue, 3 Oct 2023 01:08:53 +0200 Subject: [PATCH 20/22] fix: update app-rust template to latest bindgen --- packages/templates/app/rust/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/templates/app/rust/src/lib.rs b/packages/templates/app/rust/src/lib.rs index c744392ca0..c931668588 100644 --- a/packages/templates/app/rust/src/lib.rs +++ b/packages/templates/app/rust/src/lib.rs @@ -6,14 +6,14 @@ use wrap::types::*; pub fn main() { let ipfs_provider = "https://ipfs.io"; let cid = "Qmc5gCcjYypU7y28oCALwfSvxCBskLuPKWpK4qpterKC7z"; - let ipfs = IpfsModule::new(None, None, None); + let ipfs = IpfsModule::new(None); - let data = ipfs.cat(&IpfsModuleArgsCat{ + let data = ipfs.cat(&IpfsArgsCat{ cid: cid.to_string(), ipfs_provider: ipfs_provider.to_string(), timeout: None, cat_options: None - }, None, None, None).unwrap(); + }, None).unwrap(); assert_eq!(data, ByteBuf::from("Hello World!\r\n".as_bytes().to_vec())); } From f7dcc4b5e5065f29a2b4e34a0c3f603c41a48119 Mon Sep 17 00:00:00 2001 From: dOrgJelli Date: Tue, 3 Oct 2023 01:18:24 +0200 Subject: [PATCH 21/22] fix: update app-rust template --- packages/templates/app/rust/Cargo.toml | 2 +- packages/templates/app/rust/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/templates/app/rust/Cargo.toml b/packages/templates/app/rust/Cargo.toml index 565176c7ff..e92914b99f 100644 --- a/packages/templates/app/rust/Cargo.toml +++ b/packages/templates/app/rust/Cargo.toml @@ -11,7 +11,7 @@ include = [ ] [dependencies] -polywrap = { version = "~0.1.8" } +polywrap = { version = "~0.1.9-beta.2" } serde = {version = "1.0.145", features = ["derive"]} [dev-dependencies] diff --git a/packages/templates/app/rust/src/lib.rs b/packages/templates/app/rust/src/lib.rs index c931668588..b6279393f7 100644 --- a/packages/templates/app/rust/src/lib.rs +++ b/packages/templates/app/rust/src/lib.rs @@ -6,7 +6,7 @@ use wrap::types::*; pub fn main() { let ipfs_provider = "https://ipfs.io"; let cid = "Qmc5gCcjYypU7y28oCALwfSvxCBskLuPKWpK4qpterKC7z"; - let ipfs = IpfsModule::new(None); + let ipfs = Ipfs::new(None); let data = ipfs.cat(&IpfsArgsCat{ cid: cid.to_string(), From 62023f2c0dc44e1a20dcd0f45af5f8a81d858973 Mon Sep 17 00:00:00 2001 From: dOrgJelli Date: Tue, 3 Oct 2023 01:28:12 +0200 Subject: [PATCH 22/22] chore: update CHANGELOG & VERSION --- CHANGELOG.md | 12 ++++++++++++ VERSION | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e9aff3d51..6bf8465be5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +# Polywrap Origin (0.12.1) +## Features +**`polywrap` CLI:** +* [PR-1911](https://github.com/polywrap/cli/pull/1911) **Polywrap Manifest - Default Source Paths** + * `polywrap.yaml` manifests can now omit the `source:` section and use the defaults defined by the CLI babsed on the manifest's `project.type` property. +* [PR-1893](https://github.com/polywrap/cli/pull/1893) **Add `embed` option to `polywrap codegen`** + * Adds the `--embed` option to `polywrap codegen` which embeds wrap modules into applications (requires wrap-abi-bindgen support). + +## Bugs +**`polywrap` CLI:** +* [PR-1913](https://github.com/polywrap/cli/pull/1913) **Use Sys Bundle IPFS Providers in CLI** + # Polywrap Origin (0.12.0) ## Breaking Changes **`@polywrap/schema-bind`:** diff --git a/VERSION b/VERSION index ac454c6a1f..34a83616bb 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.12.0 +0.12.1