diff --git a/.github/workflows/rs-ci.yaml b/.github/workflows/rs-ci.yaml index 2609f44e71..724a855386 100644 --- a/.github/workflows/rs-ci.yaml +++ b/.github/workflows/rs-ci.yaml @@ -92,6 +92,42 @@ jobs: run: yarn test:rust working-directory: ./packages/js/client + Test-Cli: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Read .nvmrc + run: echo ::set-output name=NVMRC::$(cat .nvmrc) + id: nvm + + - name: Setup Node.js + uses: actions/setup-node@master + with: + node-version: '${{ steps.nvm.outputs.NVMRC }}' + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v2 + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Install dependencies + run: yarn install --nonInteractive --frozen-lockfile --prefer-offline + + - name: Build + run: yarn build + + - name: Test + run: yarn test:rust + working-directory: ./packages/cli + # NOTE: Mac & Windows CI is not currently possible, since GitHub Actions does not # use "Docker Enterprise". Docker Enterprise is required when running linux based # containers, which is what we run within our toolchain for infra and build-images. diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e5c5fa5a4..aca6bd94b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,40 @@ +# Polywrap Origin (0.9.0) +## Features +* [PR-1306](https://github.com/polywrap/toolchain/pull/1306) `polywrap` CLI: Console logging has been improved, and all commands now support `-q, --quiet` and `-v, --verbose` options. +* [PR-1204](https://github.com/polywrap/toolchain/pull/1204) `polywrap` CLI: **Build times are faster for wasm wrappers!!!** The `build` command has been updated to include the concept of "build strategies". The existing way of building (via `Dockerfile` image layers) is available through the `polywrap build --strategy image` command. Building without Docker (if all build-time dependencies are installed locally) can be performed using `--strategy local`. And lastly, the new default build strategy is `--strategy vm`, which runs all build steps in a pre-built base image, allowing for near-local speeds (once the image has been downloaded). + * NOTE: `--strategy image` is useful for source-code verification, something we'll be better supporting in the future. +* [PR-1297](https://github.com/polywrap/toolchain/pull/1297) `@polywrap/schema-bind`: `wasm/rust` now has support for `println!(...)` and `print!(...)` macros. They have been redefined to use the `polywrap_wasm_rs::wrap_debug_log(...)` function. +* [PR-1192](https://github.com/polywrap/toolchain/pull/1192) `@polywrap/client-js`: `PolywrapClient.invoke(...)` now supports invoke-time environment variables, passed in via the `env` property. +* [PR-1270](https://github.com/polywrap/toolchain/pull/1270) `polywrap` CLI: The `manifest` command has been added: +``` +Usage: polywrap manifest|m [options] [command] +Inspect & Migrade Polywrap Manifests +Options: + -h, --help display help for command +Commands: + schema|s [options] [type] Prints out the schema for the current manifest format. + migrate|m [options] [type] Migrates the polywrap project manifest to the latest version. + help [command] display help for command +``` + * [PR-1301](https://github.com/polywrap/toolchain/pull/1301) Added a `--format` option to the `migrate` command, enabling the targeting of specific format versions when migrating manifests (ex: `polywrap manifest migrate -f 0.2.0`). +* [PR-1218](https://github.com/polywrap/toolchain/pull/1218) `polywrap` CLI, `@polywrap/tracing-js`: The `tracing` infrastructure module (i.e. `polywrap infra up --modules tracing`) now uses version `0.11.0` of the `SizNoz` tracing service. Additionally the underlying `@polywrap/tracing-js` library has been updated to support this, and also now has named traces via the `traceName` configuration property. + +## Bugs +* [PR-1304](https://github.com/polywrap/toolchain/pull/1304) `polywrap` CLI: Generated build files from the `vm` strategy now have proper file-system permissions. +* [PR-1305](https://github.com/polywrap/toolchain/pull/1305) `@polywrap/ipfs-plugin-js`: Fallback providers are now properly being used. +* [PR-1296](https://github.com/polywrap/toolchain/pull/1296) `polywrap` CLI: The `polywrap.app.yaml` and `polywrap.plugin.yaml` project manifest file names are being deprecated in favor of a unified `polywrap.yaml` file for all types of projects (wasm, interface, plugin, app). They will still silently work now, but in the future will no longer be recognized defaults. +* [PR-1303](https://github.com/polywrap/toolchain/pull/1303) `@polywrap/core-js`: The `Uri` class now properly formats itself when being `JSON.stringify(...)`'d. +* [PR-1288](https://github.com/polywrap/toolchain/pull/1288) `@polywrap/core-js`: Correctly handle errors in the `getImplementations` algorithm. +* [PR-1298](https://github.com/polywrap/toolchain/pull/1298) `@polywrap/ipfs-plugin-js`, `@polywrap/ipfs-resolver-plugin-js`: Remove the use of `require(...)` statements. +* [PR-1286](https://github.com/polywrap/toolchain/pull/1286) `@polywrap/polywrap-manifest-types-js`: Manifest migration logic has been upgraded to use a strategy that finds a "shortest path" between the `from` and `to` format versions, using predefined migration functions. + +## Breaking Changes +* [PR-1284](https://github.com/polywrap/toolchain/pull/1284) `@polywrap/core-js`: `Wrapper.getFile(...)` and `Wrapper.getManifest(...)` no longer require a `Client` instance as a second function argument. +* [PR-1291](https://github.com/polywrap/toolchain/pull/1291) `@polywrap/core-js`, `@polywrap/client-js`: All `ClientConfig` properties are now `readonly`. +* [PR-1287](https://github.com/polywrap/toolchain/pull/1287) `@polywrap/core-js`: `executeMaybeAsyncFunction` has been removed. +* [PR-1277](https://github.com/polywrap/toolchain/pull/1277) `@polywrap/client-js`: The following methods now return the `Result` type, and will not throw exceptions: `getManifest(...)`, `getFile(...)`, `getImplementations(...)`, `query(...)`, `invokeWrapper(...)`, `invoke(...)`, `loadWrapper(...)`. +* [PR-1192](https://github.com/polywrap/toolchain/pull/1192) `@polywrap/client-js`: `PolywrapClient.invoke(...)` no longer accepts invoke-time reconfiguration via the `config` property. Users who wish to reconfigure the client can do so by calling `client.getConfig()`, modifying it via the `ClientConfigBuilder`, and constructing a new `PolywrapClient` instance. + # Polywrap Origin (0.8.0) ## Features * [PR-1083](https://github.com/polywrap/toolchain/pull/1083) `@polywrap/client-config-builder-js`: The default client config now has the ability to resolve `http` URIs (ex: `wrap://http/domain.com/path`) via the `@polywrap/http-resolver-plugin-js`. diff --git a/VERSION b/VERSION index a3df0a6959..ac39a106c4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.8.0 +0.9.0 diff --git a/package.json b/package.json index 735b03424e..2befafc862 100644 --- a/package.json +++ b/package.json @@ -38,9 +38,10 @@ "link:manifests": "yarn link:manifests:polywrap && yarn link:manifests:wrap", "link:manifests:polywrap": "cd packages/js/manifests/polywrap && (yarn unlink || true) && yarn link && cd ../../../../dependencies && yarn link @polywrap/polywrap-manifest-types-js && cd ../", "link:manifests:wrap": "cd packages/js/manifests/wrap && (yarn unlink || true) && yarn link && cd ../../../../dependencies && yarn link @polywrap/wrap-manifest-types-js && cd ../", - "link:schema": "yarn link:schema:parse && yarn link:schema:compose", + "link:schema": "yarn link:schema:parse && yarn link:schema:compose && yarn link:schema:bind", "link:schema:parse": "cd packages/schema/parse && (yarn unlink || true) && yarn link && cd ../../../dependencies && yarn link @polywrap/schema-parse && cd ../", "link:schema:compose": "cd packages/schema/compose && (yarn unlink || true) && yarn link && cd ../../../dependencies && yarn link @polywrap/schema-compose && cd ../", + "link:schema:bind": "cd packages/schema/bind && (yarn unlink || true) && yarn link && cd ../../../dependencies && yarn link @polywrap/schema-bind && cd ../", "lint": "lerna run lint", "lint:fix": "lerna run lint -- --fix", "lint:ci": "yarn lint", diff --git a/packages/cli/jest.config.js b/packages/cli/jest.config.js index f5c2979551..5fab3362f8 100644 --- a/packages/cli/jest.config.js +++ b/packages/cli/jest.config.js @@ -9,7 +9,8 @@ module.exports = { }, }, modulePathIgnorePatterns: [ - "/src/__tests__/project/.polywrap" + "/src/__tests__/project/.polywrap", + "/src/__tests__/e2e/build-rs.spec.ts" ], testPathIgnorePatterns: [ "/src/__tests__/project/.polywrap" diff --git a/packages/cli/jest.rs.config.js b/packages/cli/jest.rs.config.js new file mode 100644 index 0000000000..0c503af5df --- /dev/null +++ b/packages/cli/jest.rs.config.js @@ -0,0 +1,19 @@ +module.exports = { + collectCoverage: true, + preset: "ts-jest", + testEnvironment: "node", + globals: { + "ts-jest": { + diagnostics: false + }, + }, + testPathIgnorePatterns: [ + "/src/__tests__/project/.polywrap" + ], + transformIgnorePatterns: [ + "/src/__tests__/project/.polywrap" + ], + setupFilesAfterEnv: ["./jest.setup.js"], + testMatch: ["**/build-rs.spec.ts"], + modulePathIgnorePatterns: [], +}; diff --git a/packages/cli/lang/en.json b/packages/cli/lang/en.json index bc10143d18..00931b3595 100644 --- a/packages/cli/lang/en.json +++ b/packages/cli/lang/en.json @@ -1,6 +1,8 @@ { "commands_common_options_configPath": "config-path", "commands_common_options_config": "Add custom configuration to the PolywrapClient", + "commands_common_options_verbose": "Verbose output (default: false)", + "commands_common_options_quiet": "Suppress output (default: false)", "commands_build_description": "Build Polywrap Projects (type: interface, wasm)", "commands_build_error_manifestPathMissing": "{option} option missing {argument} argument", "commands_build_error_manifestNotFound": "Manifest not found. Search paths used: {paths}", @@ -15,19 +17,18 @@ "commands_build_options_t": "Use the development server's ENS instance", "commands_build_options_n": "Skip code generation", "commands_build_options_w": "Automatically rebuild when changes are made (default: false)", - "commands_build_options_v": "Verbose output (default: false)", + "commands_build_options_s": "Strategy to use for building the wrapper", + "commands_build_options_s_strategy": "strategy", "commands_infra_description": "Modular Infrastructure-As-Code Orchestrator", "commands_infra_actions_subtitle": "Infra allows you to execute the following commands:", "commands_infra_options_options": "options", - "commands_infra_options_manifest": "manifest", "commands_infra_options_i_node": "node", "commands_infra_options_h": "Show usage information", - "commands_infra_options_m": "Use only specified modules", - "commands_infra_options_v": "Verbose output (default: false)", + "commands_infra_options_o": "Use only specified modules", + "commands_infra_options_o_module": "module", "commands_infra_options_d": "Run in detached mode", - "commands_infra_moduleName": "module-name", - "commands_infra_manifestPath": "manifest-path", - "commands_infra_manifestPathDescription": "Infra Manifest path", + "commands_infra_options_m_path": "path", + "commands_infra_options_m": "Path to the Polywrap Infra manifest file (default: {default})", "commands_infra_command_up": "Start Polywrap infrastructure", "commands_infra_command_down": "Stop Polywrap infrastructure", "commands_infra_command_vars": "Show Polywrap infrastructure's required .env variables", @@ -64,7 +65,6 @@ "commands_deploy_options_o": "Output file path for the deploy result", "commands_deploy_options_n": "Name of the deployment to execute", "commands_deploy_options_c": "Argument for deployment's publish step, in case deploy step is absent", - "commands_deploy_options_v": "Verbose output (default: false)", "commands_deploy_options_p": "Path to the build directory", "commands_deploy_error_manifestPathMissing": "{option} option missing {argument} argument", "commands_deploy_error_pathMissing": "{option} option missing {argument} argument", @@ -94,6 +94,7 @@ "commands_docgen_options_markdown": "Generate {framework} markdown", "commands_docgen_options_i": "Also generate docs for dependencies", "commands_docgen_error_manifestNotFound": "Manifest not found. Search paths used: {paths}", + "commands_docgen_error_projectLoadFailed": "Could not load project form the given manifest. Manifest: `{manifestFile}`", "commands_create_description": "Create New Projects", "commands_create_directoryExists": "Directory with name {dir} already exists", "commands_create_error_commandFail": "Command failed: {error}", @@ -126,11 +127,10 @@ "commands_run_options_validateScript": "Validate the output of the workflow jobs", "commands_run_options_validate": "cue-file", "commands_run_options_outputFile": "Output file path for the workflow result", - "commands_run_options_manifest": "manifest", - "commands_run_options_quiet": "Suppress output", + "commands_run_options_m_path": "path", + "commands_run_options_m": "Path to the Polywrap Workflow manifest file (default: {default})", "commands_run_options_jobIds": "jobs", "commands_run_options_jobs": "Specify ids of jobs that you want to run", - "commands_run_manifestPathDescription": "Workflow Manifest path", "commands_run_error_validatorNotFound": "validate script not found at: {path}", "commands_run_error_outputFileMissing": "{option} option missing {argument} argument", "commands_run_error_clientConfigMissingPath": "{option} option missing {argument} argument", @@ -162,12 +162,27 @@ "commands_run_error_missingScript": "Required argument {script} is missing", "commands_run_error_noApi": "API needs to be initialized", "commands_run_error_readFail": "Failed to read query {query}", - "commands_run_error_unsupportedOutputFileExt": "Unsupported outputFile extention: ${outputFileExt}", + "commands_run_error_unsupportedOutputFileExt": "Unsupported outputFile extention: {outputFileExt}", "commands_run_error_cueDoesNotExist": "Require cue to run validator, checkout https://cuelang.org/ for more information", "commands_run_error_noWorkflowScriptFound": "Workflow script not found at path: {path}", "commands_run_error_noTestEnvFound": "polywrap test-env not found, please run 'polywrap infra up --modules=eth-ens-ipfs'", "commands_polywrap_error_notACommand": "is not a command", "commands_polywrap_helpPrompt": "Type {command} to view common commands", + "commands_manifest_description": "Inspect & Migrade Polywrap Manifests", + "commands_manifest_options_m": "Path to the manifest file (default: {default})", + "commands_manifest_options_f": "Target format to migrate to (defaults to latest)", + "commands_manifest_options_t": "Type of manifest file to migrate (default: {default})", + "commands_manifest_options_m_path": "path", + "commands_manifest_options_m_format": "format", + "commands_manifest_options_t_type": "type", + "commands_manifest_command_s": "Prints out the schema for the current manifest format.", + "commands_manifest_command_m": "Migrates the polywrap project manifest to the latest version.", + "commands_manifest_command_s_option_r": "Output raw JSON Schema", + "commands_manifest_command_m_preserveManifestMessage": "Saved previous version of manifest to {preservedFilePath}", + "commands_manifest_command_m_migrateManifestMessage": "Migrating {manifestFile} to version {version}", + "commands_manifest_formatError": "Unsupported manifest format. Please make sure that you have the 'format' field present in {fileName} with one of the following values: {values}", + "commands_manifest_migrate_targetFormatError": "Unsupported target format. Supported formats: {formats}", + "commands_manifest_projectTypeError": "Unsupported project type.", "lib_codeGenerator_genCodeError": "Failed to generate types", "lib_codeGenerator_genCodeText": "Generate types", "lib_codeGenerator_genCodeWarning": "Warnings while generating types", @@ -188,7 +203,6 @@ "lib_compiler_compileWasmModulesWarning": "Warnings while compiling Wasm modules", "lib_compiler_failedAbiReturn": "Abi composer failed to return a combined abi.", "lib_compiler_noModulesToBuild": "No modules to build declared.", - "lib_compiler_missingAbi": "Missing ABI definition", "lib_compiler_missingModule": "Missing module definition", "lib_compiler_noInterfaceModule": "Interfaces cannot have implementation file", "lib_compiler_step": "Compiling WASM module", @@ -216,6 +230,9 @@ "lib_helpers_manifest_outputWarning": "Warnings writing manifest to {path}", "lib_helpers_manifest_unableToDump": "Unable to dump manifest: {manifest}", "lib_helpers_manifest_unableToLoad": "Unable to load manifest: {path}", + "lib_helpers_copyText": "Artifacts written to {path}", + "lib_helpers_copyError": "Failed to write build artifacts to {path}", + "lib_helpers_copyWarning": "Warnings write build artifacts to {path}", "lib_helpers_docker_copyText": "Artifacts written to {path} from the image `{image}`", "lib_helpers_docker_couldNotConnect": "Could not connect to the Docker daemon. Is the docker daemon running?", "lib_helpers_docker_copyError": "Failed to write build artifacts to {path} from the image `{image}`", @@ -223,6 +240,12 @@ "lib_helpers_docker_buildText": "Building source image `{image}` using dockerfile `{dockerfile}` in context `{context}`", "lib_helpers_docker_buildError": "Error while building source image `{image}` using dockerfile `{dockerfile}` in context `{context}`", "lib_helpers_docker_buildWarning": "Warnings while building image `{image}` using dockerfile `{dockerfile}` in context `{context}`", + "lib_helpers_docker_buildVMText": "Building sources in Docker container`", + "lib_helpers_docker_buildVMError": "Error while building sources in Docker container", + "lib_helpers_docker_buildVMWarning": "Warnings while building sources in Docker container", + "lib_helpers_buildText": "Building sources", + "lib_helpers_buildError": "Error while building sources", + "lib_helpers_buildWarning": "Warnings while building sources", "lib_helpers_docker_projectFolderMissing": "Build image `{image}` missing /project folder", "lib_helpers_docker_projectBuildFolderMissing": "Build image `{image}` missing build artifact `{artifact}` in folder /project/build", "lib_helpers_parameters_unexpectedValue": "Unexpected value provided for one or more of {options}. See --help for more information.", @@ -246,5 +269,6 @@ "lib_wrap_abi_not_found": "No WRAP ABI found", "lib_helpers_wrap_manifest_outputText": "WRAP manifest written in {path}", "lib_helpers_wrap_manifest_outputError": "Error writing WRAP manifest in {path}", - "lib_helpers_wrap_manifest_outputWarning": "Warning writing WRAP manifest in {path}" + "lib_helpers_wrap_manifest_outputWarning": "Warning writing WRAP manifest in {path}", + "lib_option_defaults_deprecated_project_manifest": "WARNING: the filename `{fileName}` is deprecated and will be removed from the default project manifest files in the future. Please rename it to `polywrap.yaml`." } diff --git a/packages/cli/lang/es.json b/packages/cli/lang/es.json index c3893b2d6e..fc27c873b1 100644 --- a/packages/cli/lang/es.json +++ b/packages/cli/lang/es.json @@ -1,6 +1,8 @@ { "commands_common_options_configPath": "config-path", "commands_common_options_config": "Add custom configuration to the PolywrapClient", + "commands_common_options_verbose": "Verbose output (default: false)", + "commands_common_options_quiet": "Suppress output (default: false)", "commands_build_description": "Build Polywrap Projects (type: interface, wasm)", "commands_build_error_manifestPathMissing": "{option} option missing {argument} argument", "commands_build_error_manifestNotFound": "Manifest not found. Search paths used: {paths}", @@ -15,19 +17,18 @@ "commands_build_options_t": "Use the development server's ENS instance", "commands_build_options_n": "Skip code generation", "commands_build_options_w": "Automatically rebuild when changes are made (default: false)", - "commands_build_options_v": "Verbose output (default: false)", + "commands_build_options_s": "Strategy to use for building the wrapper", + "commands_build_options_s_strategy": "strategy", "commands_infra_description": "Modular Infrastructure-As-Code Orchestrator", "commands_infra_actions_subtitle": "Infra allows you to execute the following commands:", "commands_infra_options_options": "options", - "commands_infra_options_manifest": "manifest", "commands_infra_options_i_node": "node", "commands_infra_options_h": "Show usage information", - "commands_infra_options_m": "Use only specified modules", - "commands_infra_options_v": "Verbose output (default: false)", + "commands_infra_options_o": "Use only specified modules", + "commands_infra_options_o_module": "module", "commands_infra_options_d": "Run in detached mode", - "commands_infra_moduleName": "module-name", - "commands_infra_manifestPath": "manifest-path", - "commands_infra_manifestPathDescription": "Infra Manifest path", + "commands_infra_options_m_path": "path", + "commands_infra_options_m": "Path to the Polywrap Infra manifest file (default: {default})", "commands_infra_command_up": "Start Polywrap infrastructure", "commands_infra_command_down": "Stop Polywrap infrastructure", "commands_infra_command_vars": "Show Polywrap infrastructure's required .env variables", @@ -64,7 +65,6 @@ "commands_deploy_options_o": "Output file path for the deploy result", "commands_deploy_options_n": "Name of the deployment to execute", "commands_deploy_options_c": "Argument for deployment's publish step, in case deploy step is absent", - "commands_deploy_options_v": "Verbose output (default: false)", "commands_deploy_options_p": "Path to the build directory", "commands_deploy_error_manifestPathMissing": "{option} option missing {argument} argument", "commands_deploy_error_pathMissing": "{option} option missing {argument} argument", @@ -94,6 +94,7 @@ "commands_docgen_options_markdown": "Generate {framework} markdown", "commands_docgen_options_i": "Also generate docs for dependencies", "commands_docgen_error_manifestNotFound": "Manifest not found. Search paths used: {paths}", + "commands_docgen_error_projectLoadFailed": "Could not load project form the given manifest. Manifest: `{manifestFile}`", "commands_create_description": "Create New Projects", "commands_create_directoryExists": "Directory with name {dir} already exists", "commands_create_error_commandFail": "Command failed: {error}", @@ -126,11 +127,10 @@ "commands_run_options_validateScript": "Validate the output of the workflow jobs", "commands_run_options_validate": "cue-file", "commands_run_options_outputFile": "Output file path for the workflow result", - "commands_run_options_manifest": "manifest", - "commands_run_options_quiet": "Suppress output", + "commands_run_options_m_path": "path", + "commands_run_options_m": "Path to the Polywrap Workflow manifest file (default: {default})", "commands_run_options_jobIds": "jobs", "commands_run_options_jobs": "Specify ids of jobs that you want to run", - "commands_run_manifestPathDescription": "Workflow Manifest path", "commands_run_error_validatorNotFound": "validate script not found at: {path}", "commands_run_error_outputFileMissing": "{option} option missing {argument} argument", "commands_run_error_clientConfigMissingPath": "{option} option missing {argument} argument", @@ -162,12 +162,27 @@ "commands_run_error_missingScript": "Required argument {script} is missing", "commands_run_error_noApi": "API needs to be initialized", "commands_run_error_readFail": "Failed to read query {query}", - "commands_run_error_unsupportedOutputFileExt": "Unsupported outputFile extention: ${outputFileExt}", + "commands_run_error_unsupportedOutputFileExt": "Unsupported outputFile extention: {outputFileExt}", "commands_run_error_cueDoesNotExist": "Require cue to run validator, checkout https://cuelang.org/ for more information", "commands_run_error_noWorkflowScriptFound": "Workflow script not found at path: {path}", "commands_run_error_noTestEnvFound": "polywrap test-env not found, please run 'polywrap infra up --modules=eth-ens-ipfs'", "commands_polywrap_error_notACommand": "is not a command", "commands_polywrap_helpPrompt": "Type {command} to view common commands", + "commands_manifest_description": "Inspect & Migrade Polywrap Manifests", + "commands_manifest_options_m": "Path to the manifest file (default: {default})", + "commands_manifest_options_f": "Target format to migrate to (defaults to latest)", + "commands_manifest_options_t": "Type of manifest file to migrate (default: {default})", + "commands_manifest_options_m_path": "path", + "commands_manifest_options_m_format": "format", + "commands_manifest_options_t_type": "type", + "commands_manifest_command_s": "Prints out the schema for the current manifest format.", + "commands_manifest_command_m": "Migrates the polywrap project manifest to the latest version.", + "commands_manifest_command_s_option_r": "Output raw JSON Schema", + "commands_manifest_command_m_preserveManifestMessage": "Saved previous version of manifest to {preservedFilePath}", + "commands_manifest_command_m_migrateManifestMessage": "Migrating {manifestFile} to version {version}", + "commands_manifest_formatError": "Unsupported manifest format. Please make sure that you have the 'format' field present in {fileName} with one of the following values: {values}", + "commands_manifest_migrate_targetFormatError": "Unsupported target format. Supported formats: {formats}", + "commands_manifest_projectTypeError": "Unsupported project type.", "lib_codeGenerator_genCodeError": "Failed to generate types", "lib_codeGenerator_genCodeText": "Generate types", "lib_codeGenerator_genCodeWarning": "Warnings while generating types", @@ -188,7 +203,6 @@ "lib_compiler_compileWasmModulesWarning": "Warnings while compiling Wasm modules", "lib_compiler_failedAbiReturn": "Abi composer failed to return a combined abi.", "lib_compiler_noModulesToBuild": "No modules to build declared.", - "lib_compiler_missingAbi": "Missing ABI definition", "lib_compiler_missingModule": "Missing module definition", "lib_compiler_noInterfaceModule": "Interfaces cannot have implementation file", "lib_compiler_step": "Compiling WASM module", @@ -216,6 +230,9 @@ "lib_helpers_manifest_outputWarning": "Warnings writing manifest to {path}", "lib_helpers_manifest_unableToDump": "Unable to dump manifest: {manifest}", "lib_helpers_manifest_unableToLoad": "Unable to load manifest: {path}", + "lib_helpers_copyText": "Artifacts written to {path}", + "lib_helpers_copyError": "Failed to write build artifacts to {path}", + "lib_helpers_copyWarning": "Warnings write build artifacts to {path}", "lib_helpers_docker_couldNotConnect": "Could not connect to the Docker daemon. Is the docker daemon running?", "lib_helpers_docker_copyText": "Artifacts written to {path} from the image `{image}`", "lib_helpers_docker_copyError": "Failed to write build artifacts to {path} from the image `{image}`", @@ -223,6 +240,12 @@ "lib_helpers_docker_buildText": "Building source image `{image}` using dockerfile `{dockerfile}` in context `{context}`", "lib_helpers_docker_buildError": "Error while building source image `{image}` using dockerfile `{dockerfile}` in context `{context}`", "lib_helpers_docker_buildWarning": "Warnings while building image `{image}` using dockerfile `{dockerfile}` in context `{context}`", + "lib_helpers_docker_buildVMText": "Building sources in Docker container`", + "lib_helpers_docker_buildVMError": "Error while building sources in Docker container", + "lib_helpers_docker_buildVMWarning": "Warnings while building sources in Docker container", + "lib_helpers_buildText": "Building sources", + "lib_helpers_buildError": "Error while building sources", + "lib_helpers_buildWarning": "Warnings while building sources", "lib_helpers_docker_projectFolderMissing": "Build image `{image}` missing /project folder", "lib_helpers_docker_projectBuildFolderMissing": "Build image `{image}` missing build artifact `{artifact}` in folder /project/build", "lib_helpers_parameters_unexpectedValue": "Unexpected value provided for one or more of {options}. See --help for more information.", @@ -246,5 +269,6 @@ "lib_wrap_abi_not_found": "No WRAP ABI found", "lib_helpers_wrap_manifest_outputText": "WRAP manifest written in {path}", "lib_helpers_wrap_manifest_outputError": "Error writing WRAP manifest in {path}", - "lib_helpers_wrap_manifest_outputWarning": "Warning writing WRAP manifest in {path}" + "lib_helpers_wrap_manifest_outputWarning": "Warning writing WRAP manifest in {path}", + "lib_option_defaults_deprecated_project_manifest": "WARNING: the filename `{fileName}` is deprecated and will be removed from the default project manifest files in the future. Please rename it to `polywrap.yaml`." } diff --git a/packages/cli/package.json b/packages/cli/package.json index b4aed03b2b..76e7754e6e 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -17,8 +17,8 @@ }, "scripts": { "build": "yarn build:intl && yarn build:fast", - "build:fast": "rimraf ./build && tsc --project tsconfig.build.json && yarn build:build-images && yarn build:deploy-modules && yarn build:infra-modules && yarn build:docgen-templates", - "build:build-images": "copyfiles ./src/lib/defaults/build-images/**/**/* ./build/lib/defaults/build-images/ -u 4", + "build:fast": "rimraf ./build && tsc --project tsconfig.build.json && yarn build:build-strategies && yarn build:deploy-modules && yarn build:infra-modules && yarn build:docgen-templates", + "build:build-strategies": "ts-node ./scripts/copyfiles ./src/lib/defaults/build-strategies ./build/lib/defaults/build-strategies", "build:deploy-modules": "copyfiles ./src/lib/defaults/deploy-modules/**/polywrap.deploy.ext.json ./build/lib/defaults/deploy-modules -u 4", "build:infra-modules": "ts-node ./scripts/copyfiles ./src/lib/defaults/infra-modules ./build/lib/defaults/infra-modules", "build:docgen-templates": "yarn build:docgen-templates:docusaurus && yarn build:docgen-templates:jsdoc && yarn build:docgen-templates:schema", @@ -26,8 +26,10 @@ "build:docgen-templates:jsdoc": "ts-node ./scripts/copyfiles ./src/lib/docgen/jsdoc/templates ./build/lib/docgen/jsdoc/templates", "build:docgen-templates:schema": "ts-node ./scripts/copyfiles ./src/lib/docgen/schema/templates ./build/lib/docgen/schema/templates", "build:intl": "ts-node ./scripts/generateIntlTypes.ts", + "install:tracer": "ts-node ./scripts/installTracerInfraModule.ts", "lint": "eslint --color -c ../../.eslintrc.js .", "test": "cross-env TEST=true jest --passWithNoTests --runInBand --verbose", + "test:rust": "cross-env TEST=true jest --passWithNoTests --runInBand --verbose --config ./jest.rs.config.js", "test:ci": "cross-env TEST=true jest --passWithNoTests --runInBand --verbose", "test:watch": "cross-env TEST=true jest --watch --passWithNoTests --verbose" }, @@ -62,26 +64,26 @@ "content-hash": "2.5.2", "copyfiles": "2.4.1", "docker-compose": "0.23.17", + "extract-zip": "2.0.1", "form-data": "4.0.0", "fs-extra": "9.0.1", - "gluegun": "4.6.1", - "graphql-tag": "2.11.0", "ipfs-http-client": "48.1.3", - "js-yaml": "3.14.0", "jsonschema": "1.4.0", + "json-schema-ref-parser": "9.0.9", + "json-schema": "0.4.0", "mustache": "4.0.1", - "ora": "4.0.0", "os-locale": "5.0.0", "regex-parser": "2.2.11", "rimraf": "3.0.2", + "toml": "3.0.0", "typescript": "4.0.7", - "ws": "7.3.1" + "yaml": "2.1.3", + "yesno": "0.4.0" }, "devDependencies": { "@types/copyfiles": "2.4.0", "@types/fs-extra": "9.0.12", "@types/jest": "26.0.8", - "@types/js-yaml": "3.11.1", "@types/mustache": "4.0.1", "@types/node": "12.12.26", "@types/prettier": "2.6.0", diff --git a/packages/cli/scripts/installTracerInfraModule.ts b/packages/cli/scripts/installTracerInfraModule.ts new file mode 100644 index 0000000000..486a7cec53 --- /dev/null +++ b/packages/cli/scripts/installTracerInfraModule.ts @@ -0,0 +1,112 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +import http from "http"; +import https from "https"; +import path from "path"; +import fs from "fs"; +import fse from "fs-extra"; +import extractZip from "extract-zip"; +import rimraf from "rimraf"; +import yaml from "yaml"; + +const tempCacheDir = path.join(__dirname, ".tmp"); +const releaseName = "0.11.0"; +const releaseDownloadUrl = `https://github.com/SigNoz/signoz/archive/refs/tags/v${releaseName}.zip`; +const sourceDir = path.join( + tempCacheDir, + `signoz-${releaseName}/deploy/docker/clickhouse-setup/` +); +const destDir = path.join( + __dirname, + "../src/lib/defaults/infra-modules/tracer/" +); + +function download(url: string, w: fs.WriteStream): Promise { + return new Promise((resolve, reject) => { + let protocol = /^https:/.exec(url) ? https : http; + + protocol + .get(url, (res1: http.IncomingMessage) => { + if (!res1.headers.location) { + reject("location undefined"); + return; + } + protocol = /^https:/.exec(res1.headers.location) ? https : http; + + protocol + .get(res1.headers.location, (res2: http.IncomingMessage) => { + res2.pipe(w); + res2.on("error", reject); + res2.on("end", resolve); + }) + .on("error", reject); + }) + .on("error", reject); + }); +} + +async function main() { + // Download the release's zip + await fse.ensureDir(tempCacheDir); + const zipFile = path.join(tempCacheDir, releaseName + ".zip"); + const destWs = fs.createWriteStream(zipFile); + await download(releaseDownloadUrl, destWs); + + // Extract the zip into the directory, and delete the zip file + await extractZip(zipFile, { dir: tempCacheDir }); + fs.unlinkSync(zipFile); + + // Copy the docker-compose contents into the infra-modules folder + rimraf.sync(destDir); + await fse.ensureDir(destDir); + fse.copySync(sourceDir, destDir, { + recursive: true, + }); + + // Misc cleanup + const yamlDockerComposePath = path.join(destDir, "docker-compose.yaml"); + let yamlDockerCompose: Record | undefined; + + try { + yamlDockerCompose = yaml.parse( + fs.readFileSync(yamlDockerComposePath, "utf-8") + ) as Record | undefined; + } catch (_) { + yamlDockerCompose = undefined; + } + + if (!yamlDockerCompose) { + throw new Error(`Unable to load ${yamlDockerComposePath}`); + } + + // 1. Remove the "hotrod" & "load-hotrod" services + delete yamlDockerCompose.services.hotrod; + delete yamlDockerCompose.services["load-hotrod"]; + let rawYamlDockerCompose = yaml.stringify(yamlDockerCompose, null, 2); + + // 2. Copy the "../common" & patch the file path + fse.copySync( + path.join(sourceDir, "../common"), + path.join(destDir, "./common"), + { recursive: true } + ); + rawYamlDockerCompose = rawYamlDockerCompose.replace("../common", "./common"); + + // 3. Replace the "../dashboards" path with a local one + rawYamlDockerCompose = rawYamlDockerCompose.replace( + "../dashboards", + "./dashboards" + ); + + // Output the modified docker-compose.yaml + fs.writeFileSync(yamlDockerComposePath, rawYamlDockerCompose); + + // Clean up the temp folder + await rimraf.sync(tempCacheDir); +} + +main() + .then(() => process.exit(0)) + .catch((error) => { + console.error(error); + process.exit(1); + }); diff --git a/packages/cli/src/__tests__/e2e/build-rs.spec.ts b/packages/cli/src/__tests__/e2e/build-rs.spec.ts new file mode 100644 index 0000000000..ddd4d9a5ca --- /dev/null +++ b/packages/cli/src/__tests__/e2e/build-rs.spec.ts @@ -0,0 +1,68 @@ +import { polywrapCli } from "./utils"; + +import { runCLI } from "@polywrap/test-env-js"; +import { GetPathToCliTestFiles } from "@polywrap/test-cases"; +import fs from "fs"; +import path from "path"; + +jest.setTimeout(700000); + +describe("e2e tests for build command", () => { + const testCaseRoot = path.join(GetPathToCliTestFiles(), "wasm/build-cmd/rust"); + const testCases = fs + .readdirSync(testCaseRoot, { withFileTypes: true }) + .filter((dirent) => dirent.isDirectory()) + .map((dirent) => dirent.name); + + const getTestCaseDir = (index: number) => + path.join(testCaseRoot, testCases[index]); + + describe("Image strategy", () => { + it("Builds for rust", async () => { + const { exitCode: code, stdout: output } = await runCLI({ + args: ["build", "-v", "-s", "image"], + cwd: getTestCaseDir(0), + cli: polywrapCli, + }); + + const buildDir = `./build`; + + expect(code).toEqual(0); + expect(output).toContain(`Artifacts written to ${buildDir}`); + expect(output).toContain(`WRAP manifest written in ${buildDir}/wrap.info`); + }); + }) + + // NOTE: Skipped because CI needs system prequisites: bindgen, snip, etc. + describe.skip("Local strategy", () => { + it("Builds for rust", async () => { + const { exitCode: code, stdout: output } = await runCLI({ + args: ["build", "-v", "-s", "local"], + cwd: getTestCaseDir(0), + cli: polywrapCli, + }); + + const buildDir = `./build`; + + expect(code).toEqual(0); + expect(output).toContain(`Artifacts written to ${buildDir}`); + expect(output).toContain(`WRAP manifest written in ${buildDir}/wrap.info`); + }); + }) + + describe("VM strategy", () => { + it("Builds for rust", async () => { + const { exitCode: code, stdout: output } = await runCLI({ + args: ["build", "-v", "-s", "vm"], + cwd: getTestCaseDir(0), + cli: polywrapCli, + }); + + const buildDir = `./build`; + + expect(code).toEqual(0); + expect(output).toContain(`Artifacts written to ${buildDir}`); + expect(output).toContain(`WRAP manifest written in ${buildDir}/wrap.info`); + }); + }) +}); diff --git a/packages/cli/src/__tests__/e2e/build.spec.ts b/packages/cli/src/__tests__/e2e/build.spec.ts index fa21138655..5765dfc696 100644 --- a/packages/cli/src/__tests__/e2e/build.spec.ts +++ b/packages/cli/src/__tests__/e2e/build.spec.ts @@ -1,4 +1,3 @@ -import { PolywrapProject, loadBuildManifest } from "../../lib"; import { clearStyle, polywrapCli } from "./utils"; import { runCLI } from "@polywrap/test-env-js"; @@ -19,20 +18,24 @@ Options: -c, --client-config Add custom configuration to the PolywrapClient -n, --no-codegen Skip code generation + -s, --strategy Strategy to use for building the wrapper + (default: "vm") -w, --watch Automatically rebuild when changes are made (default: false) -v, --verbose Verbose output (default: false) + -q, --quiet Suppress output (default: false) -h, --help display help for command `; jest.setTimeout(500000); describe("e2e tests for build command", () => { - const testCaseRoot = path.join(GetPathToCliTestFiles(), "wasm/build-cmd"); + const testCaseRoot = path.join(GetPathToCliTestFiles(), "wasm/build-cmd/assemblyscript"); const testCases = fs .readdirSync(testCaseRoot, { withFileTypes: true }) .filter((dirent) => dirent.isDirectory()) .map((dirent) => dirent.name); + const getTestCaseDir = (index: number) => path.join(testCaseRoot, testCases[index]); @@ -176,42 +179,56 @@ describe("e2e tests for build command", () => { cli: polywrapCli, }); - const buildDir = `./${path.relative(testCaseDir, outputDir)}`; + const displayPath = "./" + path.relative( + getTestCaseDir(0), outputDir + ); expect(code).toEqual(0); - expect(output).toContain(`Artifacts written to ${buildDir}`); - expect(output).toContain(`WRAP manifest written in ${buildDir}/wrap.info`); + expect(output).toContain(`Artifacts written to ${displayPath}`); + expect(output).toContain(`WRAP manifest written in ${displayPath}/wrap.info`); testBuildOutput(testCaseDir, outputDir); }); - it("Should add uuid-v4 suffix to build image if no build manifest specified", async () => { - const projectRoot = getTestCaseDir(0); - const project = new PolywrapProject({ - rootDir: projectRoot, - polywrapManifestPath: path.join(projectRoot, "polywrap.yaml"), - }); + describe("Image strategy", () => { + it("Builds for assemblyscript", async () => { + const { exitCode: code, stdout: output } = await runCLI({ + args: ["build", "-v", "-s", "image"], + cwd: getTestCaseDir(0), + cli: polywrapCli, + }); - await project.cacheDefaultBuildImage(); + const buildDir = "./build"; - const cacheBuildEnvPath = path.join( - projectRoot, - ".polywrap/wasm/build/image" - ); - const cachedBuildManifest = await loadBuildManifest( - path.join(cacheBuildEnvPath, "polywrap.build.yaml") - ); + expect(code).toEqual(0); + expect(output).toContain(`Artifacts written to ${buildDir}`); + expect(output).toContain(`WRAP manifest written in ${buildDir}/wrap.info`); - const buildImageName = cachedBuildManifest.docker?.name; + const imageNameUUIDSuffix = output.match(/(?<=polywrap-build-env-)(.*)(?= \/bin)/); + + expect(imageNameUUIDSuffix?.[0]).toBeTruthy(); + expect(imageNameUUIDSuffix?.[0].length).toBe(36); + }); + }) + + describe("Local strategy", () => { + it("Builds for assemblyscript", async () => { + const { exitCode: code, stdout: output } = await runCLI({ + args: ["build", "-v", "-s", "local"], + cwd: getTestCaseDir(0), + cli: polywrapCli, + }); - expect(buildImageName?.length).toBeGreaterThan(36); - expect((buildImageName?.match(/-/g) || []).length).toBeGreaterThanOrEqual( - 4 - ); - }); + const buildDir = `./build`; + + expect(code).toEqual(0); + expect(output).toContain(`Artifacts written to ${buildDir}`); + expect(output).toContain(`WRAP manifest written in ${buildDir}/wrap.info`); + }); + }) describe("test-cases", () => { - for (let i = 0; i < testCases.length; ++i) { + for (let i = 0; i < testCases.length; i++) { const testCaseName = testCases[i]; const testCaseDir = getTestCaseDir(i); diff --git a/packages/cli/src/__tests__/e2e/codegen.spec.ts b/packages/cli/src/__tests__/e2e/codegen.spec.ts index a0ae99810c..a8185759a3 100644 --- a/packages/cli/src/__tests__/e2e/codegen.spec.ts +++ b/packages/cli/src/__tests__/e2e/codegen.spec.ts @@ -22,6 +22,8 @@ Options: (JavaScript | TypeScript) -c, --client-config Add custom configuration to the PolywrapClient + -v, --verbose Verbose output (default: false) + -q, --quiet Suppress output (default: false) -h, --help display help for command `; @@ -84,7 +86,7 @@ describe("e2e tests for codegen command", () => { }); it("Should throw error for invalid generation file - wrong file", async () => { - const { exitCode: code, stdout: output, stderr: error } = await runCLI({ + const { exitCode: code, stderr: error } = await runCLI({ args: ["codegen", "--script", `polywrap-invalid.gen.js`], cwd: getTestCaseDir(0), cli: polywrapCli, @@ -95,23 +97,30 @@ describe("e2e tests for codegen command", () => { ); expect(code).toEqual(1); - expect(error).toBe(""); - expect(clearStyle(output)).toContain( - `Failed to generate types: Cannot find module '${genFile}'` + + const errorText = clearStyle(error); + expect(errorText).toContain( + "Failed to generate types" + ); + expect(errorText).toContain( + `Cannot find module '${genFile}'` ); }); it("Should throw error for invalid generation file - no run() method", async () => { - const { exitCode: code, stdout: output, stderr: error } = await runCLI({ + const { exitCode: code, stderr: error } = await runCLI({ args: ["codegen", "--script", `polywrap-norun.gen.js`], cwd: getTestCaseDir(0), cli: polywrapCli, }); expect(code).toEqual(1); - expect(error).toBe(""); - expect(clearStyle(output)).toContain( - `Failed to generate types: The generation file provided doesn't have the 'generateBinding' method.` + const errorText = clearStyle(error); + expect(errorText).toContain( + "Failed to generate types" + ); + expect(errorText).toContain( + `The generation file provided doesn't have the 'generateBinding' method.` ); }); @@ -150,4 +159,22 @@ describe("e2e tests for codegen command", () => { rimraf.sync(`${getTestCaseDir(0)}/types`); }); + + it("Should successfully generate types - Rust", async () => { + rimraf.sync(`${getTestCaseDir(1)}/types`); + + const { exitCode: code, stdout: output, stderr: error } = await runCLI({ + args: ["codegen"], + cwd: getTestCaseDir(1), + cli: polywrapCli, + }); + + expect(code).toEqual(0); + expect(error).toBe(""); + expect(clearStyle(output)).toContain( + `🔥 Types were generated successfully 🔥` + ); + + rimraf.sync(`${getTestCaseDir(1)}/types`); + }); }); diff --git a/packages/cli/src/__tests__/e2e/create.spec.ts b/packages/cli/src/__tests__/e2e/create.spec.ts index b93dcba5f7..5eb4a0f384 100644 --- a/packages/cli/src/__tests__/e2e/create.spec.ts +++ b/packages/cli/src/__tests__/e2e/create.spec.ts @@ -122,12 +122,12 @@ describe("e2e tests for create command", () => { cwd: __dirname, cli: polywrapCli, }); - + expect(code).toEqual(0); - expect(clearStyle(output)).toMatch( - /🔥 You are ready to ([A-Za-z ]+) Polywrap 🔥/ + expect(clearStyle(output)).toContain( + "🔥 You are ready " ); - + rimraf.sync(`${__dirname}/test`); }, 60000); }) diff --git a/packages/cli/src/__tests__/e2e/deploy.spec.ts b/packages/cli/src/__tests__/e2e/deploy.spec.ts index 18ad968dda..23ec00c60e 100644 --- a/packages/cli/src/__tests__/e2e/deploy.spec.ts +++ b/packages/cli/src/__tests__/e2e/deploy.spec.ts @@ -10,7 +10,7 @@ import { import { GetPathToCliTestFiles } from "@polywrap/test-cases"; import path from "path"; import fs from "fs"; -import yaml from "js-yaml"; +import yaml from "yaml"; const HELP = `Usage: polywrap deploy|d [options] @@ -21,6 +21,7 @@ Options: (default: polywrap.yaml | polywrap.yml) -o, --output-file Output file path for the deploy result -v, --verbose Verbose output (default: false) + -q, --quiet Suppress output (default: false) -h, --help display help for command `; @@ -140,7 +141,7 @@ describe("e2e tests for deploy command", () => { const yamlOutputFileContents = JSON.parse( JSON.stringify( - (yaml.load( + (yaml.parse( fs.readFileSync( path.join(getTestCaseDir(0), "output.yaml"), "utf8" @@ -167,92 +168,32 @@ describe("e2e tests for deploy command", () => { { "name": "ens_register", "id": "fs_to_ens.ens_register", - "input": { - "_config": { - "uri": "wrap://ens/test1.eth", - "authority": "ens", - "path": "test1.eth" - } - }, - "result": { - "_config": { - "uri": "wrap://ens/testnet/test1.eth", - "authority": "ens", - "path": "testnet/test1.eth" - } - } + "input": "wrap://ens/test1.eth", + "result": "wrap://ens/testnet/test1.eth", }, { "name": "ens_register2", "id": "fs_to_ens.ens_register2", - "input": { - "_config": { - "uri": "wrap://ens/test2.eth", - "authority": "ens", - "path": "test2.eth" - } - }, - "result": { - "_config": { - "uri": "wrap://ens/testnet/test2.eth", - "authority": "ens", - "path": "testnet/test2.eth" - } - } + "input": "wrap://ens/test2.eth", + "result": "wrap://ens/testnet/test2.eth", }, { "name": "ipfs_deploy", "id": "fs_to_ens.ipfs_deploy", - "input": { - "_config": { - "uri": "wrap://fs/./build", - "authority": "fs", - "path": "./build" - } - }, - "result": { - "_config": { - "uri": "wrap://ipfs/QmT5nBb8xwrfZnmFNRZexmrebzaaxW7CPfh1ZznQ6zsVaG", - "authority": "ipfs", - "path": "QmT5nBb8xwrfZnmFNRZexmrebzaaxW7CPfh1ZznQ6zsVaG" - } - } + "input": "wrap://fs/./build", + "result": "wrap://ipfs/QmT5nBb8xwrfZnmFNRZexmrebzaaxW7CPfh1ZznQ6zsVaG", }, { "name": "from_deploy", "id": "fs_to_ens.from_deploy", - "input": { - "_config": { - "uri": "wrap://ipfs/QmT5nBb8xwrfZnmFNRZexmrebzaaxW7CPfh1ZznQ6zsVaG", - "authority": "ipfs", - "path": "QmT5nBb8xwrfZnmFNRZexmrebzaaxW7CPfh1ZznQ6zsVaG" - } - }, - "result": { - "_config": { - "uri": "wrap://ens/testnet/test1.eth", - "authority": "ens", - "path": "testnet/test1.eth" - } - } + "input": "wrap://ipfs/QmT5nBb8xwrfZnmFNRZexmrebzaaxW7CPfh1ZznQ6zsVaG", + "result": "wrap://ens/testnet/test1.eth", }, { "name": "from_deploy2", "id": "fs_to_ens.from_deploy2", - "input": { - "_config": { - "uri": "wrap://ipfs/QmT5nBb8xwrfZnmFNRZexmrebzaaxW7CPfh1ZznQ6zsVaG", - "authority": "ipfs", - "path": "QmT5nBb8xwrfZnmFNRZexmrebzaaxW7CPfh1ZznQ6zsVaG" - } - }, - "result": { - "_config": { - "uri": "wrap://ens/testnet/test2.eth", - "authority": "ens", - "path": "testnet/test2.eth" - } - } + "input": "wrap://ipfs/QmT5nBb8xwrfZnmFNRZexmrebzaaxW7CPfh1ZznQ6zsVaG", + "result": "wrap://ens/testnet/test2.eth", } ] }, @@ -262,45 +203,21 @@ describe("e2e tests for deploy command", () => { { "name": "ens_register", "id": "ipfs_to_ens.ens_register", - "input": { - "_config": { - "uri": "wrap://ens/test3.eth", - "authority": "ens", - "path": "test3.eth" - } - }, - "result": { - "_config": { - "uri": "wrap://ens/testnet/test3.eth", - "authority": "ens", - "path": "testnet/test3.eth" - } - } + "input": "wrap://ens/test3.eth", + "result": "wrap://ens/testnet/test3.eth", }, { "name": "from_uri", "id": "ipfs_to_ens.from_uri", - "input": { - "_config": { - "uri": "wrap://ipfs/QmVdDR6QtigTt38Xwpj2Ki73X1AyZn5WRCreBCJq1CEtpF", - "authority": "ipfs", - "path": "QmVdDR6QtigTt38Xwpj2Ki73X1AyZn5WRCreBCJq1CEtpF" - } - }, - "result": { - "_config": { - "uri": "wrap://ens/testnet/test3.eth", - "authority": "ens", - "path": "testnet/test3.eth" - } - } + "input": "wrap://ipfs/QmVdDR6QtigTt38Xwpj2Ki73X1AyZn5WRCreBCJq1CEtpF", + "result": "wrap://ens/testnet/test3.eth", } ] } ]) }); - it("Should show warning if no manifest ext is found in deploy package", async () => { + it.only("Should show warning if no manifest ext is found in deploy package", async () => { const { exitCode: code, stdout: output } = await runCLI( { args: ["deploy"], @@ -313,9 +230,6 @@ describe("e2e tests for deploy command", () => { const sanitizedOutput = clearStyle(output); expect(code).toEqual(0); - expect(sanitizedOutput).toContain( - "No manifest extension found in" - ); expect(sanitizedOutput).toContain( "Successfully executed step 'ipfs_test'" ); diff --git a/packages/cli/src/__tests__/e2e/docgen.spec.ts b/packages/cli/src/__tests__/e2e/docgen.spec.ts index ebf34612ea..57dae5d829 100644 --- a/packages/cli/src/__tests__/e2e/docgen.spec.ts +++ b/packages/cli/src/__tests__/e2e/docgen.spec.ts @@ -21,15 +21,14 @@ Arguments: Options: -m, --manifest-file Path to the project manifest file - (default: polywrap.yaml | polywrap.yml | - polywrap.app.yaml | polywrap.app.yml | - polywrap.plugin.yaml | - polywrap.plugin.yml) + (default: polywrap.yaml | polywrap.yml) -g, --docgen-dir Output directory for generated docs (default: ./docs) -c, --client-config Add custom configuration to the PolywrapClient -i, --imports Also generate docs for dependencies + -v, --verbose Verbose output (default: false) + -q, --quiet Suppress output (default: false) -h, --help display help for command `; diff --git a/packages/cli/src/__tests__/e2e/help.spec.ts b/packages/cli/src/__tests__/e2e/help.spec.ts index db82baad9b..0c368a76ec 100644 --- a/packages/cli/src/__tests__/e2e/help.spec.ts +++ b/packages/cli/src/__tests__/e2e/help.spec.ts @@ -16,6 +16,7 @@ Commands: infra|i [options] Modular Infrastructure-As-Code Orchestrator run|r [options] Runs Workflows docgen|o [options] Generate wrapper documentation + manifest|m Inspect & Migrade Polywrap Manifests help [command] display help for command `; diff --git a/packages/cli/src/__tests__/e2e/infra.spec.ts b/packages/cli/src/__tests__/e2e/infra.spec.ts index eb3e2d9c12..b74b2b6303 100644 --- a/packages/cli/src/__tests__/e2e/infra.spec.ts +++ b/packages/cli/src/__tests__/e2e/infra.spec.ts @@ -19,7 +19,7 @@ const HELP = `Usage: polywrap infra|i [options] Modular Infrastructure-As-Code Orchestrator Arguments: - action + action Infra allows you to execute the following commands: up Start Polywrap infrastructure down Stop Polywrap infrastructure @@ -28,10 +28,13 @@ Arguments: (choices: "up", "down", "vars", "config") Options: - --manifest Infra Manifest path (default: "polywrap.infra.yaml") - -m, --modules Use only specified modules - -v, --verbose Verbose output (default: false) - -h, --help display help for command + -m, --manifest-file Path to the Polywrap Infra manifest file + (default: polywrap.infra.yaml | + polywrap.infra.yml) + -o, --modules Use only specified modules + -v, --verbose Verbose output (default: false) + -q, --quiet Suppress output (default: false) + -h, --help display help for command `; const portInUse = (port: number) => { @@ -177,7 +180,7 @@ describe("e2e tests for infra command", () => { it("Should set environment up with all modules if no --modules are passed", async () => { await runPolywrapCli( - ["infra", "down", "--manifest=./polywrap.infra.yaml"], + ["infra", "down", "--manifest-file=./polywrap.infra.yaml"], getTestCaseDir(0), ); @@ -188,7 +191,7 @@ describe("e2e tests for infra command", () => { ]); await runPolywrapCli( - ["infra", "up", "--manifest=./polywrap.infra.yaml"], + ["infra", "up", "--manifest-file=./polywrap.infra.yaml"], getTestCaseDir(0), ); @@ -234,7 +237,7 @@ describe("e2e tests for infra command", () => { it("Should throw because default module declared in manifest is not recognized", async () => { const { stderr } = await runPolywrapCli( - ["infra", "up", "--manifest=./polywrap.infra.wrong.yaml"], + ["infra", "up", "--manifest-file=./polywrap.infra.wrong.yaml"], getTestCaseDir(4), ); diff --git a/packages/cli/src/__tests__/e2e/manifest.spec.ts b/packages/cli/src/__tests__/e2e/manifest.spec.ts new file mode 100644 index 0000000000..6b5f44521f --- /dev/null +++ b/packages/cli/src/__tests__/e2e/manifest.spec.ts @@ -0,0 +1,382 @@ +import { clearStyle, polywrapCli } from "./utils"; + +import { GetPathToCliTestFiles } from "@polywrap/test-cases"; +import fs from "fs"; +import fse from "fs-extra"; +import path from "path"; +import rimraf from "rimraf"; +import { runCLI } from "@polywrap/test-env-js"; + +const HELP = `Usage: polywrap manifest|m [options] [command] + +Inspect & Migrade Polywrap Manifests + +Options: + -h, --help display help for command + +Commands: + schema|s [options] [type] Prints out the schema for the current manifest + format. + migrate|m [options] [type] Migrates the polywrap project manifest to the + latest version. + help [command] display help for command +`; + +const MIGRATE_HELP = `Usage: polywrap manifest migrate|m [options] [type] + +Migrates the polywrap project manifest to the latest version. + +Arguments: + type Type of manifest file to migrate (default: + project) (choices: "project", "build", "deploy", + "infra", "meta", "workflow", default: "project") + +Options: + -m, --manifest-file Path to the manifest file (default: polywrap.yaml + | polywrap.yml) + -f, --format Target format to migrate to (defaults to latest) + -v, --verbose Verbose output (default: false) + -q, --quiet Suppress output (default: false) + -h, --help display help for command +`; + +const SCHEMA_HELP = `Usage: polywrap manifest schema|s [options] [type] + +Prints out the schema for the current manifest format. + +Arguments: + type Type of manifest file to migrate (default: + project) (choices: \"project\", \"build\", \"deploy\", + \"infra\", \"meta\", \"workflow\", default: \"project\") + +Options: + -r, --raw Output raw JSON Schema (default: false) + -m, --manifest-file Path to the manifest file (default: polywrap.yaml + | polywrap.yml) + -v, --verbose Verbose output (default: false) + -q, --quiet Suppress output (default: false) + -h, --help display help for command +`; + +describe("e2e tests for manifest command", () => { + const testsRoot = path.join(GetPathToCliTestFiles(), "manifest"); + + test("Should show help text", async () => { + const { exitCode: code, stdout: output, stderr: error } = await runCLI({ + args: ["manifest", "--help"], + cwd: testsRoot, + cli: polywrapCli, + }); + + expect(code).toEqual(0); + expect(error).toBe(""); + expect(clearStyle(output)).toEqual(HELP); + }); + + describe("migrate command", () => { + test("Should show help text", async () => { + const { exitCode: code, stdout: output, stderr: error } = await runCLI({ + args: ["manifest", "migrate", "--help"], + cwd: testsRoot, + cli: polywrapCli, + }); + + expect(clearStyle(output)).toEqual(MIGRATE_HELP); + expect(error).toBe(""); + expect(code).toEqual(0); + }); + + describe("options", () => { + it("Should throw error for unknown option --invalid", async () => { + const { exitCode: code, stdout: output, stderr: error } = await runCLI({ + args: ["manifest", "migrate", "--invalid"], + cwd: testsRoot, + cli: polywrapCli, + }); + + expect(error).toBe("error: unknown option '--invalid'\n"); + expect(output).toEqual(``); + expect(code).toEqual(1); + }); + + it("Should throw error if params not specified for --manifest-file option", async () => { + const { exitCode: code, stdout: output, stderr: error } = await runCLI({ + args: ["manifest", "migrate", "-m"], + cwd: testsRoot, + cli: polywrapCli, + }); + + expect(error).toBe( + `error: option '-m, --manifest-file ' argument missing\n` + ); + expect(output).toEqual(``); + expect(code).toEqual(1); + }); + }); + + describe("arguments", () => { + it("Should throw error if 'type' argument is invalid", async () => { + const { exitCode: code, stdout: output, stderr: error } = await runCLI({ + args: ["manifest", "migrate", "invalid-arg"], + cwd: testsRoot, + cli: polywrapCli, + }); + + expect(error).toBe( + `error: command-argument value 'invalid-arg' is invalid for argument 'type'. Allowed choices are project, build, deploy, infra, meta, workflow.\n` + ); + expect(output).toEqual(``); + expect(code).toEqual(1); + }); + }); + + describe("actions", () => { + const validSampleProjectManifestFiles: Record = { + wasm: "polywrap.yaml", + app: "polywrap.app.yaml", + plugin: "polywrap.plugin.yaml", + }; + + const validSampleExtensionManifestFiles: Record = { + build: "polywrap.build.yaml", + deploy: "polywrap.deploy.yaml", + infra: "polywrap.infra.yaml", + meta: "polywrap.meta.yaml", + workflow: "polywrap.test.yaml", + }; + + const tempDir = path.join(testsRoot, "temp"); + + beforeAll(async () => { + const samplesDir = path.join(testsRoot, "samples"); + + if (fs.existsSync(tempDir)) { + rimraf.sync(tempDir); + } + + await fse.copy(samplesDir, tempDir); + }); + + afterAll(async () => { + if (fs.existsSync(tempDir)) { + rimraf.sync(tempDir); + } + }); + + for (const projectType in validSampleProjectManifestFiles) { + const manifestFile = validSampleProjectManifestFiles[projectType]; + + test(`Should migrate ${projectType} project manifest`, async () => { + const { + exitCode: code, + stdout: output, + stderr: error, + } = await runCLI({ + args: ["manifest", "migrate", "-m", manifestFile], + cwd: tempDir, + cli: polywrapCli, + }); + + expect(output).toContain(`Migrating ${manifestFile} to version`); + expect(output).toContain( + `Saved previous version of manifest to .polywrap/manifest/${manifestFile}` + ); + expect(error).toBe(""); + expect(code).toBe(0); + + const oldFile = path.join( + tempDir, + ".polywrap", + "manifest", + manifestFile + ); + const oldFileExists = fs.existsSync(oldFile); + + expect(oldFileExists).toBeTruthy(); + }); + + test(`Should display error when invalid target format is provided for ${projectType} project manifest`, async () => { + const { + exitCode: code, + stdout: output, + stderr: error, + } = await runCLI({ + args: ["manifest", "migrate", "-m", manifestFile, "-f", "INVALID_MANIFEST_FORMAT"], + cwd: tempDir, + cli: polywrapCli, + }); + + expect(output).toBe(""); + expect(error).toContain("Unsupported target format. Supported formats:"); + expect(code).toBe(1); + }); + } + + for (const extensionType in validSampleExtensionManifestFiles) { + const manifestFile = validSampleExtensionManifestFiles[extensionType]; + + test(`Should migrate ${extensionType} extension manifest`, async () => { + const { + exitCode: code, + stdout: output, + stderr: error, + } = await runCLI({ + args: ["manifest", "migrate", extensionType, "-m", manifestFile], + cwd: tempDir, + cli: polywrapCli, + }); + + expect(output).toContain(`Migrating ${manifestFile} to version`); + expect(output).toContain( + `Saved previous version of manifest to .polywrap/manifest/${manifestFile}` + ); + expect(error).toBe(""); + expect(code).toBe(0); + + const oldFile = path.join( + tempDir, + ".polywrap", + "manifest", + manifestFile + ); + const oldFileExists = fs.existsSync(oldFile); + + expect(oldFileExists).toBeTruthy(); + }); + + test(`Should display error when invalid target format is provided for ${extensionType} extension manifest`, async () => { + const { + exitCode: code, + stdout: output, + stderr: error, + } = await runCLI({ + args: ["manifest", "migrate", extensionType, "-m", manifestFile, "-f", "INVALID_MANIFEST_FORMAT"], + cwd: tempDir, + cli: polywrapCli, + }); + + expect(output).toBe(""); + expect(error).toContain("Unsupported target format. Supported formats:"); + expect(code).toBe(1); + }); + } + }); + }); + + describe("Schema command", () => { + test("Should show help text", async () => { + const { exitCode: code, stdout: output, stderr: error } = await runCLI({ + args: ["manifest", "schema", "--help"], + cwd: testsRoot, + cli: polywrapCli, + }); + + expect(clearStyle(output)).toEqual(SCHEMA_HELP); + expect(error).toBe(""); + expect(code).toEqual(0); + }); + + describe("options", () => { + it("Should throw error for unknown option --invalid", async () => { + const { exitCode: code, stdout: output, stderr: error } = await runCLI({ + args: ["manifest", "migrate", "--invalid"], + cwd: testsRoot, + cli: polywrapCli, + }); + + expect(error).toBe("error: unknown option '--invalid'\n"); + expect(output).toEqual(``); + expect(code).toEqual(1); + }); + + it("Should throw error if params not specified for --manifest-file option", async () => { + const { exitCode: code, stdout: output, stderr: error } = await runCLI({ + args: ["manifest", "migrate", "-m"], + cwd: testsRoot, + cli: polywrapCli, + }); + + expect(error).toBe( + `error: option '-m, --manifest-file ' argument missing\n` + ); + expect(output).toEqual(``); + expect(code).toEqual(1); + }); + }); + + describe("arguments", () => { + it("Should throw error if 'type' argument is invalid", async () => { + const { exitCode: code, stdout: output, stderr: error } = await runCLI({ + args: ["manifest", "migrate", "invalid-arg"], + cwd: testsRoot, + cli: polywrapCli, + }); + + expect(error).toBe( + `error: command-argument value 'invalid-arg' is invalid for argument 'type'. Allowed choices are project, build, deploy, infra, meta, workflow.\n` + ); + expect(output).toEqual(``); + expect(code).toEqual(1); + }); + }); + + test("Should throw on invalid format within file", async () => { + const manifestFile = path.join( + testsRoot, + "samples", + "invalid-format.yaml" + ); + const { exitCode: code, stdout: output, stderr: error } = await runCLI({ + args: ["manifest", "schema", "-m", manifestFile], + cwd: testsRoot, + cli: polywrapCli, + }); + + expect(error).toContain( + "Unsupported manifest format. Please make sure that you have the 'format' field present in samples/invalid-format.yaml with one of the following values:" + ); + expect(output).toBe(""); + expect(code).toEqual(1); + }); + + test("Should output a YAML-ish schema", async () => { + const manifestFile = path.join(testsRoot, "samples", "polywrap.yaml"); + const { exitCode: code, stdout: output, stderr: error } = await runCLI({ + args: ["manifest", "schema", "-m", manifestFile], + cwd: testsRoot, + cli: polywrapCli, + }); + + expect(output).toContain("format: #"); + expect(error).toBe(""); + expect(code).toEqual(0); + }); + + test("Should output a raw schema", async () => { + const manifestFile = path.join(testsRoot, "samples", "polywrap.yaml"); + const { exitCode: code, stdout: output, stderr: error } = await runCLI({ + args: ["manifest", "schema", "-m", manifestFile, "--raw"], + cwd: testsRoot, + cli: polywrapCli, + }); + + const schemasPackageDir = path.dirname( + require.resolve("@polywrap/polywrap-manifest-schemas") + ); + + const originalSchemaFile = path.join( + schemasPackageDir, + "formats", + "polywrap", + "0.1.0.json" + ); + const originalSchema = fs.readFileSync(originalSchemaFile, { + encoding: "utf-8", + }); + + expect(output).toContain(originalSchema); + expect(error).toBe(""); + expect(code).toEqual(0); + }); + }); +}); diff --git a/packages/cli/src/__tests__/e2e/no-command.spec.ts b/packages/cli/src/__tests__/e2e/no-command.spec.ts index ceae614773..69289461a6 100644 --- a/packages/cli/src/__tests__/e2e/no-command.spec.ts +++ b/packages/cli/src/__tests__/e2e/no-command.spec.ts @@ -16,6 +16,7 @@ Commands: infra|i [options] Modular Infrastructure-As-Code Orchestrator run|r [options] Runs Workflows docgen|o [options] Generate wrapper documentation + manifest|m Inspect & Migrade Polywrap Manifests help [command] display help for command `; diff --git a/packages/cli/src/__tests__/e2e/run.spec.ts b/packages/cli/src/__tests__/e2e/run.spec.ts index 6b5ac072cd..160aff8e37 100644 --- a/packages/cli/src/__tests__/e2e/run.spec.ts +++ b/packages/cli/src/__tests__/e2e/run.spec.ts @@ -1,6 +1,6 @@ import fs from "fs"; import path from "path"; -import yaml from "js-yaml"; +import yaml from "yaml"; import { clearStyle, parseOutput, polywrapCli } from "./utils"; @@ -14,15 +14,17 @@ const HELP = `Usage: polywrap run|r [options] Runs Workflows Options: - -m, --manifest Workflow Manifest path (default: - "polywrap.test.yaml") + -m, --manifest-file Path to the Polywrap Workflow manifest + file (default: polywrap.test.yaml | + polywrap.test.yml) -c, --client-config Add custom configuration to the PolywrapClient -o, --output-file Output file path for the workflow result -j, --jobs Specify ids of jobs that you want to run - -q, --quiet Suppress output + -v, --verbose Verbose output (default: false) + -q, --quiet Suppress output (default: false) -h, --help display help for command `; @@ -166,7 +168,7 @@ describe("e2e tests for run command", () => { expect(parseOutput(stdout)).toMatchObject( JSON.parse( JSON.stringify( - (yaml.load( + (yaml.parse( fs.readFileSync( path.join(testCaseDir, "output.yaml"), "utf8" @@ -206,7 +208,7 @@ describe("e2e tests for run command", () => { const output = parseOutput(stdout); expect(output.filter((o => o.status === "SUCCEED"))).toHaveLength(output.length); - expect(output.filter((o => o.validation === "SUCCEED"))).toHaveLength(output.length); + expect(output.filter((o => o.validation?.startsWith("SUCCEED")))).toHaveLength(output.length); }); it("Should print error on stderr if validation fails", async () => { @@ -280,7 +282,7 @@ describe("e2e tests for run command", () => { const output = parseOutput(stdout); expect(output.filter((o => o.status === "SUCCEED"))).toHaveLength(output.length); - expect(output.filter((o => o.validation === "SUCCEED"))).toHaveLength(output.length); + expect(output.filter((o => o.validation?.startsWith("SUCCEED")))).toHaveLength(output.length); }); it("Should print error on stderr if job is named 'data' or 'error'", async () => { diff --git a/packages/cli/src/__tests__/unit/docker.spec.ts b/packages/cli/src/__tests__/unit/docker.spec.ts index 6732ec1129..0460eae0a7 100644 --- a/packages/cli/src/__tests__/unit/docker.spec.ts +++ b/packages/cli/src/__tests__/unit/docker.spec.ts @@ -18,8 +18,8 @@ describe("e2e tests for docker", () => { for (let i = 0; i < 3; i++) { promises.push( runCLI({ - args: ["build", "-v"], - cwd: path.join(GetPathToCliTestFiles(), "wasm/build-cmd/001-sanity"), + args: ["build", "-v", "-s", "image"], + cwd: path.join(GetPathToCliTestFiles(), "wasm/build-cmd/assemblyscript/001-sanity"), cli: polywrapCli }).then((result: { exitCode: number; stdout: string; stderr: string }) => { const { exitCode, stderr } = result; diff --git a/packages/cli/src/__tests__/unit/jobrunner.spec.ts b/packages/cli/src/__tests__/unit/jobrunner.spec.ts index 02a9e486a4..602d0561eb 100644 --- a/packages/cli/src/__tests__/unit/jobrunner.spec.ts +++ b/packages/cli/src/__tests__/unit/jobrunner.spec.ts @@ -15,16 +15,15 @@ describe("workflow JobRunner", () => { await buildWrapper( path.join(GetPathToTestWrappers(), "wasm-as", "simple-calculator") ); - client = new PolywrapClient({}); }); for (const testCase of testCases) { - test(testCase.name, async () => { + it(testCase.name, async () => { + expect(client).toBeTruthy(); const ids = Object.keys(testCase.workflow.jobs); const jobRunner = new JobRunner(client, testCase.onExecution); await jobRunner.run(testCase.workflow.jobs, ids); }); } }); - diff --git a/packages/cli/src/cli.ts b/packages/cli/src/cli.ts index b95e8a1b81..9d90d7a8f9 100644 --- a/packages/cli/src/cli.ts +++ b/packages/cli/src/cli.ts @@ -2,13 +2,12 @@ import * as Commands from "./commands"; -import { executeMaybeAsyncFunction } from "@polywrap/core-js"; import { program } from "commander"; export const run = async (argv: string[]): Promise => { for (const command of Object.values(Commands)) { if ("setup" in command) { - await executeMaybeAsyncFunction(command.setup, program); + await command.setup(program); } } diff --git a/packages/cli/src/commands/build.ts b/packages/cli/src/commands/build.ts index 90662f54e3..73f6538ae5 100644 --- a/packages/cli/src/commands/build.ts +++ b/packages/cli/src/commands/build.ts @@ -1,4 +1,5 @@ import { Command, Program } from "./types"; +import { createLogger } from "./utils/createLogger"; import { Compiler, PolywrapProject, @@ -8,19 +9,27 @@ import { watchEventName, intlMsg, defaultPolywrapManifest, - isDockerInstalled, - FileLock, - parseManifestFileOption, parseDirOption, parseClientConfigOption, + parseManifestFileOption, } from "../lib"; +import { CodeGenerator } from "../lib/codegen"; +import { + DockerVMBuildStrategy, + BuildStrategy, + SupportedStrategies, + DockerImageBuildStrategy, + LocalBuildStrategy, +} from "../lib/build-strategies"; -import { print } from "gluegun"; import path from "path"; import readline from "readline"; import { PolywrapClient, PolywrapClientConfig } from "@polywrap/client-js"; +import { PolywrapManifest } from "@polywrap/polywrap-manifest-types-js"; const defaultOutputDir = "./build"; +const defaultStrategy = SupportedStrategies.VM; +const strategyStr = intlMsg.commands_build_options_s_strategy(); const defaultManifestStr = defaultPolywrapManifest.join(" | "); const pathStr = intlMsg.commands_build_options_o_path(); @@ -30,7 +39,9 @@ type BuildCommandOptions = { clientConfig: Partial; codegen: boolean; // defaults to true watch?: boolean; + strategy: SupportedStrategies; verbose?: boolean; + quiet?: boolean; }; export const build: Command = { @@ -56,64 +67,110 @@ export const build: Command = { `${intlMsg.commands_common_options_config()}` ) .option(`-n, --no-codegen`, `${intlMsg.commands_build_options_n()}`) + .option( + `-s, --strategy <${strategyStr}>`, + `${intlMsg.commands_build_options_s()}`, + defaultStrategy + ) .option(`-w, --watch`, `${intlMsg.commands_build_options_w()}`) - .option(`-v, --verbose`, `${intlMsg.commands_build_options_v()}`) + .option("-v, --verbose", intlMsg.commands_common_options_verbose()) + .option("-q, --quiet", intlMsg.commands_common_options_quiet()) .action(async (options) => { await run({ ...options, - manifestFile: parseManifestFileOption(options.manifestFile), + manifestFile: parseManifestFileOption( + options.manifestFile, + defaultPolywrapManifest + ), clientConfig: await parseClientConfigOption(options.clientConfig), outputDir: parseDirOption(options.outputDir, defaultOutputDir), + strategy: options.strategy, }); }); }, }; +async function validateManifestModules(polywrapManifest: PolywrapManifest) { + if ( + polywrapManifest.project.type !== "interface" && + !polywrapManifest.source.module + ) { + const missingModuleMessage = intlMsg.lib_compiler_missingModule(); + throw Error(missingModuleMessage); + } + + if ( + polywrapManifest.project.type === "interface" && + polywrapManifest.source.module + ) { + const noInterfaceModule = intlMsg.lib_compiler_noInterfaceModule(); + throw Error(noInterfaceModule); + } +} + +function createBuildStrategy( + strategy: BuildCommandOptions["strategy"], + outputDir: string, + project: PolywrapProject +): BuildStrategy { + switch (strategy) { + case SupportedStrategies.LOCAL: + return new LocalBuildStrategy({ outputDir, project }); + case SupportedStrategies.IMAGE: + return new DockerImageBuildStrategy({ outputDir, project }); + case SupportedStrategies.VM: + return new DockerVMBuildStrategy({ outputDir, project }); + default: + throw Error(`Unknown strategy: ${strategy}`); + } +} + async function run(options: BuildCommandOptions) { const { watch, - verbose, manifestFile, outputDir, clientConfig, + strategy, codegen, + verbose, + quiet, } = options; + const logger = createLogger({ verbose, quiet }); // Get Client const client = new PolywrapClient(clientConfig); - // Ensure docker is installed - if (!isDockerInstalled()) { - console.log(intlMsg.lib_docker_noInstall()); - return; - } - const project = new PolywrapProject({ rootDir: path.dirname(manifestFile), polywrapManifestPath: manifestFile, - quiet: !verbose, + logger, }); await project.validate(); - const dockerLock = new FileLock( - project.getCachePath("build/DOCKER_LOCK"), - print.error - ); + const polywrapManifest = await project.getManifest(); + await validateManifestModules(polywrapManifest); + + const buildStrategy = createBuildStrategy(strategy, outputDir, project); const schemaComposer = new SchemaComposer({ project, client, }); - const compiler = new Compiler({ - project, - outputDir, - schemaComposer, - codegen, - }); - const execute = async (): Promise => { - compiler.reset(); + const codeGenerator = codegen + ? new CodeGenerator({ project, schemaComposer }) + : undefined; + + const compiler = new Compiler({ + project, + outputDir, + schemaComposer, + buildStrategy, + codeGenerator, + }); + const result = await compiler.compile(); if (!result) { @@ -124,9 +181,7 @@ async function run(options: BuildCommandOptions) { }; if (!watch) { - await dockerLock.request(); const result = await execute(); - await dockerLock.release(); if (!result) { process.exitCode = 1; @@ -134,16 +189,14 @@ async function run(options: BuildCommandOptions) { } } else { // Execute - await dockerLock.request(); await execute(); - await dockerLock.release(); const keyPressListener = () => { // Watch for escape key presses - console.log( + logger.info( `${intlMsg.commands_build_keypressListener_watching()}: ${project.getManifestDir()}` ); - console.log(intlMsg.commands_build_keypressListener_exit()); + logger.info(intlMsg.commands_build_keypressListener_exit()); readline.emitKeypressEvents(process.stdin); process.stdin.on("keypress", async (str, key) => { if ( @@ -152,7 +205,6 @@ async function run(options: BuildCommandOptions) { (key.name == "c" && key.ctrl) ) { await watcher.stop(); - await dockerLock.release(); process.kill(process.pid, "SIGINT"); } }); @@ -175,13 +227,11 @@ async function run(options: BuildCommandOptions) { execute: async (events: WatchEvent[]) => { // Log all of the events encountered for (const event of events) { - console.log(`${watchEventName(event.type)}: ${event.path}`); + logger.info(`${watchEventName(event.type)}: ${event.path}`); } // Execute the build - await dockerLock.request(); await execute(); - await dockerLock.release(); // Process key presses keyPressListener(); diff --git a/packages/cli/src/commands/codegen.ts b/packages/cli/src/commands/codegen.ts index 1247cd1472..451c76768a 100644 --- a/packages/cli/src/commands/codegen.ts +++ b/packages/cli/src/commands/codegen.ts @@ -1,10 +1,10 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ import { Command, Program } from "./types"; +import { createLogger } from "./utils/createLogger"; import { CodeGenerator, SchemaComposer, intlMsg, - defaultPolywrapManifest, parseDirOption, parseCodegenScriptOption, parseManifestFileOption, @@ -12,7 +12,10 @@ import { getProjectFromManifest, isPluginManifestLanguage, generateWrapFile, + defaultProjectManifestFiles, + defaultPolywrapManifest, } from "../lib"; +import { ScriptCodegenerator } from "../lib/codegen/ScriptCodeGenerator"; import { PolywrapClient, PolywrapClientConfig } from "@polywrap/client-js"; import path from "path"; @@ -30,6 +33,8 @@ type CodegenCommandOptions = { publishDir: string; script?: string; clientConfig: Partial; + verbose?: boolean; + quiet?: boolean; }; export const codegen: Command = { @@ -64,13 +69,18 @@ export const codegen: Command = { `-c, --client-config <${intlMsg.commands_common_options_configPath()}>`, `${intlMsg.commands_common_options_config()}` ) + .option("-v, --verbose", intlMsg.commands_common_options_verbose()) + .option("-q, --quiet", intlMsg.commands_common_options_quiet()) .action(async (options) => { await run({ ...options, clientConfig: await parseClientConfigOption(options.clientConfig), codegenDir: parseDirOption(options.codegenDir, defaultCodegenDir), script: parseCodegenScriptOption(options.script), - manifestFile: parseManifestFileOption(options.manifestFile), + manifestFile: parseManifestFileOption( + options.manifestFile, + defaultProjectManifestFiles + ), publishDir: parseDirOption(options.publishDir, defaultPublishDir), }); }); @@ -84,12 +94,15 @@ async function run(options: CodegenCommandOptions) { script, clientConfig, publishDir, + verbose, + quiet, } = options; + const logger = createLogger({ verbose, quiet }); // Get Client const client = new PolywrapClient(clientConfig); - const project = await getProjectFromManifest(manifestFile); + const project = await getProjectFromManifest(manifestFile, logger); if (!project) { return; @@ -103,12 +116,20 @@ async function run(options: CodegenCommandOptions) { project, client, }); - const codeGenerator = new CodeGenerator({ - project, - schemaComposer, - codegenDirAbs: codegenDir, - customScript: script, - }); + + const codeGenerator = script + ? new ScriptCodegenerator({ + codegenDirAbs: codegenDir, + script, + schemaComposer, + project, + omitHeader: false, + mustacheView: undefined, + }) + : new CodeGenerator({ + schemaComposer, + project, + }); result = await codeGenerator.generate(); @@ -125,12 +146,13 @@ async function run(options: CodegenCommandOptions) { await schemaComposer.getComposedAbis(), await project.getName(), "plugin", - manifestPath + manifestPath, + logger ); } if (result) { - console.log(`🔥 ${intlMsg.commands_codegen_success()} 🔥`); + logger.info(`🔥 ${intlMsg.commands_codegen_success()} 🔥`); process.exitCode = 0; } else { process.exitCode = 1; diff --git a/packages/cli/src/commands/create.ts b/packages/cli/src/commands/create.ts index b924faa4cd..cc31969c10 100644 --- a/packages/cli/src/commands/create.ts +++ b/packages/cli/src/commands/create.ts @@ -1,7 +1,11 @@ import { Command, Program } from "./types"; +import { createLogger } from "./utils/createLogger"; import { generateProjectTemplate, intlMsg } from "../lib"; -import { prompt, filesystem } from "gluegun"; +import fse from "fs-extra"; +import path from "path"; +import yesno from "yesno"; +import rimraf from "rimraf"; import { Argument } from "commander"; const nameStr = intlMsg.commands_create_options_projectName(); @@ -22,6 +26,8 @@ export type ProjectType = keyof typeof supportedLangs; export type SupportedLangs = typeof supportedLangs[ProjectType][number]; type CreateCommandOptions = { outputDir?: string; + verbose?: boolean; + quiet?: boolean; }; export const create: Command = { @@ -46,6 +52,8 @@ export const create: Command = { `-o, --output-dir <${pathStr}>`, `${intlMsg.commands_create_options_o()}` ) + .option("-v, --verbose", intlMsg.commands_common_options_verbose()) + .option("-q, --quiet", intlMsg.commands_common_options_quiet()) .action(async (langStr, nameStr, options) => { await run("wasm", langStr, nameStr, options); }); @@ -65,6 +73,8 @@ export const create: Command = { `-o, --output-dir <${pathStr}>`, `${intlMsg.commands_create_options_o()}` ) + .option("-v, --verbose", intlMsg.commands_common_options_verbose()) + .option("-q, --quiet", intlMsg.commands_common_options_quiet()) .action(async (langStr, nameStr, options) => { await run("app", langStr, nameStr, options); }); @@ -84,6 +94,8 @@ export const create: Command = { `-o, --output-dir <${pathStr}>`, `${intlMsg.commands_create_options_o()}` ) + .option("-v, --verbose", intlMsg.commands_common_options_verbose()) + .option("-q, --quiet", intlMsg.commands_common_options_quiet()) .action(async (langStr, nameStr, options) => { await run("plugin", langStr, nameStr, options); }); @@ -96,36 +108,36 @@ async function run( name: string, options: CreateCommandOptions ) { - const { outputDir } = options; + const { outputDir, verbose, quiet } = options; + const logger = createLogger({ verbose, quiet }); - const projectDir = outputDir ? `${outputDir}/${name}` : name; + const projectDir = path.resolve(outputDir ? `${outputDir}/${name}` : name); // check if project already exists - if (!filesystem.exists(projectDir)) { - console.log(); - console.info(intlMsg.commands_create_settingUp()); + if (!fse.existsSync(projectDir)) { + logger.info(intlMsg.commands_create_settingUp()); + fse.mkdirSync(projectDir, { recursive: true }); } else { const directoryExistsMessage = intlMsg.commands_create_directoryExists({ dir: projectDir, }); - console.info(directoryExistsMessage); - const overwrite = await prompt.confirm( - intlMsg.commands_create_overwritePrompt() - ); + logger.info(directoryExistsMessage); + const overwrite = await yesno({ + question: intlMsg.commands_create_overwritePrompt(), + }); if (overwrite) { const overwritingMessage = intlMsg.commands_create_overwriting({ dir: projectDir, }); - console.info(overwritingMessage); - filesystem.remove(projectDir); + logger.info(overwritingMessage); + rimraf.sync(projectDir); } else { process.exit(8); } } - generateProjectTemplate(command, lang, projectDir, filesystem) + generateProjectTemplate(command, lang, projectDir) .then(() => { - console.log(); let readyMessage; if (command === "wasm") { readyMessage = intlMsg.commands_create_readyProtocol(); @@ -134,12 +146,14 @@ async function run( } else if (command === "plugin") { readyMessage = intlMsg.commands_create_readyPlugin(); } - console.info(`🔥 ${readyMessage} 🔥`); + logger.info(`🔥 ${readyMessage} 🔥`); + process.exit(0); }) .catch((err) => { const commandFailError = intlMsg.commands_create_error_commandFail({ - error: err.command, + error: JSON.stringify(err, null, 2), }); - console.error(commandFailError); + logger.error(commandFailError); + process.exit(1); }); } diff --git a/packages/cli/src/commands/deploy.ts b/packages/cli/src/commands/deploy.ts index 92ab54824e..9b903bf76e 100644 --- a/packages/cli/src/commands/deploy.ts +++ b/packages/cli/src/commands/deploy.ts @@ -1,5 +1,6 @@ /* eslint-disable prefer-const */ import { Command, Program } from "./types"; +import { createLogger } from "./utils/createLogger"; import { defaultPolywrapManifest, DeployPackage, @@ -13,8 +14,7 @@ import { import { DeployManifest } from "@polywrap/polywrap-manifest-types-js"; import fs from "fs"; import nodePath from "path"; -import { print } from "gluegun"; -import yaml from "js-yaml"; +import yaml from "yaml"; import { validate } from "jsonschema"; const defaultManifestStr = defaultPolywrapManifest.join(" | "); @@ -24,6 +24,7 @@ type DeployCommandOptions = { manifestFile: string; outputFile?: string; verbose?: boolean; + quiet?: boolean; }; type ManifestJob = DeployManifest["jobs"][number]; @@ -45,23 +46,28 @@ export const deploy: Command = { `-o, --output-file <${pathStr}>`, `${intlMsg.commands_deploy_options_o()}` ) - .option(`-v, --verbose`, `${intlMsg.commands_deploy_options_v()}`) + .option("-v, --verbose", intlMsg.commands_common_options_verbose()) + .option("-q, --quiet", intlMsg.commands_common_options_quiet()) .action(async (options) => { await run({ ...options, - manifestFile: parseManifestFileOption(options.manifestFile), + manifestFile: parseManifestFileOption( + options.manifestFile, + defaultPolywrapManifest + ), }); }); }, }; async function run(options: DeployCommandOptions): Promise { - const { manifestFile, verbose, outputFile } = options; + const { manifestFile, outputFile, verbose, quiet } = options; + const logger = createLogger({ verbose, quiet }); const project = new PolywrapProject({ rootDir: nodePath.dirname(manifestFile), polywrapManifestPath: manifestFile, - quiet: !verbose, + logger, }); await project.validate(); @@ -125,7 +131,7 @@ async function run(options: DeployCommandOptions): Promise { name: jobName, steps, config: job.config ?? {}, - printer: print, + logger, }); }); @@ -137,7 +143,7 @@ async function run(options: DeployCommandOptions): Promise { switch (outputFileExt) { case "yaml": case "yml": - fs.writeFileSync(outputFile, yaml.dump(jobResults)); + fs.writeFileSync(outputFile, yaml.stringify(jobResults, null, 2)); break; case "json": fs.writeFileSync(outputFile, JSON.stringify(jobResults, null, 2)); diff --git a/packages/cli/src/commands/docgen.ts b/packages/cli/src/commands/docgen.ts index 97d0d2cfbc..b4ebbdf4f8 100644 --- a/packages/cli/src/commands/docgen.ts +++ b/packages/cli/src/commands/docgen.ts @@ -1,26 +1,21 @@ /* eslint-disable prefer-const */ import { - AnyProjectManifest, - AppProject, - CodeGenerator, - defaultAppManifest, defaultPolywrapManifest, - Project, SchemaComposer, - PolywrapProject, intlMsg, - PluginProject, parseClientConfigOption, - defaultPluginManifest, parseDirOption, - parseDocgenManifestFileOption, + parseManifestFileOption, + defaultProjectManifestFiles, + getProjectFromManifest, } from "../lib"; import { Command, Program } from "./types"; +import { createLogger } from "./utils/createLogger"; import { scriptPath as docusaurusScriptPath } from "../lib/docgen/docusaurus"; import { scriptPath as jsdocScriptPath } from "../lib/docgen/jsdoc"; import { scriptPath as schemaScriptPath } from "../lib/docgen/schema"; +import { ScriptCodegenerator } from "../lib/codegen/ScriptCodeGenerator"; -import path from "path"; import { PolywrapClient, PolywrapClientConfig } from "@polywrap/client-js"; import chalk from "chalk"; import { Argument } from "commander"; @@ -33,11 +28,6 @@ const commandToPathMap: Record = { export type DocType = keyof typeof commandToPathMap; -// A list of UNIQUE possible default filenames for the polywrap manifest -const defaultManifest = defaultPolywrapManifest - .concat(defaultAppManifest) - .concat(defaultPluginManifest) - .filter((value, index, self) => self.indexOf(value) === index); const defaultDocgenDir = "./docs"; const pathStr = intlMsg.commands_codegen_options_o_path(); @@ -46,6 +36,8 @@ type DocgenCommandOptions = { docgenDir: string; clientConfig: Partial; imports: boolean; + verbose?: boolean; + quiet?: boolean; }; enum Actions { @@ -85,7 +77,7 @@ export const docgen: Command = { .option( `-m, --manifest-file <${pathStr}>`, intlMsg.commands_docgen_options_m({ - default: defaultManifest.join(" | "), + default: defaultPolywrapManifest.join(" | "), }) ) .option( @@ -99,10 +91,15 @@ export const docgen: Command = { `${intlMsg.commands_common_options_config()}` ) .option(`-i, --imports`, `${intlMsg.commands_docgen_options_i()}`) + .option("-v, --verbose", intlMsg.commands_common_options_verbose()) + .option("-q, --quiet", intlMsg.commands_common_options_quiet()) .action(async (action, options) => { await run(action, { ...options, - manifestFile: parseDocgenManifestFileOption(options.manifestFile), + manifestFile: parseManifestFileOption( + options.manifestFile, + defaultProjectManifestFiles + ), docgenDir: parseDirOption(options.docgenDir, defaultDocgenDir), clientConfig: await parseClientConfigOption(options.clientConfig), }); @@ -111,60 +108,52 @@ export const docgen: Command = { }; async function run(command: DocType, options: DocgenCommandOptions) { - const { manifestFile, docgenDir, clientConfig, imports } = options; + const { + manifestFile, + docgenDir, + clientConfig, + imports, + verbose, + quiet, + } = options; + const logger = createLogger({ verbose, quiet }); + + let project = await getProjectFromManifest(manifestFile, logger); + + if (!project) { + logger.error( + intlMsg.commands_docgen_error_projectLoadFailed({ + manifestFile: manifestFile, + }) + ); - const isAppManifest: boolean = - (manifestFile).toLowerCase().endsWith("polywrap.app.yaml") || - (manifestFile).toLowerCase().endsWith("polywrap.app.yml"); - const isPluginManifest: boolean = - (manifestFile).toLowerCase().endsWith("polywrap.plugin.yaml") || - (manifestFile).toLowerCase().endsWith("polywrap.plugin.yml"); + process.exitCode = 1; + return; + } + + await project.validate(); // Resolve custom script const customScript = require.resolve(commandToPathMap[command]); - // Get client const client = new PolywrapClient(clientConfig); - // Get project - let project: Project; - if (isAppManifest) { - project = new AppProject({ - rootDir: path.dirname(manifestFile), - appManifestPath: manifestFile, - quiet: true, - }); - } else if (isPluginManifest) { - project = new PluginProject({ - rootDir: path.dirname(manifestFile), - pluginManifestPath: manifestFile, - quiet: true, - }); - } else { - project = new PolywrapProject({ - rootDir: path.dirname(manifestFile), - polywrapManifestPath: manifestFile, - quiet: true, - }); - } - await project.validate(); - const schemaComposer = new SchemaComposer({ project, client, }); - const codeGenerator = new CodeGenerator({ + const codeGenerator = new ScriptCodegenerator({ project, schemaComposer, - customScript, + script: customScript, codegenDirAbs: docgenDir, omitHeader: true, mustacheView: { imports }, }); if (await codeGenerator.generate()) { - console.log(`🔥 ${intlMsg.commands_docgen_success()} 🔥`); + logger.info(`🔥 ${intlMsg.commands_docgen_success()} 🔥`); process.exitCode = 0; } else { process.exitCode = 1; diff --git a/packages/cli/src/commands/index.ts b/packages/cli/src/commands/index.ts index b161ea24ea..679a6877ff 100644 --- a/packages/cli/src/commands/index.ts +++ b/packages/cli/src/commands/index.ts @@ -5,3 +5,4 @@ export * from "./deploy"; export * from "./infra"; export * from "./run"; export * from "./docgen"; +export * from "./manifest"; diff --git a/packages/cli/src/commands/infra.ts b/packages/cli/src/commands/infra.ts index d5b68dc089..9a6cce9691 100644 --- a/packages/cli/src/commands/infra.ts +++ b/packages/cli/src/commands/infra.ts @@ -1,17 +1,24 @@ -import { intlMsg, Infra, loadInfraManifest } from "../lib"; +import { + intlMsg, + Infra, + loadInfraManifest, + defaultInfraManifest, + resolvePathIfExists, +} from "../lib"; +import { createLogger } from "./utils/createLogger"; import { Command, Program } from "./types"; import { InfraManifest } from "@polywrap/polywrap-manifest-types-js"; -import { print } from "gluegun"; import path from "path"; import { Argument } from "commander"; import chalk from "chalk"; -import yaml from "js-yaml"; +import yaml from "yaml"; import { readdirSync } from "fs"; type InfraCommandOptions = { modules?: string; verbose?: boolean; + quiet?: boolean; manifest: string; }; @@ -30,8 +37,9 @@ const DEFAULT_MODULES_PATH = path.join( "infra-modules" ); -const moduleNameStr = intlMsg.commands_infra_moduleName(); -const manifestNameStr = intlMsg.commands_infra_options_manifest(); +const defaultManifestStr = defaultInfraManifest.join(" | "); +const pathStr = intlMsg.commands_infra_options_m_path(); +const moduleNameStr = intlMsg.commands_infra_options_o_module(); const argumentsDescription = ` ${intlMsg.commands_infra_actions_subtitle()} @@ -60,60 +68,74 @@ export const infra: Command = { ) .showHelpAfterError(true) .option( - `--manifest <${manifestNameStr}>`, - intlMsg.commands_infra_manifestPathDescription(), - "polywrap.infra.yaml" + `-m, --manifest-file <${pathStr}>`, + intlMsg.commands_infra_options_m({ + default: defaultManifestStr, + }) ) .option( - `-m, --modules <${moduleNameStr},${moduleNameStr}>`, - intlMsg.commands_infra_options_m() + `-o, --modules <${moduleNameStr},${moduleNameStr}>`, + intlMsg.commands_infra_options_o() ) - .option("-v, --verbose", intlMsg.commands_infra_options_v()) + .option("-v, --verbose", intlMsg.commands_common_options_verbose()) + .option("-q, --quiet", intlMsg.commands_common_options_quiet()) .action(async (action, options) => { - await run(action, options); + await run(action, { + ...options, + manifest: options.manifestFile + ? [options.manifestFile] + : defaultInfraManifest, + }); }); }, }; +const tip = `Tip: If no infra manifest is specified, a default module should be specified using the '--modules' option. + +Default Modules: \n${readdirSync(DEFAULT_MODULES_PATH) + .map((m) => `\n- ${m}`) + .join("")} + +Example: 'polywrap infra up --modules=eth-ens-ipfs'.`; + async function run( action: InfraActions, - options: InfraCommandOptions + options: InfraCommandOptions & { manifest: string[] } ): Promise { - const { modules, verbose, manifest } = options; + const { modules, verbose, quiet, manifest } = options; + + const logger = createLogger({ verbose, quiet }); + // eslint-disable-next-line prefer-const let modulesArray: string[] = []; if (modules) { modulesArray = modules.split(",").map((m: string) => m.trim()); } - const manifestPath = path.resolve(manifest); + const manifestPath = resolvePathIfExists(manifest); let infraManifest: InfraManifest | undefined; - try { - infraManifest = await loadInfraManifest(manifestPath, !verbose); - } catch (e) { - if (!modulesArray.length) { - throw new Error( - `${e.message} - -Tip: If no infra manifest is specified, a default module should be specified using the '--modules' option. - -Default Modules: \n${readdirSync(DEFAULT_MODULES_PATH) - .map((m) => `\n- ${m}`) - .join("")} - -Example: 'polywrap infra up --modules=eth-ens-ipfs'.` - ); + if (manifestPath) { + try { + infraManifest = await loadInfraManifest(manifestPath, logger); + } catch (e) { + if (!modulesArray.length) { + throw new Error(`${e.message}\n\n${tip}`); + } else { + throw new Error(e.message); + } } + } else if (!modulesArray.length) { + throw new Error(tip); } const infra = new Infra({ - rootDir: path.dirname(manifestPath), + rootDir: manifestPath ? path.dirname(manifestPath) : process.cwd(), modulesToUse: modulesArray, infraManifest, defaultInfraModulesPath: DEFAULT_MODULES_PATH, - quiet: !verbose, + logger, }); const filteredModules = infra.getFilteredModules(); @@ -123,16 +145,16 @@ Example: 'polywrap infra up --modules=eth-ens-ipfs'.` const errorMsg = intlMsg.commands_infra_error_noModulesMatch({ modules, }); - print.error(errorMsg); + logger.error(errorMsg); return; } const errorMsg = intlMsg.commands_infra_error_noModulesDeclared(); - print.error(errorMsg); + logger.error(errorMsg); return; } - print.info( + logger.info( `${intlMsg.commands_infra_modulesUsed_text()}: ${filteredModules .map((f) => `\n- ${f.name}`) .join("")}\n` @@ -146,12 +168,10 @@ Example: 'polywrap infra up --modules=eth-ens-ipfs'.` await infra.down(); break; case InfraActions.VARS: - print.info(await infra.getVars()); + logger.info(JSON.stringify(await infra.getVars(), null, 2)); break; case InfraActions.CONFIG: - print.info( - yaml.safeDump((await infra.config()).data.config, { indent: 2 }) - ); + logger.info(yaml.stringify((await infra.config()).data.config, null, 2)); break; default: throw Error(intlMsg.commands_infra_error_never()); diff --git a/packages/cli/src/commands/manifest.ts b/packages/cli/src/commands/manifest.ts new file mode 100644 index 0000000000..65696fac62 --- /dev/null +++ b/packages/cli/src/commands/manifest.ts @@ -0,0 +1,595 @@ +import { Argument, Command, Program } from "./types"; +import { createLogger } from "./utils/createLogger"; +import { + defaultBuildManifest, + defaultDeployManifest, + defaultInfraManifest, + defaultMetaManifest, + defaultWorkflowManifest, + getProjectManifestLanguage, + intlMsg, + isAppManifestLanguage, + isPluginManifestLanguage, + isPolywrapManifestLanguage, + maybeGetManifestFormatVersion, + parseManifestFileOption, + CacheDirectory, + defaultPolywrapManifest, + Logger, +} from "../lib"; +import { + getYamlishSchemaForManifestJsonSchemaObject, + migrateAppProjectManifest, + migrateBuildExtensionManifest, + migrateDeployExtensionManifest, + migrateInfraExtensionManifest, + migrateMetaExtensionManifest, + migratePluginProjectManifest, + migratePolywrapProjectManifest, + migrateWorkflow, +} from "../lib/manifest"; +import { defaultProjectManifestFiles } from "../lib/option-defaults"; + +import { JSONSchema4 } from "json-schema"; +import { + AppManifestFormats, + AppManifestSchemaFiles, + BuildManifestFormats, + BuildManifestSchemaFiles, + DeployManifestFormats, + DeployManifestSchemaFiles, + InfraManifestFormats, + InfraManifestSchemaFiles, + MetaManifestFormats, + MetaManifestSchemaFiles, + PluginManifestFormats, + PluginManifestSchemaFiles, + PolywrapManifestFormats, + PolywrapManifestSchemaFiles, + PolywrapWorkflowFormats, + PolywrapWorkflowSchemaFiles, + latestAppManifestFormat, + latestBuildManifestFormat, + latestDeployManifestFormat, + latestInfraManifestFormat, + latestMetaManifestFormat, + latestPluginManifestFormat, + latestPolywrapManifestFormat, + latestPolywrapWorkflowFormat, +} from "@polywrap/polywrap-manifest-types-js"; +import { dereference } from "json-schema-ref-parser"; +import fs from "fs"; +import path from "path"; + +const pathStr = intlMsg.commands_manifest_options_m_path(); +const formatStr = intlMsg.commands_manifest_options_m_format(); + +const defaultProjectManifestStr = defaultPolywrapManifest.join(" | "); + +const manifestTypes = [ + "project", + "build", + "deploy", + "infra", + "meta", + "workflow", +] as const; +type ManifestType = typeof manifestTypes[number]; + +type ManifestSchemaCommandOptions = { + raw: boolean; + manifestFile: ManifestType; + verbose?: boolean; + quiet?: boolean; +}; + +type ManifestMigrateCommandOptions = { + manifestFile: string; + format: string; + verbose?: boolean; + quiet?: boolean; +}; + +export const manifest: Command = { + setup: (program: Program) => { + const manifestCommand = program + .command("manifest") + .alias("m") + .description(intlMsg.commands_manifest_description()); + + manifestCommand + .command("schema") + .alias("s") + .description(intlMsg.commands_manifest_command_s()) + .addArgument( + new Argument( + "type", + intlMsg.commands_manifest_options_t({ default: manifestTypes[0] }) + ) + .argOptional() + .choices(manifestTypes) + .default(manifestTypes[0]) + ) + .option( + `-r, --raw`, + intlMsg.commands_manifest_command_s_option_r(), + false + ) + .option( + `-m, --manifest-file <${pathStr}>`, + `${intlMsg.commands_manifest_options_m({ + default: defaultProjectManifestStr, + })}` + ) + .option("-v, --verbose", intlMsg.commands_common_options_verbose()) + .option("-q, --quiet", intlMsg.commands_common_options_quiet()) + .action(async (type, options) => { + await runSchemaCommand(type, options); + }); + + manifestCommand + .command("migrate") + .alias("m") + .description(intlMsg.commands_manifest_command_m()) + .addArgument( + new Argument( + "type", + intlMsg.commands_manifest_options_t({ default: manifestTypes[0] }) + ) + .argOptional() + .choices(manifestTypes) + .default(manifestTypes[0]) + ) + .option( + `-m, --manifest-file <${pathStr}>`, + `${intlMsg.commands_manifest_options_m({ + default: defaultProjectManifestStr, + })}` + ) + .option( + `-f, --format <${formatStr}>`, + `${intlMsg.commands_manifest_options_f()}` + ) + .option("-v, --verbose", intlMsg.commands_common_options_verbose()) + .option("-q, --quiet", intlMsg.commands_common_options_quiet()) + .action(async (type, options) => { + await runMigrateCommand(type, options); + }); + }, +}; + +export const runSchemaCommand = async ( + type: ManifestType, + options: ManifestSchemaCommandOptions +): Promise => { + const { verbose, quiet } = options; + const logger = createLogger({ verbose, quiet }); + let manifestfile = ""; + + switch (type) { + case "project": + manifestfile = parseManifestFileOption( + options.manifestFile, + defaultProjectManifestFiles + ); + break; + + case "build": + manifestfile = parseManifestFileOption( + options.manifestFile, + defaultBuildManifest + ); + break; + + case "meta": + manifestfile = parseManifestFileOption( + options.manifestFile, + defaultMetaManifest + ); + break; + + case "deploy": + manifestfile = parseManifestFileOption( + options.manifestFile, + defaultDeployManifest + ); + break; + + case "infra": + manifestfile = parseManifestFileOption( + options.manifestFile, + defaultInfraManifest + ); + break; + + case "workflow": + manifestfile = parseManifestFileOption( + options.manifestFile, + defaultWorkflowManifest + ); + break; + } + + const manifestString = fs.readFileSync(manifestfile, { + encoding: "utf-8", + }); + + const manifestVersion = maybeGetManifestFormatVersion(manifestString); + + const schemasPackageDir = path.dirname( + require.resolve("@polywrap/polywrap-manifest-schemas") + ); + + let manifestSchemaFile = ""; + let language: string | undefined; + + switch (type) { + case "project": + language = getProjectManifestLanguage(manifestString); + + if (!language) { + throw new Error("Unsupported project type!"); + } + + if (isPolywrapManifestLanguage(language)) { + maybeFailOnUnsupportedManifestFormat( + manifestVersion, + Object.values(PolywrapManifestFormats), + manifestfile, + logger + ); + + manifestSchemaFile = path.join( + schemasPackageDir, + PolywrapManifestSchemaFiles[ + manifestVersion ?? latestPolywrapManifestFormat + ] + ); + } else if (isAppManifestLanguage(language)) { + maybeFailOnUnsupportedManifestFormat( + manifestVersion, + Object.values(AppManifestFormats), + manifestfile, + logger + ); + + manifestSchemaFile = path.join( + schemasPackageDir, + AppManifestSchemaFiles[manifestVersion ?? latestAppManifestFormat] + ); + } else if (isPluginManifestLanguage(language)) { + maybeFailOnUnsupportedManifestFormat( + manifestVersion, + Object.values(PluginManifestFormats), + manifestfile, + logger + ); + + manifestSchemaFile = path.join( + schemasPackageDir, + PluginManifestSchemaFiles[ + manifestVersion ?? latestPluginManifestFormat + ] + ); + } else { + throw new Error("Unsupported project type!"); + } + break; + + case "build": + maybeFailOnUnsupportedManifestFormat( + manifestVersion, + Object.values(BuildManifestFormats), + manifestfile, + logger + ); + + manifestSchemaFile = path.join( + schemasPackageDir, + BuildManifestSchemaFiles[manifestVersion ?? latestBuildManifestFormat] + ); + break; + + case "meta": + maybeFailOnUnsupportedManifestFormat( + manifestVersion, + Object.values(MetaManifestFormats), + manifestfile, + logger + ); + + manifestSchemaFile = path.join( + schemasPackageDir, + MetaManifestSchemaFiles[manifestVersion ?? latestMetaManifestFormat] + ); + break; + + case "deploy": + maybeFailOnUnsupportedManifestFormat( + manifestVersion, + Object.values(DeployManifestFormats), + manifestfile, + logger + ); + + manifestSchemaFile = path.join( + schemasPackageDir, + DeployManifestSchemaFiles[manifestVersion ?? latestDeployManifestFormat] + ); + break; + + case "infra": + maybeFailOnUnsupportedManifestFormat( + manifestVersion, + Object.values(InfraManifestFormats), + manifestfile, + logger + ); + + manifestSchemaFile = path.join( + schemasPackageDir, + InfraManifestSchemaFiles[manifestVersion ?? latestInfraManifestFormat] + ); + break; + + case "workflow": + maybeFailOnUnsupportedManifestFormat( + manifestVersion, + Object.values(PolywrapWorkflowFormats), + manifestfile, + logger + ); + + manifestSchemaFile = path.join( + schemasPackageDir, + PolywrapWorkflowSchemaFiles[ + manifestVersion ?? latestPolywrapWorkflowFormat + ] + ); + break; + } + + const schemaString = fs.readFileSync(manifestSchemaFile, { + encoding: "utf-8", + }); + + if (options.raw) { + logger.info(schemaString); + } else { + const schema = await dereference(JSON.parse(schemaString)); + + logger.info( + getYamlishSchemaForManifestJsonSchemaObject( + schema.properties as JSONSchema4 + ) + ); + } +}; + +const runMigrateCommand = async ( + type: ManifestType, + options: ManifestMigrateCommandOptions +) => { + const { verbose, quiet } = options; + const logger = createLogger({ verbose, quiet }); + let manifestFile = ""; + let manifestString: string; + let language: string | undefined; + + switch (type) { + case "project": + manifestFile = parseManifestFileOption( + options.manifestFile, + defaultProjectManifestFiles + ); + + manifestString = fs.readFileSync(manifestFile, { + encoding: "utf-8", + }); + + language = getProjectManifestLanguage(manifestString); + + if (!language) { + logger.info(intlMsg.commands_manifest_projectTypeError()); + process.exit(1); + } + + if (isPolywrapManifestLanguage(language)) { + maybeFailOnUnsupportedTargetFormat( + options.format, + Object.values(PolywrapManifestFormats), + logger + ); + return migrateManifestFile( + manifestFile, + migratePolywrapProjectManifest, + options.format ?? latestPolywrapManifestFormat, + logger + ); + } else if (isAppManifestLanguage(language)) { + maybeFailOnUnsupportedTargetFormat( + options.format, + Object.values(AppManifestFormats), + logger + ); + return migrateManifestFile( + manifestFile, + migrateAppProjectManifest, + options.format ?? latestPolywrapManifestFormat, + logger + ); + } else if (isPluginManifestLanguage(language)) { + maybeFailOnUnsupportedTargetFormat( + options.format, + Object.values(PluginManifestFormats), + logger + ); + return migrateManifestFile( + manifestFile, + migratePluginProjectManifest, + options.format ?? latestPolywrapManifestFormat, + logger + ); + } + + logger.info(intlMsg.commands_manifest_projectTypeError()); + process.exit(1); + break; + + case "build": + maybeFailOnUnsupportedTargetFormat( + options.format, + Object.values(BuildManifestFormats), + logger + ); + migrateManifestFile( + parseManifestFileOption(options.manifestFile, defaultBuildManifest), + migrateBuildExtensionManifest, + options.format ?? latestBuildManifestFormat, + logger + ); + break; + + case "meta": + maybeFailOnUnsupportedTargetFormat( + options.format, + Object.values(MetaManifestFormats), + logger + ); + migrateManifestFile( + parseManifestFileOption(options.manifestFile, defaultMetaManifest), + migrateMetaExtensionManifest, + options.format ?? latestMetaManifestFormat, + logger + ); + break; + + case "deploy": + maybeFailOnUnsupportedTargetFormat( + options.format, + Object.values(DeployManifestFormats), + logger + ); + migrateManifestFile( + parseManifestFileOption(options.manifestFile, defaultDeployManifest), + migrateDeployExtensionManifest, + options.format ?? latestDeployManifestFormat, + logger + ); + break; + + case "infra": + maybeFailOnUnsupportedTargetFormat( + options.format, + Object.values(InfraManifestFormats), + logger + ); + migrateManifestFile( + parseManifestFileOption(options.manifestFile, defaultInfraManifest), + migrateInfraExtensionManifest, + options.format ?? latestInfraManifestFormat, + logger + ); + break; + + case "workflow": + maybeFailOnUnsupportedTargetFormat( + options.format, + Object.values(PolywrapWorkflowFormats), + logger + ); + migrateManifestFile( + parseManifestFileOption(options.manifestFile, defaultWorkflowManifest), + migrateWorkflow, + options.format ?? latestPolywrapWorkflowFormat, + logger + ); + break; + } +}; + +function migrateManifestFile( + manifestFile: string, + migrationFn: (input: string, to: string) => string, + to: string, + logger: Logger +): void { + const manifestFileName = path.basename(manifestFile); + const manifestFileDir = path.dirname(manifestFile); + + logger.info( + intlMsg.commands_manifest_command_m_migrateManifestMessage({ + manifestFile: manifestFileName, + version: to, + }) + ); + + const manifestString = fs.readFileSync(manifestFile, { + encoding: "utf-8", + }); + + const outputManifestString = migrationFn(manifestString, to); + + // Cache the old manifest file + const cache = new CacheDirectory({ + rootDir: manifestFileDir, + subDir: "manifest", + }); + cache.writeCacheFile( + manifestFileName, + fs.readFileSync(manifestFile, "utf-8") + ); + + logger.info( + intlMsg.commands_manifest_command_m_preserveManifestMessage({ + preservedFilePath: path.relative( + manifestFileDir, + cache.getCachePath(manifestFileName) + ), + }) + ); + + fs.writeFileSync(manifestFile, outputManifestString, { + encoding: "utf-8", + }); +} + +function maybeFailOnUnsupportedManifestFormat( + format: string | undefined, + formats: string[], + manifestFile: string, + logger: Logger +) { + if (!format) { + return; + } + + if (!formats.includes(format)) { + logger.error( + intlMsg.commands_manifest_formatError({ + fileName: path.relative(".", manifestFile), + values: formats.join(", "), + }) + ); + process.exit(1); + } +} + +function maybeFailOnUnsupportedTargetFormat( + format: string | undefined, + formats: string[], + logger: Logger +) { + if (!format) { + return; + } + + if (!formats.includes(format)) { + logger.error( + intlMsg.commands_manifest_migrate_targetFormatError({ + formats: formats.join(", "), + }) + ); + process.exit(1); + } +} diff --git a/packages/cli/src/commands/run.ts b/packages/cli/src/commands/run.ts index f5622703c3..9c9bf9a468 100644 --- a/packages/cli/src/commands/run.ts +++ b/packages/cli/src/commands/run.ts @@ -13,11 +13,14 @@ import { validateOutput, ValidationResult, WorkflowOutput, + defaultWorkflowManifest, + parseManifestFileOption, } from "../lib"; +import { createLogger } from "./utils/createLogger"; import { PolywrapClient, PolywrapClientConfig } from "@polywrap/client-js"; import path from "path"; -import yaml from "js-yaml"; +import yaml from "yaml"; import fs from "fs"; type WorkflowCommandOptions = { @@ -26,9 +29,13 @@ type WorkflowCommandOptions = { jobs?: string[]; validationScript?: string; outputFile?: string; + verbose?: boolean; quiet?: boolean; }; +const defaultManifestStr = defaultWorkflowManifest.join(" | "); +const pathStr = intlMsg.commands_run_options_m_path(); + export const run: Command = { setup: (program: Program) => { program @@ -36,9 +43,10 @@ export const run: Command = { .alias("r") .description(intlMsg.commands_run_description()) .option( - `-m, --manifest <${intlMsg.commands_run_options_manifest()}>`, - intlMsg.commands_run_manifestPathDescription(), - "polywrap.test.yaml" + `-m, --manifest-file <${pathStr}>`, + intlMsg.commands_run_options_m({ + default: defaultManifestStr, + }) ) .option( `-c, --client-config <${intlMsg.commands_common_options_configPath()}>`, @@ -52,10 +60,15 @@ export const run: Command = { `-j, --jobs <${intlMsg.commands_run_options_jobIds()}...>`, intlMsg.commands_run_options_jobs() ) - .option(`-q, --quiet`, `${intlMsg.commands_run_options_quiet()}`) + .option("-v, --verbose", intlMsg.commands_common_options_verbose()) + .option("-q, --quiet", intlMsg.commands_common_options_quiet()) .action(async (options) => { await _run({ ...options, + manifest: parseManifestFileOption( + options.manifestFile, + defaultWorkflowManifest + ), clientConfig: await parseClientConfigOption(options.clientConfig), outputFile: options.outputFile ? parseWorkflowOutputFilePathOption(options.outputFile) @@ -66,11 +79,12 @@ export const run: Command = { }; const _run = async (options: WorkflowCommandOptions) => { - const { manifest, clientConfig, outputFile, quiet, jobs } = options; + const { manifest, clientConfig, outputFile, verbose, quiet, jobs } = options; + const logger = createLogger({ verbose, quiet }); const client = new PolywrapClient(clientConfig); const manifestPath = path.resolve(manifest); - const workflow = await loadWorkflowManifest(manifestPath, quiet); + const workflow = await loadWorkflowManifest(manifestPath, logger); validateJobNames(workflow.jobs); const validationScript = workflow.validation ? loadValidationScript(manifestPath, workflow.validation) @@ -90,7 +104,7 @@ const _run = async (options: WorkflowCommandOptions) => { let validation: ValidationResult | undefined = undefined; if (status === JobStatus.SUCCEED && validationScript) { - validation = validateOutput(output, validationScript); + validation = validateOutput(output, validationScript, logger); } if (!quiet) { @@ -107,7 +121,7 @@ const _run = async (options: WorkflowCommandOptions) => { switch (outputFileExt) { case "yaml": case "yml": - fs.writeFileSync(outputFile, yaml.dump(workflowOutput)); + fs.writeFileSync(outputFile, yaml.stringify(workflowOutput, null, 2)); break; case "json": fs.writeFileSync(outputFile, JSON.stringify(workflowOutput, null, 2)); diff --git a/packages/cli/src/commands/types.ts b/packages/cli/src/commands/types.ts index b046c78d54..03c1f5d622 100644 --- a/packages/cli/src/commands/types.ts +++ b/packages/cli/src/commands/types.ts @@ -1,7 +1,8 @@ +import { MaybeAsync } from "@polywrap/core-js"; import { Command as Program, Argument } from "commander"; export { Program, Argument }; export interface Command { - setup: (program: Program) => void; + setup: (program: Program) => MaybeAsync; } diff --git a/packages/cli/src/commands/utils/createLogger.ts b/packages/cli/src/commands/utils/createLogger.ts new file mode 100644 index 0000000000..497d18e364 --- /dev/null +++ b/packages/cli/src/commands/utils/createLogger.ts @@ -0,0 +1,16 @@ +import { Logger, LogLevel, ConsoleLog } from "../../lib"; + +export function createLogger(flags: { + verbose?: boolean; + quiet?: boolean; +}): Logger { + const level = flags.quiet + ? LogLevel.ERROR + : flags.verbose + ? LogLevel.DEBUG + : LogLevel.INFO; + + return new Logger({ + console: new ConsoleLog(level), + }); +} diff --git a/packages/cli/src/lib/CodeGenerator.ts b/packages/cli/src/lib/CodeGenerator.ts deleted file mode 100644 index cbbc0cf3de..0000000000 --- a/packages/cli/src/lib/CodeGenerator.ts +++ /dev/null @@ -1,195 +0,0 @@ -import { - step, - withSpinner, - isTypescriptFile, - importTypescriptModule, - polywrapManifestLanguages, - isPolywrapManifestLanguage, - polywrapManifestLanguageToBindLanguage, - pluginManifestLanguages, - isPluginManifestLanguage, - pluginManifestLanguageToBindLanguage, - appManifestLanguages, - isAppManifestLanguage, - appManifestLanguageToBindLanguage, - Project, - AnyProjectManifest, - SchemaComposer, - intlMsg, - resetDir, -} from "./"; - -import { BindLanguage, GenerateBindingFn } from "@polywrap/schema-bind"; -import { writeDirectorySync } from "@polywrap/os-js"; -import path from "path"; -import { readFileSync } from "fs"; -import * as gluegun from "gluegun"; -import { Ora } from "ora"; -import Mustache from "mustache"; - -export interface CodeGeneratorConfig { - codegenDirAbs: string; - project: Project; - schemaComposer: SchemaComposer; - customScript?: string; - mustacheView?: Record; - omitHeader?: boolean; -} - -export class CodeGenerator { - private _schema: string | undefined = ""; - - constructor(private _config: CodeGeneratorConfig) {} - - public async generate(): Promise { - try { - // Compile the Wrapper - await this._generateCode(); - - return true; - } catch (e) { - gluegun.print.error(e); - return false; - } - } - - private async _generateCode() { - const { schemaComposer, project, codegenDirAbs } = this._config; - - const run = async (spinner?: Ora) => { - const language = await project.getManifestLanguage(); - let bindLanguage: BindLanguage | undefined; - - if (isPolywrapManifestLanguage(language)) { - bindLanguage = polywrapManifestLanguageToBindLanguage(language); - } else if (isPluginManifestLanguage(language)) { - bindLanguage = pluginManifestLanguageToBindLanguage(language); - } else if (isAppManifestLanguage(language)) { - bindLanguage = appManifestLanguageToBindLanguage(language); - } - - if (!bindLanguage) { - throw Error( - intlMsg.lib_language_unsupportedManifestLanguage({ - language: language, - supported: [ - ...Object.keys(polywrapManifestLanguages), - ...Object.keys(pluginManifestLanguages), - ...Object.keys(appManifestLanguages), - ].join(", "), - }) - ); - } - - // Get the fully composed abi - const abi = await schemaComposer.getComposedAbis(); - - if (!abi) { - throw Error(intlMsg.lib_codeGenerator_abiMissing()); - } - - if (this._config.customScript) { - const customScript = this._config.customScript; - - // Check the generation file if it has the proper run() method - // eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports - const generator = isTypescriptFile(customScript) - ? await importTypescriptModule(customScript) - : // eslint-disable-next-line @typescript-eslint/no-require-imports - await require(customScript); - - if (!generator) { - throw Error(intlMsg.lib_codeGenerator_wrongGenFile()); - } - - const { generateBinding } = generator as { - generateBinding: GenerateBindingFn; - }; - if (!generateBinding) { - throw Error(intlMsg.lib_codeGenerator_nogenerateBindingMethod()); - } - - const binding = await generateBinding({ - projectName: await project.getName(), - abi, - outputDirAbs: codegenDirAbs, - bindLanguage, - config: this._config.mustacheView, - }); - - resetDir(codegenDirAbs); - writeDirectorySync( - codegenDirAbs, - binding.output, - (templatePath: string) => - this._generateTemplate(templatePath, abi, spinner) - ); - } else { - const binding = await project.generateSchemaBindings( - abi, - path.relative(project.getManifestDir(), codegenDirAbs) - ); - - // Output the bindings - resetDir(binding.outputDirAbs); - writeDirectorySync(binding.outputDirAbs, binding.output); - } - }; - - if (project.quiet) { - await run(); - } else { - await withSpinner( - intlMsg.lib_codeGenerator_genCodeText(), - intlMsg.lib_codeGenerator_genCodeError(), - intlMsg.lib_codeGenerator_genCodeWarning(), - async (spinner) => { - return run(spinner); - } - ); - } - } - - private _generateTemplate( - templatePath: string, - config: unknown, - spinner?: Ora - ): string { - const { project } = this._config; - - if (!project.quiet && spinner) { - const stepMessage = intlMsg.lib_codeGenerator_genTemplateStep({ - path: `${templatePath}`, - }); - step(spinner, stepMessage); - } - - if (this._config.customScript) { - // Update template path when the generation file is given - templatePath = path.join( - path.dirname(this._config.customScript), - templatePath - ); - } - - const template = readFileSync(templatePath); - const types = - typeof config === "object" && config !== null ? config : { config }; - let content = Mustache.render(template.toString(), { - ...types, - schema: this._schema, - ...this._config.mustacheView, - }); - - if (this._config.omitHeader) { - return content; - } - - content = `// ${intlMsg.lib_codeGenerator_templateNoModify()} - -${content} -`; - - return content; - } -} diff --git a/packages/cli/src/lib/Compiler.ts b/packages/cli/src/lib/Compiler.ts index 201159da9c..3e394a07c4 100644 --- a/packages/cli/src/lib/Compiler.ts +++ b/packages/cli/src/lib/Compiler.ts @@ -2,12 +2,7 @@ /* eslint-disable @typescript-eslint/no-empty-function */ import { - copyArtifactsFromBuildImage, - createBuildImage, displayPath, - ensureDockerDaemonRunning, - generateDockerfile, - generateDockerImageName, generateWrapFile, intlMsg, outputManifest, @@ -15,95 +10,44 @@ import { PolywrapProject, resetDir, SchemaComposer, - withSpinner, + logActivity, } from "./"; +import { BuildStrategy } from "./build-strategies/BuildStrategy"; +import { CodeGenerator } from "./codegen/CodeGenerator"; -import { PolywrapManifest } from "@polywrap/polywrap-manifest-types-js"; import { WasmWrapper, WrapImports } from "@polywrap/wasm-js"; import { AsyncWasmInstance } from "@polywrap/asyncify-js"; -import { normalizePath, writeDirectorySync } from "@polywrap/os-js"; -import * as gluegun from "gluegun"; +import { normalizePath } from "@polywrap/os-js"; import fs from "fs"; import path from "path"; -import { WrapAbi } from "@polywrap/schema-parse"; - -interface CompilerState { - abi: WrapAbi; - compilerOverrides?: CompilerOverrides; -} - -export interface CompilerOverrides { - validateManifest: (manifest: PolywrapManifest) => void; - generationSubPath: string; -} export interface CompilerConfig { outputDir: string; project: PolywrapProject; + codeGenerator?: CodeGenerator; + buildStrategy: BuildStrategy; schemaComposer: SchemaComposer; - codegen: boolean; } export class Compiler { - private _state: CompilerState | undefined; - constructor(private _config: CompilerConfig) {} - public async codegen(): Promise { - const { project } = this._config; - - const run = async (): Promise => { - const state = await this._getCompilerState(); - - if (!(await this._isInterface())) { - // Generate the bindings - await this._generateCode(state); - } - }; - - if (project.quiet) { - try { - await run(); - return true; - } catch (e) { - gluegun.print.error(e); - return false; - } - } else { - try { - await withSpinner( - intlMsg.lib_compiler_codegenText(), - intlMsg.lib_compiler_codegenError(), - intlMsg.lib_compiler_codegenWarning(), - async () => { - return run(); - } - ); - return true; - } catch (e) { - gluegun.print.error(e); - return false; - } - } - } - public async compile(): Promise { - const { project } = this._config; + const { project, codeGenerator } = this._config; const run = async (): Promise => { - const state = await this._getCompilerState(); - // Init & clean output directory resetDir(this._config.outputDir); // Output: wrap.info - await this._outputWrapManifest(state); + await this._outputWrapManifest(); if (!(await this._isInterface())) { - if (this._config.codegen) { - // Generate the bindings - await this._generateCode(state); + // Generate the bindings + if (codeGenerator) { + await codeGenerator.generate(); } + // Compile the Wrapper await this._buildModules(); } @@ -112,81 +56,20 @@ export class Compiler { await this._outputPolywrapMetadata(); }; - if (project.quiet) { - try { - await run(); - return true; - } catch (e) { - gluegun.print.error(e); - return false; - } - } else { - try { - await withSpinner( - intlMsg.lib_compiler_compileText(), - intlMsg.lib_compiler_compileError(), - intlMsg.lib_compiler_compileWarning(), - async () => { - return run(); - } - ); - return true; - } catch (e) { - gluegun.print.error(e); - return false; - } - } - } - - public reset(): void { - this._config.project.reset(); - this._config.schemaComposer.reset(); - this._state = undefined; - } - - private async _getCompilerState(): Promise { - if (this._state) { - return this._state; - } - - const { project } = this._config; - - // Get the PolywrapManifest - const polywrapManifest = await project.getManifest(); - - // Compose the ABI - const abi = await this._composeAbi(); - - // Allow the build-image to validate the manifest & override functionality - const buildImageDir = `${__dirname}/defaults/build-images/${polywrapManifest.project.type}`; - const buildImageEntryFile = path.join(buildImageDir, "index.ts"); - let compilerOverrides: CompilerOverrides | undefined; - - if (fs.existsSync(buildImageEntryFile)) { - const module = await import(buildImageDir); - - // Get any compiler overrides for the given build-image - if (module.getCompilerOverrides) { - compilerOverrides = module.getCompilerOverrides() as CompilerOverrides; - } - - if (compilerOverrides) { - // Validate the manifest for the given build-image - if (compilerOverrides.validateManifest) { - compilerOverrides.validateManifest(polywrapManifest); + try { + await logActivity( + project.logger, + intlMsg.lib_compiler_compileText(), + intlMsg.lib_compiler_compileError(), + intlMsg.lib_compiler_compileWarning(), + async () => { + return run(); } - } + ); + return true; + } catch (e) { + return false; } - - const state: CompilerState = { - abi, - compilerOverrides, - }; - - await this._validateState(state); - - this._state = state; - return this._state; } private async _isInterface(): Promise { @@ -195,33 +78,6 @@ export class Compiler { return manifest.project.type === "interface"; } - private async _composeAbi(): Promise { - const { schemaComposer } = this._config; - - // Get the fully composed schema - const abi = await schemaComposer.getComposedAbis(); - - if (!abi) { - throw Error(intlMsg.lib_compiler_failedAbiReturn()); - } - - return abi; - } - - private async _generateCode(state: CompilerState): Promise { - const { abi, compilerOverrides } = state; - const { project } = this._config; - - // Generate the bindings - const binding = await project.generateSchemaBindings( - abi, - compilerOverrides?.generationSubPath - ); - - // Output the bindings - return writeDirectorySync(binding.outputDirAbs, binding.output); - } - private async _buildModules(): Promise { const { outputDir } = this._config; @@ -230,137 +86,45 @@ export class Compiler { } // Build the sources - await this._buildSourcesInDocker(); + await this._config.buildStrategy.build(); // Validate the Wasm module await this._validateWasmModule(outputDir); } - private async _buildSourcesInDocker(): Promise { - const { project, outputDir } = this._config; - await ensureDockerDaemonRunning(); - const buildManifestDir = await project.getBuildManifestDir(); - const buildManifest = await project.getBuildManifest(); - const imageName = - buildManifest?.docker?.name || - generateDockerImageName(await project.getBuildUuid()); - let dockerfile = buildManifest?.docker?.dockerfile - ? path.join(buildManifestDir, buildManifest?.docker?.dockerfile) - : path.join(buildManifestDir, "Dockerfile"); - - await project.cacheBuildManifestLinkedPackages(); - - // If the dockerfile path isn't provided, generate it - if (!buildManifest?.docker?.dockerfile) { - // Make sure the default template is in the cached .polywrap/wasm/build/image folder - await project.cacheDefaultBuildImage(); - - dockerfile = generateDockerfile( - project.getCachePath( - path.join( - PolywrapProject.cacheLayout.buildImageDir, - "Dockerfile.mustache" - ) - ), - buildManifest.config || {} - ); - } - - const dockerBuildxConfig = buildManifest?.docker?.buildx; - const useBuildx = !!dockerBuildxConfig; - - let cacheDir: string | undefined; - let removeBuilder = false; - - if (dockerBuildxConfig && typeof dockerBuildxConfig !== "boolean") { - const cache = dockerBuildxConfig.cache; - - if (cache == true) { - cacheDir = project.getCachePath( - PolywrapProject.cacheLayout.buildImageCacheDir - ); - } else if (cache) { - if (!path.isAbsolute(cache)) { - cacheDir = path.join(project.getManifestDir(), cache); - } else { - cacheDir = cache; - } - } - - removeBuilder = !!dockerBuildxConfig.removeBuilder; - } - - const removeImage = !!buildManifest?.docker?.removeImage; - - // If the dockerfile path contains ".mustache", generate - if (dockerfile.indexOf(".mustache") > -1) { - dockerfile = generateDockerfile(dockerfile, buildManifest.config || {}); - } - - // Construct the build image - const dockerImageId = await createBuildImage( - project.getManifestDir(), - imageName, - dockerfile, - cacheDir, - useBuildx, - project.quiet - ); - - await copyArtifactsFromBuildImage( - outputDir, - "wrap.wasm", - imageName, - removeBuilder, - removeImage, - useBuildx, - project.quiet - ); - - return dockerImageId; - } - - private async _outputWrapManifest( - state: CompilerState, - quiet = false - ): Promise { - const { outputDir, project } = this._config; - let manifestPath = `${outputDir}/wrap.info`; + private async _outputWrapManifest(): Promise { + const { outputDir, project, schemaComposer } = this._config; + const manifestPath = `${outputDir}/wrap.info`; const run = async () => { - if (!state.abi) { - throw Error(intlMsg.lib_wrap_abi_not_found()); - } - const manifest = await project.getManifest(); const type = (await this._isInterface()) ? "interface" : "wasm"; + const abi = await schemaComposer.getComposedAbis(); await generateWrapFile( - state.abi, + abi, manifest.project.name, type, - manifestPath + manifestPath, + project.logger ); }; - if (quiet) { - return await run(); - } else { - manifestPath = displayPath(manifestPath); - return await withSpinner( - intlMsg.lib_helpers_wrap_manifest_outputText({ - path: normalizePath(manifestPath), - }), - intlMsg.lib_helpers_wrap_manifest_outputError({ - path: normalizePath(manifestPath), - }), - intlMsg.lib_helpers_wrap_manifest_outputWarning({ - path: normalizePath(manifestPath), - }), - (_spinner): Promise => { - return Promise.resolve(run()); - } - ); - } + const displayManifestPath = displayPath(manifestPath); + return await logActivity( + project.logger, + intlMsg.lib_helpers_wrap_manifest_outputText({ + path: normalizePath(displayManifestPath), + }), + intlMsg.lib_helpers_wrap_manifest_outputError({ + path: normalizePath(displayManifestPath), + }), + intlMsg.lib_helpers_wrap_manifest_outputWarning({ + path: normalizePath(displayManifestPath), + }), + (): Promise => { + return Promise.resolve(run()); + } + ); } private async _outputPolywrapMetadata(): Promise { @@ -376,37 +140,16 @@ export class Compiler { projectMetaManifest, outputDir, project.getManifestDir(), - project.quiet + project.logger ); await outputManifest( builtMetaManifest, path.join(outputDir, "polywrap.meta.json"), - project.quiet + project.logger ); } - private async _validateState(state: CompilerState): Promise { - const { abi } = state; - const { project } = this._config; - - if (!abi) { - throw Error(intlMsg.lib_compiler_missingAbi()); - } - - const manifest = await project.getManifest(); - - if (manifest.project.type !== "interface" && !manifest.source.module) { - const missingModuleMessage = intlMsg.lib_compiler_missingModule(); - throw Error(missingModuleMessage); - } - - if (manifest.project.type === "interface" && manifest.source.module) { - const noInterfaceModule = intlMsg.lib_compiler_noInterfaceModule(); - throw Error(noInterfaceModule); - } - } - private async _validateWasmModule(buildDir: string): Promise { const modulePath = path.join(buildDir, `wrap.wasm`); const wasmSource = fs.readFileSync(modulePath); diff --git a/packages/cli/src/lib/SchemaComposer.ts b/packages/cli/src/lib/SchemaComposer.ts index c0742f0f2b..abc6194d4c 100644 --- a/packages/cli/src/lib/SchemaComposer.ts +++ b/packages/cli/src/lib/SchemaComposer.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/naming-convention */ /* eslint-disable @typescript-eslint/no-empty-function */ +/* eslint-disable no-empty */ import { Project, AnyProjectManifest, intlMsg } from "./"; @@ -11,8 +12,7 @@ import { } from "@polywrap/schema-compose"; import fs from "fs"; import path from "path"; -import * as gluegun from "gluegun"; -import YAML from "js-yaml"; +import YAML from "yaml"; import { deserializeWrapManifest, validateWrapManifest, @@ -127,13 +127,16 @@ export class SchemaComposer { } } - try { - const manifest = await this._client.getManifest(new Uri(uri)); - return manifest.abi; - } catch (e) { - gluegun.print.error(e); - throw e; + const manifest = await this._client.getManifest(new Uri(uri)); + if (!manifest.ok) { + if (manifest.error) { + this._config.project.logger.error( + JSON.stringify(manifest.error, null, 2) + ); + } + throw manifest.error; } + return manifest.value.abi; } private async _loadGraphqlAbi( @@ -179,7 +182,11 @@ export class SchemaComposer { private async _loadYamlAbi(path: string): Promise { // Load the YAML ABI const yaml = fs.readFileSync(path, "utf-8"); - const result = YAML.safeLoad(yaml); + let result: unknown | undefined; + + try { + result = YAML.parse(yaml); + } catch (_) {} if (!result) { throw Error( diff --git a/packages/cli/src/lib/build-strategies/BuildStrategy.ts b/packages/cli/src/lib/build-strategies/BuildStrategy.ts new file mode 100644 index 0000000000..9b0086903c --- /dev/null +++ b/packages/cli/src/lib/build-strategies/BuildStrategy.ts @@ -0,0 +1,47 @@ +import { PolywrapProject } from "../project"; + +import fse from "fs-extra"; +import path from "path"; + +export interface BuildStrategyArgs { + project: PolywrapProject; + outputDir: string; +} + +export abstract class BuildStrategy { + protected project: PolywrapProject; + protected outputDir: string; + + constructor({ project, outputDir }: BuildStrategyArgs) { + this.project = project; + this.outputDir = outputDir; + } + + abstract buildSources(): Promise; + + abstract getStrategyName(): string; + + async build(): Promise { + const language = await this.project.getManifestLanguage(); + const defaultsOfStrategyUsed = path.join( + __dirname, + "..", + "defaults", + "build-strategies", + language, + this.getStrategyName() + ); + const strategyUsedCacheDir = this.project.getCachePath( + PolywrapProject.cacheLayout.buildStrategyUsed + ); + + if (fse.existsSync(strategyUsedCacheDir)) { + fse.removeSync(strategyUsedCacheDir); + } + + fse.mkdirSync(strategyUsedCacheDir, { recursive: true }); + + fse.copySync(defaultsOfStrategyUsed, strategyUsedCacheDir); + return this.buildSources(); + } +} diff --git a/packages/cli/src/lib/build-strategies/index.ts b/packages/cli/src/lib/build-strategies/index.ts new file mode 100644 index 0000000000..6aa24c9e22 --- /dev/null +++ b/packages/cli/src/lib/build-strategies/index.ts @@ -0,0 +1,8 @@ +export * from "./BuildStrategy"; +export * from "./strategies"; + +export enum SupportedStrategies { + VM = "vm", + IMAGE = "image", + LOCAL = "local", +} diff --git a/packages/cli/src/lib/build-strategies/strategies/DockerImageStrategy.ts b/packages/cli/src/lib/build-strategies/strategies/DockerImageStrategy.ts new file mode 100644 index 0000000000..05899c271b --- /dev/null +++ b/packages/cli/src/lib/build-strategies/strategies/DockerImageStrategy.ts @@ -0,0 +1,336 @@ +import { + displayPath, + ensureDockerDaemonRunning, + FileLock, + generateDockerImageName, + isDockerInstalled, + runCommand, + runCommandSync, +} from "../../system"; +import { BuildStrategyArgs, BuildStrategy } from "../BuildStrategy"; +import { intlMsg } from "../../intl"; +import { logActivity } from "../../logging"; + +import fs from "fs"; +import path from "path"; +import { isWin, writeFileSync } from "@polywrap/os-js"; +import Mustache from "mustache"; + +type BuildImageId = string; + +export class DockerImageBuildStrategy extends BuildStrategy { + private _dockerLock: FileLock; + + constructor(args: BuildStrategyArgs) { + super(args); + + if (!isDockerInstalled(this.project.logger)) { + throw new Error(intlMsg.lib_docker_noInstall()); + } + + this._dockerLock = new FileLock( + this.project.getCachePath("build/DOCKER_LOCK"), + (msg) => { + throw new Error(msg); + } + ); + } + + getStrategyName(): string { + return "image"; + } + + public async buildSources(): Promise { + await this._dockerLock.request(); + try { + await ensureDockerDaemonRunning(this.project.logger); + + const buildManifestPath = await this.project.getBuildManifestPath(); + const buildManifestDir = + buildManifestPath && path.dirname(buildManifestPath); + const buildManifest = await this.project.getBuildManifest(); + const imageName = + buildManifest?.strategies?.image?.name || + generateDockerImageName(await this.project.getBuildUuid()); + + const language = await this.project.getManifestLanguage(); + + const dockerfileTemplatePath = path.join( + __dirname, + "..", + "..", + "defaults", + "build-strategies", + language, + this.getStrategyName(), + "Dockerfile.mustache" + ); + + let dockerfilePath: string; + + const customManifestDockerfilePath = + buildManifest?.strategies?.image?.dockerfile; + + if (buildManifestDir && customManifestDockerfilePath) { + dockerfilePath = path.join( + buildManifestDir, + customManifestDockerfilePath + ); + } else { + dockerfilePath = this._generateDockerfile(dockerfileTemplatePath, { + ...buildManifest.config, + ...buildManifest.strategies?.image, + }); + } + + await this.project.cacheBuildManifestLinkedPackages(); + + const dockerBuildxConfig = buildManifest?.strategies?.image?.buildx; + const useBuildx = !!dockerBuildxConfig; + + let cacheDir: string | undefined; + let removeBuilder = false; + + if (dockerBuildxConfig && typeof dockerBuildxConfig !== "boolean") { + const cache = dockerBuildxConfig.cache; + + if (cache == true) { + cacheDir = this.project.getCachePath("build/image/cache"); + } else if (cache) { + if (path.isAbsolute(cache)) { + cacheDir = cache; + } else { + cacheDir = path.join(this.project.getManifestDir(), cache); + } + } + + removeBuilder = !!dockerBuildxConfig.removeBuilder; + } + + const removeImage = !!buildManifest?.strategies?.image?.removeImage; + + // Construct the build image + const dockerImageId = await this._createBuildImage( + this.project.getManifestDir(), + imageName, + dockerfilePath, + cacheDir, + useBuildx + ); + + await this._copyArtifactsFromBuildImage( + this.outputDir, + "wrap.wasm", + imageName, + removeBuilder, + removeImage, + useBuildx + ); + + await this._dockerLock.release(); + return dockerImageId; + } catch (e) { + await this._dockerLock.release(); + throw e; + } + } + + private async _copyArtifactsFromBuildImage( + outputDir: string, + buildArtifact: string, + imageName: string, + removeBuilder = false, + removeImage = false, + useBuildx = false + ): Promise { + const run = async (): Promise => { + // Make sure the interactive terminal name is available + + useBuildx &&= await this._isDockerBuildxInstalled(); + + const { stdout: containerLsOutput } = runCommandSync( + "docker container ls -a", + this.project.logger + ); + + if ( + containerLsOutput && + containerLsOutput.indexOf(`root-${imageName}`) > -1 + ) { + await runCommand(`docker rm -f root-${imageName}`, this.project.logger); + } + + // Create a new interactive terminal + await runCommand( + `docker create -ti --name root-${imageName} ${imageName}`, + this.project.logger + ); + + // Make sure the "project" directory exists + const { stdout: projectLsOutput } = runCommandSync( + `docker run --rm ${imageName} /bin/bash -c "ls /project"`, + this.project.logger + ); + + if (!projectLsOutput || projectLsOutput.length <= 1) { + throw Error( + intlMsg.lib_helpers_docker_projectFolderMissing({ image: imageName }) + ); + } + + const { stdout: buildLsOutput } = runCommandSync( + `docker run --rm ${imageName} /bin/bash -c "ls /project/build"`, + this.project.logger + ); + + if (!buildLsOutput || buildLsOutput.indexOf(buildArtifact) === -1) { + throw Error( + intlMsg.lib_helpers_docker_projectBuildFolderMissing({ + image: imageName, + artifact: buildArtifact, + }) + ); + } + + await runCommand( + `docker cp root-${imageName}:/project/build/${buildArtifact} ${outputDir}`, + this.project.logger + ); + + await runCommand(`docker rm -f root-${imageName}`, this.project.logger); + + if (useBuildx) { + if (removeBuilder) { + await runCommand( + `docker buildx rm ${imageName}`, + this.project.logger + ); + } + } + if (removeImage) { + await runCommand(`docker rmi ${imageName}`, this.project.logger); + } + }; + + const args = { + path: displayPath(outputDir), + image: imageName, + }; + return await logActivity( + this.project.logger, + intlMsg.lib_helpers_docker_copyText(args), + intlMsg.lib_helpers_docker_copyError(args), + intlMsg.lib_helpers_docker_copyWarning(args), + async (_spinner) => { + return await run(); + } + ); + } + + private async _createBuildImage( + rootDir: string, + imageName: string, + dockerfile: string, + cacheDir?: string, + useBuildx = false + ): Promise { + const run = async (): Promise => { + useBuildx = useBuildx && (await this._isDockerBuildxInstalled()); + + if (useBuildx) { + const cacheFrom = + cacheDir && fs.existsSync(path.join(cacheDir, "index.json")) + ? `--cache-from type=local,src=${cacheDir}` + : ""; + const cacheTo = cacheDir + ? `--cache-to type=local,dest=${cacheDir}` + : ""; + + // Build the docker image + let buildxUseFailed: boolean; + try { + const { stderr } = runCommandSync( + `docker buildx use ${imageName}`, + this.project.logger + ); + buildxUseFailed = !!stderr; + } catch (e) { + buildxUseFailed = true; + } + + if (buildxUseFailed) { + await runCommand( + `docker buildx create --use --name ${imageName}`, + this.project.logger + ); + } + await runCommand( + `docker buildx build -f ${dockerfile} -t ${imageName} ${rootDir} ${cacheFrom} ${cacheTo} --output=type=docker`, + this.project.logger + ); + } else { + await runCommand( + `docker build -f ${dockerfile} -t ${imageName} ${rootDir}`, + this.project.logger, + isWin() + ? undefined + : { + // eslint-disable-next-line @typescript-eslint/naming-convention + DOCKER_BUILDKIT: "true", + } + ); + } + + // Get the docker image ID + const { stdout } = runCommandSync( + `docker image inspect ${imageName} -f "{{.ID}}"`, + this.project.logger + ); + + if (!stdout || stdout.indexOf("sha256:") === -1) { + throw Error( + intlMsg.lib_docker_invalidImageId({ imageId: stdout || "N/A" }) + ); + } + + return stdout; + }; + + const args = { + image: imageName, + dockerfile: displayPath(dockerfile), + context: displayPath(rootDir), + }; + return await logActivity( + this.project.logger, + intlMsg.lib_helpers_docker_buildText(args), + intlMsg.lib_helpers_docker_buildError(args), + intlMsg.lib_helpers_docker_buildWarning(args), + async (_spinner) => { + return await run(); + } + ); + } + + private async _isDockerBuildxInstalled(): Promise { + const { stdout: version } = runCommandSync( + "docker buildx version", + this.project.logger + ); + return version && version.startsWith("github.com/docker/buildx") + ? true + : false; + } + + private _generateDockerfile( + templatePath: string, + config: Record + ): string { + const outputDir = path.dirname(templatePath); + const outputFilePath = path.join(outputDir, "Dockerfile"); + const template = fs.readFileSync(templatePath, "utf-8"); + const dockerfile = Mustache.render(template, config); + writeFileSync(outputFilePath, dockerfile, "utf-8"); + return outputFilePath; + } +} diff --git a/packages/cli/src/lib/build-strategies/strategies/DockerVMStrategy.ts b/packages/cli/src/lib/build-strategies/strategies/DockerVMStrategy.ts new file mode 100644 index 0000000000..ec4b01b8ff --- /dev/null +++ b/packages/cli/src/lib/build-strategies/strategies/DockerVMStrategy.ts @@ -0,0 +1,249 @@ +import { + displayPath, + ensureDockerDaemonRunning, + isDockerInstalled, + runCommand, +} from "../../system"; +import { BuildStrategyArgs, BuildStrategy } from "../BuildStrategy"; +import { intlMsg } from "../../intl"; +import { + BuildManifestConfig, + PolywrapManifestLanguage, + PolywrapProject, +} from "../../project"; +import { logActivity } from "../../logging"; + +import fse from "fs-extra"; +import path from "path"; +import Mustache from "mustache"; + +type BuildableLanguage = Exclude; +const DEFAULTS_DIR = path.join( + __dirname, + "..", + "..", + "defaults", + "build-strategies" +); + +export interface VMConfig { + defaultIncludes: string[]; + baseImage: string; +} + +const CONFIGS: Record = { + "wasm/rust": { + defaultIncludes: ["Cargo.toml", "Cargo.lock"], + baseImage: "namesty/base-rust", + }, + "wasm/assemblyscript": { + defaultIncludes: ["package.json", "package-lock.json", "yarn.lock"], + baseImage: "namesty/base-assemblyscript", + }, +}; + +export class DockerVMBuildStrategy extends BuildStrategy { + private _volumePaths: { + project: string; + linkedPackages: string; + }; + constructor(args: BuildStrategyArgs) { + super(args); + + if (!isDockerInstalled(this.project.logger)) { + throw new Error(intlMsg.lib_docker_noInstall()); + } + + this._volumePaths = { + project: this.project.getCachePath( + PolywrapProject.cacheLayout.buildProjectDir + ), + linkedPackages: this.project.getCachePath( + PolywrapProject.cacheLayout.buildLinkedPackagesDir + ), + }; + } + + getStrategyName(): string { + return "vm"; + } + + public async buildSources(): Promise { + await ensureDockerDaemonRunning(this.project.logger); + + await this._buildSources(); + + await this._copyBuildOutput(); + } + + private async _buildSources(): Promise { + const run = async () => { + const manifestDir = this.project.getManifestDir(); + const buildManifest = await this.project.getBuildManifest(); + const buildManifestConfig = buildManifest.config as BuildManifestConfig; + + // Copy manifests + buildManifestConfig.polywrap_manifests.forEach((manifestPath) => { + fse.copySync( + path.join(manifestDir, manifestPath), + path.join(this._volumePaths.project, manifestPath) + ); + }); + + const language = (await this.project.getManifestLanguage()) as BuildableLanguage; + + if (buildManifestConfig.polywrap_linked_packages) { + if (fse.existsSync(this._volumePaths.linkedPackages)) { + fse.removeSync(this._volumePaths.linkedPackages); + } + + await this.project.cacheBuildManifestLinkedPackages(); + } + + // Copy additional includes + + CONFIGS[language].defaultIncludes.forEach((include) => { + if (fse.existsSync(path.join(manifestDir, include))) { + if (fse.existsSync(path.join(this._volumePaths.project, include))) { + fse.removeSync(path.join(this._volumePaths.project, include)); + } + + fse.copySync( + path.join(manifestDir, include), + path.join(this._volumePaths.project, include) + ); + } + }); + + // Copy includes + if (buildManifestConfig.include) { + buildManifestConfig.include.forEach((includePath) => { + fse.copySync( + path.join(manifestDir, includePath), + path.join(this._volumePaths.project, includePath), + { + overwrite: false, + } + ); + }); + } + + // Copy sources and build + if (buildManifestConfig.polywrap_module) { + // HACK: moduleDir is path to Cargo.toml in Rust + if (language === "wasm/rust") { + fse.copySync( + path.join(manifestDir, "src"), + path.join(this._volumePaths.project, "src") + ); + } else { + fse.copySync( + path.join(manifestDir, buildManifestConfig.polywrap_module.dir), + path.join( + this._volumePaths.project, + buildManifestConfig.polywrap_module.dir + ) + ); + } + + const scriptTemplate = fse.readFileSync( + path.join( + DEFAULTS_DIR, + language, + this.getStrategyName(), + "vm-script.mustache" + ), + "utf8" + ); + + const scriptContent = Mustache.render( + scriptTemplate, + buildManifestConfig + ); + const buildScriptPath = path.join( + this._volumePaths.project, + "polywrap-build.sh" + ); + if (fse.existsSync(buildScriptPath)) { + fse.removeSync(buildScriptPath); + } + fse.writeFileSync(buildScriptPath, scriptContent, { + mode: "777", + flag: "wx", + }); + + // For rust, we want to also mount the cargo registry's cache directory + const localCargoCache = `${process.env.HOME}/.cargo/registry`; + let cacheVolume = ""; + if (language === "wasm/rust" && fse.existsSync(localCargoCache)) { + cacheVolume = `-v ${localCargoCache}:/usr/local/cargo/registry`; + } + + let buildError: Error | undefined = undefined; + + try { + await runCommand( + `docker run --rm -v ${path.resolve( + this._volumePaths.project + )}:/project -v ${path.resolve( + this._volumePaths.linkedPackages + )}:/linked-packages ${cacheVolume} ${ + CONFIGS[language].baseImage + }:latest /bin/bash --verbose /project/polywrap-build.sh`, + this.project.logger, + undefined, + undefined, + true + ); + + const buildDir = path.join(this._volumePaths.project, "build"); + if (!fse.existsSync(buildDir)) { + buildError = new Error("Build directory missing."); + } + + await runCommand( + `docker run --rm -v ${path.resolve( + this._volumePaths.project + )}:/project -v ${path.resolve( + this._volumePaths.linkedPackages + )}:/linked-packages ${ + CONFIGS[language].baseImage + }:latest /bin/bash -c "chmod -R 777 /project && chmod -R 777 /linked-packages"`, + this.project.logger + ); + } catch (e) { + buildError = e; + } + + if (buildError) { + throw buildError; + } + } + }; + + return run(); + } + + private async _copyBuildOutput() { + const run = () => { + fse.copySync( + path.join(this._volumePaths.project, "build"), + this.outputDir + ); + }; + + const args = { + path: displayPath(this.outputDir), + }; + + return await logActivity( + this.project.logger, + intlMsg.lib_helpers_copyText(args), + intlMsg.lib_helpers_copyError(args), + intlMsg.lib_helpers_copyWarning(args), + async () => { + run(); + } + ); + } +} diff --git a/packages/cli/src/lib/build-strategies/strategies/LocalStrategy.ts b/packages/cli/src/lib/build-strategies/strategies/LocalStrategy.ts new file mode 100644 index 0000000000..5152825cd5 --- /dev/null +++ b/packages/cli/src/lib/build-strategies/strategies/LocalStrategy.ts @@ -0,0 +1,58 @@ +import { BuildStrategy } from "../BuildStrategy"; +import { displayPath, runCommand } from "../../system"; +import { logActivity } from "../../logging"; +import { intlMsg } from "../../intl"; +import { BuildManifestConfig } from "../../project"; + +export class LocalBuildStrategy extends BuildStrategy { + getStrategyName(): string { + return "local"; + } + + public async buildSources(): Promise { + const run = async () => { + const bindLanguage = await this.project.getManifestLanguage(); + const buildManifest = await this.project.getBuildManifest(); + const buildManifestConfig = buildManifest.config as BuildManifestConfig; + + if (buildManifestConfig.polywrap_module) { + let scriptPath = `${__dirname}/../../defaults/build-strategies/${bindLanguage}/${this.getStrategyName()}/local.sh`; + + if (bindLanguage.startsWith("wasm")) { + const customScript = buildManifest.strategies?.local?.scriptPath; + scriptPath = customScript ?? scriptPath; + } + + const command = `chmod +x ${scriptPath} && ${scriptPath} ${buildManifestConfig.polywrap_module.dir} ${this.outputDir}`; + + await logActivity( + this.project.logger, + intlMsg.lib_helpers_buildText(), + intlMsg.lib_helpers_buildError(), + intlMsg.lib_helpers_buildWarning(), + async (_spinner) => { + return await runCommand( + command, + this.project.logger, + undefined, + process.cwd() + ); + } + ); + } + }; + + const args = { + path: displayPath(this.outputDir), + }; + return await logActivity( + this.project.logger, + intlMsg.lib_helpers_copyText(args), + intlMsg.lib_helpers_copyError(args), + intlMsg.lib_helpers_copyWarning(args), + async () => { + return await run(); + } + ); + } +} diff --git a/packages/cli/src/lib/build-strategies/strategies/index.ts b/packages/cli/src/lib/build-strategies/strategies/index.ts new file mode 100644 index 0000000000..e9f431e872 --- /dev/null +++ b/packages/cli/src/lib/build-strategies/strategies/index.ts @@ -0,0 +1,3 @@ +export * from "./DockerVMStrategy"; +export * from "./LocalStrategy"; +export * from "./DockerImageStrategy"; diff --git a/packages/cli/src/lib/codegen/CodeGenerator.ts b/packages/cli/src/lib/codegen/CodeGenerator.ts new file mode 100644 index 0000000000..affc649213 --- /dev/null +++ b/packages/cli/src/lib/codegen/CodeGenerator.ts @@ -0,0 +1,101 @@ +import { logActivity } from "../logging"; +import { intlMsg } from "../intl"; +import { + AnyProjectManifest, + AnyProjectManifestLanguage, + appManifestLanguages, + appManifestLanguageToBindLanguage, + isAppManifestLanguage, + isPluginManifestLanguage, + isPolywrapManifestLanguage, + pluginManifestLanguages, + pluginManifestLanguageToBindLanguage, + polywrapManifestLanguages, + polywrapManifestLanguageToBindLanguage, + Project, +} from "../project"; +import { resetDir } from "../system"; +import { SchemaComposer } from "../SchemaComposer"; + +import path from "path"; +import { BindLanguage } from "@polywrap/schema-bind"; +import { writeDirectorySync } from "@polywrap/os-js"; + +export interface CodeGeneratorConfig { + project: Project; + schemaComposer: SchemaComposer; + codegenDirAbs?: string; +} + +export class CodeGenerator { + constructor(protected _config: CodeGeneratorConfig) {} + + public async generate(): Promise { + try { + const language = await this._config.project.getManifestLanguage(); + const bindLanguage = await this.getBindingLanguage(language); + + if (!bindLanguage) { + throw Error( + intlMsg.lib_language_unsupportedManifestLanguage({ + language: language, + supported: [ + ...Object.keys(polywrapManifestLanguages), + ...Object.keys(pluginManifestLanguages), + ...Object.keys(appManifestLanguages), + ].join(", "), + }) + ); + } + + await logActivity( + this._config.project.logger, + intlMsg.lib_codeGenerator_genCodeText(), + intlMsg.lib_codeGenerator_genCodeError(), + intlMsg.lib_codeGenerator_genCodeWarning(), + async () => { + return this.runCodegen(bindLanguage); + } + ); + + return true; + } catch (e) { + this._config.project.logger.error(e); + return false; + } + } + + protected async runCodegen(_: BindLanguage): Promise { + const codegenDir = this._config.codegenDirAbs + ? path.relative( + this._config.project.getManifestDir(), + this._config.codegenDirAbs + ) + : undefined; + + const abi = await this._config.schemaComposer.getComposedAbis(); + const binding = await this._config.project.generateSchemaBindings( + abi, + codegenDir + ); + + resetDir(binding.outputDirAbs); + return writeDirectorySync(binding.outputDirAbs, binding.output); + } + + protected async getBindingLanguage( + language: AnyProjectManifestLanguage + ): Promise { + let bindLanguage: BindLanguage | undefined; + + if (isPolywrapManifestLanguage(language)) { + bindLanguage = polywrapManifestLanguageToBindLanguage(language); + } else if (isPluginManifestLanguage(language)) { + bindLanguage = pluginManifestLanguageToBindLanguage(language); + } else if (isAppManifestLanguage(language)) { + bindLanguage = appManifestLanguageToBindLanguage(language); + } + + return bindLanguage; + } +} diff --git a/packages/cli/src/lib/codegen/ScriptCodeGenerator.ts b/packages/cli/src/lib/codegen/ScriptCodeGenerator.ts new file mode 100644 index 0000000000..6cd6feae92 --- /dev/null +++ b/packages/cli/src/lib/codegen/ScriptCodeGenerator.ts @@ -0,0 +1,112 @@ +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"; +import { BindLanguage, GenerateBindingFn } from "@polywrap/schema-bind"; +import { readFileSync } from "fs-extra"; +import Mustache from "mustache"; +import path from "path"; + +export class ScriptCodegenerator extends CodeGenerator { + private readonly _script: string; + private readonly _mustacheView: Record | undefined; + private readonly _codegenDirAbs: string; + private readonly _omitHeader: boolean; + private readonly _schema: string | undefined = ""; + + constructor(config: { + project: Project; + schemaComposer: SchemaComposer; + codegenDirAbs: string; + script: string; + mustacheView: Record | undefined; + omitHeader: boolean; + schema?: string; + }) { + super({ + project: config.project, + schemaComposer: config.schemaComposer, + codegenDirAbs: config.codegenDirAbs, + }); + + this._script = config.script; + this._mustacheView = config.mustacheView; + this._codegenDirAbs = config.codegenDirAbs; + this._omitHeader = config.omitHeader; + + if (config.schema) { + this._schema = config.schema; + } + } + + protected async runCodegen(bindLanguage: BindLanguage): Promise { + const generator = isTypescriptFile(this._script) + ? await importTypescriptModule(this._script) + : // eslint-disable-next-line @typescript-eslint/no-require-imports + await require(this._script); + + if (!generator) { + throw Error(intlMsg.lib_codeGenerator_wrongGenFile()); + } + + const { generateBinding } = generator as { + generateBinding: GenerateBindingFn; + }; + if (!generateBinding) { + throw Error(intlMsg.lib_codeGenerator_nogenerateBindingMethod()); + } + + const binding = await generateBinding({ + projectName: await this._config.project.getName(), + abi: await this._config.schemaComposer.getComposedAbis(), + outputDirAbs: this._codegenDirAbs, + bindLanguage, + config: this._mustacheView, + }); + + resetDir(this._codegenDirAbs); + return writeDirectorySync( + this._codegenDirAbs, + binding.output, + (templatePath: string) => this._generateTemplate(templatePath, {}) + ); + } + + private _generateTemplate(templatePath: string, config: unknown): string { + const logger = this._config.project.logger; + + logger.info( + intlMsg.lib_codeGenerator_genTemplateStep({ + path: `${templatePath}`, + }) + ); + + if (this._script) { + // Update template path when the generation file is given + templatePath = path.join(path.dirname(this._script), templatePath); + } + + const template = readFileSync(templatePath); + const types = + typeof config === "object" && config !== null ? config : { config }; + let content = Mustache.render(template.toString(), { + ...types, + schema: this._schema, + ...this._mustacheView, + }); + + if (this._omitHeader) { + return content; + } + + content = `// ${intlMsg.lib_codeGenerator_templateNoModify()} + +${content} +`; + + return content; + } +} diff --git a/packages/cli/src/lib/codegen/index.ts b/packages/cli/src/lib/codegen/index.ts new file mode 100644 index 0000000000..fb9b3a2ef5 --- /dev/null +++ b/packages/cli/src/lib/codegen/index.ts @@ -0,0 +1,2 @@ +export * from "./CodeGenerator"; +export * from "./ScriptCodeGenerator"; diff --git a/packages/cli/src/lib/defaults/build-images/wasm/assemblyscript/polywrap.build.ext.json b/packages/cli/src/lib/defaults/build-images/wasm/assemblyscript/polywrap.build.ext.json deleted file mode 100644 index 92d6f6fc61..0000000000 --- a/packages/cli/src/lib/defaults/build-images/wasm/assemblyscript/polywrap.build.ext.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "id": "BuildManifest_WasmAsExt", - "type": "object", - "required": [ - "config" - ], - "properties": { - "config": { - "type": "object", - "required": [ - "node_version", - "include" - ], - "properties": { - "node_version": { - "type": "string" - }, - "include": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } -} diff --git a/packages/cli/src/lib/defaults/build-images/wasm/assemblyscript/polywrap.build.yaml b/packages/cli/src/lib/defaults/build-images/wasm/assemblyscript/polywrap.build.yaml deleted file mode 100644 index dea1ffe01c..0000000000 --- a/packages/cli/src/lib/defaults/build-images/wasm/assemblyscript/polywrap.build.yaml +++ /dev/null @@ -1,7 +0,0 @@ -format: 0.1.0 -docker: - dockerfile: ./Dockerfile.mustache -config: - node_version: "16.13.0" - include: - - ./package.json diff --git a/packages/cli/src/lib/defaults/build-images/wasm/rust/index.ts b/packages/cli/src/lib/defaults/build-images/wasm/rust/index.ts deleted file mode 100644 index 76a98ca4af..0000000000 --- a/packages/cli/src/lib/defaults/build-images/wasm/rust/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { CompilerOverrides } from "../../../../Compiler"; -import { intlMsg } from "../../../../intl"; - -import { PolywrapManifest } from "@polywrap/polywrap-manifest-types-js"; - -export function getCompilerOverrides(): CompilerOverrides { - return { - validateManifest: (manifest: PolywrapManifest) => { - const module = manifest.source.module; - - if (module && module.indexOf("Cargo.toml") === -1) { - throw Error(intlMsg.lib_wasm_rust_invalidModule({ path: module })); - } - }, - generationSubPath: "src/wrap", - }; -} diff --git a/packages/cli/src/lib/defaults/build-images/wasm/rust/polywrap.build.ext.json b/packages/cli/src/lib/defaults/build-images/wasm/rust/polywrap.build.ext.json deleted file mode 100644 index 609eb64803..0000000000 --- a/packages/cli/src/lib/defaults/build-images/wasm/rust/polywrap.build.ext.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "id": "BuildManifest_WasmRsExt", - "type": "object", - "properties": { - "config": { - "type": "object", - "properties": { - "include": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } -} diff --git a/packages/cli/src/lib/defaults/build-images/wasm/rust/polywrap.build.yaml b/packages/cli/src/lib/defaults/build-images/wasm/rust/polywrap.build.yaml deleted file mode 100644 index 9df4ff713b..0000000000 --- a/packages/cli/src/lib/defaults/build-images/wasm/rust/polywrap.build.yaml +++ /dev/null @@ -1,3 +0,0 @@ -format: 0.1.0 -docker: - dockerfile: ./Dockerfile.mustache diff --git a/packages/cli/src/lib/defaults/build-strategies/wasm/assemblyscript/default.build.yaml b/packages/cli/src/lib/defaults/build-strategies/wasm/assemblyscript/default.build.yaml new file mode 100644 index 0000000000..f387bff921 --- /dev/null +++ b/packages/cli/src/lib/defaults/build-strategies/wasm/assemblyscript/default.build.yaml @@ -0,0 +1,6 @@ +format: 0.2.0 +strategies: + image: + node_version: "16.13.0" + include: + - ./package.json \ No newline at end of file diff --git a/packages/cli/src/lib/defaults/build-images/wasm/assemblyscript/Dockerfile.mustache b/packages/cli/src/lib/defaults/build-strategies/wasm/assemblyscript/image/Dockerfile.mustache similarity index 100% rename from packages/cli/src/lib/defaults/build-images/wasm/assemblyscript/Dockerfile.mustache rename to packages/cli/src/lib/defaults/build-strategies/wasm/assemblyscript/image/Dockerfile.mustache diff --git a/packages/cli/src/lib/defaults/build-strategies/wasm/assemblyscript/local/local.sh b/packages/cli/src/lib/defaults/build-strategies/wasm/assemblyscript/local/local.sh new file mode 100644 index 0000000000..3f5c7551b4 --- /dev/null +++ b/packages/cli/src/lib/defaults/build-strategies/wasm/assemblyscript/local/local.sh @@ -0,0 +1,9 @@ +#!/bin/sh +yarn +asc "$1"/wrap/entry.ts \ + --path ./node_modules \ + --outFile "$2"/wrap.wasm \ + --use abort="$1"/wrap/entry/wrapAbort \ + --optimize --importMemory \ + --runtime stub \ + --runPasses asyncify \ No newline at end of file diff --git a/packages/cli/src/lib/defaults/build-strategies/wasm/assemblyscript/manifest.ext.json b/packages/cli/src/lib/defaults/build-strategies/wasm/assemblyscript/manifest.ext.json new file mode 100644 index 0000000000..1fbcf50ddb --- /dev/null +++ b/packages/cli/src/lib/defaults/build-strategies/wasm/assemblyscript/manifest.ext.json @@ -0,0 +1,27 @@ +{ + "properties": { + "strategies": { + "properties": { + "image": { + "type": "object", + "required": ["node_version", "include"], + "properties": { + "node_version": { + "description": "Docker image's node version.", + "type": "string" + }, + "include": { + "description": "Files to include in docker image.", + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "local": { }, + "vm": { } + } +} \ No newline at end of file diff --git a/packages/cli/src/lib/defaults/build-strategies/wasm/assemblyscript/vm/Dockerfile b/packages/cli/src/lib/defaults/build-strategies/wasm/assemblyscript/vm/Dockerfile new file mode 100644 index 0000000000..2282d35220 --- /dev/null +++ b/packages/cli/src/lib/defaults/build-strategies/wasm/assemblyscript/vm/Dockerfile @@ -0,0 +1,6 @@ +FROM node:16.13.0-alpine as base + +RUN apk --no-cache --virtual build-dependencies add bash +RUN npm -g config set user root +RUN npm -g install --unsafe-perm assemblyscript@0.19.1 json +WORKDIR /project \ No newline at end of file diff --git a/packages/cli/src/lib/defaults/build-strategies/wasm/assemblyscript/vm/vm-script.mustache b/packages/cli/src/lib/defaults/build-strategies/wasm/assemblyscript/vm/vm-script.mustache new file mode 100644 index 0000000000..7d05cfe171 --- /dev/null +++ b/packages/cli/src/lib/defaults/build-strategies/wasm/assemblyscript/vm/vm-script.mustache @@ -0,0 +1,15 @@ +set -e + +{{#polywrap_linked_packages}} +json -I -f package.json -e 'this.dependencies["{{name}}"]="../linked-packages/{{name}}"' +{{/polywrap_linked_packages}} +{{#polywrap_module}} +yarn +asc {{dir}}/wrap/entry.ts \ + --path ./node_modules \ + --outFile ./build/wrap.wasm \ + --use abort={{dir}}/wrap/entry/wrapAbort \ + --optimize --importMemory \ + --runtime stub \ + --runPasses asyncify +{{/polywrap_module}} \ No newline at end of file diff --git a/packages/cli/src/lib/defaults/build-strategies/wasm/rust/default.build.yaml b/packages/cli/src/lib/defaults/build-strategies/wasm/rust/default.build.yaml new file mode 100644 index 0000000000..2d69edd896 --- /dev/null +++ b/packages/cli/src/lib/defaults/build-strategies/wasm/rust/default.build.yaml @@ -0,0 +1,4 @@ +format: 0.2.0 +strategies: + image: + dockerfile: ./Dockerfile.mustache diff --git a/packages/cli/src/lib/defaults/build-images/wasm/rust/Dockerfile.mustache b/packages/cli/src/lib/defaults/build-strategies/wasm/rust/image/Dockerfile.mustache similarity index 96% rename from packages/cli/src/lib/defaults/build-images/wasm/rust/Dockerfile.mustache rename to packages/cli/src/lib/defaults/build-strategies/wasm/rust/image/Dockerfile.mustache index 3e031dd235..7a4190891c 100644 --- a/packages/cli/src/lib/defaults/build-images/wasm/rust/Dockerfile.mustache +++ b/packages/cli/src/lib/defaults/build-strategies/wasm/rust/image/Dockerfile.mustache @@ -66,8 +66,7 @@ RUN PACKAGE_NAME={{name}}; \ # Ensure the module at {{dir}} has the crate-type = ["cdylib"] RUN toml set ./{{dir}}/Cargo.toml lib.crate-type ["cdylib"] > ./{{dir}}/Cargo-local.toml && \ rm -rf ./{{dir}}/Cargo.toml && \ - mv ./{{dir}}/Cargo-local.toml ./{{dir}}/Cargo.toml && \ - true + mv ./{{dir}}/Cargo-local.toml ./{{dir}}/Cargo.toml # Clean up artifacts left by the toml CLI program ("["cdylib"]" -> ["cdylib"]) RUN sed -i 's/"\[cdylib\]"/\["cdylib"\]/g' ./{{dir}}/Cargo.toml @@ -75,8 +74,7 @@ RUN sed -i 's/"\[cdylib\]"/\["cdylib"\]/g' ./{{dir}}/Cargo.toml # Ensure the package name = "module" RUN toml set ./{{dir}}/Cargo.toml package.name "module" > ./{{dir}}/Cargo-local.toml && \ rm -rf ./{{dir}}/Cargo.toml && \ - mv ./{{dir}}/Cargo-local.toml ./{{dir}}/Cargo.toml && \ - true + mv ./{{dir}}/Cargo-local.toml ./{{dir}}/Cargo.toml # Prebuild all project dependencies, adding them to the cache RUN cd ./{{dir}} && cargo build-deps --release && cd /project diff --git a/packages/cli/src/lib/defaults/build-strategies/wasm/rust/local/local.sh b/packages/cli/src/lib/defaults/build-strategies/wasm/rust/local/local.sh new file mode 100644 index 0000000000..ebc7f36f15 --- /dev/null +++ b/packages/cli/src/lib/defaults/build-strategies/wasm/rust/local/local.sh @@ -0,0 +1,27 @@ +#!/bin/sh +rustup target add wasm32-unknown-unknown +export RUSTFLAGS="-C link-arg=-z -C link-arg=stack-size=65536 -C link-arg=--import-memory" +cargo install toml-cli +cargo install wasm-snip +cargo install wasm-bindgen-cli + +toml set "$1"/Cargo.toml lib.crate-type ["cdylib"] > "$1"/Cargo-local.toml && \ + rm -rf "$1"/Cargo.toml && \ + mv "$1"/Cargo-local.toml "$1"/Cargo.toml + +# Clean up artifacts left by the toml CLI program ("["cdylib"]" -> ["cdylib"]) +sed -i 's/"\[cdylib\]"/\["cdylib"\]/g' "$1"/Cargo.toml + +# Ensure the package name = "module" +toml set "$1"/Cargo.toml package.name "module" > "$1"/Cargo-local.toml && \ + rm -rf "$1"/Cargo.toml && \ + mv "$1"/Cargo-local.toml "$1"/Cargo.toml + +cargo build --manifest-path "$1"/Cargo.toml \ + --target wasm32-unknown-unknown --release +export WASM_INTERFACE_TYPES=1 +wasm-bindgen "$1"/target/wasm32-unknown-unknown/release/module.wasm --out-dir "$2" --out-name bg_module.wasm +wasm-snip "$2"/bg_module.wasm -o "$2"/snipped_module.wasm && \ + rm -rf "$2"/bg_module.wasm +npx wasm-opt --asyncify -Os "$2"/snipped_module.wasm -o "$2"/wrap.wasm + rm -rf "$2"/snipped_module.wasm \ No newline at end of file diff --git a/packages/cli/src/lib/defaults/build-strategies/wasm/rust/manifest.ext.json b/packages/cli/src/lib/defaults/build-strategies/wasm/rust/manifest.ext.json new file mode 100644 index 0000000000..2f78f1952d --- /dev/null +++ b/packages/cli/src/lib/defaults/build-strategies/wasm/rust/manifest.ext.json @@ -0,0 +1,22 @@ +{ + "properties": { + "strategies": { + "properties": { + "image": { + "type": "object", + "properties": { + "include": { + "description": "Files to include in docker image.", + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "local": { }, + "vm": { } + } +} \ No newline at end of file diff --git a/packages/cli/src/lib/defaults/build-strategies/wasm/rust/vm/Dockerfile b/packages/cli/src/lib/defaults/build-strategies/wasm/rust/vm/Dockerfile new file mode 100644 index 0000000000..35b5b569e6 --- /dev/null +++ b/packages/cli/src/lib/defaults/build-strategies/wasm/rust/vm/Dockerfile @@ -0,0 +1,33 @@ +FROM rust:1.60.0 as base + +# Install the wasm32 rust build target +RUN rustup target add wasm32-unknown-unknown + +WORKDIR /build-deps + +# Install curl +RUN apt-get update +RUN apt-get -y install curl clang llvm build-essential + +# Install wasm-opt +RUN curl -L https://github.com/WebAssembly/binaryen/releases/download/version_101/binaryen-version_101-x86_64-linux.tar.gz | tar -xz \ + && chmod +x binaryen-version_101/bin/wasm-opt \ + && cp binaryen-version_101/bin/wasm-opt /usr/local/bin/ \ + && rm -rf binary-version_101 + +# Install the toml-cli +RUN cargo install -f toml-cli + +# Install wasm-snip +RUN cargo install -f wasm-snip + +# Install wasm-bindgen +RUN cargo install -f wasm-bindgen-cli + +# Install cargo-build-deps +RUN cargo install -f cargo-build-deps + +ENV RUSTFLAGS="-C link-arg=-z -C link-arg=stack-size=65536 -C link-arg=--import-memory" +ENV WASM_INTERFACE_TYPES=1 + +WORKDIR /project diff --git a/packages/cli/src/lib/defaults/build-strategies/wasm/rust/vm/vm-script.mustache b/packages/cli/src/lib/defaults/build-strategies/wasm/rust/vm/vm-script.mustache new file mode 100644 index 0000000000..ca0987fc89 --- /dev/null +++ b/packages/cli/src/lib/defaults/build-strategies/wasm/rust/vm/vm-script.mustache @@ -0,0 +1,34 @@ +set -e + +{{#polywrap_linked_packages.length}} +{{#polywrap_linked_packages}} +toml set ./{{#polywrap_module}}{{dir}}{{/polywrap_module}}/Cargo.toml dependencies.{{name}}.path /linked-packages/{{name}} > ./{{#polywrap_module}}{{dir}}{{/polywrap_module}}/Cargo-local.toml + rm -rf ./{{#polywrap_module}}{{dir}}{{/polywrap_module}}/Cargo.toml + mv ./{{#polywrap_module}}{{dir}}{{/polywrap_module}}/Cargo-local.toml ./{{#polywrap_module}}{{dir}}{{/polywrap_module}}/Cargo.toml +{{/polywrap_linked_packages}} +{{/polywrap_linked_packages.length}} + +{{#polywrap_module}} +toml set ./{{dir}}/Cargo.toml lib.crate-type ["cdylib"] > ./{{dir}}/Cargo-local.toml +rm -rf ./{{dir}}/Cargo.toml +mv ./{{dir}}/Cargo-local.toml ./{{dir}}/Cargo.toml +sed -i 's/\"\[cdylib\]\"/\[\"cdylib\"\]/g' ./{{dir}}/Cargo.toml + +toml set ./{{dir}}/Cargo.toml package.name "module" > ./{{dir}}/Cargo-local.toml +rm -rf ./{{dir}}/Cargo.toml +mv ./{{dir}}/Cargo-local.toml ./{{dir}}/Cargo.toml + +cargo build --manifest-path ./{{dir}}/Cargo.toml \ + --target wasm32-unknown-unknown --release + +rm -rf ./build +mkdir ./build + +wasm-bindgen ./{{dir}}/target/wasm32-unknown-unknown/release/module.wasm --out-dir ./build --out-name bg_module.wasm + +wasm-snip ./build/bg_module.wasm -o ./build/snipped_module.wasm +rm -rf ./build/bg_module.wasm + +wasm-opt --asyncify -Os ./build/snipped_module.wasm -o ./build/wrap.wasm +rm -rf ./build/snipped_module.wasm +{{/polywrap_module}} \ No newline at end of file diff --git a/packages/cli/src/lib/defaults/deploy-modules/ens-recursive-name-register/index.ts b/packages/cli/src/lib/defaults/deploy-modules/ens-recursive-name-register/index.ts index 83ae04f700..bc34d6dd1a 100644 --- a/packages/cli/src/lib/defaults/deploy-modules/ens-recursive-name-register/index.ts +++ b/packages/cli/src/lib/defaults/deploy-modules/ens-recursive-name-register/index.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-require-imports */ /* eslint-disable @typescript-eslint/no-var-requires */ -import { Deployer } from "../../../deploy/deployer"; +import { Deployer } from "../../../deploy"; import { Wallet } from "@ethersproject/wallet"; import { JsonRpcProvider } from "@ethersproject/providers"; @@ -76,7 +76,7 @@ class ENSRecursiveNameRegisterPublisher implements Deployer { ], }); - const { data: signerAddress } = await client.invoke({ + const signerAddress = await client.invoke({ method: "getSignerAddress", uri: ethereumPluginUri, args: { @@ -86,32 +86,30 @@ class ENSRecursiveNameRegisterPublisher implements Deployer { }, }); - if (!signerAddress) { + if (!signerAddress.ok) { throw new Error("Could not get signer"); } - const { data: registerData, error } = await client.invoke<{ hash: string }>( - { - method: "registerDomainAndSubdomainsRecursively", - uri: ensWrapperUri, - args: { - domain: ensDomain, - owner: signerAddress, - resolverAddress: config.ensResolverAddress, - ttl: "0", - registrarAddress: config.ensRegistrarAddress, - registryAddress: config.ensRegistryAddress, - connection: { - networkNameOrChainId: network, - }, + const registerData = await client.invoke<{ hash: string }>({ + method: "registerDomainAndSubdomainsRecursively", + uri: ensWrapperUri, + args: { + domain: ensDomain, + owner: signerAddress.value, + resolverAddress: config.ensResolverAddress, + ttl: "0", + registrarAddress: config.ensRegistrarAddress, + registryAddress: config.ensRegistryAddress, + connection: { + networkNameOrChainId: network, }, - } - ); + }, + }); - if (!registerData) { + if (!registerData.ok) { throw new Error( `Could not register domain '${ensDomain}'` + - (error ? `\nError: ${error.message}` : "") + (registerData.error ? `\nError: ${registerData.error.message}` : "") ); } @@ -119,7 +117,7 @@ class ENSRecursiveNameRegisterPublisher implements Deployer { method: "awaitTransaction", uri: ethereumPluginUri, args: { - txHash: registerData.hash, + txHash: registerData.value.hash, confirmations: 1, timeout: 15000, connection: { diff --git a/packages/cli/src/lib/defaults/deploy-modules/ens/index.ts b/packages/cli/src/lib/defaults/deploy-modules/ens/index.ts index 6710597bd6..8d4453e6e2 100644 --- a/packages/cli/src/lib/defaults/deploy-modules/ens/index.ts +++ b/packages/cli/src/lib/defaults/deploy-modules/ens/index.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-require-imports */ /* eslint-disable @typescript-eslint/no-var-requires */ -import { Deployer } from "../../../deploy/deployer"; +import { Deployer } from "../../../deploy"; import { Wallet } from "@ethersproject/wallet"; import { JsonRpcProvider } from "@ethersproject/providers"; @@ -77,7 +77,7 @@ class ENSPublisher implements Deployer { ], }); - const { data: resolver } = await client.invoke({ + const resolver = await client.invoke({ method: "getResolver", uri: ensWrapperUri, args: { @@ -89,30 +89,30 @@ class ENSPublisher implements Deployer { }, }); - if (!resolver) { + if (!resolver.ok) { throw new Error(`Could not get resolver for '${config.domainName}'`); } - if (resolver === "0x0000000000000000000000000000000000000000") { + if (resolver.value === "0x0000000000000000000000000000000000000000") { throw new Error(`Resolver not set for '${config.domainName}'`); } const hash = "0x" + contentHash.fromIpfs(cid); - const { data: setContenthashData } = await client.invoke<{ hash: string }>({ + const setContenthashData = await client.invoke<{ hash: string }>({ method: "setContentHash", uri: ensWrapperUri, args: { domain: config.domainName, cid: hash, - resolverAddress: resolver, + resolverAddress: resolver.value, connection: { networkNameOrChainId: network, }, }, }); - if (!setContenthashData) { + if (!setContenthashData.ok) { throw new Error(`Could not set contentHash for '${config.domainName}'`); } @@ -120,7 +120,7 @@ class ENSPublisher implements Deployer { method: "awaitTransaction", uri: ethereumPluginUri, args: { - txHash: setContenthashData.hash, + txHash: setContenthashData.value.hash, confirmations: 1, timeout: 15000, connection: { diff --git a/packages/cli/src/lib/defaults/infra-modules/http/server/yarn.lock b/packages/cli/src/lib/defaults/infra-modules/http/server/yarn.lock deleted file mode 100644 index 64c2a7e428..0000000000 --- a/packages/cli/src/lib/defaults/infra-modules/http/server/yarn.lock +++ /dev/null @@ -1,4233 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@ampproject/remapping@^2.1.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.0.tgz#56c133824780de3174aed5ab6834f3026790154d" - integrity sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w== - dependencies: - "@jridgewell/gen-mapping" "^0.1.0" - "@jridgewell/trace-mapping" "^0.3.9" - -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a" - integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== - dependencies: - "@babel/highlight" "^7.18.6" - -"@babel/compat-data@^7.18.8": - version "7.18.8" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.18.8.tgz#2483f565faca607b8535590e84e7de323f27764d" - integrity sha512-HSmX4WZPPK3FUxYp7g2T6EyO8j96HlZJlxmKPSh6KAcqwyDrfx7hKjXpAW/0FhFfTJsR0Yt4lAjLI2coMptIHQ== - -"@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.5": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.18.9.tgz#805461f967c77ff46c74ca0460ccf4fe933ddd59" - integrity sha512-1LIb1eL8APMy91/IMW+31ckrfBM4yCoLaVzoDhZUKSM4cu1L1nIidyxkCgzPAgrC5WEz36IPEr/eSeSF9pIn+g== - dependencies: - "@ampproject/remapping" "^2.1.0" - "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.18.9" - "@babel/helper-compilation-targets" "^7.18.9" - "@babel/helper-module-transforms" "^7.18.9" - "@babel/helpers" "^7.18.9" - "@babel/parser" "^7.18.9" - "@babel/template" "^7.18.6" - "@babel/traverse" "^7.18.9" - "@babel/types" "^7.18.9" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.2.1" - semver "^6.3.0" - -"@babel/generator@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.18.9.tgz#68337e9ea8044d6ddc690fb29acae39359cca0a5" - integrity sha512-wt5Naw6lJrL1/SGkipMiFxJjtyczUWTP38deiP1PO60HsBjDeKk08CGC3S8iVuvf0FmTdgKwU1KIXzSKL1G0Ug== - dependencies: - "@babel/types" "^7.18.9" - "@jridgewell/gen-mapping" "^0.3.2" - jsesc "^2.5.1" - -"@babel/helper-compilation-targets@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.18.9.tgz#69e64f57b524cde3e5ff6cc5a9f4a387ee5563bf" - integrity sha512-tzLCyVmqUiFlcFoAPLA/gL9TeYrF61VLNtb+hvkuVaB5SUjW7jcfrglBIX1vUIoT7CLP3bBlIMeyEsIl2eFQNg== - dependencies: - "@babel/compat-data" "^7.18.8" - "@babel/helper-validator-option" "^7.18.6" - browserslist "^4.20.2" - semver "^6.3.0" - -"@babel/helper-environment-visitor@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be" - integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg== - -"@babel/helper-function-name@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.18.9.tgz#940e6084a55dee867d33b4e487da2676365e86b0" - integrity sha512-fJgWlZt7nxGksJS9a0XdSaI4XvpExnNIgRP+rVefWh5U7BL8pPuir6SJUmFKRfjWQ51OtWSzwOxhaH/EBWWc0A== - dependencies: - "@babel/template" "^7.18.6" - "@babel/types" "^7.18.9" - -"@babel/helper-hoist-variables@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678" - integrity sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-module-imports@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz#1e3ebdbbd08aad1437b428c50204db13c5a3ca6e" - integrity sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-module-transforms@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.18.9.tgz#5a1079c005135ed627442df31a42887e80fcb712" - integrity sha512-KYNqY0ICwfv19b31XzvmI/mfcylOzbLtowkw+mfvGPAQ3kfCnMLYbED3YecL5tPd8nAYFQFAd6JHp2LxZk/J1g== - dependencies: - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-module-imports" "^7.18.6" - "@babel/helper-simple-access" "^7.18.6" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/helper-validator-identifier" "^7.18.6" - "@babel/template" "^7.18.6" - "@babel/traverse" "^7.18.9" - "@babel/types" "^7.18.9" - -"@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.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.18.9.tgz#4b8aea3b069d8cb8a72cdfe28ddf5ceca695ef2f" - integrity sha512-aBXPT3bmtLryXaoJLyYPXPlSD4p1ld9aYeR+sJNOZjJJGiOpb+fKfh3NkcCu7J54nUJwCERPBExCCpyCOHnu/w== - -"@babel/helper-simple-access@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.18.6.tgz#d6d8f51f4ac2978068df934b569f08f29788c7ea" - integrity sha512-iNpIgTgyAvDQpDj76POqg+YEt8fPxx3yaNBg3S30dxNKm2SWfYhD0TGrK/Eu9wHpUW63VQU894TsTg+GLbUa1g== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-split-export-declaration@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz#7367949bc75b20c6d5a5d4a97bba2824ae8ef075" - integrity sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-validator-identifier@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz#9c97e30d31b2b8c72a1d08984f2ca9b574d7a076" - integrity sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g== - -"@babel/helper-validator-option@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz#bf0d2b5a509b1f336099e4ff36e1a63aa5db4db8" - integrity sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw== - -"@babel/helpers@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.18.9.tgz#4bef3b893f253a1eced04516824ede94dcfe7ff9" - integrity sha512-Jf5a+rbrLoR4eNdUmnFu8cN5eNJT6qdTdOg5IHIzq87WwyRw9PwguLFOWYgktN/60IP4fgDUawJvs7PjQIzELQ== - dependencies: - "@babel/template" "^7.18.6" - "@babel/traverse" "^7.18.9" - "@babel/types" "^7.18.9" - -"@babel/highlight@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" - integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== - dependencies: - "@babel/helper-validator-identifier" "^7.18.6" - chalk "^2.0.0" - js-tokens "^4.0.0" - -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.18.6", "@babel/parser@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.9.tgz#f2dde0c682ccc264a9a8595efd030a5cc8fd2539" - integrity sha512-9uJveS9eY9DJ0t64YbIBZICtJy8a5QrDEVdiLCG97fVLpDTpGX7t8mMSb6OWw6Lrnjqj4O8zwjELX3dhoMgiBg== - -"@babel/plugin-syntax-async-generators@^7.8.4": - version "7.8.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" - integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-bigint@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz#4c9a6f669f5d0cdf1b90a1671e9a146be5300cea" - integrity sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-class-properties@^7.8.3": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" - integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== - dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - -"@babel/plugin-syntax-import-meta@^7.8.3": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51" - integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-json-strings@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" - integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-logical-assignment-operators@^7.8.3": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" - integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" - integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-numeric-separator@^7.8.3": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" - integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-object-rest-spread@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" - integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-optional-catch-binding@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1" - integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-optional-chaining@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" - integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-top-level-await@^7.8.3": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" - integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/template@^7.18.6", "@babel/template@^7.3.3": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.18.6.tgz#1283f4993e00b929d6e2d3c72fdc9168a2977a31" - integrity sha512-JoDWzPe+wgBsTTgdnIma3iHNFC7YVJoPssVBDjiHfNlyt4YcunDtcDOUmfVDfCK5MfdsaIoX9PkijPhjH3nYUw== - dependencies: - "@babel/code-frame" "^7.18.6" - "@babel/parser" "^7.18.6" - "@babel/types" "^7.18.6" - -"@babel/traverse@^7.1.0", "@babel/traverse@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.18.9.tgz#deeff3e8f1bad9786874cb2feda7a2d77a904f98" - integrity sha512-LcPAnujXGwBgv3/WHv01pHtb2tihcyW1XuL9wd7jqh1Z8AQkTd+QVjMrMijrln0T7ED3UXLIy36P9Ao7W75rYg== - dependencies: - "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.18.9" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.18.9" - "@babel/helper-hoist-variables" "^7.18.6" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.18.9" - "@babel/types" "^7.18.9" - debug "^4.1.0" - globals "^11.1.0" - -"@babel/types@^7.0.0", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.3.0", "@babel/types@^7.3.3": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.18.9.tgz#7148d64ba133d8d73a41b3172ac4b83a1452205f" - integrity sha512-WwMLAg2MvJmt/rKEVQBBhIVffMmnilX4oe0sRe7iPOHIGsqpruFHHdrfj4O1CMMtgMtCU4oPafZjDPCRgO57Wg== - dependencies: - "@babel/helper-validator-identifier" "^7.18.6" - to-fast-properties "^2.0.0" - -"@bcoe/v8-coverage@^0.2.3": - version "0.2.3" - resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" - integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== - -"@cnakazawa/watch@^1.0.3": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.4.tgz#f864ae85004d0fcab6f50be9141c4da368d1656a" - integrity sha512-v9kIhKwjeZThiWrLmj0y17CWoyddASLj9O2yvbZkbvw/N3rWOYy9zkV66ursAoVr0mV15bL8g0c4QZUE6cdDoQ== - dependencies: - exec-sh "^0.3.2" - minimist "^1.2.0" - -"@istanbuljs/load-nyc-config@^1.0.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" - integrity sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ== - dependencies: - camelcase "^5.3.1" - find-up "^4.1.0" - get-package-type "^0.1.0" - js-yaml "^3.13.1" - resolve-from "^5.0.0" - -"@istanbuljs/schema@^0.1.2": - version "0.1.3" - resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" - integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== - -"@jest/console@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-26.6.2.tgz#4e04bc464014358b03ab4937805ee36a0aeb98f2" - integrity sha512-IY1R2i2aLsLr7Id3S6p2BA82GNWryt4oSvEXLAKc+L2zdi89dSkE8xC1C+0kpATG4JhBJREnQOH7/zmccM2B0g== - dependencies: - "@jest/types" "^26.6.2" - "@types/node" "*" - chalk "^4.0.0" - jest-message-util "^26.6.2" - jest-util "^26.6.2" - slash "^3.0.0" - -"@jest/core@^26.6.3": - version "26.6.3" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-26.6.3.tgz#7639fcb3833d748a4656ada54bde193051e45fad" - integrity sha512-xvV1kKbhfUqFVuZ8Cyo+JPpipAHHAV3kcDBftiduK8EICXmTFddryy3P7NfZt8Pv37rA9nEJBKCCkglCPt/Xjw== - dependencies: - "@jest/console" "^26.6.2" - "@jest/reporters" "^26.6.2" - "@jest/test-result" "^26.6.2" - "@jest/transform" "^26.6.2" - "@jest/types" "^26.6.2" - "@types/node" "*" - ansi-escapes "^4.2.1" - chalk "^4.0.0" - exit "^0.1.2" - graceful-fs "^4.2.4" - jest-changed-files "^26.6.2" - jest-config "^26.6.3" - jest-haste-map "^26.6.2" - jest-message-util "^26.6.2" - jest-regex-util "^26.0.0" - jest-resolve "^26.6.2" - jest-resolve-dependencies "^26.6.3" - jest-runner "^26.6.3" - jest-runtime "^26.6.3" - jest-snapshot "^26.6.2" - jest-util "^26.6.2" - jest-validate "^26.6.2" - jest-watcher "^26.6.2" - micromatch "^4.0.2" - p-each-series "^2.1.0" - rimraf "^3.0.0" - slash "^3.0.0" - strip-ansi "^6.0.0" - -"@jest/environment@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-26.6.2.tgz#ba364cc72e221e79cc8f0a99555bf5d7577cf92c" - integrity sha512-nFy+fHl28zUrRsCeMB61VDThV1pVTtlEokBRgqPrcT1JNq4yRNIyTHfyht6PqtUvY9IsuLGTrbG8kPXjSZIZwA== - dependencies: - "@jest/fake-timers" "^26.6.2" - "@jest/types" "^26.6.2" - "@types/node" "*" - jest-mock "^26.6.2" - -"@jest/fake-timers@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-26.6.2.tgz#459c329bcf70cee4af4d7e3f3e67848123535aad" - integrity sha512-14Uleatt7jdzefLPYM3KLcnUl1ZNikaKq34enpb5XG9i81JpppDb5muZvonvKyrl7ftEHkKS5L5/eB/kxJ+bvA== - dependencies: - "@jest/types" "^26.6.2" - "@sinonjs/fake-timers" "^6.0.1" - "@types/node" "*" - jest-message-util "^26.6.2" - jest-mock "^26.6.2" - jest-util "^26.6.2" - -"@jest/globals@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-26.6.2.tgz#5b613b78a1aa2655ae908eba638cc96a20df720a" - integrity sha512-85Ltnm7HlB/KesBUuALwQ68YTU72w9H2xW9FjZ1eL1U3lhtefjjl5c2MiUbpXt/i6LaPRvoOFJ22yCBSfQ0JIA== - dependencies: - "@jest/environment" "^26.6.2" - "@jest/types" "^26.6.2" - expect "^26.6.2" - -"@jest/reporters@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-26.6.2.tgz#1f518b99637a5f18307bd3ecf9275f6882a667f6" - integrity sha512-h2bW53APG4HvkOnVMo8q3QXa6pcaNt1HkwVsOPMBV6LD/q9oSpxNSYZQYkAnjdMjrJ86UuYeLo+aEZClV6opnw== - dependencies: - "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^26.6.2" - "@jest/test-result" "^26.6.2" - "@jest/transform" "^26.6.2" - "@jest/types" "^26.6.2" - chalk "^4.0.0" - collect-v8-coverage "^1.0.0" - exit "^0.1.2" - glob "^7.1.2" - graceful-fs "^4.2.4" - istanbul-lib-coverage "^3.0.0" - istanbul-lib-instrument "^4.0.3" - istanbul-lib-report "^3.0.0" - istanbul-lib-source-maps "^4.0.0" - istanbul-reports "^3.0.2" - jest-haste-map "^26.6.2" - jest-resolve "^26.6.2" - jest-util "^26.6.2" - jest-worker "^26.6.2" - slash "^3.0.0" - source-map "^0.6.0" - string-length "^4.0.1" - terminal-link "^2.0.0" - v8-to-istanbul "^7.0.0" - optionalDependencies: - node-notifier "^8.0.0" - -"@jest/source-map@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-26.6.2.tgz#29af5e1e2e324cafccc936f218309f54ab69d535" - integrity sha512-YwYcCwAnNmOVsZ8mr3GfnzdXDAl4LaenZP5z+G0c8bzC9/dugL8zRmxZzdoTl4IaS3CryS1uWnROLPFmb6lVvA== - dependencies: - callsites "^3.0.0" - graceful-fs "^4.2.4" - source-map "^0.6.0" - -"@jest/test-result@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-26.6.2.tgz#55da58b62df134576cc95476efa5f7949e3f5f18" - integrity sha512-5O7H5c/7YlojphYNrK02LlDIV2GNPYisKwHm2QTKjNZeEzezCbwYs9swJySv2UfPMyZ0VdsmMv7jIlD/IKYQpQ== - dependencies: - "@jest/console" "^26.6.2" - "@jest/types" "^26.6.2" - "@types/istanbul-lib-coverage" "^2.0.0" - collect-v8-coverage "^1.0.0" - -"@jest/test-sequencer@^26.6.3": - version "26.6.3" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-26.6.3.tgz#98e8a45100863886d074205e8ffdc5a7eb582b17" - integrity sha512-YHlVIjP5nfEyjlrSr8t/YdNfU/1XEt7c5b4OxcXCjyRhjzLYu/rO69/WHPuYcbCWkz8kAeZVZp2N2+IOLLEPGw== - dependencies: - "@jest/test-result" "^26.6.2" - graceful-fs "^4.2.4" - jest-haste-map "^26.6.2" - jest-runner "^26.6.3" - jest-runtime "^26.6.3" - -"@jest/transform@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-26.6.2.tgz#5ac57c5fa1ad17b2aae83e73e45813894dcf2e4b" - integrity sha512-E9JjhUgNzvuQ+vVAL21vlyfy12gP0GhazGgJC4h6qUt1jSdUXGWJ1wfu/X7Sd8etSgxV4ovT1pb9v5D6QW4XgA== - dependencies: - "@babel/core" "^7.1.0" - "@jest/types" "^26.6.2" - babel-plugin-istanbul "^6.0.0" - chalk "^4.0.0" - convert-source-map "^1.4.0" - fast-json-stable-stringify "^2.0.0" - graceful-fs "^4.2.4" - jest-haste-map "^26.6.2" - jest-regex-util "^26.0.0" - jest-util "^26.6.2" - micromatch "^4.0.2" - pirates "^4.0.1" - slash "^3.0.0" - source-map "^0.6.1" - write-file-atomic "^3.0.0" - -"@jest/types@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-26.6.2.tgz#bef5a532030e1d88a2f5a6d933f84e97226ed48e" - integrity sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^15.0.0" - chalk "^4.0.0" - -"@jridgewell/gen-mapping@^0.1.0": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz#e5d2e450306a9491e3bd77e323e38d7aff315996" - integrity sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w== - dependencies: - "@jridgewell/set-array" "^1.0.0" - "@jridgewell/sourcemap-codec" "^1.4.10" - -"@jridgewell/gen-mapping@^0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" - integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A== - dependencies: - "@jridgewell/set-array" "^1.0.1" - "@jridgewell/sourcemap-codec" "^1.4.10" - "@jridgewell/trace-mapping" "^0.3.9" - -"@jridgewell/resolve-uri@^3.0.3": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" - integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== - -"@jridgewell/set-array@^1.0.0", "@jridgewell/set-array@^1.0.1": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" - integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== - -"@jridgewell/sourcemap-codec@^1.4.10": - version "1.4.14" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" - integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== - -"@jridgewell/trace-mapping@^0.3.9": - version "0.3.14" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz#b231a081d8f66796e475ad588a1ef473112701ed" - integrity sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - -"@msgpack/msgpack@2.7.2": - version "2.7.2" - resolved "https://registry.yarnpkg.com/@msgpack/msgpack/-/msgpack-2.7.2.tgz#f34b8aa0c49f0dd55eb7eba577081299cbf3f90b" - integrity sha512-rYEi46+gIzufyYUAoHDnRzkWGxajpD9vVXFQ3g1vbjrBm6P7MBmm+s/fqPa46sxa+8FOUdEuRQKaugo5a4JWpw== - -"@polywrap/msgpack-js@^0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@polywrap/msgpack-js/-/msgpack-js-0.2.0.tgz#f882298fa2418ea9c42aa8ee581297058095eb13" - integrity sha512-0VNEPmU4bOG54lKqZjyFjiNQMVJKWbtvBg3wEr+TjkAEgemRwhlnT9BoSqPomza3vAlXLOOhXIkgUS364q5j0w== - dependencies: - "@msgpack/msgpack" "2.7.2" - -"@sinonjs/commons@^1.7.0": - version "1.8.3" - resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d" - integrity sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ== - dependencies: - type-detect "4.0.8" - -"@sinonjs/fake-timers@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz#293674fccb3262ac782c7aadfdeca86b10c75c40" - integrity sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA== - dependencies: - "@sinonjs/commons" "^1.7.0" - -"@tootallnate/once@1": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" - integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== - -"@types/babel__core@^7.0.0", "@types/babel__core@^7.1.7": - version "7.1.19" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.19.tgz#7b497495b7d1b4812bdb9d02804d0576f43ee460" - integrity sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw== - dependencies: - "@babel/parser" "^7.1.0" - "@babel/types" "^7.0.0" - "@types/babel__generator" "*" - "@types/babel__template" "*" - "@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== - 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== - 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.17.1" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.17.1.tgz#1a0e73e8c28c7e832656db372b779bfd2ef37314" - integrity sha512-kVzjari1s2YVi77D3w1yuvohV2idweYXMCDzqBiVNN63TcDWrIlTVOYpqVrvbbyOE/IyzBoTKF0fdnLPEORFxA== - dependencies: - "@babel/types" "^7.3.0" - -"@types/body-parser@*": - version "1.19.2" - resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.2.tgz#aea2059e28b7658639081347ac4fab3de166e6f0" - integrity sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g== - dependencies: - "@types/connect" "*" - "@types/node" "*" - -"@types/connect@*": - version "3.4.35" - resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1" - integrity sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ== - dependencies: - "@types/node" "*" - -"@types/express-serve-static-core@^4.17.18": - version "4.17.29" - resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.29.tgz#2a1795ea8e9e9c91b4a4bbe475034b20c1ec711c" - integrity sha512-uMd++6dMKS32EOuw1Uli3e3BPgdLIXmezcfHv7N4c1s3gkhikBplORPpMq3fuWkxncZN1reb16d5n8yhQ80x7Q== - dependencies: - "@types/node" "*" - "@types/qs" "*" - "@types/range-parser" "*" - -"@types/express@*", "@types/express@^4.17.7": - version "4.17.13" - resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.13.tgz#a76e2995728999bab51a33fabce1d705a3709034" - integrity sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA== - dependencies: - "@types/body-parser" "*" - "@types/express-serve-static-core" "^4.17.18" - "@types/qs" "*" - "@types/serve-static" "*" - -"@types/file-saver@^2.0.5": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@types/file-saver/-/file-saver-2.0.5.tgz#9ee342a5d1314bb0928375424a2f162f97c310c7" - integrity sha512-zv9kNf3keYegP5oThGLaPk8E081DFDuwfqjtiTzm6PoxChdJ1raSuADf2YGCVIyrSynLrgc8JWv296s7Q7pQSQ== - -"@types/fs-extra@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-7.0.0.tgz#9c4ad9e1339e7448a76698829def1f159c1b636c" - integrity sha512-ndoMMbGyuToTy4qB6Lex/inR98nPiNHacsgMPvy+zqMLgSxbt8VtWpDArpGp69h1fEDQHn1KB+9DWD++wgbwYA== - dependencies: - "@types/node" "*" - -"@types/graceful-fs@^4.1.2": - version "4.1.5" - resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15" - integrity sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw== - dependencies: - "@types/node" "*" - -"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44" - integrity sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g== - -"@types/istanbul-lib-report@*": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#c14c24f18ea8190c118ee7562b7ff99a36552686" - integrity sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg== - dependencies: - "@types/istanbul-lib-coverage" "*" - -"@types/istanbul-reports@^3.0.0": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz#9153fe98bba2bd565a63add9436d6f0d7f8468ff" - integrity sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw== - dependencies: - "@types/istanbul-lib-report" "*" - -"@types/jest@^26.0.8": - version "26.0.24" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.24.tgz#943d11976b16739185913a1936e0de0c4a7d595a" - integrity sha512-E/X5Vib8BWqZNRlDxj9vYXhsDwPYbPINqKF9BsnSoon4RQ0D9moEuLD8txgyypFLH7J4+Lho9Nr/c8H0Fi+17w== - dependencies: - jest-diff "^26.0.0" - pretty-format "^26.0.0" - -"@types/mime@^1": - version "1.3.2" - resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a" - integrity sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw== - -"@types/multer@^1.4.7": - version "1.4.7" - resolved "https://registry.yarnpkg.com/@types/multer/-/multer-1.4.7.tgz#89cf03547c28c7bbcc726f029e2a76a7232cc79e" - integrity sha512-/SNsDidUFCvqqcWDwxv2feww/yqhNeTRL5CVoL3jU4Goc4kKEL10T7Eye65ZqPNi4HRx8sAEX59pV1aEH7drNA== - dependencies: - "@types/express" "*" - -"@types/node@*": - version "18.0.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.0.6.tgz#0ba49ac517ad69abe7a1508bc9b3a5483df9d5d7" - integrity sha512-/xUq6H2aQm261exT6iZTMifUySEt4GR5KX8eYyY+C4MSNPqSh9oNIP7tz2GLKTlFaiBbgZNxffoR3CVRG+cljw== - -"@types/node@^14.0.27": - version "14.18.22" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.22.tgz#fd2a15dca290fc9ad565b672fde746191cd0c6e6" - integrity sha512-qzaYbXVzin6EPjghf/hTdIbnVW1ErMx8rPzwRNJhlbyJhu2SyqlvjGOY/tbUt6VFyzg56lROcOeSQRInpt63Yw== - -"@types/normalize-package-data@^2.4.0": - version "2.4.1" - resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" - integrity sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw== - -"@types/prettier@^2.0.0": - version "2.6.3" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.6.3.tgz#68ada76827b0010d0db071f739314fa429943d0a" - integrity sha512-ymZk3LEC/fsut+/Q5qejp6R9O1rMxz3XaRHDV6kX8MrGAhOSPqVARbDi+EZvInBpw+BnCX3TD240byVkOfQsHg== - -"@types/qs@*": - version "6.9.7" - resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" - integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== - -"@types/range-parser@*": - version "1.2.4" - resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" - integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== - -"@types/serve-static@*": - version "1.13.10" - resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.13.10.tgz#f5e0ce8797d2d7cc5ebeda48a52c96c4fa47a8d9" - integrity sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ== - dependencies: - "@types/mime" "^1" - "@types/node" "*" - -"@types/stack-utils@^2.0.0": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" - integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== - -"@types/yargs-parser@*": - version "21.0.0" - resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b" - integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== - -"@types/yargs@^15.0.0": - version "15.0.14" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.14.tgz#26d821ddb89e70492160b66d10a0eb6df8f6fb06" - integrity sha512-yEJzHoxf6SyQGhBhIYGXQDSCkJjB6HohDShto7m8vaKg9Yp0Yn8+71J9eakh2bnPg6BfsH9PRMhiRTZnd4eXGQ== - dependencies: - "@types/yargs-parser" "*" - -abab@^2.0.3, abab@^2.0.5: - version "2.0.6" - resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" - integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== - -abbrev@1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== - -accepts@~1.3.8: - version "1.3.8" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" - integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== - dependencies: - mime-types "~2.1.34" - negotiator "0.6.3" - -acorn-globals@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-6.0.0.tgz#46cdd39f0f8ff08a876619b55f5ac8a6dc770b45" - integrity sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg== - dependencies: - acorn "^7.1.1" - acorn-walk "^7.1.1" - -acorn-walk@^7.1.1: - version "7.2.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" - integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== - -acorn@^7.1.1: - version "7.4.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" - integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== - -acorn@^8.2.4: - version "8.8.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" - integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== - -agent-base@6: - version "6.0.2" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" - integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== - dependencies: - debug "4" - -ansi-escapes@^4.2.1: - version "4.3.2" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" - integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== - dependencies: - type-fest "^0.21.3" - -ansi-regex@^5.0.0, ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== - -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -ansi-styles@^4.0.0, ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -anymatch@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" - integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== - dependencies: - micromatch "^3.1.4" - normalize-path "^2.1.1" - -anymatch@^3.0.3, anymatch@~3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" - integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - -append-field@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/append-field/-/append-field-1.0.0.tgz#1e3440e915f0b1203d23748e78edd7b9b5b43e56" - integrity sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw== - -arg@^4.1.0: - version "4.1.3" - resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" - integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - -arr-diff@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - integrity sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA== - -arr-flatten@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== - -arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - integrity sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q== - -array-flatten@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" - integrity sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg== - -array-unique@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - integrity sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ== - -assign-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - integrity sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw== - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== - -atob@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" - integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== - -babel-jest@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-26.6.3.tgz#d87d25cb0037577a0c89f82e5755c5d293c01056" - integrity sha512-pl4Q+GAVOHwvjrck6jKjvmGhnO3jHX/xuB9d27f+EJZ/6k+6nMuPjorrYp7s++bKKdANwzElBWnLWaObvTnaZA== - dependencies: - "@jest/transform" "^26.6.2" - "@jest/types" "^26.6.2" - "@types/babel__core" "^7.1.7" - babel-plugin-istanbul "^6.0.0" - babel-preset-jest "^26.6.2" - chalk "^4.0.0" - graceful-fs "^4.2.4" - slash "^3.0.0" - -babel-plugin-istanbul@^6.0.0: - version "6.1.1" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" - integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@istanbuljs/load-nyc-config" "^1.0.0" - "@istanbuljs/schema" "^0.1.2" - istanbul-lib-instrument "^5.0.4" - test-exclude "^6.0.0" - -babel-plugin-jest-hoist@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.6.2.tgz#8185bd030348d254c6d7dd974355e6a28b21e62d" - integrity sha512-PO9t0697lNTmcEHH69mdtYiOIkkOlj9fySqfO3K1eCcdISevLAE0xY59VLLUj0SoiPiTX/JU2CYFpILydUa5Lw== - dependencies: - "@babel/template" "^7.3.3" - "@babel/types" "^7.3.3" - "@types/babel__core" "^7.0.0" - "@types/babel__traverse" "^7.0.6" - -babel-preset-current-node-syntax@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz#b4399239b89b2a011f9ddbe3e4f401fc40cff73b" - integrity sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ== - dependencies: - "@babel/plugin-syntax-async-generators" "^7.8.4" - "@babel/plugin-syntax-bigint" "^7.8.3" - "@babel/plugin-syntax-class-properties" "^7.8.3" - "@babel/plugin-syntax-import-meta" "^7.8.3" - "@babel/plugin-syntax-json-strings" "^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators" "^7.8.3" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.8.3" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-syntax-top-level-await" "^7.8.3" - -babel-preset-jest@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-26.6.2.tgz#747872b1171df032252426586881d62d31798fee" - integrity sha512-YvdtlVm9t3k777c5NPQIv6cxFFFapys25HiUmuSgHwIZhfifweR5c5Sf5nwE3MAbfu327CYSvps8Yx6ANLyleQ== - dependencies: - babel-plugin-jest-hoist "^26.6.2" - babel-preset-current-node-syntax "^1.0.0" - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -base@^0.11.1: - version "0.11.2" - resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" - integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== - dependencies: - cache-base "^1.0.1" - class-utils "^0.3.5" - component-emitter "^1.2.1" - define-property "^1.0.0" - isobject "^3.0.1" - mixin-deep "^1.2.0" - pascalcase "^0.1.1" - -binary-extensions@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" - integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== - -body-parser@1.20.0: - version "1.20.0" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.0.tgz#3de69bd89011c11573d7bfee6a64f11b6bd27cc5" - integrity sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg== - dependencies: - bytes "3.1.2" - content-type "~1.0.4" - debug "2.6.9" - depd "2.0.0" - destroy "1.2.0" - http-errors "2.0.0" - iconv-lite "0.4.24" - on-finished "2.4.1" - qs "6.10.3" - raw-body "2.5.1" - type-is "~1.6.18" - unpipe "1.0.0" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" - integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== - dependencies: - arr-flatten "^1.1.0" - array-unique "^0.3.2" - extend-shallow "^2.0.1" - fill-range "^4.0.0" - isobject "^3.0.1" - repeat-element "^1.1.2" - snapdragon "^0.8.1" - snapdragon-node "^2.0.1" - split-string "^3.0.2" - to-regex "^3.0.1" - -braces@^3.0.2, braces@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -browser-process-hrtime@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" - integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== - -browserslist@^4.20.2: - version "4.21.2" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.2.tgz#59a400757465535954946a400b841ed37e2b4ecf" - integrity sha512-MonuOgAtUB46uP5CezYbRaYKBNt2LxP0yX+Pmj4LkcDFGkn9Cbpi83d9sCjwQDErXsIJSzY5oKGDbgOlF/LPAA== - dependencies: - caniuse-lite "^1.0.30001366" - electron-to-chromium "^1.4.188" - node-releases "^2.0.6" - update-browserslist-db "^1.0.4" - -bs-logger@0.x: - version "0.2.6" - resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" - integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog== - dependencies: - fast-json-stable-stringify "2.x" - -bser@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" - integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ== - dependencies: - node-int64 "^0.4.0" - -buffer-from@1.x, buffer-from@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" - integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== - -busboy@^1.0.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893" - integrity sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA== - dependencies: - streamsearch "^1.1.0" - -bytes@3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" - integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== - -cache-base@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" - integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== - dependencies: - collection-visit "^1.0.0" - component-emitter "^1.2.1" - get-value "^2.0.6" - has-value "^1.0.0" - isobject "^3.0.1" - set-value "^2.0.0" - to-object-path "^0.3.0" - union-value "^1.0.0" - unset-value "^1.0.0" - -call-bind@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" - integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== - dependencies: - function-bind "^1.1.1" - get-intrinsic "^1.0.2" - -callsites@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" - integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== - -camelcase@^5.0.0, camelcase@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - -camelcase@^6.0.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" - integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== - -caniuse-lite@^1.0.30001366: - version "1.0.30001368" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001368.tgz#c5c06381c6051cd863c45021475434e81936f713" - integrity sha512-wgfRYa9DenEomLG/SdWgQxpIyvdtH3NW8Vq+tB6AwR9e56iOIcu1im5F/wNdDf04XlKHXqIx4N8Jo0PemeBenQ== - -capture-exit@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4" - integrity sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g== - dependencies: - rsvp "^4.8.4" - -chalk@^2.0.0: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chalk@^4.0.0: - version "4.1.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -char-regex@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" - integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== - -chokidar@^3.5.2: - version "3.5.3" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" - integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== - dependencies: - anymatch "~3.1.2" - braces "~3.0.2" - glob-parent "~5.1.2" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.6.0" - optionalDependencies: - fsevents "~2.3.2" - -ci-info@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" - integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== - -cjs-module-lexer@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-0.6.0.tgz#4186fcca0eae175970aee870b9fe2d6cf8d5655f" - integrity sha512-uc2Vix1frTfnuzxxu1Hp4ktSvM3QaI4oXl4ZUqL1wjTu/BGki9TrCWoqLTg/drR1KwAEarXuRFCG2Svr1GxPFw== - -class-utils@^0.3.5: - version "0.3.6" - resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== - dependencies: - arr-union "^3.1.0" - define-property "^0.2.5" - isobject "^3.0.0" - static-extend "^0.1.1" - -cliui@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" - integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^6.2.0" - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== - -collect-v8-coverage@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59" - integrity sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg== - -collection-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - integrity sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw== - dependencies: - map-visit "^1.0.0" - object-visit "^1.0.0" - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -combined-stream@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - -component-emitter@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" - integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== - -concat-stream@^1.5.2: - version "1.6.2" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" - integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== - dependencies: - buffer-from "^1.0.0" - inherits "^2.0.3" - readable-stream "^2.2.2" - typedarray "^0.0.6" - -content-disposition@0.5.4: - version "0.5.4" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" - integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ== - dependencies: - safe-buffer "5.2.1" - -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== - -convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" - integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== - dependencies: - safe-buffer "~5.1.1" - -cookie-signature@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== - -cookie@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" - integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== - -copy-descriptor@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - integrity sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw== - -core-util-is@~1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" - integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== - -cross-spawn@^6.0.0: - version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" - integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== - dependencies: - nice-try "^1.0.4" - path-key "^2.0.1" - semver "^5.5.0" - shebang-command "^1.2.0" - which "^1.2.9" - -cross-spawn@^7.0.0: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - -cssom@^0.4.4: - version "0.4.4" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10" - integrity sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw== - -cssom@~0.3.6: - version "0.3.8" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" - integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== - -cssstyle@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-2.3.0.tgz#ff665a0ddbdc31864b09647f34163443d90b0852" - integrity sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A== - dependencies: - cssom "~0.3.6" - -data-urls@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-2.0.0.tgz#156485a72963a970f5d5821aaf642bef2bf2db9b" - integrity sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ== - dependencies: - abab "^2.0.3" - whatwg-mimetype "^2.3.0" - whatwg-url "^8.0.0" - -debug@2.6.9, debug@^2.2.0, debug@^2.3.3: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -debug@4, debug@^4.1.0, debug@^4.1.1: - version "4.3.4" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== - dependencies: - ms "2.1.2" - -debug@^3.2.7: - version "3.2.7" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" - integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== - dependencies: - ms "^2.1.1" - -decamelize@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== - -decimal.js@^10.2.1: - version "10.3.1" - resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.3.1.tgz#d8c3a444a9c6774ba60ca6ad7261c3a94fd5e783" - integrity sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ== - -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og== - -deep-is@~0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" - integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== - -deepmerge@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" - integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== - -define-property@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - integrity sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA== - dependencies: - is-descriptor "^0.1.0" - -define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - integrity sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA== - dependencies: - is-descriptor "^1.0.0" - -define-property@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== - dependencies: - is-descriptor "^1.0.2" - isobject "^3.0.1" - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== - -depd@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" - integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== - -destroy@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" - integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== - -detect-newline@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" - integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== - -diff-sequences@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.6.2.tgz#48ba99157de1923412eed41db6b6d4aa9ca7c0b1" - integrity sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q== - -diff@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" - integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== - -domexception@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/domexception/-/domexception-2.0.1.tgz#fb44aefba793e1574b0af6aed2801d057529f304" - integrity sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg== - dependencies: - webidl-conversions "^5.0.0" - -dotenv@^8.2.0: - version "8.6.0" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b" - integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g== - -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== - -electron-to-chromium@^1.4.188: - version "1.4.197" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.197.tgz#172054244cca16320ebc19459bd03d8a9018ff73" - integrity sha512-7EZCIDDraA2NUaHewLaAh6T63cZzgBmgDx/iiaeZ/pjSs36bOFEJ3hLIrn1TKCFhV0PEZZKu6qFPrxa/LGAzLg== - -emittery@^0.7.1: - version "0.7.2" - resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.7.2.tgz#25595908e13af0f5674ab419396e2fb394cdfa82" - integrity sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ== - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -encodeurl@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== - -end-of-stream@^1.1.0: - version "1.4.4" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" - integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== - dependencies: - once "^1.4.0" - -error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - -escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== - -escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== - -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== - -escape-string-regexp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" - integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== - -escodegen@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.0.0.tgz#5e32b12833e8aa8fa35e1bf0befa89380484c7dd" - integrity sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw== - dependencies: - esprima "^4.0.1" - estraverse "^5.2.0" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.6.1" - -esprima@^4.0.0, esprima@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -estraverse@^5.2.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" - integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== - -esutils@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" - integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== - -etag@~1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg== - -exec-sh@^0.3.2: - version "0.3.6" - resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.6.tgz#ff264f9e325519a60cb5e273692943483cca63bc" - integrity sha512-nQn+hI3yp+oD0huYhKwvYI32+JFeq+XkNcD1GAo3Y/MjxsfVGmrrzrnzjWiNY6f+pUCP440fThsFh5gZrRAU/w== - -execa@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" - integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== - dependencies: - cross-spawn "^6.0.0" - get-stream "^4.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - -execa@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-4.1.0.tgz#4e5491ad1572f2f17a77d388c6c857135b22847a" - integrity sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA== - dependencies: - cross-spawn "^7.0.0" - get-stream "^5.0.0" - human-signals "^1.1.1" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.0" - onetime "^5.1.0" - signal-exit "^3.0.2" - strip-final-newline "^2.0.0" - -exit@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" - integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== - -expand-brackets@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - integrity sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA== - dependencies: - debug "^2.3.3" - define-property "^0.2.5" - extend-shallow "^2.0.1" - posix-character-classes "^0.1.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -expect@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/expect/-/expect-26.6.2.tgz#c6b996bf26bf3fe18b67b2d0f51fc981ba934417" - integrity sha512-9/hlOBkQl2l/PLHJx6JjoDF6xPKcJEsUlWKb23rKE7KzeDqUZKXKNMW27KIue5JMdBV9HgmoJPcc8HtO85t9IA== - dependencies: - "@jest/types" "^26.6.2" - ansi-styles "^4.0.0" - jest-get-type "^26.3.0" - jest-matcher-utils "^26.6.2" - jest-message-util "^26.6.2" - jest-regex-util "^26.0.0" - -express@^4.17.1: - version "4.18.1" - resolved "https://registry.yarnpkg.com/express/-/express-4.18.1.tgz#7797de8b9c72c857b9cd0e14a5eea80666267caf" - integrity sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q== - dependencies: - accepts "~1.3.8" - array-flatten "1.1.1" - body-parser "1.20.0" - content-disposition "0.5.4" - content-type "~1.0.4" - cookie "0.5.0" - cookie-signature "1.0.6" - debug "2.6.9" - depd "2.0.0" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - finalhandler "1.2.0" - fresh "0.5.2" - http-errors "2.0.0" - merge-descriptors "1.0.1" - methods "~1.1.2" - on-finished "2.4.1" - parseurl "~1.3.3" - path-to-regexp "0.1.7" - proxy-addr "~2.0.7" - qs "6.10.3" - range-parser "~1.2.1" - safe-buffer "5.2.1" - send "0.18.0" - serve-static "1.15.0" - setprototypeof "1.2.0" - statuses "2.0.1" - type-is "~1.6.18" - utils-merge "1.0.1" - vary "~1.1.2" - -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - integrity sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug== - dependencies: - is-extendable "^0.1.0" - -extend-shallow@^3.0.0, extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - integrity sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q== - dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" - -extglob@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - -fast-levenshtein@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== - -fb-watchman@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.1.tgz#fc84fb39d2709cf3ff6d743706157bb5708a8a85" - integrity sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg== - dependencies: - bser "2.1.1" - -file-saver@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/file-saver/-/file-saver-2.0.5.tgz#d61cfe2ce059f414d899e9dd6d4107ee25670c38" - integrity sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA== - -fill-range@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - integrity sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ== - dependencies: - extend-shallow "^2.0.1" - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range "^2.1.0" - -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - -finalhandler@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" - integrity sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg== - dependencies: - debug "2.6.9" - encodeurl "~1.0.2" - escape-html "~1.0.3" - on-finished "2.4.1" - parseurl "~1.3.3" - statuses "2.0.1" - unpipe "~1.0.0" - -find-up@^4.0.0, find-up@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" - -for-in@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ== - -form-data@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - -forwarded@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" - integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== - -fragment-cache@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - integrity sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA== - dependencies: - map-cache "^0.2.2" - -fresh@0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== - -fs-extra@^7.0.0: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" - integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== - dependencies: - graceful-fs "^4.1.2" - jsonfile "^4.0.0" - universalify "^0.1.0" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== - -fsevents@^2.1.2, fsevents@~2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" - integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== - -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - -gensync@^1.0.0-beta.2: - version "1.0.0-beta.2" - resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" - integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== - -get-caller-file@^2.0.1: - version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - -get-intrinsic@^1.0.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.2.tgz#336975123e05ad0b7ba41f152ee4aadbea6cf598" - integrity sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA== - dependencies: - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.3" - -get-package-type@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" - integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== - -get-stream@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" - integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== - dependencies: - pump "^3.0.0" - -get-stream@^5.0.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" - integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== - dependencies: - pump "^3.0.0" - -get-value@^2.0.3, get-value@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - integrity sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA== - -glob-parent@~5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - -glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4: - version "7.2.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" - integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.1.1" - once "^1.3.0" - path-is-absolute "^1.0.0" - -globals@^11.1.0: - version "11.12.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" - integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== - -graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.4: - version "4.2.10" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" - integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== - -growly@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" - integrity sha512-+xGQY0YyAWCnqy7Cd++hc2JqMYzlm0dG30Jd0beaA64sROr8C4nt8Yc9V5Ro3avlSUDTN0ulqP/VBKi1/lLygw== - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -has-symbols@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" - integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== - -has-value@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - integrity sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q== - dependencies: - get-value "^2.0.3" - has-values "^0.1.4" - isobject "^2.0.0" - -has-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - integrity sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw== - dependencies: - get-value "^2.0.6" - has-values "^1.0.0" - isobject "^3.0.0" - -has-values@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - integrity sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ== - -has-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - integrity sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ== - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - -has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - -hosted-git-info@^2.1.4: - version "2.8.9" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" - integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== - -html-encoding-sniffer@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz#42a6dc4fd33f00281176e8b23759ca4e4fa185f3" - integrity sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ== - dependencies: - whatwg-encoding "^1.0.5" - -html-escaper@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" - integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== - -http-errors@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" - integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ== - dependencies: - depd "2.0.0" - inherits "2.0.4" - setprototypeof "1.2.0" - statuses "2.0.1" - toidentifier "1.0.1" - -http-proxy-agent@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a" - integrity sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg== - dependencies: - "@tootallnate/once" "1" - agent-base "6" - debug "4" - -https-proxy-agent@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" - integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== - dependencies: - agent-base "6" - debug "4" - -human-signals@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" - integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== - -iconv-lite@0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -ignore-by-default@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09" - integrity sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA== - -immediate@~3.0.5: - version "3.0.6" - resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" - integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ== - -import-local@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.1.0.tgz#b4479df8a5fd44f6cdce24070675676063c95cb4" - integrity sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg== - dependencies: - pkg-dir "^4.2.0" - resolve-cwd "^3.0.0" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@2.0.4, inherits@^2.0.3, inherits@~2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -ipaddr.js@1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" - integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== - -is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - integrity sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A== - dependencies: - kind-of "^3.0.2" - -is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== - dependencies: - kind-of "^6.0.0" - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== - -is-binary-path@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== - dependencies: - binary-extensions "^2.0.0" - -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== - -is-ci@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" - integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== - dependencies: - ci-info "^2.0.0" - -is-core-module@^2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.9.0.tgz#e1c34429cd51c6dd9e09e0799e396e27b19a9c69" - integrity sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A== - dependencies: - has "^1.0.3" - -is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - integrity sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg== - dependencies: - kind-of "^3.0.2" - -is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== - dependencies: - kind-of "^6.0.0" - -is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== - dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" - -is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== - dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" - -is-docker@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" - integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== - -is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - integrity sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw== - -is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== - dependencies: - is-plain-object "^2.0.4" - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== - -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-generator-fn@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" - integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== - -is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - integrity sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg== - dependencies: - kind-of "^3.0.2" - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -is-plain-object@^2.0.3, is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== - dependencies: - isobject "^3.0.1" - -is-potential-custom-element-name@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" - integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== - -is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ== - -is-stream@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" - integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== - -is-typedarray@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== - -is-windows@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== - -is-wsl@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" - integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== - dependencies: - is-docker "^2.0.0" - -isarray@1.0.0, isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== - -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - integrity sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA== - dependencies: - isarray "1.0.0" - -isobject@^3.0.0, isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== - -istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" - integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== - -istanbul-lib-instrument@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz#873c6fff897450118222774696a3f28902d77c1d" - integrity sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ== - dependencies: - "@babel/core" "^7.7.5" - "@istanbuljs/schema" "^0.1.2" - istanbul-lib-coverage "^3.0.0" - semver "^6.3.0" - -istanbul-lib-instrument@^5.0.4: - version "5.2.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.0.tgz#31d18bdd127f825dd02ea7bfdfd906f8ab840e9f" - integrity sha512-6Lthe1hqXHBNsqvgDzGO6l03XNeu3CrG4RqQ1KM9+l5+jNGpEJfIELx1NS3SEHmJQA8np/u+E4EPRKRiu6m19A== - dependencies: - "@babel/core" "^7.12.3" - "@babel/parser" "^7.14.7" - "@istanbuljs/schema" "^0.1.2" - istanbul-lib-coverage "^3.2.0" - semver "^6.3.0" - -istanbul-lib-report@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6" - integrity sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw== - dependencies: - istanbul-lib-coverage "^3.0.0" - make-dir "^3.0.0" - supports-color "^7.1.0" - -istanbul-lib-source-maps@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz#895f3a709fcfba34c6de5a42939022f3e4358551" - integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw== - dependencies: - debug "^4.1.1" - istanbul-lib-coverage "^3.0.0" - source-map "^0.6.1" - -istanbul-reports@^3.0.2: - version "3.1.5" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.5.tgz#cc9a6ab25cb25659810e4785ed9d9fb742578bae" - integrity sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w== - dependencies: - html-escaper "^2.0.0" - istanbul-lib-report "^3.0.0" - -jest-changed-files@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-26.6.2.tgz#f6198479e1cc66f22f9ae1e22acaa0b429c042d0" - integrity sha512-fDS7szLcY9sCtIip8Fjry9oGf3I2ht/QT21bAHm5Dmf0mD4X3ReNUf17y+bO6fR8WgbIZTlbyG1ak/53cbRzKQ== - dependencies: - "@jest/types" "^26.6.2" - execa "^4.0.0" - throat "^5.0.0" - -jest-cli@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-26.6.3.tgz#43117cfef24bc4cd691a174a8796a532e135e92a" - integrity sha512-GF9noBSa9t08pSyl3CY4frMrqp+aQXFGFkf5hEPbh/pIUFYWMK6ZLTfbmadxJVcJrdRoChlWQsA2VkJcDFK8hg== - dependencies: - "@jest/core" "^26.6.3" - "@jest/test-result" "^26.6.2" - "@jest/types" "^26.6.2" - chalk "^4.0.0" - exit "^0.1.2" - graceful-fs "^4.2.4" - import-local "^3.0.2" - is-ci "^2.0.0" - jest-config "^26.6.3" - jest-util "^26.6.2" - jest-validate "^26.6.2" - prompts "^2.0.1" - yargs "^15.4.1" - -jest-config@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-26.6.3.tgz#64f41444eef9eb03dc51d5c53b75c8c71f645349" - integrity sha512-t5qdIj/bCj2j7NFVHb2nFB4aUdfucDn3JRKgrZnplb8nieAirAzRSHP8uDEd+qV6ygzg9Pz4YG7UTJf94LPSyg== - dependencies: - "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^26.6.3" - "@jest/types" "^26.6.2" - babel-jest "^26.6.3" - chalk "^4.0.0" - deepmerge "^4.2.2" - glob "^7.1.1" - graceful-fs "^4.2.4" - jest-environment-jsdom "^26.6.2" - jest-environment-node "^26.6.2" - jest-get-type "^26.3.0" - jest-jasmine2 "^26.6.3" - jest-regex-util "^26.0.0" - jest-resolve "^26.6.2" - jest-util "^26.6.2" - jest-validate "^26.6.2" - micromatch "^4.0.2" - pretty-format "^26.6.2" - -jest-diff@^26.0.0, jest-diff@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-26.6.2.tgz#1aa7468b52c3a68d7d5c5fdcdfcd5e49bd164394" - integrity sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA== - dependencies: - chalk "^4.0.0" - diff-sequences "^26.6.2" - jest-get-type "^26.3.0" - pretty-format "^26.6.2" - -jest-docblock@^26.0.0: - version "26.0.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-26.0.0.tgz#3e2fa20899fc928cb13bd0ff68bd3711a36889b5" - integrity sha512-RDZ4Iz3QbtRWycd8bUEPxQsTlYazfYn/h5R65Fc6gOfwozFhoImx+affzky/FFBuqISPTqjXomoIGJVKBWoo0w== - dependencies: - detect-newline "^3.0.0" - -jest-each@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-26.6.2.tgz#02526438a77a67401c8a6382dfe5999952c167cb" - integrity sha512-Mer/f0KaATbjl8MCJ+0GEpNdqmnVmDYqCTJYTvoo7rqmRiDllmp2AYN+06F93nXcY3ur9ShIjS+CO/uD+BbH4A== - dependencies: - "@jest/types" "^26.6.2" - chalk "^4.0.0" - jest-get-type "^26.3.0" - jest-util "^26.6.2" - pretty-format "^26.6.2" - -jest-environment-jsdom@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-26.6.2.tgz#78d09fe9cf019a357009b9b7e1f101d23bd1da3e" - integrity sha512-jgPqCruTlt3Kwqg5/WVFyHIOJHsiAvhcp2qiR2QQstuG9yWox5+iHpU3ZrcBxW14T4fe5Z68jAfLRh7joCSP2Q== - dependencies: - "@jest/environment" "^26.6.2" - "@jest/fake-timers" "^26.6.2" - "@jest/types" "^26.6.2" - "@types/node" "*" - jest-mock "^26.6.2" - jest-util "^26.6.2" - jsdom "^16.4.0" - -jest-environment-node@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-26.6.2.tgz#824e4c7fb4944646356f11ac75b229b0035f2b0c" - integrity sha512-zhtMio3Exty18dy8ee8eJ9kjnRyZC1N4C1Nt/VShN1apyXc8rWGtJ9lI7vqiWcyyXS4BVSEn9lxAM2D+07/Tag== - dependencies: - "@jest/environment" "^26.6.2" - "@jest/fake-timers" "^26.6.2" - "@jest/types" "^26.6.2" - "@types/node" "*" - jest-mock "^26.6.2" - jest-util "^26.6.2" - -jest-get-type@^26.3.0: - version "26.3.0" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-26.3.0.tgz#e97dc3c3f53c2b406ca7afaed4493b1d099199e0" - integrity sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig== - -jest-haste-map@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-26.6.2.tgz#dd7e60fe7dc0e9f911a23d79c5ff7fb5c2cafeaa" - integrity sha512-easWIJXIw71B2RdR8kgqpjQrbMRWQBgiBwXYEhtGUTaX+doCjBheluShdDMeR8IMfJiTqH4+zfhtg29apJf/8w== - dependencies: - "@jest/types" "^26.6.2" - "@types/graceful-fs" "^4.1.2" - "@types/node" "*" - anymatch "^3.0.3" - fb-watchman "^2.0.0" - graceful-fs "^4.2.4" - jest-regex-util "^26.0.0" - jest-serializer "^26.6.2" - jest-util "^26.6.2" - jest-worker "^26.6.2" - micromatch "^4.0.2" - sane "^4.0.3" - walker "^1.0.7" - optionalDependencies: - fsevents "^2.1.2" - -jest-jasmine2@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-26.6.3.tgz#adc3cf915deacb5212c93b9f3547cd12958f2edd" - integrity sha512-kPKUrQtc8aYwBV7CqBg5pu+tmYXlvFlSFYn18ev4gPFtrRzB15N2gW/Roew3187q2w2eHuu0MU9TJz6w0/nPEg== - dependencies: - "@babel/traverse" "^7.1.0" - "@jest/environment" "^26.6.2" - "@jest/source-map" "^26.6.2" - "@jest/test-result" "^26.6.2" - "@jest/types" "^26.6.2" - "@types/node" "*" - chalk "^4.0.0" - co "^4.6.0" - expect "^26.6.2" - is-generator-fn "^2.0.0" - jest-each "^26.6.2" - jest-matcher-utils "^26.6.2" - jest-message-util "^26.6.2" - jest-runtime "^26.6.3" - jest-snapshot "^26.6.2" - jest-util "^26.6.2" - pretty-format "^26.6.2" - throat "^5.0.0" - -jest-leak-detector@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-26.6.2.tgz#7717cf118b92238f2eba65054c8a0c9c653a91af" - integrity sha512-i4xlXpsVSMeKvg2cEKdfhh0H39qlJlP5Ex1yQxwF9ubahboQYMgTtz5oML35AVA3B4Eu+YsmwaiKVev9KCvLxg== - dependencies: - jest-get-type "^26.3.0" - pretty-format "^26.6.2" - -jest-matcher-utils@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-26.6.2.tgz#8e6fd6e863c8b2d31ac6472eeb237bc595e53e7a" - integrity sha512-llnc8vQgYcNqDrqRDXWwMr9i7rS5XFiCwvh6DTP7Jqa2mqpcCBBlpCbn+trkG0KNhPu/h8rzyBkriOtBstvWhw== - dependencies: - chalk "^4.0.0" - jest-diff "^26.6.2" - jest-get-type "^26.3.0" - pretty-format "^26.6.2" - -jest-message-util@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-26.6.2.tgz#58173744ad6fc0506b5d21150b9be56ef001ca07" - integrity sha512-rGiLePzQ3AzwUshu2+Rn+UMFk0pHN58sOG+IaJbk5Jxuqo3NYO1U2/MIR4S1sKgsoYSXSzdtSa0TgrmtUwEbmA== - dependencies: - "@babel/code-frame" "^7.0.0" - "@jest/types" "^26.6.2" - "@types/stack-utils" "^2.0.0" - chalk "^4.0.0" - graceful-fs "^4.2.4" - micromatch "^4.0.2" - pretty-format "^26.6.2" - slash "^3.0.0" - stack-utils "^2.0.2" - -jest-mock@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-26.6.2.tgz#d6cb712b041ed47fe0d9b6fc3474bc6543feb302" - integrity sha512-YyFjePHHp1LzpzYcmgqkJ0nm0gg/lJx2aZFzFy1S6eUqNjXsOqTK10zNRff2dNfssgokjkG65OlWNcIlgd3zew== - dependencies: - "@jest/types" "^26.6.2" - "@types/node" "*" - -jest-pnp-resolver@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" - integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== - -jest-regex-util@^26.0.0: - version "26.0.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-26.0.0.tgz#d25e7184b36e39fd466c3bc41be0971e821fee28" - integrity sha512-Gv3ZIs/nA48/Zvjrl34bf+oD76JHiGDUxNOVgUjh3j890sblXryjY4rss71fPtD/njchl6PSE2hIhvyWa1eT0A== - -jest-resolve-dependencies@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-26.6.3.tgz#6680859ee5d22ee5dcd961fe4871f59f4c784fb6" - integrity sha512-pVwUjJkxbhe4RY8QEWzN3vns2kqyuldKpxlxJlzEYfKSvY6/bMvxoFrYYzUO1Gx28yKWN37qyV7rIoIp2h8fTg== - dependencies: - "@jest/types" "^26.6.2" - jest-regex-util "^26.0.0" - jest-snapshot "^26.6.2" - -jest-resolve@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-26.6.2.tgz#a3ab1517217f469b504f1b56603c5bb541fbb507" - integrity sha512-sOxsZOq25mT1wRsfHcbtkInS+Ek7Q8jCHUB0ZUTP0tc/c41QHriU/NunqMfCUWsL4H3MHpvQD4QR9kSYhS7UvQ== - dependencies: - "@jest/types" "^26.6.2" - chalk "^4.0.0" - graceful-fs "^4.2.4" - jest-pnp-resolver "^1.2.2" - jest-util "^26.6.2" - read-pkg-up "^7.0.1" - resolve "^1.18.1" - slash "^3.0.0" - -jest-runner@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-26.6.3.tgz#2d1fed3d46e10f233fd1dbd3bfaa3fe8924be159" - integrity sha512-atgKpRHnaA2OvByG/HpGA4g6CSPS/1LK0jK3gATJAoptC1ojltpmVlYC3TYgdmGp+GLuhzpH30Gvs36szSL2JQ== - dependencies: - "@jest/console" "^26.6.2" - "@jest/environment" "^26.6.2" - "@jest/test-result" "^26.6.2" - "@jest/types" "^26.6.2" - "@types/node" "*" - chalk "^4.0.0" - emittery "^0.7.1" - exit "^0.1.2" - graceful-fs "^4.2.4" - jest-config "^26.6.3" - jest-docblock "^26.0.0" - jest-haste-map "^26.6.2" - jest-leak-detector "^26.6.2" - jest-message-util "^26.6.2" - jest-resolve "^26.6.2" - jest-runtime "^26.6.3" - jest-util "^26.6.2" - jest-worker "^26.6.2" - source-map-support "^0.5.6" - throat "^5.0.0" - -jest-runtime@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-26.6.3.tgz#4f64efbcfac398331b74b4b3c82d27d401b8fa2b" - integrity sha512-lrzyR3N8sacTAMeonbqpnSka1dHNux2uk0qqDXVkMv2c/A3wYnvQ4EXuI013Y6+gSKSCxdaczvf4HF0mVXHRdw== - dependencies: - "@jest/console" "^26.6.2" - "@jest/environment" "^26.6.2" - "@jest/fake-timers" "^26.6.2" - "@jest/globals" "^26.6.2" - "@jest/source-map" "^26.6.2" - "@jest/test-result" "^26.6.2" - "@jest/transform" "^26.6.2" - "@jest/types" "^26.6.2" - "@types/yargs" "^15.0.0" - chalk "^4.0.0" - cjs-module-lexer "^0.6.0" - collect-v8-coverage "^1.0.0" - exit "^0.1.2" - glob "^7.1.3" - graceful-fs "^4.2.4" - jest-config "^26.6.3" - jest-haste-map "^26.6.2" - jest-message-util "^26.6.2" - jest-mock "^26.6.2" - jest-regex-util "^26.0.0" - jest-resolve "^26.6.2" - jest-snapshot "^26.6.2" - jest-util "^26.6.2" - jest-validate "^26.6.2" - slash "^3.0.0" - strip-bom "^4.0.0" - yargs "^15.4.1" - -jest-serializer@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-26.6.2.tgz#d139aafd46957d3a448f3a6cdabe2919ba0742d1" - integrity sha512-S5wqyz0DXnNJPd/xfIzZ5Xnp1HrJWBczg8mMfMpN78OJ5eDxXyf+Ygld9wX1DnUWbIbhM1YDY95NjR4CBXkb2g== - dependencies: - "@types/node" "*" - graceful-fs "^4.2.4" - -jest-snapshot@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-26.6.2.tgz#f3b0af1acb223316850bd14e1beea9837fb39c84" - integrity sha512-OLhxz05EzUtsAmOMzuupt1lHYXCNib0ECyuZ/PZOx9TrZcC8vL0x+DUG3TL+GLX3yHG45e6YGjIm0XwDc3q3og== - dependencies: - "@babel/types" "^7.0.0" - "@jest/types" "^26.6.2" - "@types/babel__traverse" "^7.0.4" - "@types/prettier" "^2.0.0" - chalk "^4.0.0" - expect "^26.6.2" - graceful-fs "^4.2.4" - jest-diff "^26.6.2" - jest-get-type "^26.3.0" - jest-haste-map "^26.6.2" - jest-matcher-utils "^26.6.2" - jest-message-util "^26.6.2" - jest-resolve "^26.6.2" - natural-compare "^1.4.0" - pretty-format "^26.6.2" - semver "^7.3.2" - -jest-util@^26.1.0, jest-util@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-26.6.2.tgz#907535dbe4d5a6cb4c47ac9b926f6af29576cbc1" - integrity sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q== - dependencies: - "@jest/types" "^26.6.2" - "@types/node" "*" - chalk "^4.0.0" - graceful-fs "^4.2.4" - is-ci "^2.0.0" - micromatch "^4.0.2" - -jest-validate@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-26.6.2.tgz#23d380971587150467342911c3d7b4ac57ab20ec" - integrity sha512-NEYZ9Aeyj0i5rQqbq+tpIOom0YS1u2MVu6+euBsvpgIme+FOfRmoC4R5p0JiAUpaFvFy24xgrpMknarR/93XjQ== - dependencies: - "@jest/types" "^26.6.2" - camelcase "^6.0.0" - chalk "^4.0.0" - jest-get-type "^26.3.0" - leven "^3.1.0" - pretty-format "^26.6.2" - -jest-watcher@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-26.6.2.tgz#a5b683b8f9d68dbcb1d7dae32172d2cca0592975" - integrity sha512-WKJob0P/Em2csiVthsI68p6aGKTIcsfjH9Gsx1f0A3Italz43e3ho0geSAVsmj09RWOELP1AZ/DXyJgOgDKxXQ== - dependencies: - "@jest/test-result" "^26.6.2" - "@jest/types" "^26.6.2" - "@types/node" "*" - ansi-escapes "^4.2.1" - chalk "^4.0.0" - jest-util "^26.6.2" - string-length "^4.0.1" - -jest-worker@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed" - integrity sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ== - dependencies: - "@types/node" "*" - merge-stream "^2.0.0" - supports-color "^7.0.0" - -jest@^26.2.2: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest/-/jest-26.6.3.tgz#40e8fdbe48f00dfa1f0ce8121ca74b88ac9148ef" - integrity sha512-lGS5PXGAzR4RF7V5+XObhqz2KZIDUA1yD0DG6pBVmy10eh0ZIXQImRuzocsI/N2XZ1GrLFwTS27In2i2jlpq1Q== - dependencies: - "@jest/core" "^26.6.3" - import-local "^3.0.2" - jest-cli "^26.6.3" - -js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -js-yaml@^3.13.1: - version "3.14.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -jsdom@^16.4.0: - version "16.7.0" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.7.0.tgz#918ae71965424b197c819f8183a754e18977b710" - integrity sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw== - dependencies: - abab "^2.0.5" - acorn "^8.2.4" - acorn-globals "^6.0.0" - cssom "^0.4.4" - cssstyle "^2.3.0" - data-urls "^2.0.0" - decimal.js "^10.2.1" - domexception "^2.0.1" - escodegen "^2.0.0" - form-data "^3.0.0" - html-encoding-sniffer "^2.0.1" - http-proxy-agent "^4.0.1" - https-proxy-agent "^5.0.0" - is-potential-custom-element-name "^1.0.1" - nwsapi "^2.2.0" - parse5 "6.0.1" - saxes "^5.0.1" - symbol-tree "^3.2.4" - tough-cookie "^4.0.0" - w3c-hr-time "^1.0.2" - w3c-xmlserializer "^2.0.0" - webidl-conversions "^6.1.0" - whatwg-encoding "^1.0.5" - whatwg-mimetype "^2.3.0" - whatwg-url "^8.5.0" - ws "^7.4.6" - xml-name-validator "^3.0.0" - -jsesc@^2.5.1: - version "2.5.2" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" - integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== - -json-parse-even-better-errors@^2.3.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" - integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== - -json5@2.x, json5@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" - integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== - -jsonfile@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" - integrity sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg== - optionalDependencies: - graceful-fs "^4.1.6" - -jszip@^3.2.0: - version "3.10.0" - resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.10.0.tgz#faf3db2b4b8515425e34effcdbb086750a346061" - integrity sha512-LDfVtOLtOxb9RXkYOwPyNBTQDL4eUbqahtoY6x07GiDJHwSYvn8sHHIw8wINImV3MqbMNve2gSuM1DDqEKk09Q== - dependencies: - lie "~3.3.0" - pako "~1.0.2" - readable-stream "~2.3.6" - setimmediate "^1.0.5" - -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ== - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - integrity sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw== - dependencies: - is-buffer "^1.1.5" - -kind-of@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== - -kind-of@^6.0.0, kind-of@^6.0.2: - version "6.0.3" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" - integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== - -kleur@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" - integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== - -leven@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" - integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== - -levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA== - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - -lie@~3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/lie/-/lie-3.3.0.tgz#dcf82dee545f46074daf200c7c1c5a08e0f40f6a" - integrity sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ== - dependencies: - immediate "~3.0.5" - -lines-and-columns@^1.1.6: - version "1.2.4" - resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" - integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== - -locate-path@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" - integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== - dependencies: - p-locate "^4.1.0" - -lodash@4.x, lodash@^4.7.0: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -make-dir@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" - integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== - dependencies: - semver "^6.0.0" - -make-error@1.x, make-error@^1.1.1: - version "1.3.6" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" - integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== - -makeerror@1.0.12: - version "1.0.12" - resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a" - integrity sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg== - dependencies: - tmpl "1.0.5" - -map-cache@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - integrity sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg== - -map-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - integrity sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w== - dependencies: - object-visit "^1.0.0" - -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ== - -merge-descriptors@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w== - -merge-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" - integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== - -methods@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" - integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== - -micromatch@^3.1.4: - version "3.1.10" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" - integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.2" - -micromatch@^4.0.2: - version "4.0.5" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" - integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== - dependencies: - braces "^3.0.2" - picomatch "^2.3.1" - -mime-db@1.52.0: - version "1.52.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" - integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== - -mime-types@^2.1.12, mime-types@~2.1.24, mime-types@~2.1.34: - version "2.1.35" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" - integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== - dependencies: - mime-db "1.52.0" - -mime@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" - integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== - -mimic-fn@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - -minimatch@^3.0.4, minimatch@^3.1.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== - dependencies: - brace-expansion "^1.1.7" - -minimist@^1.1.1, minimist@^1.2.0, minimist@^1.2.6: - version "1.2.6" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" - integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== - -mixin-deep@^1.2.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" - integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== - dependencies: - for-in "^1.0.2" - is-extendable "^1.0.1" - -mkdirp@1.x: - version "1.0.4" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" - integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== - -mkdirp@^0.5.4: - version "0.5.6" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" - integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== - dependencies: - minimist "^1.2.6" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -ms@2.1.3, ms@^2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - -multer@^1.4.5-lts.1: - version "1.4.5-lts.1" - resolved "https://registry.yarnpkg.com/multer/-/multer-1.4.5-lts.1.tgz#803e24ad1984f58edffbc79f56e305aec5cfd1ac" - integrity sha512-ywPWvcDMeH+z9gQq5qYHCCy+ethsk4goepZ45GLD63fOu0YcNecQxi64nDs3qluZB+murG3/D4dJ7+dGctcCQQ== - dependencies: - append-field "^1.0.0" - busboy "^1.0.0" - concat-stream "^1.5.2" - mkdirp "^0.5.4" - object-assign "^4.1.1" - type-is "^1.6.4" - xtend "^4.0.0" - -nanomatch@^1.2.9: - version "1.2.13" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" - integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^2.0.2" - extend-shallow "^3.0.2" - fragment-cache "^0.2.1" - is-windows "^1.0.2" - kind-of "^6.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== - -negotiator@0.6.3: - version "0.6.3" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" - integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== - -nice-try@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" - integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== - -node-int64@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" - integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== - -node-notifier@^8.0.0: - version "8.0.2" - resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-8.0.2.tgz#f3167a38ef0d2c8a866a83e318c1ba0efeb702c5" - integrity sha512-oJP/9NAdd9+x2Q+rfphB2RJCHjod70RcRLjosiPMMu5gjIfwVnOUGq2nbTjTUbmy0DJ/tFIVT30+Qe3nzl4TJg== - dependencies: - growly "^1.3.0" - is-wsl "^2.2.0" - semver "^7.3.2" - shellwords "^0.1.1" - uuid "^8.3.0" - which "^2.0.2" - -node-releases@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.6.tgz#8a7088c63a55e493845683ebf3c828d8c51c5503" - integrity sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg== - -nodemon@^2.0.4: - version "2.0.19" - resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-2.0.19.tgz#cac175f74b9cb8b57e770d47841995eebe4488bd" - integrity sha512-4pv1f2bMDj0Eeg/MhGqxrtveeQ5/G/UVe9iO6uTZzjnRluSA4PVWf8CW99LUPwGB3eNIA7zUFoP77YuI7hOc0A== - dependencies: - chokidar "^3.5.2" - debug "^3.2.7" - ignore-by-default "^1.0.1" - minimatch "^3.0.4" - pstree.remy "^1.1.8" - semver "^5.7.1" - simple-update-notifier "^1.0.7" - supports-color "^5.5.0" - touch "^3.1.0" - undefsafe "^2.0.5" - -nopt@~1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee" - integrity sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg== - dependencies: - abbrev "1" - -normalize-package-data@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" - integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== - dependencies: - hosted-git-info "^2.1.4" - resolve "^1.10.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - -normalize-path@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w== - dependencies: - remove-trailing-separator "^1.0.1" - -normalize-path@^3.0.0, normalize-path@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - -npm-run-path@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" - integrity sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw== - dependencies: - path-key "^2.0.0" - -npm-run-path@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" - integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== - dependencies: - path-key "^3.0.0" - -nwsapi@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.1.tgz#10a9f268fbf4c461249ebcfe38e359aa36e2577c" - integrity sha512-JYOWTeFoS0Z93587vRJgASD5Ut11fYl5NyihP3KrYBvMe1FRRs6RN7m20SA/16GM4P6hTnZjT+UmDOt38UeXNg== - -object-assign@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== - -object-copy@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - integrity sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ== - dependencies: - copy-descriptor "^0.1.0" - define-property "^0.2.5" - kind-of "^3.0.3" - -object-inspect@^1.9.0: - version "1.12.2" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea" - integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== - -object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - integrity sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA== - dependencies: - isobject "^3.0.0" - -object.pick@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - integrity sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ== - dependencies: - isobject "^3.0.1" - -on-finished@2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" - integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg== - dependencies: - ee-first "1.1.1" - -once@^1.3.0, once@^1.3.1, once@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== - dependencies: - wrappy "1" - -onetime@^5.1.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" - integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== - dependencies: - mimic-fn "^2.1.0" - -optionator@^0.8.1: - version "0.8.3" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" - integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.6" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - word-wrap "~1.2.3" - -p-each-series@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-2.2.0.tgz#105ab0357ce72b202a8a8b94933672657b5e2a9a" - integrity sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA== - -p-finally@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - integrity sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow== - -p-limit@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== - dependencies: - p-try "^2.0.0" - -p-locate@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" - integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== - dependencies: - p-limit "^2.2.0" - -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - -pako@~1.0.2: - version "1.0.11" - resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" - integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== - -parse-json@^5.0.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" - integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== - dependencies: - "@babel/code-frame" "^7.0.0" - error-ex "^1.3.1" - json-parse-even-better-errors "^2.3.0" - lines-and-columns "^1.1.6" - -parse5@6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" - integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== - -parseurl@~1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" - integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== - -pascalcase@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - integrity sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw== - -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== - -path-key@^2.0.0, path-key@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw== - -path-key@^3.0.0, path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== - -path-parse@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" - integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== - -path-to-regexp@0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== - -picocolors@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" - integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== - -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== - -pirates@^4.0.1: - version "4.0.5" - resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b" - integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ== - -pkg-dir@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" - integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== - dependencies: - find-up "^4.0.0" - -posix-character-classes@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - integrity sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg== - -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== - -pretty-format@^26.0.0, pretty-format@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.6.2.tgz#e35c2705f14cb7fe2fe94fa078345b444120fc93" - integrity sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg== - dependencies: - "@jest/types" "^26.6.2" - ansi-regex "^5.0.0" - ansi-styles "^4.0.0" - react-is "^17.0.1" - -process-nextick-args@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" - integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== - -prompts@^2.0.1: - version "2.4.2" - resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" - integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q== - dependencies: - kleur "^3.0.3" - sisteransi "^1.0.5" - -proxy-addr@~2.0.7: - version "2.0.7" - resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" - integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== - dependencies: - forwarded "0.2.0" - ipaddr.js "1.9.1" - -psl@^1.1.33: - version "1.9.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" - integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== - -pstree.remy@^1.1.8: - version "1.1.8" - resolved "https://registry.yarnpkg.com/pstree.remy/-/pstree.remy-1.1.8.tgz#c242224f4a67c21f686839bbdb4ac282b8373d3a" - integrity sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w== - -pump@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" - integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -punycode@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== - -qs@6.10.3: - version "6.10.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.3.tgz#d6cde1b2ffca87b5aa57889816c5f81535e22e8e" - integrity sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ== - dependencies: - side-channel "^1.0.4" - -range-parser@~1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" - integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== - -raw-body@2.5.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857" - integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== - dependencies: - bytes "3.1.2" - http-errors "2.0.0" - iconv-lite "0.4.24" - unpipe "1.0.0" - -react-is@^17.0.1: - version "17.0.2" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" - integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== - -read-pkg-up@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" - integrity sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg== - dependencies: - find-up "^4.1.0" - read-pkg "^5.2.0" - type-fest "^0.8.1" - -read-pkg@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" - integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== - dependencies: - "@types/normalize-package-data" "^2.4.0" - normalize-package-data "^2.5.0" - parse-json "^5.0.0" - type-fest "^0.6.0" - -readable-stream@^2.2.2, readable-stream@~2.3.6: - version "2.3.7" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readdirp@~3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" - integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== - dependencies: - picomatch "^2.2.1" - -regex-not@^1.0.0, regex-not@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== - dependencies: - extend-shallow "^3.0.2" - safe-regex "^1.1.0" - -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - integrity sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw== - -repeat-element@^1.1.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.4.tgz#be681520847ab58c7568ac75fbfad28ed42d39e9" - integrity sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ== - -repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w== - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== - -require-main-filename@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" - integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== - -resolve-cwd@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" - integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== - dependencies: - resolve-from "^5.0.0" - -resolve-from@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" - integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== - -resolve-url@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - integrity sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg== - -resolve@^1.10.0, resolve@^1.18.1: - version "1.22.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" - integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== - dependencies: - is-core-module "^2.9.0" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - -ret@~0.1.10: - version "0.1.15" - resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== - -rimraf@3.0.2, rimraf@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - dependencies: - glob "^7.1.3" - -rsvp@^4.8.4: - version "4.8.5" - resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" - integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA== - -safe-buffer@5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -safe-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - integrity sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg== - dependencies: - ret "~0.1.10" - -"safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -sane@^4.0.3: - version "4.1.0" - resolved "https://registry.yarnpkg.com/sane/-/sane-4.1.0.tgz#ed881fd922733a6c461bc189dc2b6c006f3ffded" - integrity sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA== - dependencies: - "@cnakazawa/watch" "^1.0.3" - anymatch "^2.0.0" - capture-exit "^2.0.0" - exec-sh "^0.3.2" - execa "^1.0.0" - fb-watchman "^2.0.0" - micromatch "^3.1.4" - minimist "^1.1.1" - walker "~1.0.5" - -saxes@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/saxes/-/saxes-5.0.1.tgz#eebab953fa3b7608dbe94e5dadb15c888fa6696d" - integrity sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw== - dependencies: - xmlchars "^2.2.0" - -"semver@2 || 3 || 4 || 5", semver@^5.5.0, semver@^5.7.1: - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== - -semver@7.x, semver@^7.3.2: - version "7.3.7" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f" - integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== - dependencies: - lru-cache "^6.0.0" - -semver@^6.0.0, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - -semver@~7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" - integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== - -send@0.18.0: - version "0.18.0" - resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" - integrity sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg== - dependencies: - debug "2.6.9" - depd "2.0.0" - destroy "1.2.0" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - fresh "0.5.2" - http-errors "2.0.0" - mime "1.6.0" - ms "2.1.3" - on-finished "2.4.1" - range-parser "~1.2.1" - statuses "2.0.1" - -serve-static@1.15.0: - version "1.15.0" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540" - integrity sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g== - dependencies: - encodeurl "~1.0.2" - escape-html "~1.0.3" - parseurl "~1.3.3" - send "0.18.0" - -set-blocking@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== - -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" - integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.3" - split-string "^3.0.1" - -setimmediate@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" - integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA== - -setprototypeof@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" - integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== - -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg== - dependencies: - shebang-regex "^1.0.0" - -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ== - -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - -shellwords@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" - integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== - -side-channel@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" - integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== - dependencies: - call-bind "^1.0.0" - get-intrinsic "^1.0.2" - object-inspect "^1.9.0" - -signal-exit@^3.0.0, signal-exit@^3.0.2: - version "3.0.7" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" - integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== - -simple-update-notifier@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/simple-update-notifier/-/simple-update-notifier-1.0.7.tgz#7edf75c5bdd04f88828d632f762b2bc32996a9cc" - integrity sha512-BBKgR84BJQJm6WjWFMHgLVuo61FBDSj1z/xSFUIozqO6wO7ii0JxCqlIud7Enr/+LhlbNI0whErq96P2qHNWew== - dependencies: - semver "~7.0.0" - -sisteransi@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" - integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== - -slash@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" - integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== - -snapdragon-node@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== - dependencies: - define-property "^1.0.0" - isobject "^3.0.0" - snapdragon-util "^3.0.1" - -snapdragon-util@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== - dependencies: - kind-of "^3.2.0" - -snapdragon@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" - integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== - dependencies: - base "^0.11.1" - debug "^2.2.0" - define-property "^0.2.5" - extend-shallow "^2.0.1" - map-cache "^0.2.2" - source-map "^0.5.6" - source-map-resolve "^0.5.0" - use "^3.1.0" - -source-map-resolve@^0.5.0: - version "0.5.3" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" - integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== - dependencies: - atob "^2.1.2" - decode-uri-component "^0.2.0" - resolve-url "^0.2.1" - source-map-url "^0.4.0" - urix "^0.1.0" - -source-map-support@^0.5.17, source-map-support@^0.5.6: - version "0.5.21" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" - integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map-url@^0.4.0: - version "0.4.1" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.1.tgz#0af66605a745a5a2f91cf1bbf8a7afbc283dec56" - integrity sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw== - -source-map@^0.5.6: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ== - -source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -source-map@^0.7.3: - version "0.7.4" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" - integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== - -spdx-correct@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" - integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== - dependencies: - spdx-expression-parse "^3.0.0" - spdx-license-ids "^3.0.0" - -spdx-exceptions@^2.1.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" - integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== - -spdx-expression-parse@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" - integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== - dependencies: - spdx-exceptions "^2.1.0" - spdx-license-ids "^3.0.0" - -spdx-license-ids@^3.0.0: - version "3.0.11" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz#50c0d8c40a14ec1bf449bae69a0ea4685a9d9f95" - integrity sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g== - -split-string@^3.0.1, split-string@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== - dependencies: - extend-shallow "^3.0.0" - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== - -stack-utils@^2.0.2: - version "2.0.5" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.5.tgz#d25265fca995154659dbbfba3b49254778d2fdd5" - integrity sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA== - dependencies: - escape-string-regexp "^2.0.0" - -static-extend@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - integrity sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g== - dependencies: - define-property "^0.2.5" - object-copy "^0.1.0" - -statuses@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" - integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== - -streamsearch@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764" - integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg== - -string-length@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a" - integrity sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ== - dependencies: - char-regex "^1.0.2" - strip-ansi "^6.0.0" - -string-width@^4.1.0, string-width@^4.2.0: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-bom@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" - integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== - -strip-eof@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" - integrity sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q== - -strip-final-newline@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" - integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== - -supports-color@^5.3.0, supports-color@^5.5.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -supports-color@^7.0.0, supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -supports-hyperlinks@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz#4f77b42488765891774b70c79babd87f9bd594bb" - integrity sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ== - dependencies: - has-flag "^4.0.0" - supports-color "^7.0.0" - -supports-preserve-symlinks-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" - integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== - -symbol-tree@^3.2.4: - version "3.2.4" - resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" - integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== - -terminal-link@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/terminal-link/-/terminal-link-2.1.1.tgz#14a64a27ab3c0df933ea546fba55f2d078edc994" - integrity sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ== - dependencies: - ansi-escapes "^4.2.1" - supports-hyperlinks "^2.0.0" - -test-exclude@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" - integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== - dependencies: - "@istanbuljs/schema" "^0.1.2" - glob "^7.1.4" - minimatch "^3.0.4" - -throat@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/throat/-/throat-5.0.0.tgz#c5199235803aad18754a667d659b5e72ce16764b" - integrity sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA== - -tmpl@1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" - integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== - -to-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== - -to-object-path@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - integrity sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg== - dependencies: - kind-of "^3.0.2" - -to-regex-range@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - integrity sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg== - dependencies: - is-number "^3.0.0" - repeat-string "^1.6.1" - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -to-regex@^3.0.1, to-regex@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== - dependencies: - define-property "^2.0.2" - extend-shallow "^3.0.2" - regex-not "^1.0.2" - safe-regex "^1.1.0" - -toidentifier@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" - integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== - -touch@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/touch/-/touch-3.1.0.tgz#fe365f5f75ec9ed4e56825e0bb76d24ab74af83b" - integrity sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA== - dependencies: - nopt "~1.0.10" - -tough-cookie@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.0.0.tgz#d822234eeca882f991f0f908824ad2622ddbece4" - integrity sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg== - dependencies: - psl "^1.1.33" - punycode "^2.1.1" - universalify "^0.1.2" - -tr46@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-2.1.0.tgz#fa87aa81ca5d5941da8cbf1f9b749dc969a4e240" - integrity sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw== - dependencies: - punycode "^2.1.1" - -ts-jest@^26.1.4: - version "26.5.6" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.5.6.tgz#c32e0746425274e1dfe333f43cd3c800e014ec35" - integrity sha512-rua+rCP8DxpA8b4DQD/6X2HQS8Zy/xzViVYfEs2OQu68tkCuKLV0Md8pmX55+W24uRIyAsf/BajRfxOs+R2MKA== - dependencies: - bs-logger "0.x" - buffer-from "1.x" - fast-json-stable-stringify "2.x" - jest-util "^26.1.0" - json5 "2.x" - lodash "4.x" - make-error "1.x" - mkdirp "1.x" - semver "7.x" - yargs-parser "20.x" - -ts-node@^8.10.2: - version "8.10.2" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.10.2.tgz#eee03764633b1234ddd37f8db9ec10b75ec7fb8d" - integrity sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA== - dependencies: - arg "^4.1.0" - diff "^4.0.1" - make-error "^1.1.1" - source-map-support "^0.5.17" - yn "3.1.1" - -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg== - dependencies: - prelude-ls "~1.1.2" - -type-detect@4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" - integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== - -type-fest@^0.21.3: - version "0.21.3" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" - integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== - -type-fest@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" - integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== - -type-fest@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" - integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== - -type-is@^1.6.4, type-is@~1.6.18: - version "1.6.18" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" - integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== - dependencies: - media-typer "0.3.0" - mime-types "~2.1.24" - -typedarray-to-buffer@^3.1.5: - version "3.1.5" - resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" - integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== - dependencies: - is-typedarray "^1.0.0" - -typedarray@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== - -typescript@4.7.4: - version "4.7.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235" - integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== - -undefsafe@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-2.0.5.tgz#38733b9327bdcd226db889fb723a6efd162e6e2c" - integrity sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA== - -union-value@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" - integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== - dependencies: - arr-union "^3.1.0" - get-value "^2.0.6" - is-extendable "^0.1.1" - set-value "^2.0.1" - -universalify@^0.1.0, universalify@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" - integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== - -unpipe@1.0.0, unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== - -unset-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - integrity sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ== - dependencies: - has-value "^0.3.1" - isobject "^3.0.0" - -update-browserslist-db@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.5.tgz#be06a5eedd62f107b7c19eb5bcefb194411abf38" - integrity sha512-dteFFpCyvuDdr9S/ff1ISkKt/9YZxKjI9WlRR99c180GaztJtRa/fn18FdxGVKVsnPY7/a/FDN68mcvUmP4U7Q== - dependencies: - escalade "^3.1.1" - picocolors "^1.0.0" - -urix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - integrity sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg== - -use@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" - integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== - -util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== - -utils-merge@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== - -uuid@^8.3.0: - version "8.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" - integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== - -v8-to-istanbul@^7.0.0: - version "7.1.2" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-7.1.2.tgz#30898d1a7fa0c84d225a2c1434fb958f290883c1" - integrity sha512-TxNb7YEUwkLXCQYeudi6lgQ/SZrzNO4kMdlqVxaZPUIUjCv6iSSypUQX70kNBSERpQ8fk48+d61FXk+tgqcWow== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.1" - convert-source-map "^1.6.0" - source-map "^0.7.3" - -validate-npm-package-license@^3.0.1: - version "3.0.4" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" - integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== - dependencies: - spdx-correct "^3.0.0" - spdx-expression-parse "^3.0.0" - -vary@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== - -w3c-hr-time@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd" - integrity sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ== - dependencies: - browser-process-hrtime "^1.0.0" - -w3c-xmlserializer@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz#3e7104a05b75146cc60f564380b7f683acf1020a" - integrity sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA== - dependencies: - xml-name-validator "^3.0.0" - -walker@^1.0.7, walker@~1.0.5: - version "1.0.8" - resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f" - integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== - dependencies: - makeerror "1.0.12" - -webidl-conversions@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-5.0.0.tgz#ae59c8a00b121543a2acc65c0434f57b0fc11aff" - integrity sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA== - -webidl-conversions@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" - integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== - -whatwg-encoding@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" - integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== - dependencies: - iconv-lite "0.4.24" - -whatwg-mimetype@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" - integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== - -whatwg-url@^8.0.0, whatwg-url@^8.5.0: - version "8.7.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.7.0.tgz#656a78e510ff8f3937bc0bcbe9f5c0ac35941b77" - integrity sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg== - dependencies: - lodash "^4.7.0" - tr46 "^2.1.0" - webidl-conversions "^6.1.0" - -which-module@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" - integrity sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q== - -which@^1.2.9: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - -which@^2.0.1, which@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -word-wrap@~1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" - integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== - -wrap-ansi@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" - integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== - -write-file-atomic@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" - integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== - dependencies: - imurmurhash "^0.1.4" - is-typedarray "^1.0.0" - signal-exit "^3.0.2" - typedarray-to-buffer "^3.1.5" - -ws@^7.4.6: - version "7.5.9" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" - integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== - -xml-name-validator@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" - integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== - -xmlchars@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" - integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== - -xtend@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" - integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== - -y18n@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" - integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - -yargs-parser@20.x: - version "20.2.9" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== - -yargs-parser@^18.1.2: - version "18.1.3" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" - integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - -yargs@^15.4.1: - version "15.4.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" - integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== - dependencies: - cliui "^6.0.0" - decamelize "^1.2.0" - find-up "^4.1.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^4.2.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^18.1.2" - -yn@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" - integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== diff --git a/packages/cli/src/lib/defaults/infra-modules/tracer/alertmanager.yml b/packages/cli/src/lib/defaults/infra-modules/tracer/alertmanager.yml new file mode 100644 index 0000000000..d69357f9dd --- /dev/null +++ b/packages/cli/src/lib/defaults/infra-modules/tracer/alertmanager.yml @@ -0,0 +1,35 @@ +global: + resolve_timeout: 1m + slack_api_url: 'https://hooks.slack.com/services/xxx' + +route: + receiver: 'slack-notifications' + +receivers: +- name: 'slack-notifications' + slack_configs: + - channel: '#alerts' + send_resolved: true + icon_url: https://avatars3.githubusercontent.com/u/3380462 + title: |- + [{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}] {{ .CommonLabels.alertname }} for {{ .CommonLabels.job }} + {{- if gt (len .CommonLabels) (len .GroupLabels) -}} + {{" "}}( + {{- with .CommonLabels.Remove .GroupLabels.Names }} + {{- range $index, $label := .SortedPairs -}} + {{ if $index }}, {{ end }} + {{- $label.Name }}="{{ $label.Value -}}" + {{- end }} + {{- end -}} + ) + {{- end }} + text: >- + {{ range .Alerts -}} + *Alert:* {{ .Annotations.title }}{{ if .Labels.severity }} - `{{ .Labels.severity }}`{{ end }} + + *Description:* {{ .Annotations.description }} + + *Details:* + {{ range .Labels.SortedPairs }} • *{{ .Name }}:* `{{ .Value }}` + {{ end }} + {{ end }} \ No newline at end of file diff --git a/packages/cli/src/lib/defaults/infra-modules/tracer/clickhouse-storage.xml b/packages/cli/src/lib/defaults/infra-modules/tracer/clickhouse-storage.xml new file mode 100644 index 0000000000..2b2f4010ac --- /dev/null +++ b/packages/cli/src/lib/defaults/infra-modules/tracer/clickhouse-storage.xml @@ -0,0 +1,29 @@ + + + + + + 10485760 + + + s3 + https://BUCKET-NAME.s3.amazonaws.com/data/ + ACCESS-KEY-ID + SECRET-ACCESS-KEY + + + + + + + default + + + s3 + 0 + + + + + + diff --git a/packages/cli/src/lib/defaults/infra-modules/tracer/common/locust-scripts/locustfile.py b/packages/cli/src/lib/defaults/infra-modules/tracer/common/locust-scripts/locustfile.py new file mode 100644 index 0000000000..0b518208cd --- /dev/null +++ b/packages/cli/src/lib/defaults/infra-modules/tracer/common/locust-scripts/locustfile.py @@ -0,0 +1,16 @@ +from locust import HttpUser, task, between +class UserTasks(HttpUser): + wait_time = between(5, 15) + + @task + def rachel(self): + self.client.get("/dispatch?customer=123&nonse=0.6308392664170006") + @task + def trom(self): + self.client.get("/dispatch?customer=392&nonse=0.015296363321630757") + @task + def japanese(self): + self.client.get("/dispatch?customer=731&nonse=0.8022286220408668") + @task + def coffee(self): + self.client.get("/dispatch?customer=567&nonse=0.0022220379420636593") diff --git a/packages/cli/src/lib/defaults/infra-modules/tracer/nginx-config.conf b/packages/cli/src/lib/defaults/infra-modules/tracer/common/nginx-config.conf similarity index 90% rename from packages/cli/src/lib/defaults/infra-modules/tracer/nginx-config.conf rename to packages/cli/src/lib/defaults/infra-modules/tracer/common/nginx-config.conf index 9eeaeaab2c..99615f1f60 100644 --- a/packages/cli/src/lib/defaults/infra-modules/tracer/nginx-config.conf +++ b/packages/cli/src/lib/defaults/infra-modules/tracer/common/nginx-config.conf @@ -25,9 +25,9 @@ server { try_files $uri $uri/ /index.html; } - #location /api/alertmanager { - # proxy_pass http://alertmanager:9093/api/v2; - #} + location /api/alertmanager { + proxy_pass http://alertmanager:9093/api/v2; + } location /api { proxy_pass http://query-service:8080/api; @@ -39,4 +39,4 @@ server { location = /50x.html { root /usr/share/nginx/html; } -} +} \ No newline at end of file diff --git a/packages/test-cases/cases/cli/wasm/codegen/001-sanity/polywrap-norun.gen.js b/packages/cli/src/lib/defaults/infra-modules/tracer/data/alertmanager/.gitkeep similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/001-sanity/polywrap-norun.gen.js rename to packages/cli/src/lib/defaults/infra-modules/tracer/data/alertmanager/.gitkeep diff --git a/packages/cli/src/lib/defaults/infra-modules/tracer/data/clickhouse/.gitkeep b/packages/cli/src/lib/defaults/infra-modules/tracer/data/clickhouse/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/cli/src/lib/defaults/infra-modules/tracer/data/signoz/.gitkeep b/packages/cli/src/lib/defaults/infra-modules/tracer/data/signoz/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/cli/src/lib/defaults/infra-modules/tracer/docker-compose-core.yaml b/packages/cli/src/lib/defaults/infra-modules/tracer/docker-compose-core.yaml new file mode 100644 index 0000000000..ead470cefb --- /dev/null +++ b/packages/cli/src/lib/defaults/infra-modules/tracer/docker-compose-core.yaml @@ -0,0 +1,108 @@ +version: "2.4" + +services: + clickhouse: + image: clickhouse/clickhouse-server:22.4.5-alpine + container_name: clickhouse + # ports: + # - "9000:9000" + # - "8123:8123" + tty: true + volumes: + - ./clickhouse-config.xml:/etc/clickhouse-server/config.xml + - ./clickhouse-users.xml:/etc/clickhouse-server/users.xml + # - ./clickhouse-storage.xml:/etc/clickhouse-server/config.d/storage.xml + - ./data/clickhouse/:/var/lib/clickhouse/ + restart: on-failure + logging: + options: + max-size: 50m + max-file: "3" + healthcheck: + # "clickhouse", "client", "-u ${CLICKHOUSE_USER}", "--password ${CLICKHOUSE_PASSWORD}", "-q 'SELECT 1'" + test: ["CMD", "wget", "--spider", "-q", "localhost:8123/ping"] + interval: 30s + timeout: 5s + retries: 3 + + alertmanager: + container_name: alertmanager + image: signoz/alertmanager:0.23.0-0.2 + volumes: + - ./data/alertmanager:/data + depends_on: + query-service: + condition: service_healthy + restart: on-failure + command: + - --queryService.url=http://query-service:8085 + - --storage.path=/data + + # Notes for Maintainers/Contributors who will change Line Numbers of Frontend & Query-Section. Please Update Line Numbers in `./scripts/commentLinesForSetup.sh` & `./CONTRIBUTING.md` + otel-collector: + container_name: otel-collector + image: signoz/signoz-otel-collector:0.55.0 + command: ["--config=/etc/otel-collector-config.yaml"] + # user: root # required for reading docker container logs + volumes: + - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml + environment: + - OTEL_RESOURCE_ATTRIBUTES=host.name=signoz-host,os.type=linux + ports: + # - "1777:1777" # pprof extension + - "4317:4317" # OTLP gRPC receiver + - "4318:4318" # OTLP HTTP receiver + # - "8888:8888" # OtelCollector internal metrics + # - "8889:8889" # signoz spanmetrics exposed by the agent + # - "9411:9411" # Zipkin port + # - "13133:13133" # health check extension + # - "14250:14250" # Jaeger gRPC + # - "14268:14268" # Jaeger thrift HTTP + # - "55678:55678" # OpenCensus receiver + # - "55679:55679" # zPages extension + restart: on-failure + depends_on: + clickhouse: + condition: service_healthy + + otel-collector-metrics: + container_name: otel-collector-metrics + image: signoz/signoz-otel-collector:0.55.0 + command: ["--config=/etc/otel-collector-metrics-config.yaml"] + volumes: + - ./otel-collector-metrics-config.yaml:/etc/otel-collector-metrics-config.yaml + # ports: + # - "1777:1777" # pprof extension + # - "8888:8888" # OtelCollector internal metrics + # - "13133:13133" # Health check extension + # - "55679:55679" # zPages extension + restart: on-failure + depends_on: + clickhouse: + condition: service_healthy + + hotrod: + image: jaegertracing/example-hotrod:1.30 + container_name: hotrod + logging: + options: + max-size: 50m + max-file: "3" + command: ["all"] + environment: + - JAEGER_ENDPOINT=http://otel-collector:14268/api/traces + + load-hotrod: + image: "grubykarol/locust:1.2.3-python3.9-alpine3.12" + container_name: load-hotrod + hostname: load-hotrod + environment: + ATTACKED_HOST: http://hotrod:8080 + LOCUST_MODE: standalone + NO_PROXY: standalone + TASK_DELAY_FROM: 5 + TASK_DELAY_TO: 30 + QUIET_MODE: "${QUIET_MODE:-false}" + LOCUST_OPTS: "--headless -u 10 -r 1" + volumes: + - ../common/locust-scripts:/locust diff --git a/packages/cli/src/lib/defaults/infra-modules/tracer/docker-compose-local.yaml b/packages/cli/src/lib/defaults/infra-modules/tracer/docker-compose-local.yaml new file mode 100644 index 0000000000..1a17da83d1 --- /dev/null +++ b/packages/cli/src/lib/defaults/infra-modules/tracer/docker-compose-local.yaml @@ -0,0 +1,55 @@ +version: "2.4" + +services: + query-service: + hostname: query-service + build: + context: "../../../pkg/query-service" + dockerfile: "./Dockerfile" + args: + LDFLAGS: "" + TARGETPLATFORM: "${LOCAL_GOOS}/${LOCAL_GOARCH}" + container_name: query-service + environment: + - ClickHouseUrl=tcp://clickhouse:9000 + - ALERTMANAGER_API_PREFIX=http://alertmanager:9093/api/ + - STORAGE=clickhouse + - GODEBUG=netdns=go + - TELEMETRY_ENABLED=true + - SIGNOZ_LOCAL_DB_PATH=/var/lib/signoz/signoz.db + volumes: + - ./prometheus.yml:/root/config/prometheus.yml + - ../dashboards:/root/config/dashboards + - ./data/signoz/:/var/lib/signoz/ + command: ["-config=/root/config/prometheus.yml"] + ports: + - "6060:6060" + - "8080:8080" + restart: on-failure + healthcheck: + test: ["CMD", "wget", "--spider", "-q", "localhost:8080/api/v1/version"] + interval: 30s + timeout: 5s + retries: 3 + depends_on: + clickhouse: + condition: service_healthy + + frontend: + build: + context: "../../../frontend" + dockerfile: "./Dockerfile" + args: + TARGETOS: "${LOCAL_GOOS}" + TARGETPLATFORM: "${LOCAL_GOARCH}" + container_name: frontend + environment: + - FRONTEND_API_ENDPOINT=http://query-service:8080 + restart: on-failure + depends_on: + - alertmanager + - query-service + ports: + - "3301:3301" + volumes: + - ../common/nginx-config.conf:/etc/nginx/conf.d/default.conf diff --git a/packages/cli/src/lib/defaults/infra-modules/tracer/docker-compose-prod.yaml b/packages/cli/src/lib/defaults/infra-modules/tracer/docker-compose-prod.yaml new file mode 100644 index 0000000000..d86510e849 --- /dev/null +++ b/packages/cli/src/lib/defaults/infra-modules/tracer/docker-compose-prod.yaml @@ -0,0 +1,43 @@ +version: "2.4" + +services: + query-service: + image: signoz/query-service:0.11.0 + container_name: query-service + command: ["-config=/root/config/prometheus.yml"] + # ports: + # - "6060:6060" # pprof port + # - "8080:8080" # query-service port + volumes: + - ./prometheus.yml:/root/config/prometheus.yml + - ../dashboards:/root/config/dashboards + - ./data/signoz/:/var/lib/signoz/ + environment: + - ClickHouseUrl=tcp://clickhouse:9000/?database=signoz_traces + - ALERTMANAGER_API_PREFIX=http://alertmanager:9093/api/ + - STORAGE=clickhouse + - GODEBUG=netdns=go + - TELEMETRY_ENABLED=true + - DEPLOYMENT_TYPE=docker-standalone-amd + - SIGNOZ_LOCAL_DB_PATH=/var/lib/signoz/signoz.db + restart: on-failure + healthcheck: + test: ["CMD", "wget", "--spider", "-q", "localhost:8080/api/v1/version"] + interval: 30s + timeout: 5s + retries: 3 + depends_on: + clickhouse: + condition: service_healthy + + frontend: + image: signoz/frontend:0.11.0 + container_name: frontend + restart: on-failure + depends_on: + - alertmanager + - query-service + ports: + - "3301:3301" + volumes: + - ../common/nginx-config.conf:/etc/nginx/conf.d/default.conf diff --git a/packages/cli/src/lib/defaults/infra-modules/tracer/docker-compose.yaml b/packages/cli/src/lib/defaults/infra-modules/tracer/docker-compose.yaml index 3c01a0294a..924216bcca 100644 --- a/packages/cli/src/lib/defaults/infra-modules/tracer/docker-compose.yaml +++ b/packages/cli/src/lib/defaults/infra-modules/tracer/docker-compose.yaml @@ -1,69 +1,104 @@ -version: "2.4" - +version: '2.4' services: clickhouse: - image: clickhouse/clickhouse-server:22.4.5-alpine + image: 'clickhouse/clickhouse-server:22.4.5-alpine' tty: true volumes: - - ./clickhouse-config.xml:/etc/clickhouse-server/config.xml - - ./clickhouse-users.xml:/etc/clickhouse-server/users.xml - - ./data/clickhouse/:/var/lib/clickhouse/ + - './clickhouse-config.xml:/etc/clickhouse-server/config.xml' + - './clickhouse-users.xml:/etc/clickhouse-server/users.xml' + - './data/clickhouse/:/var/lib/clickhouse/' restart: on-failure logging: options: max-size: 50m - max-file: "3" + max-file: '3' healthcheck: - test: ["CMD", "wget", "--spider", "-q", "localhost:8123/ping"] + test: + - CMD + - wget + - '--spider' + - '-q' + - 'localhost:8123/ping' interval: 30s timeout: 5s retries: 3 - + alertmanager: + image: 'signoz/alertmanager:0.23.0-0.2' + volumes: + - './data/alertmanager:/data' + depends_on: + query-service: + condition: service_healthy + restart: on-failure + command: + - '--queryService.url=http://query-service:8085' + - '--storage.path=/data' query-service: - image: signoz/query-service:0.10.0 + image: 'signoz/query-service:0.11.0' container_name: query-service - command: ["-config=/root/config/prometheus.yml"] + command: + - '-config=/root/config/prometheus.yml' volumes: - - ./prometheus.yml:/root/config/prometheus.yml - - ./dashboards:/root/config/dashboards - - ./data/signoz/:/var/lib/signoz/ + - './prometheus.yml:/root/config/prometheus.yml' + - './dashboards:/root/config/dashboards' + - './data/signoz/:/var/lib/signoz/' environment: - - ClickHouseUrl=tcp://clickhouse:9000/?database=signoz_traces + - 'ClickHouseUrl=tcp://clickhouse:9000/?database=signoz_traces' + - 'ALERTMANAGER_API_PREFIX=http://alertmanager:9093/api/' + - SIGNOZ_LOCAL_DB_PATH=/var/lib/signoz/signoz.db - STORAGE=clickhouse - GODEBUG=netdns=go - TELEMETRY_ENABLED=true - DEPLOYMENT_TYPE=docker-standalone-amd restart: on-failure healthcheck: - test: ["CMD", "wget", "--spider", "-q", "localhost:8080/api/v1/version"] + test: + - CMD + - wget + - '--spider' + - '-q' + - 'localhost:8080/api/v1/version' interval: 30s timeout: 5s retries: 3 depends_on: clickhouse: condition: service_healthy - frontend: - image: signoz/frontend:0.10.0 + image: 'signoz/frontend:0.11.0' container_name: frontend restart: on-failure depends_on: + - alertmanager - query-service ports: - - "3301:3301" + - '3301:3301' volumes: - - ./nginx-config.conf:/etc/nginx/conf.d/default.conf - + - './common/nginx-config.conf:/etc/nginx/conf.d/default.conf' otel-collector: - image: signoz/otelcontribcol:0.45.1-1.1 - command: ["--config=/etc/otel-collector-config.yaml"] + image: 'signoz/signoz-otel-collector:0.55.0' + command: + - '--config=/etc/otel-collector-config.yaml' + user: root volumes: - - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml + - './otel-collector-config.yaml:/etc/otel-collector-config.yaml' + - '/var/lib/docker/containers:/var/lib/docker/containers:ro' environment: - - OTEL_RESOURCE_ATTRIBUTES=host.name=signoz-host,os.type=linux + - 'OTEL_RESOURCE_ATTRIBUTES=host.name=signoz-host,os.type=linux' ports: - - "4318:4318" # OTLP HTTP receiver - mem_limit: 2000m + - '4317:4317' + - '4318:4318' + restart: on-failure + depends_on: + clickhouse: + condition: service_healthy + otel-collector-metrics: + image: 'signoz/signoz-otel-collector:0.55.0' + command: + - '--config=/etc/otel-collector-metrics-config.yaml' + volumes: + - >- + ./otel-collector-metrics-config.yaml:/etc/otel-collector-metrics-config.yaml restart: on-failure depends_on: clickhouse: diff --git a/packages/cli/src/lib/defaults/infra-modules/tracer/otel-collector-config.yaml b/packages/cli/src/lib/defaults/infra-modules/tracer/otel-collector-config.yaml index f55bfdca07..b05b957e30 100644 --- a/packages/cli/src/lib/defaults/infra-modules/tracer/otel-collector-config.yaml +++ b/packages/cli/src/lib/defaults/infra-modules/tracer/otel-collector-config.yaml @@ -1,4 +1,29 @@ receivers: + filelog/dockercontainers: + include: [ "/var/lib/docker/containers/*/*.log" ] + start_at: end + include_file_path: true + include_file_name: false + operators: + - type: json_parser + id: parser-docker + output: extract_metadata_from_filepath + timestamp: + parse_from: attributes.time + layout: '%Y-%m-%dT%H:%M:%S.%LZ' + - type: regex_parser + id: extract_metadata_from_filepath + regex: '^.*containers/(?P[^_]+)/.*log$' + parse_from: attributes["log.file.path"] + output: parse_body + - type: move + id: parse_body + from: attributes.log + to: body + output: time + - type: remove + id: time + field: attributes.time opencensus: endpoint: 0.0.0.0:55678 otlp/spanmetrics: @@ -11,10 +36,6 @@ receivers: endpoint: 0.0.0.0:4317 http: endpoint: 0.0.0.0:4318 - cors: - allowed_origins: - - http://* - - https://* jaeger: protocols: grpc: @@ -89,6 +110,17 @@ exporters: endpoint: 0.0.0.0:8889 # logging: {} + clickhouselogsexporter: + dsn: tcp://clickhouse:9000/ + timeout: 5s + sending_queue: + queue_size: 100 + retry_on_failure: + enabled: true + initial_interval: 5s + max_interval: 30s + max_elapsed_time: 300s + service: telemetry: metrics: @@ -113,3 +145,7 @@ service: metrics/spanmetrics: receivers: [otlp/spanmetrics] exporters: [prometheus] + logs: + receivers: [otlp, filelog/dockercontainers] + processors: [batch] + exporters: [clickhouselogsexporter] \ No newline at end of file diff --git a/packages/cli/src/lib/defaults/infra-modules/tracer/otel-collector-metrics-config.yaml b/packages/cli/src/lib/defaults/infra-modules/tracer/otel-collector-metrics-config.yaml new file mode 100644 index 0000000000..fdc5830f57 --- /dev/null +++ b/packages/cli/src/lib/defaults/infra-modules/tracer/otel-collector-metrics-config.yaml @@ -0,0 +1,73 @@ +receivers: + otlp: + protocols: + grpc: + http: + prometheus: + config: + scrape_configs: + # otel-collector internal metrics + - job_name: "otel-collector" + scrape_interval: 60s + static_configs: + - targets: + - otel-collector:8888 + # otel-collector-metrics internal metrics + - job_name: "otel-collector-metrics" + scrape_interval: 60s + static_configs: + - targets: + - localhost:8888 + # SigNoz span metrics + - job_name: "signozspanmetrics-collector" + scrape_interval: 60s + static_configs: + - targets: + - otel-collector:8889 + +processors: + batch: + send_batch_size: 10000 + send_batch_max_size: 11000 + timeout: 10s + # memory_limiter: + # # 80% of maximum memory up to 2G + # limit_mib: 1500 + # # 25% of limit up to 2G + # spike_limit_mib: 512 + # check_interval: 5s + # + # # 50% of the maximum memory + # limit_percentage: 50 + # # 20% of max memory usage spike expected + # spike_limit_percentage: 20 + # queued_retry: + # num_workers: 4 + # queue_size: 100 + # retry_on_failure: true + +extensions: + health_check: + endpoint: 0.0.0.0:13133 + zpages: + endpoint: 0.0.0.0:55679 + pprof: + endpoint: 0.0.0.0:1777 + +exporters: + clickhousemetricswrite: + endpoint: tcp://clickhouse:9000/?database=signoz_metrics + +service: + telemetry: + metrics: + address: 0.0.0.0:8888 + extensions: + - health_check + - zpages + - pprof + pipelines: + metrics: + receivers: [prometheus] + processors: [batch] + exporters: [clickhousemetricswrite] diff --git a/packages/cli/src/lib/defaults/infra-modules/tracer/prometheus.yml b/packages/cli/src/lib/defaults/infra-modules/tracer/prometheus.yml index 1b222c10ec..16e65ff18c 100644 --- a/packages/cli/src/lib/defaults/infra-modules/tracer/prometheus.yml +++ b/packages/cli/src/lib/defaults/infra-modules/tracer/prometheus.yml @@ -13,6 +13,8 @@ alerting: # Load rules once and periodically evaluate them according to the global 'evaluation_interval'. rule_files: + # - "first_rules.yml" + # - "second_rules.yml" - 'alerts.yml' # A scrape configuration containing exactly one endpoint to scrape: diff --git a/packages/cli/src/lib/deploy/job.ts b/packages/cli/src/lib/deploy/job.ts index 9152019974..e43f1c986f 100644 --- a/packages/cli/src/lib/deploy/job.ts +++ b/packages/cli/src/lib/deploy/job.ts @@ -1,7 +1,7 @@ import { DeployStep, StepName, StepResult, UriOrPrevStepResult } from "./step"; +import { Logger } from "../logging"; import { Uri } from "@polywrap/core-js"; -import { GluegunPrint } from "gluegun"; export interface DeployJobResult { name: string; @@ -17,7 +17,7 @@ interface DeployJobArgs { name: string; steps: DeployStep[]; config: Record; - printer: GluegunPrint; + logger: Logger; } export class DeployJob { @@ -25,7 +25,7 @@ export class DeployJob { public steps: DeployStep[]; public config: Record; - private _printer: GluegunPrint; + private _logger: Logger; private _resultMap: Map = new Map(); constructor(config: DeployJobArgs) { @@ -33,7 +33,7 @@ export class DeployJob { this.steps = config.steps; this.config = config.config; - this._printer = config.printer; + this._logger = config.logger; this.steps.forEach((step, index) => { if (step.uriOrStepResult.startsWith("$")) { @@ -53,7 +53,7 @@ export class DeployJob { } public async run(): Promise { - this._printer.info( + this._logger.info( `\n\nExecuting '${this.name}' deployment DeployJob: \n${this.steps .map((s) => `\n- ${s.name}`) .join("")}\n\n` @@ -62,7 +62,7 @@ export class DeployJob { for await (const step of this.steps) { const uri = this._getUriArgument(step.uriOrStepResult); - this._printer.info( + this._logger.info( `Executing step: '${step.name}', with URI: '${uri.toString()}'` ); @@ -78,7 +78,7 @@ export class DeployJob { result, }); - this._printer.success( + this._logger.info( `Successfully executed step '${ step.name }'. Result: '${result.toString()}'` @@ -88,7 +88,7 @@ export class DeployJob { } } - this._printer.info( + this._logger.info( `\n\nSuccessfully executed '${this.name}' deployment job\n\n` ); diff --git a/packages/cli/src/lib/helpers/index.ts b/packages/cli/src/lib/helpers/index.ts index 5503aeaed5..9226d360ac 100644 --- a/packages/cli/src/lib/helpers/index.ts +++ b/packages/cli/src/lib/helpers/index.ts @@ -1,7 +1,5 @@ export * from "./client"; export * from "./metadata"; -export * from "./parameters"; -export * from "./spinner"; export * from "./uuid"; export * from "./validate-client-config"; export * from "./workflow-validator"; diff --git a/packages/cli/src/lib/helpers/metadata.ts b/packages/cli/src/lib/helpers/metadata.ts index 3b36283e81..cb7139b479 100644 --- a/packages/cli/src/lib/helpers/metadata.ts +++ b/packages/cli/src/lib/helpers/metadata.ts @@ -1,9 +1,8 @@ -import { withSpinner } from "./"; +import { Logger, logActivity } from "../logging"; import { displayPath, intlMsg } from "../"; import { normalizePath } from "@polywrap/os-js"; import { MetaManifest } from "@polywrap/polywrap-manifest-types-js"; -import { Ora } from "ora"; import fs from "fs"; import path from "path"; @@ -11,7 +10,7 @@ export async function outputMetadata( metaManifest: MetaManifest, outputDir: string, rootDir: string, - quiet: boolean + logger: Logger ): Promise { const result: MetaManifest = { ...metaManifest, @@ -22,30 +21,29 @@ export async function outputMetadata( const writeMetadataFile = ( filePath: string, outputFilePath: string, - spinner?: Ora + logger: Logger ): string => { const outputPath = path.join(outputDir, outputFilePath); fs.mkdirSync(path.dirname(outputPath), { recursive: true }); fs.copyFileSync(path.join(rootDir, filePath), outputPath); - if (spinner) { - spinner.succeed( + logger.info( + `✅` + intlMsg.lib_compiler_outputMetadataFileText({ path: displayPath(normalizePath(outputPath)), }) - ); - } + ); return displayPath(normalizePath(outputFilePath)); }; - const run = (spinner?: Ora) => { + const run = (logger: Logger) => { const writeFile = (filePath: string, subDir: string): string => { return writeMetadataFile( filePath, path.join("meta", subDir, path.basename(filePath)), - spinner + logger ); }; @@ -71,18 +69,15 @@ export async function outputMetadata( } }; - if (quiet) { - run(); - } else { - await withSpinner( - intlMsg.lib_compiler_outputMetadataText(), - intlMsg.lib_compiler_outputMetadataError(), - intlMsg.lib_compiler_outputMetadataWarning(), - async (spinner: Ora) => { - return run(spinner); - } - ); - } + await logActivity( + logger, + intlMsg.lib_compiler_outputMetadataText(), + intlMsg.lib_compiler_outputMetadataError(), + intlMsg.lib_compiler_outputMetadataWarning(), + async (logger) => { + return run(logger); + } + ); return result; } diff --git a/packages/cli/src/lib/helpers/parameters.ts b/packages/cli/src/lib/helpers/parameters.ts deleted file mode 100644 index 034c00d392..0000000000 --- a/packages/cli/src/lib/helpers/parameters.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Workaround for https://github.com/infinitered/gluegun/pull/464. -import { intlMsg } from "../intl"; - -export const fixParameters = ( - parameters: { options: Record; array?: string[] }, - booleanOptions: Record -): string[] => { - const unexpectedStringOptions = Object.keys(booleanOptions) - .filter((key) => typeof booleanOptions[key] === "string") - .map((key) => ({ key, value: booleanOptions[key] })) as { - key: string; - value: string; - }[]; - - const optionNames = unexpectedStringOptions - .map(({ key }) => `--` + key.replace(/([A-Z])/, "-$1").toLowerCase()) - .join(", "); - - if (unexpectedStringOptions.length > 1) { - const unexpectedValueMessage = intlMsg.lib_helpers_parameters_unexpectedValue( - { options: `${optionNames}` } - ); - throw new Error(unexpectedValueMessage); - } else if (unexpectedStringOptions.length == 1) { - const params = parameters.array || []; - params.unshift(unexpectedStringOptions[0].value); - return params; - } else { - return parameters.array || []; - } -}; diff --git a/packages/cli/src/lib/helpers/spinner.ts b/packages/cli/src/lib/helpers/spinner.ts deleted file mode 100644 index 0b0b787dae..0000000000 --- a/packages/cli/src/lib/helpers/spinner.ts +++ /dev/null @@ -1,86 +0,0 @@ -import * as gluegun from "gluegun"; -import { Ora } from "ora"; - -// Executes the function `f` in a command-line spinner, using the -// provided captions for in-progress, error and failed messages. -// -// If `f` throws an error, the spinner stops with the failure message -// and rethrows the error. -// If `f` returns an object with a `warning` and a `result` key, the -// spinner stops with the warning message and returns the `result` value. -// Otherwise the spinner prints the in-progress message with a check mark -// and simply returns the value returned by `f`. -export const withSpinner = async ( - text: string, - errorText: string, - warningText: string, - execute: (spinner: Ora) => Promise -): Promise => { - const spinner = gluegun.print.spin({ - text, - stream: process.stdout, - }); - try { - const result = await execute(spinner); - if (result && typeof result === "object") { - const res = result as Record; - const hasWarning = !!res.warning; - const hasResult = !!res.result; - if (hasWarning && hasResult) { - if (res.warning !== null) { - spinner.warn(`${warningText}: ${res.warning}`); - } - spinner.succeed(text); - return res.result as TReturn; - } else { - spinner.succeed(text); - return result; - } - } else { - spinner.succeed(text); - return result; - } - } catch (e) { - spinner.fail(`${errorText}: ${e.message}`); - throw e; - } -}; - -export const step = (spinner: Ora, subject: string, text?: string): unknown => { - if (text) { - spinner.stopAndPersist({ - text: gluegun.print.colors.muted(`${subject} ${text}`), - }); - } else { - spinner.stopAndPersist({ text: gluegun.print.colors.muted(subject) }); - } - spinner.start(); - return spinner; -}; - -export const searchOptional = async ( - loadText: string, - errorText: string, - warningText: string, - execute: (spinner: Ora) => Promise -): Promise => { - const spinner = gluegun.print.spin({ - text: loadText, - stream: process.stdout, - }); - - try { - const result = await execute(spinner); - - if (!result) { - spinner.warn(warningText); - } else { - spinner.succeed(loadText); - } - - return result as T; - } catch (e) { - spinner.fail(`${errorText}: ${e.message}`); - throw e; - } -}; diff --git a/packages/cli/src/lib/helpers/validate-client-config.ts b/packages/cli/src/lib/helpers/validate-client-config.ts index afca693909..0538796e05 100644 --- a/packages/cli/src/lib/helpers/validate-client-config.ts +++ b/packages/cli/src/lib/helpers/validate-client-config.ts @@ -12,7 +12,7 @@ import { export function validateRedirects< TUri extends PluginPackage | Uri | string ->(redirects: UriRedirect[]): void { +>(redirects: readonly UriRedirect[]): void { if (!Array.isArray(redirects)) { throw new Error(intlMsg.commands_run_error_redirectsExportNotArray()); } @@ -44,7 +44,7 @@ export function validateRedirects< } export function validatePlugins( - plugins: PluginRegistration[] + plugins: readonly PluginRegistration[] ): void { if (!Array.isArray(plugins)) { throw new Error(intlMsg.commands_run_error_pluginsExportNotArray()); @@ -88,7 +88,7 @@ export function validatePlugins( } export function validateInterfaces( - interfaces: InterfaceImplementations[] + interfaces: readonly InterfaceImplementations[] ): void { if (!Array.isArray(interfaces)) { throw new Error(intlMsg.commands_run_error_interfacesExportNotArray()); @@ -138,7 +138,7 @@ export function validateInterfaces( } export function validateEnvs( - envs: Env[] + envs: readonly Env[] ): void { if (!Array.isArray(envs)) { throw new Error(intlMsg.commands_run_error_envsExportNotArray()); diff --git a/packages/cli/src/lib/helpers/workflow-validator.ts b/packages/cli/src/lib/helpers/workflow-validator.ts index 9fa0ee6a48..3a1bb76d80 100644 --- a/packages/cli/src/lib/helpers/workflow-validator.ts +++ b/packages/cli/src/lib/helpers/workflow-validator.ts @@ -1,4 +1,5 @@ import { runCommandSync } from "../system"; +import { Logger } from "../logging"; import { intlMsg } from "../intl"; import { JobStatus, ValidationResult, WorkflowOutput } from "../workflow"; @@ -8,16 +9,17 @@ import os from "os"; const TMPDIR = fs.mkdtempSync(path.join(os.tmpdir(), `polywrap-cli`)); -export function cueExists(): boolean { - const { stdout } = runCommandSync("cue version", true); +export function cueExists(logger: Logger): boolean { + const { stdout } = runCommandSync("cue version", logger); return stdout ? stdout.startsWith("cue version ") : false; } export function validateOutput( output: WorkflowOutput, - validateScriptPath: string + validateScriptPath: string, + logger: Logger ): ValidationResult { - if (!cueExists()) { + if (!cueExists(logger)) { console.warn(intlMsg.commands_run_error_cueDoesNotExist()); } @@ -34,7 +36,7 @@ export function validateOutput( const { stderr } = runCommandSync( `cue vet -d ${selector} ${validateScriptPath} ${jsonOutput}`, - true + logger ); if (fs.existsSync(jsonOutput)) { diff --git a/packages/cli/src/lib/helpers/wrap.ts b/packages/cli/src/lib/helpers/wrap.ts index 5a19533100..8522f869d2 100644 --- a/packages/cli/src/lib/helpers/wrap.ts +++ b/packages/cli/src/lib/helpers/wrap.ts @@ -1,4 +1,4 @@ -import { withSpinner } from "./spinner"; +import { Logger, logActivity } from "../logging"; import { intlMsg } from "../intl"; import { displayPath } from "../system"; @@ -33,25 +33,22 @@ export const generateWrapFile = async ( name: string, type: "interface" | "wasm" | "plugin", path: string, - quiet = false + logger: Logger ): Promise => { - if (quiet) { - return run(abi, name, type, path); - } else { - const relativePath = displayPath(path); - return await withSpinner( - intlMsg.lib_helpers_manifest_outputText({ - path: normalizePath(relativePath), - }), - intlMsg.lib_helpers_manifest_outputError({ - path: normalizePath(relativePath), - }), - intlMsg.lib_helpers_manifest_outputWarning({ - path: normalizePath(relativePath), - }), - async (_spinner): Promise => { - await run(abi, name, type, path); - } - ); - } + const relativePath = displayPath(path); + return await logActivity( + logger, + intlMsg.lib_helpers_manifest_outputText({ + path: normalizePath(relativePath), + }), + intlMsg.lib_helpers_manifest_outputError({ + path: normalizePath(relativePath), + }), + intlMsg.lib_helpers_manifest_outputWarning({ + path: normalizePath(relativePath), + }), + async (): Promise => { + await run(abi, name, type, path); + } + ); }; diff --git a/packages/cli/src/lib/index.ts b/packages/cli/src/lib/index.ts index 929beb434f..9be4c276bf 100644 --- a/packages/cli/src/lib/index.ts +++ b/packages/cli/src/lib/index.ts @@ -3,11 +3,13 @@ export * from "./helpers"; export * from "./infra"; export * from "./intl"; export * from "./option-parsers"; +export * from "./option-defaults"; export * from "./project"; export * from "./system"; export * from "./test-env"; export * from "./CacheDirectory"; export * from "./Compiler"; -export * from "./CodeGenerator"; +export * from "./codegen"; export * from "./SchemaComposer"; export * from "./workflow"; +export * from "./logging"; diff --git a/packages/cli/src/lib/infra/Infra.ts b/packages/cli/src/lib/infra/Infra.ts index 1877d4482a..ace735541e 100644 --- a/packages/cli/src/lib/infra/Infra.ts +++ b/packages/cli/src/lib/infra/Infra.ts @@ -5,20 +5,21 @@ import { ensureDockerDaemonRunning, DockerCompose, CacheDirectory, + Logger, } from "../"; import { InfraManifest } from "@polywrap/polywrap-manifest-types-js"; import path from "path"; import fs, { lstatSync, readdirSync } from "fs"; -import YAML from "js-yaml"; +import YAML from "yaml"; import { copySync } from "fs-extra"; export interface InfraConfig { rootDir: string; defaultInfraModulesPath: string; + logger: Logger; infraManifest?: InfraManifest; modulesToUse?: string[]; - quiet?: boolean; } interface ModuleWithPath { @@ -71,13 +72,13 @@ export class Infra { this._defaultDockerOptions = DockerCompose.getDefaultConfig( this._baseDockerComposePath, - this._config.quiet ?? true, + this._config.logger, this._config.infraManifest ); } public async up(): Promise { - await ensureDockerDaemonRunning(); + await ensureDockerDaemonRunning(this._config.logger); const modulesWithPaths = await this._fetchModules(); @@ -89,7 +90,7 @@ export class Infra { } public async down(): Promise { - await ensureDockerDaemonRunning(); + await ensureDockerDaemonRunning(this._config.logger); const modulesWithPaths = await this._fetchModules(); @@ -230,7 +231,7 @@ export class Infra { } private _generateBaseDockerCompose(composePath: string): void { - const fileContent = YAML.dump(DEFAULT_BASE_COMPOSE); + const fileContent = YAML.stringify(DEFAULT_BASE_COMPOSE, null, 2); this._writeFileToCacheFromAbsPath(composePath, fileContent); } @@ -261,6 +262,7 @@ export class Infra { cache: this._cache, installationDirectory: installationDir, name: registry, + logger: this._config.logger, }); const mappedInfraModules = modules.map((p) => ({ @@ -327,7 +329,11 @@ export class Infra { ); // Write new docker-compose manifests with corrected build path and 'polywrap' prefix - const newComposeFile = YAML.dump(composeFileWithCorrectPaths); + const newComposeFile = YAML.stringify( + composeFileWithCorrectPaths, + null, + 2 + ); this._writeFileToCacheFromAbsPath(m.path, newComposeFile); }); diff --git a/packages/cli/src/lib/infra/InfraDependencyFetcher.ts b/packages/cli/src/lib/infra/InfraDependencyFetcher.ts index c1cc8cb4e0..74c6a7be65 100644 --- a/packages/cli/src/lib/infra/InfraDependencyFetcher.ts +++ b/packages/cli/src/lib/infra/InfraDependencyFetcher.ts @@ -1,4 +1,5 @@ import { CacheDirectory } from "../CacheDirectory"; +import { Logger } from "../logging"; import path from "path"; @@ -9,6 +10,7 @@ export interface InfraPackageArg { export interface InfraDependencyFetcherConfig { cache: CacheDirectory; + logger: Logger; installationDirectory: string; name: string; } diff --git a/packages/cli/src/lib/infra/fetchers/NodeDependencyFetcher.ts b/packages/cli/src/lib/infra/fetchers/NodeDependencyFetcher.ts index bcf06b8d47..b33795c7db 100644 --- a/packages/cli/src/lib/infra/fetchers/NodeDependencyFetcher.ts +++ b/packages/cli/src/lib/infra/fetchers/NodeDependencyFetcher.ts @@ -9,7 +9,10 @@ import path from "path"; export class NodeDependencyFetcher extends InfraDependencyFetcher { public async installPackages(packages: InfraPackageArg[]): Promise { this.composePackageJson(packages); - await runCommand(`cd ${this.config.installationDirectory} && npm i`, true); + await runCommand( + `cd ${this.config.installationDirectory} && npm i`, + this.config.logger + ); } public getPackageDir(packageName: string): string { @@ -44,6 +47,9 @@ export class NodeDependencyFetcher extends InfraDependencyFetcher { export class YarnDependencyFetcher extends NodeDependencyFetcher { public async installPackages(packages: InfraPackageArg[]): Promise { this.composePackageJson(packages); - await runCommand(`cd ${this.config.installationDirectory} && yarn`, true); + await runCommand( + `cd ${this.config.installationDirectory} && yarn`, + this.config.logger + ); } } diff --git a/packages/cli/src/lib/logging/Log.ts b/packages/cli/src/lib/logging/Log.ts new file mode 100644 index 0000000000..e2a3bcd91b --- /dev/null +++ b/packages/cli/src/lib/logging/Log.ts @@ -0,0 +1,16 @@ +export enum LogLevel { + DEBUG, + INFO, + WARN, + ERROR, +} + +export abstract class Log { + public readonly level: LogLevel; + + constructor(level: LogLevel) { + this.level = level; + } + + public abstract log(message: string, level: LogLevel): void; +} diff --git a/packages/cli/src/lib/logging/Logger.ts b/packages/cli/src/lib/logging/Logger.ts new file mode 100644 index 0000000000..f21823b1e5 --- /dev/null +++ b/packages/cli/src/lib/logging/Logger.ts @@ -0,0 +1,45 @@ +import { Log, LogLevel } from "./Log"; + +interface Logs { + [name: string]: Log; +} + +export class Logger { + private _logs: Logs; + + constructor(logs: Logs) { + this._logs = logs; + } + + public getLog(name: string): Log | undefined { + return this._logs[name]; + } + + public setLog(name: string, log: Log): void { + this._logs[name] = log; + } + + public removeLog(name: string): void { + delete this._logs[name]; + } + + public log(message: string, level: LogLevel): void { + Object.values(this._logs).forEach((log) => log.log(message, level)); + } + + public debug(message: string): void { + this.log(message, LogLevel.DEBUG); + } + + public info(message: string): void { + this.log(message, LogLevel.INFO); + } + + public warn(message: string): void { + this.log(message, LogLevel.WARN); + } + + public error(message: string): void { + this.log(message, LogLevel.ERROR); + } +} diff --git a/packages/cli/src/lib/logging/index.ts b/packages/cli/src/lib/logging/index.ts new file mode 100644 index 0000000000..77a92c1ad8 --- /dev/null +++ b/packages/cli/src/lib/logging/index.ts @@ -0,0 +1,4 @@ +export * from "./Log"; +export * from "./logActivity"; +export * from "./Logger"; +export * from "./logs"; diff --git a/packages/cli/src/lib/logging/logActivity.ts b/packages/cli/src/lib/logging/logActivity.ts new file mode 100644 index 0000000000..a0e20c4c30 --- /dev/null +++ b/packages/cli/src/lib/logging/logActivity.ts @@ -0,0 +1,43 @@ +import { Logger } from "./Logger"; + +export async function logActivity( + logger: Logger, + infoText: string, + errorText: string, + warningText: string, + execute: (logger: Logger) => Promise +): Promise { + // Log the start of an activity + logger.info(`🔄 ${infoText}`); + + // Execute the activity + try { + const result = await execute(logger); + if (result && typeof result === "object") { + const res = result as Record; + const hasWarning = !!res.warning; + const hasResult = !!res.result; + if (hasWarning && hasResult) { + if (res.warning !== null) { + logger.warn(`${warningText}: ${res.warning}`); + } + logger.info(`✅ ${infoText}`); + return res.result as TReturn; + } else { + logger.info(`✅ ${infoText}`); + return result; + } + } else { + logger.info(`✅ ${infoText}`); + return result; + } + } catch (e) { + let errMsg = `${e}`; + if (errMsg === "[object Object]") { + errMsg = JSON.stringify(e, null, 2); + } + + logger.error(`❌ ${errorText}: ${errMsg}`); + throw e; + } +} diff --git a/packages/cli/src/lib/logging/logs/ConsoleLog.ts b/packages/cli/src/lib/logging/logs/ConsoleLog.ts new file mode 100644 index 0000000000..11b240a158 --- /dev/null +++ b/packages/cli/src/lib/logging/logs/ConsoleLog.ts @@ -0,0 +1,30 @@ +import { Log, LogLevel } from "../Log"; + +import chalk from "chalk"; + +export class ConsoleLog extends Log { + constructor(level: LogLevel) { + super(level); + } + + public log(message: string, level: LogLevel): void { + if (level < this.level) { + return; + } + + switch (level) { + case LogLevel.DEBUG: + console.debug(chalk.gray(message)); + break; + case LogLevel.INFO: + console.info(message); + break; + case LogLevel.WARN: + console.warn(chalk.yellow(message)); + break; + case LogLevel.ERROR: + console.error(chalk.red(message)); + break; + } + } +} diff --git a/packages/cli/src/lib/logging/logs/FileLog.ts b/packages/cli/src/lib/logging/logs/FileLog.ts new file mode 100644 index 0000000000..ecd9caa295 --- /dev/null +++ b/packages/cli/src/lib/logging/logs/FileLog.ts @@ -0,0 +1,47 @@ +import { Log, LogLevel } from "../Log"; + +import fs, { WriteStream } from "fs"; + +export class FileLog extends Log { + private _logFileStream: WriteStream; + + constructor(public readonly logFilePath: string, level: LogLevel) { + super(level); + this._createWriteStream(); + } + + public end(): void { + this._logFileStream.end(); + } + + public log(message: string, level: LogLevel): void { + if (level < this.level || !this._logFileStream) { + return; + } + + let prefix = Date.now().toString() + " "; + + switch (level) { + case LogLevel.DEBUG: + prefix += "DEBUG: "; + break; + case LogLevel.INFO: + prefix += "INFO: "; + break; + case LogLevel.WARN: + prefix += "WARN: "; + break; + case LogLevel.ERROR: + prefix += "ERROR: "; + break; + } + + this._logFileStream.write(prefix + message); + } + + private _createWriteStream() { + this._logFileStream = fs.createWriteStream(this.logFilePath, { + encoding: "utf8", + }); + } +} diff --git a/packages/cli/src/lib/logging/logs/index.ts b/packages/cli/src/lib/logging/logs/index.ts new file mode 100644 index 0000000000..422aa16218 --- /dev/null +++ b/packages/cli/src/lib/logging/logs/index.ts @@ -0,0 +1,2 @@ +export * from "./ConsoleLog"; +export * from "./FileLog"; diff --git a/packages/cli/src/lib/manifest/index.ts b/packages/cli/src/lib/manifest/index.ts new file mode 100644 index 0000000000..cc3cda0042 --- /dev/null +++ b/packages/cli/src/lib/manifest/index.ts @@ -0,0 +1,2 @@ +export * from "./schema"; +export * from "./migrate"; diff --git a/packages/cli/src/lib/manifest/migrate/index.ts b/packages/cli/src/lib/manifest/migrate/index.ts new file mode 100644 index 0000000000..0c5dcdadd8 --- /dev/null +++ b/packages/cli/src/lib/manifest/migrate/index.ts @@ -0,0 +1,8 @@ +export * from "./migrateAppProjectManifest"; +export * from "./migrateBuildExtensionManifest"; +export * from "./migrateDeployExtensionManifest"; +export * from "./migrateInfraExtensionManifest"; +export * from "./migrateMetaExtensionManifest"; +export * from "./migratePluginProjectManifest"; +export * from "./migratePolywrapProjectManifest"; +export * from "./migrateTestExtensionManifest"; diff --git a/packages/cli/src/lib/manifest/migrate/migrateAnyManifest.ts b/packages/cli/src/lib/manifest/migrate/migrateAnyManifest.ts new file mode 100644 index 0000000000..62b1af50f5 --- /dev/null +++ b/packages/cli/src/lib/manifest/migrate/migrateAnyManifest.ts @@ -0,0 +1,30 @@ +/* eslint-disable no-empty */ + +import YAML from "yaml"; + +export function migrateAnyManifest( + manifestString: string, + manifestTypeName: string, + migrateFn: (manifest: unknown, to: string) => unknown, + to: string +): string { + let manifest: unknown | undefined; + try { + manifest = JSON.parse(manifestString); + } catch (_) { + try { + manifest = YAML.parse(manifestString); + } catch (_) {} + } + + if (!manifest) { + throw Error(`Unable to parse ${manifestTypeName}: ${manifestString}`); + } + + const newManifest = migrateFn(manifest, to); + + const cleanedManifest = JSON.parse(JSON.stringify(newManifest)); + delete cleanedManifest.__type; + + return YAML.stringify(cleanedManifest, null, 2); +} diff --git a/packages/cli/src/lib/manifest/migrate/migrateAppProjectManifest.ts b/packages/cli/src/lib/manifest/migrate/migrateAppProjectManifest.ts new file mode 100644 index 0000000000..9b8e920194 --- /dev/null +++ b/packages/cli/src/lib/manifest/migrate/migrateAppProjectManifest.ts @@ -0,0 +1,15 @@ +import { migrateAnyManifest } from "./migrateAnyManifest"; + +import { migrateAppManifest } from "@polywrap/polywrap-manifest-types-js"; + +export function migrateAppProjectManifest( + manifestString: string, + to: string +): string { + return migrateAnyManifest( + manifestString, + "AppManifest", + migrateAppManifest, + to + ); +} diff --git a/packages/cli/src/lib/manifest/migrate/migrateBuildExtensionManifest.ts b/packages/cli/src/lib/manifest/migrate/migrateBuildExtensionManifest.ts new file mode 100644 index 0000000000..1d6607f881 --- /dev/null +++ b/packages/cli/src/lib/manifest/migrate/migrateBuildExtensionManifest.ts @@ -0,0 +1,15 @@ +import { migrateAnyManifest } from "./migrateAnyManifest"; + +import { migrateBuildManifest } from "@polywrap/polywrap-manifest-types-js"; + +export function migrateBuildExtensionManifest( + manifestString: string, + to: string +): string { + return migrateAnyManifest( + manifestString, + "BuildManifest", + migrateBuildManifest, + to + ); +} diff --git a/packages/cli/src/lib/manifest/migrate/migrateDeployExtensionManifest.ts b/packages/cli/src/lib/manifest/migrate/migrateDeployExtensionManifest.ts new file mode 100644 index 0000000000..0b096e63a9 --- /dev/null +++ b/packages/cli/src/lib/manifest/migrate/migrateDeployExtensionManifest.ts @@ -0,0 +1,15 @@ +import { migrateAnyManifest } from "./migrateAnyManifest"; + +import { migrateDeployManifest } from "@polywrap/polywrap-manifest-types-js"; + +export function migrateDeployExtensionManifest( + manifestString: string, + to: string +): string { + return migrateAnyManifest( + manifestString, + "DeployManifest", + migrateDeployManifest, + to + ); +} diff --git a/packages/cli/src/lib/manifest/migrate/migrateInfraExtensionManifest.ts b/packages/cli/src/lib/manifest/migrate/migrateInfraExtensionManifest.ts new file mode 100644 index 0000000000..e7a214810e --- /dev/null +++ b/packages/cli/src/lib/manifest/migrate/migrateInfraExtensionManifest.ts @@ -0,0 +1,15 @@ +import { migrateAnyManifest } from "./migrateAnyManifest"; + +import { migrateInfraManifest } from "@polywrap/polywrap-manifest-types-js"; + +export function migrateInfraExtensionManifest( + manifestString: string, + to: string +): string { + return migrateAnyManifest( + manifestString, + "InfraManifest", + migrateInfraManifest, + to + ); +} diff --git a/packages/cli/src/lib/manifest/migrate/migrateMetaExtensionManifest.ts b/packages/cli/src/lib/manifest/migrate/migrateMetaExtensionManifest.ts new file mode 100644 index 0000000000..c136d4edd2 --- /dev/null +++ b/packages/cli/src/lib/manifest/migrate/migrateMetaExtensionManifest.ts @@ -0,0 +1,15 @@ +import { migrateAnyManifest } from "./migrateAnyManifest"; + +import { migrateMetaManifest } from "@polywrap/polywrap-manifest-types-js"; + +export function migrateMetaExtensionManifest( + manifestString: string, + to: string +): string { + return migrateAnyManifest( + manifestString, + "MetaManifest", + migrateMetaManifest, + to + ); +} diff --git a/packages/cli/src/lib/manifest/migrate/migratePluginProjectManifest.ts b/packages/cli/src/lib/manifest/migrate/migratePluginProjectManifest.ts new file mode 100644 index 0000000000..21297e7116 --- /dev/null +++ b/packages/cli/src/lib/manifest/migrate/migratePluginProjectManifest.ts @@ -0,0 +1,15 @@ +import { migrateAnyManifest } from "./migrateAnyManifest"; + +import { migratePluginManifest } from "@polywrap/polywrap-manifest-types-js"; + +export function migratePluginProjectManifest( + manifestString: string, + to: string +): string { + return migrateAnyManifest( + manifestString, + "PluginManifest", + migratePluginManifest, + to + ); +} diff --git a/packages/cli/src/lib/manifest/migrate/migratePolywrapProjectManifest.ts b/packages/cli/src/lib/manifest/migrate/migratePolywrapProjectManifest.ts new file mode 100644 index 0000000000..9c15a4e62b --- /dev/null +++ b/packages/cli/src/lib/manifest/migrate/migratePolywrapProjectManifest.ts @@ -0,0 +1,15 @@ +import { migrateAnyManifest } from "./migrateAnyManifest"; + +import { migratePolywrapManifest } from "@polywrap/polywrap-manifest-types-js"; + +export function migratePolywrapProjectManifest( + manifestString: string, + to: string +): string { + return migrateAnyManifest( + manifestString, + "PolywrapManifest", + migratePolywrapManifest, + to + ); +} diff --git a/packages/cli/src/lib/manifest/migrate/migrateTestExtensionManifest.ts b/packages/cli/src/lib/manifest/migrate/migrateTestExtensionManifest.ts new file mode 100644 index 0000000000..cd61504b5b --- /dev/null +++ b/packages/cli/src/lib/manifest/migrate/migrateTestExtensionManifest.ts @@ -0,0 +1,12 @@ +import { migrateAnyManifest } from "./migrateAnyManifest"; + +import { migratePolywrapWorkflow } from "@polywrap/polywrap-manifest-types-js"; + +export function migrateWorkflow(manifestString: string, to: string): string { + return migrateAnyManifest( + manifestString, + "PolywrapWorkflow", + migratePolywrapWorkflow, + to + ); +} diff --git a/packages/cli/src/lib/manifest/schema/getYamlishSchemaForManifestJsonSchemaObject.ts b/packages/cli/src/lib/manifest/schema/getYamlishSchemaForManifestJsonSchemaObject.ts new file mode 100644 index 0000000000..3875cf42b9 --- /dev/null +++ b/packages/cli/src/lib/manifest/schema/getYamlishSchemaForManifestJsonSchemaObject.ts @@ -0,0 +1,60 @@ +import { JSONSchema4 } from "json-schema"; + +export function getYamlishSchemaForManifestJsonSchemaObject( + schema: JSONSchema4, + name = "", + description = "", + indent = 0 +): string { + let output = ""; + + if (name.length) { + output += `${name}: # ${description}\n`; + } + + for (const prop in schema) { + const schemaProperty = schema[prop]; + + if (schemaProperty.type === "object") { + output += getYamlishSchemaForManifestJsonSchemaObject( + schemaProperty.properties, + prop, + schemaProperty.description, + indent + 1 + ); + } else { + output += + getYamlishJsonSchemaPropertyString(schemaProperty, prop, indent) + "\n"; + } + } + + return output; +} + +function getYamlishJsonSchemaPropertyString( + property: JSONSchema4, + propName: string, + indent = 0 +) { + let output = ""; + + for (let i = 0; i < indent; i++) { + output += " "; + } + + output += `${propName}: # ${property.description}`; + + const propEnum = property.enum; + + if (propEnum) { + output += " Values: "; + for (let j = 0; j < propEnum.length; j++) { + output += `${propEnum[j]}`; + if (j !== propEnum.length - 1) { + output += ", "; + } + } + } + + return output; +} diff --git a/packages/cli/src/lib/manifest/schema/index.ts b/packages/cli/src/lib/manifest/schema/index.ts new file mode 100644 index 0000000000..3adb0ba8ac --- /dev/null +++ b/packages/cli/src/lib/manifest/schema/index.ts @@ -0,0 +1 @@ +export * from "./getYamlishSchemaForManifestJsonSchemaObject"; diff --git a/packages/cli/src/lib/option-defaults/defaultManifestFiles.ts b/packages/cli/src/lib/option-defaults/defaultManifestFiles.ts new file mode 100644 index 0000000000..d27d42ed40 --- /dev/null +++ b/packages/cli/src/lib/option-defaults/defaultManifestFiles.ts @@ -0,0 +1,14 @@ +import { + defaultAppManifest, + defaultPluginManifest, + defaultPolywrapManifest, +} from "../project"; + +const filterUniqueFn = (value: string, index: number, self: Array) => + self.indexOf(value) === index; + +export const defaultProjectManifestFiles = [ + ...defaultPolywrapManifest, + ...defaultAppManifest, + ...defaultPluginManifest, +].filter(filterUniqueFn); diff --git a/packages/cli/src/lib/option-defaults/index.ts b/packages/cli/src/lib/option-defaults/index.ts new file mode 100644 index 0000000000..91daa59cd1 --- /dev/null +++ b/packages/cli/src/lib/option-defaults/index.ts @@ -0,0 +1 @@ +export * from "./defaultManifestFiles"; diff --git a/packages/cli/src/lib/option-parsers/client-config.ts b/packages/cli/src/lib/option-parsers/client-config.ts index abc0e16701..0f3f464d03 100644 --- a/packages/cli/src/lib/option-parsers/client-config.ts +++ b/packages/cli/src/lib/option-parsers/client-config.ts @@ -3,7 +3,6 @@ import { intlMsg } from "../intl"; import { importTypescriptModule } from "../system"; import { getTestEnvClientConfig } from "../test-env"; -import { executeMaybeAsyncFunction } from "@polywrap/core-js"; import { PolywrapClientConfig } from "@polywrap/client-js"; import path from "path"; @@ -43,10 +42,7 @@ export async function parseClientConfigOption( process.exit(1); } - finalClientConfig = await executeMaybeAsyncFunction( - configModule.getClientConfig, - finalClientConfig - ); + finalClientConfig = await configModule.getClientConfig(finalClientConfig); try { validateClientConfig(finalClientConfig); diff --git a/packages/cli/src/lib/option-parsers/docgen.ts b/packages/cli/src/lib/option-parsers/docgen.ts deleted file mode 100644 index 805bc1b142..0000000000 --- a/packages/cli/src/lib/option-parsers/docgen.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { intlMsg } from "../intl"; -import { resolvePathIfExists } from "../system"; -import { - defaultAppManifest, - defaultPluginManifest, - defaultPolywrapManifest, -} from "../project"; - -export function parseDocgenManifestFileOption( - manifestFile: string | undefined -): string { - const manifestPaths = manifestFile - ? [manifestFile] - : defaultPolywrapManifest - .concat(defaultAppManifest) - .concat(defaultPluginManifest); - manifestFile = resolvePathIfExists(manifestPaths); - - if (!manifestFile) { - console.error( - intlMsg.commands_docgen_error_manifestNotFound({ - paths: manifestPaths.join(", "), - }) - ); - process.exit(1); - } - - return manifestFile; -} diff --git a/packages/cli/src/lib/option-parsers/index.ts b/packages/cli/src/lib/option-parsers/index.ts index 785058b5b2..482fd2ecde 100644 --- a/packages/cli/src/lib/option-parsers/index.ts +++ b/packages/cli/src/lib/option-parsers/index.ts @@ -1,6 +1,5 @@ export * from "./client-config"; export * from "./codegen"; export * from "./dir"; -export * from "./docgen"; export * from "./run"; export * from "./manifestFile"; diff --git a/packages/cli/src/lib/option-parsers/manifestFile.ts b/packages/cli/src/lib/option-parsers/manifestFile.ts index 6c58a0158c..00eceaa262 100644 --- a/packages/cli/src/lib/option-parsers/manifestFile.ts +++ b/packages/cli/src/lib/option-parsers/manifestFile.ts @@ -1,26 +1,22 @@ import { intlMsg } from "../intl"; -import { - defaultPolywrapManifest, - defaultAppManifest, - defaultPluginManifest, -} from ".."; +import { defaultAppManifest, defaultPluginManifest } from "../project"; import { resolvePathIfExists } from "../system"; -const filterUniqueFn = (value: string, index: number, self: Array) => - self.indexOf(value) === index; +import path from "path"; + +const deprecatedDefaultManifests = [ + ...defaultAppManifest, + ...defaultPluginManifest, +]; export function parseManifestFileOption( - manifestFile: string | undefined + manifestFile: string | undefined, + defaults: string[] ): string { - const defaultManifests = [ - ...defaultPolywrapManifest, - ...defaultAppManifest, - ...defaultPluginManifest, - ].filter(filterUniqueFn); + const didUserProvideManifestFile = + manifestFile != undefined && !!manifestFile.length; - const manifestPaths = manifestFile - ? [manifestFile as string] - : defaultManifests; + const manifestPaths = manifestFile ? [manifestFile as string] : defaults; manifestFile = resolvePathIfExists(manifestPaths); @@ -33,5 +29,18 @@ export function parseManifestFileOption( process.exit(1); } + const fileName = path.basename(manifestFile); + + if ( + !didUserProvideManifestFile && + deprecatedDefaultManifests.includes(fileName) + ) { + console.warn( + intlMsg.lib_option_defaults_deprecated_project_manifest({ + fileName: path.basename(fileName), + }) + ); + } + return manifestFile; } diff --git a/packages/cli/src/lib/project/AppProject.ts b/packages/cli/src/lib/project/AppProject.ts index b29b67e19c..28b0b15b2d 100644 --- a/packages/cli/src/lib/project/AppProject.ts +++ b/packages/cli/src/lib/project/AppProject.ts @@ -58,7 +58,7 @@ export class AppProject extends Project { if (!this._appManifest) { this._appManifest = await loadAppManifest( this.getManifestPath(), - this.quiet + this.logger ); } diff --git a/packages/cli/src/lib/project/PluginProject.ts b/packages/cli/src/lib/project/PluginProject.ts index 6a3dd9a33b..fd2eccb893 100644 --- a/packages/cli/src/lib/project/PluginProject.ts +++ b/packages/cli/src/lib/project/PluginProject.ts @@ -59,7 +59,7 @@ export class PluginProject extends Project { if (!this._pluginManifest) { this._pluginManifest = await loadPluginManifest( this.getManifestPath(), - this.quiet + this.logger ); } diff --git a/packages/cli/src/lib/project/PolywrapProject.ts b/packages/cli/src/lib/project/PolywrapProject.ts index f6567761dc..cccee4aa9d 100644 --- a/packages/cli/src/lib/project/PolywrapProject.ts +++ b/packages/cli/src/lib/project/PolywrapProject.ts @@ -9,15 +9,13 @@ import { loadDeployManifestExt, loadMetaManifest, loadPolywrapManifest, - outputManifest, PolywrapManifestLanguage, polywrapManifestLanguages, polywrapManifestLanguageToBindLanguage, } from "./manifests"; import { Deployer } from "../deploy"; -import { generateDockerImageName, resetDir } from "../system"; +import { resetDir } from "../system"; import { createUUID } from "../helpers"; -import { intlMsg } from "../intl"; import { BuildManifest, @@ -41,13 +39,30 @@ export interface PolywrapProjectConfig extends ProjectConfig { metaManifestPath?: string; } +export interface BuildManifestConfig { + [k: string]: unknown; + // eslint-disable-next-line @typescript-eslint/naming-convention + polywrap_module?: { + name: string; + dir: string; + }; + // eslint-disable-next-line @typescript-eslint/naming-convention + polywrap_linked_packages?: { + dir: string; + name: string; + }[]; + // eslint-disable-next-line @typescript-eslint/naming-convention + polywrap_manifests: string[]; + include?: string[]; +} + export class PolywrapProject extends Project { public static cacheLayout = { root: "wasm/", + buildStrategyUsed: "build/strategy-used", buildDir: "build/", - buildImageDir: "build/image/", - buildImageCacheDir: "build/image/cache", buildUuidFile: "build/uuid", + buildProjectDir: "build/project", buildLinkedPackagesDir: "build/linked-packages/", deployDir: "deploy/", deployModulesDir: "deploy/modules/", @@ -56,7 +71,6 @@ export class PolywrapProject extends Project { private _buildManifest: BuildManifest | undefined; private _deployManifest: DeployManifest | undefined; private _metaManifest: MetaManifest | undefined; - private _defaultBuildImageCached = false; private _defaultDeployModulesCached = false; constructor(protected _config: PolywrapProjectConfig) { @@ -77,9 +91,7 @@ export class PolywrapProject extends Project { this._buildManifest = undefined; this._metaManifest = undefined; this._deployManifest = undefined; - this._defaultBuildImageCached = false; this._defaultDeployModulesCached = false; - this._cache.removeCacheDir(PolywrapProject.cacheLayout.buildImageDir); this._cache.removeCacheDir( PolywrapProject.cacheLayout.buildLinkedPackagesDir ); @@ -100,7 +112,7 @@ export class PolywrapProject extends Project { if (!this._polywrapManifest) { this._polywrapManifest = await loadPolywrapManifest( this.getManifestPath(), - this._config.quiet + this.logger ); } @@ -168,7 +180,7 @@ export class PolywrapProject extends Project { /// Polywrap Build Manifest (polywrap.build.yaml) - public async getBuildManifestPath(): Promise { + public async getBuildManifestPath(): Promise { const polywrapManifest = await this.getManifest(); // If a custom build manifest path is configured @@ -183,28 +195,27 @@ export class PolywrapProject extends Project { ); return this._config.buildManifestPath; } - // Use a default build image for the provided language - else { - await this.cacheDefaultBuildImage(); - - // Return the cached manifest - this._config.buildManifestPath = path.join( - this._cache.getCachePath(PolywrapProject.cacheLayout.buildImageDir), - "polywrap.build.yaml" - ); - return this._config.buildManifestPath; - } - } - public async getBuildManifestDir(): Promise { - return path.dirname(await this.getBuildManifestPath()); + return undefined; } public async getBuildManifest(): Promise { if (!this._buildManifest) { + const buildManifestPath = await this.getBuildManifestPath(); + const language = await this.getManifestLanguage(); + this._buildManifest = await loadBuildManifest( - await this.getBuildManifestPath(), - this.quiet + language, + buildManifestPath ?? + path.join( + __dirname, + "..", + "defaults", + "build-strategies", + language, + "default.build.yaml" + ), + this.logger ); const root = this.getManifestDir(); @@ -266,57 +277,6 @@ export class PolywrapProject extends Project { return uuid; } - public async cacheDefaultBuildImage(): Promise { - if (this._defaultBuildImageCached) { - return; - } - - const language = await this.getManifestLanguage(); - - const defaultBuildManifestFilename = "polywrap.build.yaml"; - const defaultPath = `${__dirname}/../defaults/build-images/${language}/${defaultBuildManifestFilename}`; - const buildImageCachePath = this._cache.getCachePath( - PolywrapProject.cacheLayout.buildImageDir - ); - - if (!fs.existsSync(defaultPath)) { - throw Error( - intlMsg.lib_project_invalid_manifest_language_pathed({ - language, - defaultPath: defaultPath, - }) - ); - } - - // Clean the directory - this._cache.removeCacheDir(PolywrapProject.cacheLayout.buildImageDir); - - // Copy default build image files into cache - await this._cache.copyIntoCache( - PolywrapProject.cacheLayout.buildImageDir, - `${__dirname}/../defaults/build-images/${language}/*`, - { up: true } - ); - - // Load the default build manifest - const defaultManifest = await loadBuildManifest(defaultPath); - - // Set a unique docker image name - defaultManifest.docker = { - ...defaultManifest.docker, - name: generateDockerImageName(await this.getBuildUuid()), - }; - - // Output the modified build manifest - await outputManifest( - defaultManifest, - path.join(buildImageCachePath, defaultBuildManifestFilename), - this._config.quiet - ); - - this._defaultBuildImageCached = true; - } - public async cacheBuildManifestLinkedPackages(): Promise { const buildManifest = await this.getBuildManifest(); @@ -398,7 +358,7 @@ export class PolywrapProject extends Project { if (manifestPath) { this._deployManifest = await loadDeployManifest( manifestPath, - this.quiet + this.logger ); } } @@ -418,7 +378,10 @@ export class PolywrapProject extends Project { const manifestExtPath = path.join(cachePath, "polywrap.deploy.ext.json"); - const manifestExt = await loadDeployManifestExt(manifestExtPath); + const manifestExt = await loadDeployManifestExt( + manifestExtPath, + this.logger + ); return { // eslint-disable-next-line @typescript-eslint/no-require-imports @@ -483,7 +446,7 @@ export class PolywrapProject extends Project { const manifestPath = await this.getMetaManifestPath(); if (manifestPath) { - this._metaManifest = await loadMetaManifest(manifestPath, this.quiet); + this._metaManifest = await loadMetaManifest(manifestPath, this.logger); } } return this._metaManifest; @@ -495,11 +458,16 @@ export class PolywrapProject extends Project { absolute ? this.getManifestPath() : path.relative(root, this.getManifestPath()), - absolute - ? await this.getBuildManifestPath() - : path.relative(root, await this.getBuildManifestPath()), ]; + const buildManifestPath = await this.getBuildManifestPath(); + + if (buildManifestPath) { + paths.push( + absolute ? buildManifestPath : path.relative(root, buildManifestPath) + ); + } + const metaManifestPath = await this.getMetaManifestPath(); if (metaManifestPath) { diff --git a/packages/cli/src/lib/project/Project.ts b/packages/cli/src/lib/project/Project.ts index 3c47c1c170..63c14dfd24 100644 --- a/packages/cli/src/lib/project/Project.ts +++ b/packages/cli/src/lib/project/Project.ts @@ -5,6 +5,7 @@ import { CacheDirectory, CacheDirectoryConfig, } from "../"; +import { Logger } from "../logging"; import { PolywrapManifest } from "@polywrap/polywrap-manifest-types-js"; import { BindOutput } from "@polywrap/schema-bind"; @@ -12,7 +13,7 @@ import { Abi } from "@polywrap/schema-parse"; export interface ProjectConfig { rootDir: string; - quiet?: boolean; + logger: Logger; } export abstract class Project { @@ -70,7 +71,7 @@ export abstract class Project { generationSubPath?: string ): Promise; - public get quiet(): boolean { - return !!this._config.quiet; + public get logger(): Logger { + return this._config.logger; } } diff --git a/packages/cli/src/lib/project/helpers/getProjectFromManifest.ts b/packages/cli/src/lib/project/helpers/getProjectFromManifest.ts index 6cf1f33127..83420a85e9 100644 --- a/packages/cli/src/lib/project/helpers/getProjectFromManifest.ts +++ b/packages/cli/src/lib/project/helpers/getProjectFromManifest.ts @@ -5,16 +5,17 @@ import { isPluginManifestLanguage, isPolywrapManifestLanguage, } from "../manifests"; -import { Project } from "../Project"; -import { PolywrapProject } from "../PolywrapProject"; import { AppProject } from "../AppProject"; import { PluginProject } from "../PluginProject"; +import { PolywrapProject } from "../PolywrapProject"; +import { Project } from "../Project"; +import { Logger } from "../../logging"; +import { getProjectManifestLanguage } from "./getProjectManifestLanguage"; -import { filesystem } from "gluegun"; -import YAML from "js-yaml"; +import fs from "fs"; import path from "path"; -type ManifestProjectTypeProps = { +export type ManifestProjectTypeProps = { // >= 0.2 project?: { type: AnyProjectManifestLanguage; @@ -24,9 +25,11 @@ type ManifestProjectTypeProps = { }; export async function getProjectFromManifest( - manifestFile: string + manifestFile: string, + logger: Logger ): Promise | undefined> { - const manifest = filesystem.read(manifestFile) as string; + const manifestPath = path.resolve(manifestFile); + const manifest = fs.readFileSync(manifestPath, "utf-8"); const type = getProjectManifestLanguage(manifest); if (!type) { return undefined; @@ -36,18 +39,21 @@ export async function getProjectFromManifest( if (isPolywrapManifestLanguage(type)) { project = new PolywrapProject({ - rootDir: path.dirname(manifestFile), - polywrapManifestPath: manifestFile, + rootDir: path.dirname(manifestPath), + polywrapManifestPath: manifestPath, + logger, }); } else if (isPluginManifestLanguage(type)) { project = new PluginProject({ - rootDir: path.dirname(manifestFile), - pluginManifestPath: manifestFile, + rootDir: path.dirname(manifestPath), + pluginManifestPath: manifestPath, + logger, }); } else if (isAppManifestLanguage(type)) { project = new AppProject({ - rootDir: path.dirname(manifestFile), - appManifestPath: manifestFile, + rootDir: path.dirname(manifestPath), + appManifestPath: manifestPath, + logger, }); } else { return undefined; @@ -57,19 +63,3 @@ export async function getProjectFromManifest( return project; } - -function getProjectManifestLanguage( - manifestStr: string -): AnyProjectManifestLanguage | undefined { - let manifest: ManifestProjectTypeProps | undefined; - - try { - manifest = JSON.parse(manifestStr) as ManifestProjectTypeProps; - } catch (e) { - manifest = YAML.safeLoad(manifestStr) as - | ManifestProjectTypeProps - | undefined; - } - - return manifest?.project?.type ?? manifest?.language; -} diff --git a/packages/cli/src/lib/project/helpers/getProjectManifestLanguage.ts b/packages/cli/src/lib/project/helpers/getProjectManifestLanguage.ts new file mode 100644 index 0000000000..57e5800abb --- /dev/null +++ b/packages/cli/src/lib/project/helpers/getProjectManifestLanguage.ts @@ -0,0 +1,22 @@ +/* eslint-disable no-empty */ + +import { AnyProjectManifestLanguage } from "../manifests"; +import { ManifestProjectTypeProps } from "./getProjectFromManifest"; + +import YAML from "yaml"; + +export function getProjectManifestLanguage( + manifestStr: string +): AnyProjectManifestLanguage | undefined { + let manifest: ManifestProjectTypeProps | undefined; + + try { + manifest = JSON.parse(manifestStr) as ManifestProjectTypeProps; + } catch (_) { + try { + manifest = YAML.parse(manifestStr) as ManifestProjectTypeProps; + } catch (_) {} + } + + return manifest?.project?.type ?? manifest?.language; +} diff --git a/packages/cli/src/lib/project/helpers/index.ts b/packages/cli/src/lib/project/helpers/index.ts new file mode 100644 index 0000000000..47ba6f7542 --- /dev/null +++ b/packages/cli/src/lib/project/helpers/index.ts @@ -0,0 +1,3 @@ +export * from "./getProjectFromManifest"; +export * from "./getProjectManifestLanguage"; +export * from "./maybeGetManifestFormatVersion"; diff --git a/packages/cli/src/lib/project/helpers/maybeGetManifestFormatVersion.ts b/packages/cli/src/lib/project/helpers/maybeGetManifestFormatVersion.ts new file mode 100644 index 0000000000..1cc8ec53dd --- /dev/null +++ b/packages/cli/src/lib/project/helpers/maybeGetManifestFormatVersion.ts @@ -0,0 +1,23 @@ +/* eslint-disable no-empty */ + +import YAML from "yaml"; + +export function maybeGetManifestFormatVersion( + manifestStr: string +): string | undefined { + type ManifestFormatProps = { + format: string; + }; + + let manifest: ManifestFormatProps | undefined; + + try { + manifest = JSON.parse(manifestStr) as ManifestFormatProps; + } catch (_) { + try { + manifest = YAML.parse(manifestStr) as ManifestFormatProps; + } catch (_) {} + } + + return manifest?.format; +} diff --git a/packages/cli/src/lib/project/index.ts b/packages/cli/src/lib/project/index.ts index 44e0986424..e545b08194 100644 --- a/packages/cli/src/lib/project/index.ts +++ b/packages/cli/src/lib/project/index.ts @@ -4,4 +4,4 @@ export * from "./PluginProject"; export * from "./AppProject"; export * from "./templates"; export * from "./manifests"; -export * from "./helpers/getProjectFromManifest"; +export * from "./helpers"; diff --git a/packages/cli/src/lib/project/manifests/app/load.ts b/packages/cli/src/lib/project/manifests/app/load.ts index 5248ea554d..1575b42c4a 100644 --- a/packages/cli/src/lib/project/manifests/app/load.ts +++ b/packages/cli/src/lib/project/manifests/app/load.ts @@ -1,4 +1,4 @@ -import { displayPath, withSpinner, intlMsg } from "../../../"; +import { displayPath, Logger, logActivity, intlMsg } from "../../../"; import { AppManifest, @@ -6,15 +6,11 @@ import { } from "@polywrap/polywrap-manifest-types-js"; import fs from "fs"; -export const defaultAppManifest = [ - "polywrap.yaml", - "polywrap.app.yaml", - "polywrap.app.yml", -]; +export const defaultAppManifest = ["polywrap.app.yaml", "polywrap.app.yml"]; export async function loadAppManifest( manifestPath: string, - quiet = false + logger: Logger ): Promise { const run = (): Promise => { const manifest = fs.readFileSync(manifestPath, "utf-8"); @@ -33,17 +29,14 @@ export async function loadAppManifest( } }; - if (quiet) { - return await run(); - } else { - manifestPath = displayPath(manifestPath); - return (await withSpinner( - intlMsg.lib_helpers_manifest_loadText({ path: manifestPath }), - intlMsg.lib_helpers_manifest_loadError({ path: manifestPath }), - intlMsg.lib_helpers_manifest_loadWarning({ path: manifestPath }), - async (_spinner) => { - return await run(); - } - )) as AppManifest; - } + manifestPath = displayPath(manifestPath); + return await logActivity( + logger, + intlMsg.lib_helpers_manifest_loadText({ path: manifestPath }), + intlMsg.lib_helpers_manifest_loadError({ path: manifestPath }), + intlMsg.lib_helpers_manifest_loadWarning({ path: manifestPath }), + async () => { + return await run(); + } + ); } diff --git a/packages/cli/src/lib/project/manifests/output.ts b/packages/cli/src/lib/project/manifests/output.ts index 38cf7594fb..28706b2edc 100644 --- a/packages/cli/src/lib/project/manifests/output.ts +++ b/packages/cli/src/lib/project/manifests/output.ts @@ -1,4 +1,4 @@ -import { displayPath, withSpinner, intlMsg } from "../../"; +import { displayPath, Logger, logActivity, intlMsg } from "../../"; import { BuildManifest, @@ -7,14 +7,14 @@ import { PluginManifest, } from "@polywrap/polywrap-manifest-types-js"; import { writeFileSync, normalizePath } from "@polywrap/os-js"; -import YAML from "js-yaml"; +import YAML from "yaml"; import path from "path"; import fs from "fs"; export async function outputManifest( manifest: PolywrapManifest | BuildManifest | MetaManifest | PluginManifest, manifestPath: string, - quiet = false + logger: Logger ): Promise { const run = () => { const removeUndefinedProps = ( @@ -52,7 +52,7 @@ export async function outputManifest( const isYaml = manifestPath.endsWith(".yaml") || manifestPath.endsWith(".yml"); const str = isYaml - ? YAML.safeDump(sanitizedManifest, { indent: 2 }) + ? YAML.stringify(sanitizedManifest, null, 2) : JSON.stringify(sanitizedManifest, null, 2); if (!str) { @@ -71,23 +71,20 @@ export async function outputManifest( writeFileSync(manifestPath, str, "utf-8"); }; - if (quiet) { - return run(); - } else { - manifestPath = displayPath(manifestPath); - return await withSpinner( - intlMsg.lib_helpers_manifest_outputText({ - path: normalizePath(manifestPath), - }), - intlMsg.lib_helpers_manifest_outputError({ - path: normalizePath(manifestPath), - }), - intlMsg.lib_helpers_manifest_outputWarning({ - path: normalizePath(manifestPath), - }), - (_spinner): Promise => { - return Promise.resolve(run()); - } - ); - } + manifestPath = displayPath(manifestPath); + return await logActivity( + logger, + intlMsg.lib_helpers_manifest_outputText({ + path: normalizePath(manifestPath), + }), + intlMsg.lib_helpers_manifest_outputError({ + path: normalizePath(manifestPath), + }), + intlMsg.lib_helpers_manifest_outputWarning({ + path: normalizePath(manifestPath), + }), + (): Promise => { + return Promise.resolve(run()); + } + ); } diff --git a/packages/cli/src/lib/project/manifests/plugin/load.ts b/packages/cli/src/lib/project/manifests/plugin/load.ts index 08b2fbe8a3..6ea1511085 100644 --- a/packages/cli/src/lib/project/manifests/plugin/load.ts +++ b/packages/cli/src/lib/project/manifests/plugin/load.ts @@ -1,4 +1,4 @@ -import { displayPath, withSpinner, intlMsg } from "../../../"; +import { displayPath, Logger, logActivity, intlMsg } from "../../../"; import { PluginManifest, @@ -7,14 +7,13 @@ import { import fs from "fs"; export const defaultPluginManifest = [ - "polywrap.yaml", "polywrap.plugin.yaml", "polywrap.plugin.yml", ]; export async function loadPluginManifest( manifestPath: string, - quiet = false + logger: Logger ): Promise { const run = (): Promise => { const manifest = fs.readFileSync(manifestPath, "utf-8"); @@ -34,17 +33,14 @@ export async function loadPluginManifest( } }; - if (quiet) { - return await run(); - } else { - manifestPath = displayPath(manifestPath); - return (await withSpinner( - intlMsg.lib_helpers_manifest_loadText({ path: manifestPath }), - intlMsg.lib_helpers_manifest_loadError({ path: manifestPath }), - intlMsg.lib_helpers_manifest_loadWarning({ path: manifestPath }), - async (_spinner) => { - return await run(); - } - )) as PluginManifest; - } + manifestPath = displayPath(manifestPath); + return await logActivity( + logger, + intlMsg.lib_helpers_manifest_loadText({ path: manifestPath }), + intlMsg.lib_helpers_manifest_loadError({ path: manifestPath }), + intlMsg.lib_helpers_manifest_loadWarning({ path: manifestPath }), + async () => { + return await run(); + } + ); } diff --git a/packages/cli/src/lib/project/manifests/polywrap/load.ts b/packages/cli/src/lib/project/manifests/polywrap/load.ts index a3ebe574ac..9f83b07093 100644 --- a/packages/cli/src/lib/project/manifests/polywrap/load.ts +++ b/packages/cli/src/lib/project/manifests/polywrap/load.ts @@ -1,9 +1,10 @@ import { displayPath, - withSpinner, intlMsg, - searchOptional, loadEnvironmentVariables, + PolywrapManifestLanguage, + Logger, + logActivity, } from "../../../"; import { @@ -28,7 +29,7 @@ export const defaultPolywrapManifest = ["polywrap.yaml", "polywrap.yml"]; export async function loadPolywrapManifest( manifestPath: string, - quiet = false + logger: Logger ): Promise { const run = (): Promise => { const manifest = fs.readFileSync(manifestPath, "utf-8"); @@ -48,19 +49,16 @@ export async function loadPolywrapManifest( } }; - if (quiet) { - return await run(); - } else { - manifestPath = displayPath(manifestPath); - return (await withSpinner( - intlMsg.lib_helpers_manifest_loadText({ path: manifestPath }), - intlMsg.lib_helpers_manifest_loadError({ path: manifestPath }), - intlMsg.lib_helpers_manifest_loadWarning({ path: manifestPath }), - async () => { - return await run(); - } - )) as PolywrapManifest; - } + manifestPath = displayPath(manifestPath); + return await logActivity( + logger, + intlMsg.lib_helpers_manifest_loadText({ path: manifestPath }), + intlMsg.lib_helpers_manifest_loadError({ path: manifestPath }), + intlMsg.lib_helpers_manifest_loadWarning({ path: manifestPath }), + async () => { + return await run(); + } + ); } export const defaultBuildManifest = [ @@ -69,10 +67,11 @@ export const defaultBuildManifest = [ ]; export async function loadBuildManifest( + language: PolywrapManifestLanguage, manifestPath: string, - quiet = false + logger: Logger ): Promise { - const run = (): Promise => { + const run = (): BuildManifest => { const manifest = fs.readFileSync(manifestPath, "utf-8"); if (!manifest) { @@ -82,45 +81,40 @@ export async function loadBuildManifest( throw Error(noLoadMessage); } - // Load the custom json-schema extension if it exists - const configSchemaPath = path.join( - path.dirname(manifestPath), - "/polywrap.build.ext.json" - ); let extSchema: JsonSchema | undefined = undefined; - if (fs.existsSync(configSchemaPath)) { + if (language.startsWith("wasm")) { + const extSchemaPath = path.join( + __dirname, + "..", + "..", + "..", + "defaults", + "build-strategies", + language, + "manifest.ext.json" + ); + extSchema = JSON.parse( - fs.readFileSync(configSchemaPath, "utf-8") + fs.readFileSync(extSchemaPath, "utf-8") ) as JsonSchema; - - // The extension schema must support additional properties - extSchema.additionalProperties = true; } - try { - const result = deserializeBuildManifest(manifest, { - extSchema: extSchema, - }); - return Promise.resolve(result); - } catch (e) { - return Promise.reject(e); - } + return deserializeBuildManifest(manifest, { + extSchema: extSchema, + }); }; - if (quiet) { - return await run(); - } else { - manifestPath = displayPath(manifestPath); - return (await withSpinner( - intlMsg.lib_helpers_manifest_loadText({ path: manifestPath }), - intlMsg.lib_helpers_manifest_loadError({ path: manifestPath }), - intlMsg.lib_helpers_manifest_loadWarning({ path: manifestPath }), - async () => { - return await run(); - } - )) as BuildManifest; - } + manifestPath = displayPath(manifestPath); + return await logActivity( + logger, + intlMsg.lib_helpers_manifest_loadText({ path: manifestPath }), + intlMsg.lib_helpers_manifest_loadError({ path: manifestPath }), + intlMsg.lib_helpers_manifest_loadWarning({ path: manifestPath }), + async () => { + return run(); + } + ); } export const defaultDeployManifest = [ @@ -130,7 +124,7 @@ export const defaultDeployManifest = [ export async function loadDeployManifest( manifestPath: string, - quiet = false + logger: Logger ): Promise { const run = (): Promise => { const manifest = fs.readFileSync(manifestPath, "utf-8"); @@ -153,24 +147,21 @@ export async function loadDeployManifest( } }; - if (quiet) { - return await run(); - } else { - manifestPath = displayPath(manifestPath); - return (await withSpinner( - intlMsg.lib_helpers_manifest_loadText({ path: manifestPath }), - intlMsg.lib_helpers_manifest_loadError({ path: manifestPath }), - intlMsg.lib_helpers_manifest_loadWarning({ path: manifestPath }), - async () => { - return await run(); - } - )) as DeployManifest; - } + manifestPath = displayPath(manifestPath); + return await logActivity( + logger, + intlMsg.lib_helpers_manifest_loadText({ path: manifestPath }), + intlMsg.lib_helpers_manifest_loadError({ path: manifestPath }), + intlMsg.lib_helpers_manifest_loadWarning({ path: manifestPath }), + async () => { + return await run(); + } + ); } export async function loadDeployManifestExt( manifestExtPath: string, - quiet = false + logger: Logger ): Promise { const run = (): JsonSchema | undefined => { const configSchemaPath = path.join( @@ -189,30 +180,27 @@ export async function loadDeployManifestExt( return extSchema; }; - if (quiet) { - return run(); - } else { - manifestExtPath = displayPath(manifestExtPath); - return await searchOptional( - intlMsg.lib_helpers_deployManifestExt_loadText({ path: manifestExtPath }), - intlMsg.lib_helpers_deployManifestExt_loadError({ - path: manifestExtPath, - }), - intlMsg.lib_helpers_deployManifestExt_loadWarning({ - path: manifestExtPath, - }), - async () => { - return run(); - } - ); - } + manifestExtPath = displayPath(manifestExtPath); + return await logActivity( + logger, + intlMsg.lib_helpers_deployManifestExt_loadText({ path: manifestExtPath }), + intlMsg.lib_helpers_deployManifestExt_loadError({ + path: manifestExtPath, + }), + intlMsg.lib_helpers_deployManifestExt_loadWarning({ + path: manifestExtPath, + }), + async () => { + return run(); + } + ); } export const defaultMetaManifest = ["polywrap.meta.yaml", "polywrap.meta.yml"]; export async function loadMetaManifest( manifestPath: string, - quiet = false + logger: Logger ): Promise { const run = (): Promise => { const manifest = fs.readFileSync(manifestPath, "utf-8"); @@ -232,24 +220,26 @@ export async function loadMetaManifest( } }; - if (quiet) { - return await run(); - } else { - manifestPath = displayPath(manifestPath); - return (await withSpinner( - intlMsg.lib_helpers_manifest_loadText({ path: manifestPath }), - intlMsg.lib_helpers_manifest_loadError({ path: manifestPath }), - intlMsg.lib_helpers_manifest_loadWarning({ path: manifestPath }), - async () => { - return await run(); - } - )) as MetaManifest; - } + manifestPath = displayPath(manifestPath); + return await logActivity( + logger, + intlMsg.lib_helpers_manifest_loadText({ path: manifestPath }), + intlMsg.lib_helpers_manifest_loadError({ path: manifestPath }), + intlMsg.lib_helpers_manifest_loadWarning({ path: manifestPath }), + async () => { + return await run(); + } + ); } +export const defaultInfraManifest = [ + "polywrap.infra.yaml", + "polywrap.infra.yml", +]; + export async function loadInfraManifest( manifestPath: string, - quiet = false + logger: Logger ): Promise { const run = (): Promise => { const manifest = fs.readFileSync(manifestPath, "utf-8"); @@ -272,24 +262,26 @@ export async function loadInfraManifest( } }; - if (quiet) { - return await run(); - } else { - manifestPath = displayPath(manifestPath); - return (await withSpinner( - intlMsg.lib_helpers_manifest_loadText({ path: manifestPath }), - intlMsg.lib_helpers_manifest_loadError({ path: manifestPath }), - intlMsg.lib_helpers_manifest_loadWarning({ path: manifestPath }), - async () => { - return await run(); - } - )) as InfraManifest; - } + manifestPath = displayPath(manifestPath); + return await logActivity( + logger, + intlMsg.lib_helpers_manifest_loadText({ path: manifestPath }), + intlMsg.lib_helpers_manifest_loadError({ path: manifestPath }), + intlMsg.lib_helpers_manifest_loadWarning({ path: manifestPath }), + async () => { + return await run(); + } + ); } +export const defaultWorkflowManifest = [ + "polywrap.test.yaml", + "polywrap.test.yml", +]; + export async function loadWorkflowManifest( manifestPath: string, - quiet = false + logger: Logger ): Promise { const run = (): Promise => { const manifest = fs.readFileSync(manifestPath, "utf-8"); @@ -309,17 +301,14 @@ export async function loadWorkflowManifest( } }; - if (quiet) { - return await run(); - } else { - manifestPath = displayPath(manifestPath); - return (await withSpinner( - intlMsg.lib_helpers_manifest_loadText({ path: manifestPath }), - intlMsg.lib_helpers_manifest_loadError({ path: manifestPath }), - intlMsg.lib_helpers_manifest_loadWarning({ path: manifestPath }), - async () => { - return await run(); - } - )) as PolywrapWorkflow; - } + manifestPath = displayPath(manifestPath); + return await logActivity( + logger, + intlMsg.lib_helpers_manifest_loadText({ path: manifestPath }), + intlMsg.lib_helpers_manifest_loadError({ path: manifestPath }), + intlMsg.lib_helpers_manifest_loadWarning({ path: manifestPath }), + async () => { + return await run(); + } + ); } diff --git a/packages/cli/src/lib/project/templates/index.ts b/packages/cli/src/lib/project/templates/index.ts index cdc1788aaa..5a8d4d3da0 100644 --- a/packages/cli/src/lib/project/templates/index.ts +++ b/packages/cli/src/lib/project/templates/index.ts @@ -1,7 +1,8 @@ import { intlMsg } from "../../"; import { execSync, spawn } from "child_process"; -import { GluegunFilesystem } from "gluegun"; +import fs from "fs"; +import fse from "fs-extra"; import dns from "dns"; import url from "url"; import chalk from "chalk"; @@ -83,24 +84,20 @@ const executeCommand = ( export const generateProjectTemplate = ( type: string, lang: string, - projectName: string, - fs: GluegunFilesystem + projectDir: string ): Promise => { return new Promise((resolve, reject) => { - const { dir, copyAsync } = fs; - dir(projectName); - let command = ""; let args: string[] = []; const useYarn = shouldUseYarn(); const isOnline = checkIfOnline(useYarn); - const root = path.resolve(projectName); + const root = path.resolve(projectDir); const dependencies: string[] = ["@polywrap/templates"]; - fs.write( - `${root}/package.json`, + fs.writeFileSync( + path.join(root, "package.json"), ` { "name": "template" @@ -146,13 +143,14 @@ export const generateProjectTemplate = ( executeCommand(command, args, root) .then(() => { - copyAsync( - `${root}/node_modules/@polywrap/templates/${type}/${lang}`, - `${root}`, - { - overwrite: true, - } - ) + fse + .copy( + `${root}/node_modules/@polywrap/templates/${type}/${lang}`, + `${root}`, + { + overwrite: true, + } + ) .then(() => { resolve(true); }) diff --git a/packages/cli/src/lib/system/DockerCompose.ts b/packages/cli/src/lib/system/DockerCompose.ts index 031bf7e684..acbb04153d 100644 --- a/packages/cli/src/lib/system/DockerCompose.ts +++ b/packages/cli/src/lib/system/DockerCompose.ts @@ -1,4 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { Logger } from "../logging"; import { getDockerFileLock } from "./docker"; import path from "path"; @@ -6,7 +7,7 @@ import Commands, { IDockerComposeOptions } from "docker-compose"; import { InfraManifest } from "@polywrap/polywrap-manifest-types-js"; export class DockerCompose { - private _dockerLock = getDockerFileLock(); + private _dockerLock = getDockerFileLock(new Logger({})); public commands: typeof Commands; constructor() { @@ -20,7 +21,7 @@ export class DockerCompose { static getDefaultConfig( baseDockerComposePath: string, - quiet: boolean, + logger: Logger, infraManifest?: InfraManifest ): Partial { const env = @@ -38,7 +39,20 @@ export class DockerCompose { return { cwd: path.dirname(baseDockerComposePath), env, - log: !quiet, + log: true, + callback: (chunk: Buffer, streamSource?: "stdout" | "stderr") => { + if (!streamSource) { + return; + } + + const chunkStr = chunk.toString(); + + if (streamSource === "stdout") { + logger.info(chunkStr); + } else { + logger.error(chunkStr); + } + }, }; } diff --git a/packages/cli/src/lib/system/child-process.ts b/packages/cli/src/lib/system/child-process.ts index 221833a43f..1f67338071 100644 --- a/packages/cli/src/lib/system/child-process.ts +++ b/packages/cli/src/lib/system/child-process.ts @@ -1,13 +1,13 @@ +import { Logger } from "../logging"; + import { exec, ExecException, execSync, SpawnSyncReturns } from "child_process"; export function runCommandSync( command: string, - quiet = false, + logger: Logger, env: Record | undefined = undefined ): { stdout?: string; stderr?: SpawnSyncReturns & Error } { - if (!quiet) { - console.log(`> ${command}`); - } + logger.info(`> ${command}`); try { const stdout = execSync(command, { @@ -26,12 +26,12 @@ export function runCommandSync( export async function runCommand( command: string, - quiet = false, - env: Record | undefined = undefined + logger: Logger, + env: Record | undefined = undefined, + cwd: string | undefined = undefined, + redirectStderr = false ): Promise<{ stdout: string; stderr: string }> { - if (!quiet) { - console.log(`> ${command}`); - } + logger.info(`> ${command}`); return new Promise<{ stdout: string; stderr: string }>((resolve, reject) => { const callback = ( @@ -49,7 +49,7 @@ export async function runCommand( const childObj = exec( command, { - cwd: __dirname, + cwd: cwd ?? __dirname, env: { ...process.env, ...env, @@ -58,14 +58,16 @@ export async function runCommand( callback ); - if (!quiet) { - childObj.stdout?.on("data", (data) => { - console.log(data.toString()); - }); + childObj.stdout?.on("data", (data) => { + logger.info(data.toString()); + }); - childObj.stderr?.on("data", (data) => { - console.error(data.toString()); - }); - } + childObj.stderr?.on("data", (data) => { + if (redirectStderr) { + logger.info(data.toString()); + } else { + logger.error(data.toString()); + } + }); }); } diff --git a/packages/cli/src/lib/system/docker.ts b/packages/cli/src/lib/system/docker.ts index b564068754..186f3150b4 100644 --- a/packages/cli/src/lib/system/docker.ts +++ b/packages/cli/src/lib/system/docker.ts @@ -1,226 +1,29 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { displayPath, runCommand, FileLock } from "./"; -import { withSpinner, intlMsg } from "../"; +import { FileLock } from "./"; +import { intlMsg, Logger, runCommandSync } from "../"; -import { isWin, writeFileSync } from "@polywrap/os-js"; -import { system, print } from "gluegun"; -import Mustache from "mustache"; -import YAML from "js-yaml"; +import YAML from "yaml"; import path from "path"; import fs from "fs"; -export function isDockerInstalled(): boolean { - return !!system.which("docker"); +export function isDockerInstalled(logger: Logger): boolean { + const { stdout } = runCommandSync("docker version", logger); + return stdout ? stdout.includes("Version") : false; } -export async function ensureDockerDaemonRunning(): Promise { +export async function ensureDockerDaemonRunning(logger: Logger): Promise { try { - await system.run("docker stats --no-stream"); + runCommandSync("docker stats --no-stream", logger); } catch (e) { throw new Error(intlMsg.lib_helpers_docker_couldNotConnect()); } } -export function getDockerFileLock(): FileLock { - return new FileLock(__dirname + "/DOCKER_LOCK", print.error); -} - -export async function isDockerBuildxInstalled(): Promise { - const { stdout: version } = await runCommand("docker buildx version", true); - return version.startsWith("github.com/docker/buildx"); -} - -export async function copyArtifactsFromBuildImage( - outputDir: string, - buildArtifact: string, - imageName: string, - removeBuilder = false, - removeImage = false, - useBuildx = false, - quiet = true -): Promise { - const run = async (): Promise => { - // Make sure the interactive terminal name is available - - useBuildx &&= await isDockerBuildxInstalled(); - - const { stdout: containerLsOutput } = await runCommand( - "docker container ls -a", - quiet - ); - - if (containerLsOutput.indexOf(`root-${imageName}`) > -1) { - await runCommand(`docker rm -f root-${imageName}`, quiet); - } - - // Create a new interactive terminal - await runCommand( - `docker create -ti --name root-${imageName} ${imageName}`, - quiet - ); - - // Make sure the "project" directory exists - const { stdout: projectLsOutput } = await runCommand( - `docker run --rm ${imageName} /bin/bash -c "ls /project"`, - quiet - ).catch(() => ({ stdout: "" })); - - if (projectLsOutput.length <= 1) { - throw Error( - intlMsg.lib_helpers_docker_projectFolderMissing({ image: imageName }) - ); - } - - const { stdout: buildLsOutput } = await runCommand( - `docker run --rm ${imageName} /bin/bash -c "ls /project/build"`, - quiet - ).catch(() => ({ stdout: "" })); - - if (buildLsOutput.indexOf(buildArtifact) === -1) { - throw Error( - intlMsg.lib_helpers_docker_projectBuildFolderMissing({ - image: imageName, - artifact: buildArtifact, - }) - ); - } - - await runCommand( - `docker cp root-${imageName}:/project/build/${buildArtifact} ${outputDir}`, - quiet - ); - - await runCommand(`docker rm -f root-${imageName}`, quiet); - - if (useBuildx) { - if (removeBuilder) { - await runCommand(`docker buildx rm ${imageName}`, quiet); - } - } - if (removeImage) { - await runCommand(`docker rmi ${imageName}`, quiet); - } - }; - - if (quiet) { - return await run(); - } else { - const args = { - path: displayPath(outputDir), - image: imageName, - }; - return (await withSpinner( - intlMsg.lib_helpers_docker_copyText(args), - intlMsg.lib_helpers_docker_copyError(args), - intlMsg.lib_helpers_docker_copyWarning(args), - async (_spinner) => { - return await run(); - } - )) as void; - } -} - -export async function createBuildImage( - rootDir: string, - imageName: string, - dockerfile: string, - cacheDir?: string, - useBuildx = false, - quiet = true -): Promise { - const run = async (): Promise => { - useBuildx = useBuildx && (await isDockerBuildxInstalled()); - - if (useBuildx) { - const cacheFrom = - cacheDir && fs.existsSync(path.join(cacheDir, "index.json")) - ? `--cache-from type=local,src=${cacheDir}` - : ""; - const cacheTo = cacheDir ? `--cache-to type=local,dest=${cacheDir}` : ""; - - // Build the docker image - let buildxUseFailed: boolean; - try { - const { stderr } = await runCommand( - `docker buildx use ${imageName}`, - quiet - ); - buildxUseFailed = !!stderr; - } catch (e) { - buildxUseFailed = true; - } - - if (buildxUseFailed) { - await runCommand( - `docker buildx create --use --name ${imageName}`, - quiet - ); - } - await runCommand( - `docker buildx build -f ${dockerfile} -t ${imageName} ${rootDir} ${cacheFrom} ${cacheTo} --output=type=docker`, - quiet - ); - } else { - await runCommand( - `docker build -f ${dockerfile} -t ${imageName} ${rootDir}`, - quiet, - isWin() - ? undefined - : { - DOCKER_BUILDKIT: "true", - } - ); - } - - // Get the docker image ID - const { stdout } = await runCommand( - `docker image inspect ${imageName} -f "{{.ID}}"`, - quiet - ); - - if (stdout.indexOf("sha256:") === -1) { - throw Error(intlMsg.lib_docker_invalidImageId({ imageId: stdout })); - } - - return stdout; - }; - - if (quiet) { - // Show spinner with helpful messages - const args = { - image: imageName, - dockerfile: displayPath(dockerfile), - context: displayPath(rootDir), - }; - return (await withSpinner( - intlMsg.lib_helpers_docker_buildText(args), - intlMsg.lib_helpers_docker_buildError(args), - intlMsg.lib_helpers_docker_buildWarning(args), - async (_spinner) => { - return await run(); - } - )) as string; - } else { - // Verbose output will be emitted within run() - return await run(); - } -} - -export function generateDockerfile( - templatePath: string, - config: Record -): string { - const outputDir = path.dirname(templatePath); - const outputFilePath = path.join(outputDir, "Dockerfile"); - const template = fs.readFileSync(templatePath, "utf-8"); - const dockerfile = Mustache.render(template, config); - writeFileSync(outputFilePath, dockerfile, "utf-8"); - return outputFilePath; -} - -export function generateDockerImageName(uuid: string): string { - return `polywrap-build-env-${uuid}`; +export function getDockerFileLock(logger: Logger): FileLock { + return new FileLock(__dirname + "/DOCKER_LOCK", (message: string) => + logger.info(message) + ); } interface DockerCompose { @@ -238,7 +41,7 @@ interface DockerCompose { export function correctBuildContextPathsFromCompose( dockerComposePath: string ): DockerCompose { - const dockerComposeFile = YAML.safeLoad( + const dockerComposeFile = YAML.parse( fs.readFileSync(dockerComposePath, "utf-8") ) as DockerCompose; @@ -282,3 +85,7 @@ export function correctBuildContextPathsFromCompose( services: Object.fromEntries(correctedServiceEntries), }; } + +export function generateDockerImageName(uuid: string): string { + return `polywrap-build-env-${uuid}`; +} diff --git a/packages/cli/src/lib/workflow/JobRunner.ts b/packages/cli/src/lib/workflow/JobRunner.ts index 0540403dbe..b5e6f05457 100644 --- a/packages/cli/src/lib/workflow/JobRunner.ts +++ b/packages/cli/src/lib/workflow/JobRunner.ts @@ -1,17 +1,15 @@ import { JobResult, JobStatus, Step } from "./types"; -import { - Client, - executeMaybeAsyncFunction, - MaybeAsync, -} from "@polywrap/core-js"; +import { PolywrapClient } from "@polywrap/client-js"; +import { MaybeAsync } from "@polywrap/core-js"; import { WorkflowJobs } from "@polywrap/polywrap-manifest-types-js"; +import { ClientConfigBuilder } from "@polywrap/client-config-builder-js"; export class JobRunner { private jobOutput: Map; constructor( - private client: Client, + private client: PolywrapClient, private onExecution?: (id: string, JobResult: JobResult) => MaybeAsync ) { this.jobOutput = new Map(); @@ -176,17 +174,27 @@ export class JobRunner { } } - const invokeResult = await this.client.invoke({ + let finalClient = this.client; + + if (step.config) { + const finalConfig = new ClientConfigBuilder() + .add(this.client.getConfig()) + .add(step.config) + .build(); + + finalClient = new PolywrapClient(finalConfig); + } + + const invokeResult = await finalClient.invoke({ uri: step.uri, method: step.method, - config: step.config, args: args, }); - if (invokeResult.error) { - return { ...invokeResult, status: JobStatus.FAILED }; + if (!invokeResult.ok) { + return { error: invokeResult.error, status: JobStatus.FAILED }; } else { - return { ...invokeResult, status: JobStatus.SUCCEED }; + return { data: invokeResult.value, status: JobStatus.SUCCEED }; } } @@ -200,7 +208,7 @@ export class JobRunner { this.jobOutput.set(absId, result); if (this.onExecution) { - await executeMaybeAsyncFunction(this.onExecution, absId, result); + await this.onExecution(absId, result); } } } diff --git a/packages/cli/src/lib/workflow/types.ts b/packages/cli/src/lib/workflow/types.ts index 5437a7fcdd..cce561c138 100644 --- a/packages/cli/src/lib/workflow/types.ts +++ b/packages/cli/src/lib/workflow/types.ts @@ -1,4 +1,4 @@ -import { ClientConfig, InvokeResult, Uri } from "@polywrap/core-js"; +import { ClientConfig, Uri } from "@polywrap/core-js"; export interface Step { uri: string | Uri; @@ -15,7 +15,9 @@ export enum JobStatus { SKIPPED = "SKIPPED", } -export interface JobResult extends InvokeResult { +export interface JobResult { + data?: TData; + error?: Error; status: JobStatus; } diff --git a/packages/js/asyncify/src/AsyncWasmInstance.ts b/packages/js/asyncify/src/AsyncWasmInstance.ts index f43845cf93..6d4e6bc018 100644 --- a/packages/js/asyncify/src/AsyncWasmInstance.ts +++ b/packages/js/asyncify/src/AsyncWasmInstance.ts @@ -40,7 +40,7 @@ export class AsyncWasmInstance { private _instance: WasmInstance; private _wrappedImports: WasmImports; private _wrappedExports: AsyncifyExports; - private _returnValue: Promise | unknown; + private _importFnResult: Promise | unknown; private constructor() {} @@ -190,19 +190,19 @@ export class AsyncWasmInstance { ); } - private _wrapImportFn(fn: Function) { + private _wrapImportFn(importFn: Function) { return (...args: unknown[]) => { if (this._getAsyncifyState() === AsyncifyState.Rewinding) { this._wrappedExports.asyncify_stop_rewind(); - return this._returnValue; + return this._importFnResult; } this._assertNoneState(); - const value = fn(...args); + const value = importFn(...args); if (!isPromise(value)) { return value; } this._wrappedExports.asyncify_start_unwind(AsyncWasmInstance._dataAddr); - this._returnValue = value; + this._importFnResult = value; }; } @@ -223,18 +223,18 @@ export class AsyncWasmInstance { return newExports; } - private _wrapExportFn(fn: Function) { + private _wrapExportFn(exportFn: Function) { return async (...args: unknown[]) => { this._assertNoneState(); - let result = fn(...args); + let result = exportFn(...args); while (this._getAsyncifyState() === AsyncifyState.Unwinding) { this._wrappedExports.asyncify_stop_unwind(); - this._returnValue = await this._returnValue; + this._importFnResult = await this._importFnResult; this._assertNoneState(); this._wrappedExports.asyncify_start_rewind(AsyncWasmInstance._dataAddr); - result = fn(); + result = exportFn(); } this._assertNoneState(); diff --git a/packages/js/client/package.json b/packages/js/client/package.json index e86a5fcb01..a6777eeb94 100644 --- a/packages/js/client/package.json +++ b/packages/js/client/package.json @@ -40,15 +40,13 @@ "@polywrap/uri-resolvers-js": "0.8.0", "@polywrap/wrap-manifest-types-js": "0.8.0", "graphql": "15.5.0", - "js-yaml": "3.14.0", - "uuid": "8.3.2" + "yaml": "2.1.3" }, "devDependencies": { "@polywrap/os-js": "0.8.0", "@polywrap/test-cases": "0.8.0", "@polywrap/test-env-js": "0.8.0", "@types/jest": "26.0.8", - "@types/js-yaml": "3.11.1", "@types/prettier": "2.6.0", "@types/uuid": "8.3.0", "bignumber.js": "9.0.2", diff --git a/packages/js/client/src/PolywrapClient.ts b/packages/js/client/src/PolywrapClient.ts index 991d7fbf5b..01d8fd58b2 100644 --- a/packages/js/client/src/PolywrapClient.ts +++ b/packages/js/client/src/PolywrapClient.ts @@ -1,22 +1,17 @@ -import { v4 as uuid } from "uuid"; +import { UriResolverError } from "./UriResolverError"; + import { Wrapper, Client, ClientConfig, Env, - GetEnvsOptions, GetFileOptions, GetImplementationsOptions, - GetInterfacesOptions, - GetPluginsOptions, - GetRedirectsOptions, InterfaceImplementations, InvokeOptions, - InvokeResult, InvokerOptions, PluginRegistration, QueryOptions, - QueryResult, SubscribeOptions, Subscription, Uri, @@ -26,32 +21,32 @@ import { parseQuery, TryResolveUriOptions, IUriResolver, - GetUriResolverOptions, - Contextualized, GetManifestOptions, - GetPluginOptions, - initWrapper, - IWrapPackage, IUriResolutionContext, UriPackageOrWrapper, UriResolutionContext, getEnvFromUriHistory, PluginPackage, + QueryResult, + InvokeResult, } from "@polywrap/core-js"; import { buildCleanUriHistory, IWrapperCache, } from "@polywrap/uri-resolvers-js"; import { msgpackEncode, msgpackDecode } from "@polywrap/msgpack-js"; -import { WrapManifest } from "@polywrap/wrap-manifest-types-js"; +import { + DeserializeManifestOptions, + WrapManifest, +} from "@polywrap/wrap-manifest-types-js"; import { Tracer, TracerConfig, TracingLevel } from "@polywrap/tracing-js"; import { ClientConfigBuilder } from "@polywrap/client-config-builder-js"; -import { Result } from "@polywrap/result"; +import { Result, ResultErr, ResultOk } from "@polywrap/result"; export interface PolywrapClientConfig extends ClientConfig { - tracerConfig: Partial; - wrapperCache?: IWrapperCache; + readonly tracerConfig: Readonly>; + readonly wrapperCache?: Readonly; } export class PolywrapClient implements Client { @@ -63,9 +58,6 @@ export class PolywrapClient implements Client { tracerConfig: {}, } as unknown) as PolywrapClientConfig; - // Invoke specific contexts - private _contexts: Map> = new Map(); - constructor( config?: Partial>, options?: { noDefaults?: boolean } @@ -109,66 +101,62 @@ export class PolywrapClient implements Client { } } + public getConfig(): PolywrapClientConfig { + return this._config; + } + public setTracingEnabled(tracerConfig?: Partial): void { if (tracerConfig?.consoleEnabled || tracerConfig?.httpEnabled) { Tracer.enableTracing("PolywrapClient", tracerConfig); } else { Tracer.disableTracing(); } - this._config.tracerConfig = tracerConfig ?? {}; + this._config = { + ...this._config, + tracerConfig: tracerConfig ?? {}, + }; } @Tracer.traceMethod("PolywrapClient: getRedirects") - public getRedirects( - options: GetRedirectsOptions = {} - ): readonly UriRedirect[] { - return this._getConfig(options.contextId).redirects; + public getRedirects(): readonly UriRedirect[] { + return this._config.redirects; } @Tracer.traceMethod("PolywrapClient: getPlugins") - public getPlugins( - options: GetPluginsOptions = {} - ): readonly PluginRegistration[] { - return this._getConfig(options.contextId).plugins; + public getPlugins(): readonly PluginRegistration[] { + return this._config.plugins; } @Tracer.traceMethod("PolywrapClient: getPlugin") public getPluginByUri( - uri: TUri, - options: GetPluginOptions = {} + uri: TUri ): PluginPackage | undefined { - return this.getPlugins(options).find((x) => - Uri.equals(x.uri, Uri.from(uri)) - )?.plugin; + return this.getPlugins().find((x) => Uri.equals(x.uri, Uri.from(uri))) + ?.plugin; } @Tracer.traceMethod("PolywrapClient: getInterfaces") - public getInterfaces( - options: GetInterfacesOptions = {} - ): readonly InterfaceImplementations[] { - return this._getConfig(options.contextId).interfaces; + public getInterfaces(): readonly InterfaceImplementations[] { + return this._config.interfaces; } @Tracer.traceMethod("PolywrapClient: getEnvs") - public getEnvs(options: GetEnvsOptions = {}): readonly Env[] { - return this._getConfig(options.contextId).envs; + public getEnvs(): readonly Env[] { + return this._config.envs; } @Tracer.traceMethod("PolywrapClient: getUriResolver") - public getUriResolver( - options: GetUriResolverOptions = {} - ): IUriResolver { - return this._getConfig(options.contextId).resolver; + public getUriResolver(): IUriResolver { + return this._config.resolver; } @Tracer.traceMethod("PolywrapClient: getEnvByUri") public getEnvByUri( - uri: TUri, - options: GetEnvsOptions + uri: TUri ): Env | undefined { const uriUri = Uri.from(uri); - return this.getEnvs(options).find((environment) => + return this.getEnvs().find((environment) => Uri.equals(environment.uri, uriUri) ); } @@ -177,41 +165,54 @@ export class PolywrapClient implements Client { public async getManifest( uri: TUri, options: GetManifestOptions = {} - ): Promise { - const wrapper = await this._loadWrapper(Uri.from(uri), undefined, options); - const client = contextualizeClient(this, options.contextId); - return await wrapper.getManifest(options, client); + ): Promise> { + const load = await this.loadWrapper(Uri.from(uri), undefined); + if (!load.ok) { + return load; + } + const wrapper = load.value; + const manifest = wrapper.getManifest(options); + + return ResultOk(manifest); } @Tracer.traceMethod("PolywrapClient: getFile") public async getFile( uri: TUri, options: GetFileOptions - ): Promise { - const wrapper = await this._loadWrapper(Uri.from(uri), undefined, options); - const client = contextualizeClient(this, options.contextId); - return await wrapper.getFile(options, client); + ): Promise> { + const load = await this.loadWrapper(Uri.from(uri), undefined); + if (!load.ok) { + return load; + } + const wrapper = load.value; + + return await wrapper.getFile(options); } @Tracer.traceMethod("PolywrapClient: getImplementations") public getImplementations( uri: TUri, options: GetImplementationsOptions = {} - ): TUri[] { + ): Result { const isUriTypeString = typeof uri === "string"; const applyRedirects = !!options.applyRedirects; - return isUriTypeString - ? (getImplementations( - Uri.from(uri), - this.getInterfaces(options), - applyRedirects ? this.getRedirects(options) : undefined - ).map((x: Uri) => x.uri) as TUri[]) - : (getImplementations( - Uri.from(uri), - this.getInterfaces(options), - applyRedirects ? this.getRedirects(options) : undefined - ) as TUri[]); + const getImplResult = getImplementations( + Uri.from(uri), + this.getInterfaces(), + applyRedirects ? this.getRedirects() : undefined + ); + + if (!getImplResult.ok) { + return getImplResult; + } + + const uris = isUriTypeString + ? (getImplResult.value.map((x: Uri) => x.uri) as TUri[]) + : (getImplResult.value as TUri[]); + + return ResultOk(uris); } @Tracer.traceMethod("PolywrapClient: query", TracingLevel.High) @@ -219,17 +220,10 @@ export class PolywrapClient implements Client { TData extends Record = Record, TVariables extends Record = Record, TUri extends Uri | string = string - >( - options: QueryOptions - ): Promise> { - const { contextId, shouldClearContext } = this._setContext( - options.contextId, - options.config - ); - + >(options: QueryOptions): Promise> { let result: QueryResult; - try { + err: try { const typedOptions: QueryOptions = { ...options, uri: Uri.from(options.uri), @@ -242,7 +236,12 @@ export class PolywrapClient implements Client { typeof query === "string" ? createQueryDocument(query) : query; // Parse the query to understand what's being invoked - const queryInvocations = parseQuery(uri, queryDocument, variables); + const parseResult = parseQuery(uri, queryDocument, variables); + if (!parseResult.ok) { + result = { errors: [parseResult.error as Error] }; + break err; + } + const queryInvocations = parseResult.value; // Execute all invocations in parallel const parallelInvocations: Promise<{ @@ -255,7 +254,6 @@ export class PolywrapClient implements Client { this.invoke({ ...queryInvocations[invocationName], uri: queryInvocations[invocationName].uri, - contextId, }).then((result) => ({ name: invocationName, result, @@ -273,9 +271,10 @@ export class PolywrapClient implements Client { const errors: Error[] = []; for (const invocation of invocationResults) { - data[invocation.name] = invocation.result.data; - if (invocation.result.error) { - errors.push(invocation.result.error); + if (invocation.result.ok) { + data[invocation.name] = invocation.result.value; + } else { + errors.push(invocation.result.error as Error); } } @@ -291,9 +290,6 @@ export class PolywrapClient implements Client { } } - if (shouldClearContext) { - this._clearContext(contextId); - } return result; } @@ -302,123 +298,92 @@ export class PolywrapClient implements Client { TData = unknown, TUri extends Uri | string = string >( - options: InvokerOptions & { wrapper: Wrapper } + options: InvokerOptions & { wrapper: Wrapper } ): Promise> { - const { contextId, shouldClearContext } = this._setContext( - options.contextId, - options.config - ); - - let error: Error | undefined; - try { const typedOptions: InvokeOptions = { ...options, - contextId: contextId, uri: Uri.from(options.uri), }; const wrapper = options.wrapper; - const invocableResult = await wrapper.invoke( - typedOptions, - contextualizeClient(this, contextId) - ); + const invocableResult = await wrapper.invoke(typedOptions, this); - if (invocableResult.data !== undefined) { - if (options.encodeResult && !invocableResult.encoded) { - return { - data: (msgpackEncode(invocableResult.data) as unknown) as TData, - }; - } else if (invocableResult.encoded && !options.encodeResult) { - return { - data: msgpackDecode(invocableResult.data as Uint8Array) as TData, - }; - } else { - return { - data: invocableResult.data as TData, - }; - } - } else { - error = invocableResult.error; + if (!invocableResult.ok) { + return ResultErr(invocableResult.error); } - } catch (e) { - error = e; - } - if (shouldClearContext) { - this._clearContext(contextId); - } + const value = invocableResult.value; - return { error }; + if (options.encodeResult && !invocableResult.encoded) { + const encoded = msgpackEncode(value); + return ResultOk((encoded as unknown) as TData); + } else if (invocableResult.encoded && !options.encodeResult) { + const decoded = msgpackDecode(value as Uint8Array); + return ResultOk(decoded as TData); + } else { + return ResultOk(value as TData); + } + } catch (error) { + return ResultErr(error); + } } @Tracer.traceMethod("PolywrapClient: invoke") public async invoke( - options: InvokerOptions + options: InvokerOptions ): Promise> { - const { contextId, shouldClearContext } = this._setContext( - options.contextId, - options.config - ); - - let error: Error | undefined; - try { const typedOptions: InvokeOptions = { ...options, - contextId: contextId, uri: Uri.from(options.uri), }; const resolutionContext = options.resolutionContext ?? new UriResolutionContext(); - const wrapper = await this._loadWrapper( + const loadWrapperResult = await this.loadWrapper( typedOptions.uri, - resolutionContext, - { contextId } + resolutionContext ); - - const client = contextualizeClient(this, contextId); + if (!loadWrapperResult.ok) { + return ResultErr(loadWrapperResult.error); + } + const wrapper = loadWrapperResult.value; const env = getEnvFromUriHistory( resolutionContext.getResolutionPath(), - client + this ); - return await client.invokeWrapper({ + const invokeResult = await this.invokeWrapper({ env: env?.env, ...typedOptions, wrapper, }); - } catch (e) { - error = e; - } - if (shouldClearContext) { - this._clearContext(contextId); - } + if (!invokeResult.ok) { + return ResultErr(invokeResult.error); + } - return { error }; + return invokeResult; + } catch (error) { + return ResultErr(error); + } } @Tracer.traceMethod("PolywrapClient: subscribe") public subscribe( - options: SubscribeOptions + options: SubscribeOptions ): Subscription { - const { contextId, shouldClearContext } = this._setContext( - options.contextId, - options.config - ); // eslint-disable-next-line @typescript-eslint/no-this-alias const thisClient: PolywrapClient = this; - const client = contextualizeClient(this, contextId); const typedOptions: SubscribeOptions = { ...options, uri: Uri.from(options.uri), }; - const { uri, method, args, config, frequency: freq } = typedOptions; + const { uri, method, args, frequency: freq } = typedOptions; // calculate interval between invokes, in milliseconds, 1 min default value /* eslint-disable prettier/prettier */ @@ -437,9 +402,6 @@ export class PolywrapClient implements Client { frequency: frequency, isActive: false, stop(): void { - if (shouldClearContext) { - thisClient._clearContext(contextId); - } subscription.isActive = false; }, async *[Symbol.asyncIterator](): AsyncGenerator> { @@ -468,12 +430,10 @@ export class PolywrapClient implements Client { break; } - const result: InvokeResult = await client.invoke({ + const result = await thisClient.invoke({ uri: uri, method: method, args: args, - config: config, - contextId, }); yield result; @@ -483,9 +443,6 @@ export class PolywrapClient implements Client { if (timeout) { clearInterval(timeout); } - if (shouldClearContext) { - thisClient._clearContext(contextId); - } subscription.isActive = false; } }, @@ -500,28 +457,17 @@ export class PolywrapClient implements Client { ): Promise> { const uri = Uri.from(options.uri); - const { contextId, shouldClearContext } = this._setContext( - options.contextId, - options.config - ); - - const client = contextualizeClient(this, contextId); - - const uriResolver = this.getUriResolver({ contextId: contextId }); + const uriResolver = this.getUriResolver(); const resolutionContext = options.resolutionContext ?? new UriResolutionContext(); const response = await uriResolver.tryResolveUri( uri, - client, + this, resolutionContext ); - if (shouldClearContext) { - this._clearContext(contextId); - } - if (options.resolutionContext) { Tracer.setAttribute( "label", @@ -533,99 +479,12 @@ export class PolywrapClient implements Client { return response; } - @Tracer.traceMethod("PolywrapClient: getConfig") - private _getConfig(contextId?: string): Readonly> { - if (contextId) { - const context = this._contexts.get(contextId); - if (!context) { - throw new Error(`No invoke context found with id: ${contextId}`); - } - - return context; - } else { - return this._config; - } - } - - @Tracer.traceMethod("PolywrapClient: validateConfig") - private _validateConfig(): void { - // Require plugins to use non-interface URIs - const pluginUris = this.getPlugins().map((x) => x.uri.uri); - const interfaceUris = this.getInterfaces().map((x) => x.interface.uri); - - const pluginsWithInterfaceUris = pluginUris.filter((plugin) => - interfaceUris.includes(plugin) - ); - - if (pluginsWithInterfaceUris.length) { - throw Error( - `Plugins can't use interfaces for their URI. Invalid plugins: ${pluginsWithInterfaceUris}` - ); - } - } - - /** - * Sets invoke context: - * 1. !parentId && !context -> do nothing - * 2. parentId && !context -> do nothing, use parent context ID - * 3. !parentId && context -> create context ID, default config as "base", cache context - * 4. parentId && context -> create context ID, parent config as "base", cache context - */ - @Tracer.traceMethod("PolywrapClient: setContext") - private _setContext( - parentId: string | undefined, - context: Partial | undefined - ): { - contextId: string | undefined; - shouldClearContext: boolean; - } { - if (!context) { - return { - contextId: parentId, - shouldClearContext: false, - }; - } - - const parentConfig = this._getConfig(parentId); - - const id = uuid(); - - const config = new ClientConfigBuilder() - .add({ - envs: context.envs ?? parentConfig.envs, - interfaces: context.interfaces ?? parentConfig.interfaces, - plugins: context.plugins ?? parentConfig.plugins, - redirects: context.redirects ?? parentConfig.redirects, - resolver: context.resolver ?? parentConfig.resolver, - }) - .build(); - - const newContext = { - ...config, - tracerConfig: context.tracerConfig ?? parentConfig.tracerConfig, - }; - - this._contexts.set(id, newContext); - - return { - contextId: id, - shouldClearContext: true, - }; - } - - @Tracer.traceMethod("PolywrapClient: clearContext") - private _clearContext(contextId: string | undefined): void { - if (contextId) { - this._contexts.delete(contextId); - } - } - - @Tracer.traceMethod("PolywrapClient: _loadWrapper", TracingLevel.High) - private async _loadWrapper( + @Tracer.traceMethod("PolywrapClient: loadWrapper", TracingLevel.High) + public async loadWrapper( uri: Uri, resolutionContext?: IUriResolutionContext, - options?: Contextualized - ): Promise { + options?: DeserializeManifestOptions + ): Promise> { Tracer.setAttribute("label", `Wrapper loaded: ${uri}`, TracingLevel.High); if (!resolutionContext) { @@ -635,19 +494,22 @@ export class PolywrapClient implements Client { const result = await this.tryResolveUri({ uri, resolutionContext, - contextId: options?.contextId, }); if (!result.ok) { if (result.error) { - throw result.error; + return ResultErr(new UriResolverError(result.error, resolutionContext)); } else { - throw Error( - `Error resolving URI "${uri.uri}"\nResolution Stack: ${JSON.stringify( - resolutionContext.getHistory(), - null, - 2 - )}` + return ResultErr( + Error( + `Error resolving URI "${ + uri.uri + }"\nResolution Stack: ${JSON.stringify( + buildCleanUriHistory(resolutionContext.getHistory()), + null, + 2 + )}` + ) ); } } @@ -655,106 +517,45 @@ export class PolywrapClient implements Client { const uriPackageOrWrapper = result.value; if (uriPackageOrWrapper.type === "uri") { - throw Error( + const error = Error( `Error resolving URI "${uri.uri}"\nURI not found ${ uriPackageOrWrapper.uri.uri - }\nResolution Stack: ${JSON.stringify(history, null, 2)}` + }\nResolution Stack: ${JSON.stringify( + buildCleanUriHistory(resolutionContext.getHistory()), + null, + 2 + )}` ); + return ResultErr(error); } - let packageOrWrapper: IWrapPackage | Wrapper; - if (uriPackageOrWrapper.type === "package") { - packageOrWrapper = uriPackageOrWrapper.package; + const result = await uriPackageOrWrapper.package.createWrapper(options); + + if (!result.ok) { + return result; + } + + return ResultOk(result.value); } else { - packageOrWrapper = uriPackageOrWrapper.wrapper; + return ResultOk(uriPackageOrWrapper.wrapper); } + } - const wrapper = await initWrapper(packageOrWrapper); + @Tracer.traceMethod("PolywrapClient: validateConfig") + private _validateConfig(): void { + // Require plugins to use non-interface URIs + const pluginUris = this.getPlugins().map((x) => x.uri.uri); + const interfaceUris = this.getInterfaces().map((x) => x.interface.uri); - return wrapper; + const pluginsWithInterfaceUris = pluginUris.filter((plugin) => + interfaceUris.includes(plugin) + ); + + if (pluginsWithInterfaceUris.length) { + throw Error( + `Plugins can't use interfaces for their URI. Invalid plugins: ${pluginsWithInterfaceUris}` + ); + } } } - -const contextualizeClient = ( - client: PolywrapClient, - contextId: string | undefined -): Client => - contextId - ? { - query: < - TData extends Record = Record, - TVariables extends Record = Record, - TUri extends Uri | string = string - >( - options: QueryOptions - ): Promise> => { - return client.query({ ...options, contextId }); - }, - invokeWrapper: ( - options: InvokeOptions & { wrapper: Wrapper } - ): Promise> => { - return client.invokeWrapper({ ...options, contextId }); - }, - invoke: ( - options: InvokeOptions - ): Promise> => { - return client.invoke({ ...options, contextId }); - }, - subscribe: ( - options: SubscribeOptions - ): Subscription => { - return client.subscribe({ ...options, contextId }); - }, - getRedirects: (options: GetRedirectsOptions = {}) => { - return client.getRedirects({ ...options, contextId }); - }, - getPlugins: (options: GetPluginsOptions = {}) => { - return client.getPlugins({ ...options, contextId }); - }, - getPluginByUri: ( - uri: TUri, - options: GetPluginOptions = {} - ) => { - return client.getPluginByUri(uri, { ...options, contextId }); - }, - getInterfaces: (options: GetInterfacesOptions = {}) => { - return client.getInterfaces({ ...options, contextId }); - }, - getEnvs: (options: GetEnvsOptions = {}) => { - return client.getEnvs({ ...options, contextId }); - }, - getUriResolver: (options: GetUriResolverOptions = {}) => { - return client.getUriResolver({ ...options, contextId }); - }, - getEnvByUri: ( - uri: TUri, - options: GetEnvsOptions = {} - ) => { - return client.getEnvByUri(uri, { ...options, contextId }); - }, - getFile: ( - uri: TUri, - options: GetFileOptions - ) => { - return client.getFile(uri, { ...options, contextId }); - }, - getManifest: ( - uri: TUri, - options: GetManifestOptions = {} - ) => { - return client.getManifest(uri, { ...options, contextId }); - }, - getImplementations: ( - uri: TUri, - options: GetImplementationsOptions = {} - ) => { - return client.getImplementations(uri, { ...options, contextId }); - }, - tryResolveUri: ( - options: TryResolveUriOptions - ): Promise> => { - return client.tryResolveUri({ ...options, contextId }); - }, - } - : client; diff --git a/packages/js/client/src/UriResolverError.ts b/packages/js/client/src/UriResolverError.ts new file mode 100644 index 0000000000..5b41a2cacf --- /dev/null +++ b/packages/js/client/src/UriResolverError.ts @@ -0,0 +1,19 @@ +import { IUriResolutionContext } from "@polywrap/core-js"; +import { buildCleanUriHistory } from "@polywrap/uri-resolvers-js"; + +export class UriResolverError< + TError extends unknown = undefined +> extends Error { + constructor( + public readonly resolverError: TError, + resolutionContext: IUriResolutionContext + ) { + super( + `An internal resolver error occurred while resolving a URI.\nResolution Stack: ${JSON.stringify( + buildCleanUriHistory(resolutionContext.getHistory()), + null, + 2 + )}` + ); + } +} diff --git a/packages/js/client/src/__tests__/core/interface-impls.spec.ts b/packages/js/client/src/__tests__/core/interface-impls.spec.ts index 080728d408..4ef005e719 100644 --- a/packages/js/client/src/__tests__/core/interface-impls.spec.ts +++ b/packages/js/client/src/__tests__/core/interface-impls.spec.ts @@ -38,7 +38,8 @@ describe("interface-impls", () => { const implementations = client.getImplementations(interfaceUri); - expect(implementations).toEqual([implementation1Uri, implementation2Uri]); + if (!implementations.ok) fail(implementations.error); + expect(implementations.value).toEqual([implementation1Uri, implementation2Uri]); }); it("should get all implementations of interface", async () => { @@ -101,19 +102,22 @@ describe("interface-impls", () => { applyRedirects: true, }); - expect(implementations1).toEqual([ + if (!implementations1.ok) fail(implementations1.error); + expect(implementations1.value).toEqual([ implementation1Uri, implementation2Uri, implementation3Uri, ]); - expect(implementations2).toEqual([ + if (!implementations2.ok) fail(implementations2.error); + expect(implementations2.value).toEqual([ implementation1Uri, implementation2Uri, implementation3Uri, ]); - expect(implementations3).toEqual([implementation3Uri, implementation4Uri]); + if (!implementations3.ok) fail(implementations3.error); + expect(implementations3.value).toEqual([implementation3Uri, implementation4Uri]); }); it("should not register plugins with an interface uri (without default plugins)", () => { @@ -291,7 +295,8 @@ describe("interface-impls", () => { { applyRedirects: true } ); - expect(getImplementationsResult).toEqual([new Uri(implementation2Uri)]); + if (!getImplementationsResult.ok) fail(getImplementationsResult.error); + expect(getImplementationsResult.value).toEqual([new Uri(implementation2Uri)]); }); test("get implementations - return implementations for plugins which don't have interface stated in manifest", () => { @@ -323,7 +328,8 @@ describe("interface-impls", () => { { applyRedirects: true } ); - expect(getImplementationsResult).toEqual([ + if (!getImplementationsResult.ok) fail(getImplementationsResult.error); + expect(getImplementationsResult.value).toEqual([ new Uri(implementation1Uri), new Uri(implementation2Uri), ]); @@ -356,20 +362,24 @@ describe("interface-impls", () => { }); let result = client.getImplementations(oldInterfaceUri); - expect(result).toEqual([implementation1Uri]); + if (!result.ok) fail(result.error); + expect(result.value).toEqual([implementation1Uri]); result = client.getImplementations(oldInterfaceUri, { applyRedirects: true, }); - expect(result).toEqual([implementation1Uri, implementation2Uri]); + if (!result.ok) fail(result.error); + expect(result.value).toEqual([implementation1Uri, implementation2Uri]); let result2 = client.getImplementations(new Uri(oldInterfaceUri)); - expect(result2).toEqual([new Uri(implementation1Uri)]); + if (!result2.ok) fail(result2.error); + expect(result2.value).toEqual([new Uri(implementation1Uri)]); result2 = client.getImplementations(new Uri(oldInterfaceUri), { applyRedirects: true, }); - expect(result2).toEqual([ + if (!result2.ok) fail(result2.error); + expect(result2.value).toEqual([ new Uri(implementation1Uri), new Uri(implementation2Uri), ]); diff --git a/packages/js/client/src/__tests__/core/plugin-wrapper.spec.ts b/packages/js/client/src/__tests__/core/plugin-wrapper.spec.ts index 8d9a375bba..2158650136 100644 --- a/packages/js/client/src/__tests__/core/plugin-wrapper.spec.ts +++ b/packages/js/client/src/__tests__/core/plugin-wrapper.spec.ts @@ -84,9 +84,9 @@ describe("plugin-wrapper", () => { method: "getMap", }); - expect(getResult.error).toBeFalsy(); - expect(getResult.data).toBeTruthy(); - expect(getResult.data).toMatchObject( + if (!getResult.ok) fail(getResult.error); + expect(getResult.value).toBeTruthy(); + expect(getResult.value).toMatchObject( new Map().set("a", 1).set("b", 2) ); @@ -98,9 +98,9 @@ describe("plugin-wrapper", () => { }, }); - expect(updateResult.error).toBeFalsy(); - expect(updateResult.data).toBeTruthy(); - expect(updateResult.data).toMatchObject( + if (!updateResult.ok) fail(updateResult.error); + expect(updateResult.value).toBeTruthy(); + expect(updateResult.value).toMatchObject( new Map().set("a", 1).set("b", 3).set("c", 5) ); }); @@ -203,7 +203,8 @@ describe("plugin-wrapper", () => { test("get manifest should fetch wrap manifest from plugin", async () => { const client = await getClient(); const manifest = await client.getManifest("ens/ipfs.polywrap.eth"); - expect(manifest.type).toEqual("plugin"); - expect(manifest.name).toEqual("Ipfs"); + if (!manifest.ok) fail(manifest.error); + expect(manifest.value.type).toEqual("plugin"); + expect(manifest.value.name).toEqual("Ipfs"); }); }); diff --git a/packages/js/client/src/__tests__/core/uri-resolution/uri-resolution.spec.ts b/packages/js/client/src/__tests__/core/uri-resolution/uri-resolution.spec.ts index 604184ba3f..e99d68aaff 100644 --- a/packages/js/client/src/__tests__/core/uri-resolution/uri-resolution.spec.ts +++ b/packages/js/client/src/__tests__/core/uri-resolution/uri-resolution.spec.ts @@ -1,7 +1,7 @@ -import { Uri } from "../../../../"; import { buildWrapper } from "@polywrap/test-env-js"; import { GetPathToTestWrappers } from "@polywrap/test-cases"; import { + Uri, coreInterfaceUris, IUriResolutionStep, PluginModule, @@ -360,23 +360,22 @@ describe("URI resolution", () => { const fromUri = new Uri(`ens/from.eth`); const redirectUri = new Uri(`ens/to.eth`); - const client = await getClient(); + const client = await getClient({ + resolver: { + tryResolveUri: async (uri: Uri) => { + if (uri.uri === fromUri.uri) { + return UriResolutionResult.ok(redirectUri); + } - const result = await client.tryResolveUri({ - uri: fromUri, - config: { - resolver: { - tryResolveUri: async (uri: Uri) => { - if (uri.uri === fromUri.uri) { - return UriResolutionResult.ok(redirectUri); - } - - return UriResolutionResult.ok(uri); - }, + return UriResolutionResult.ok(uri); }, }, }); + const result = await client.tryResolveUri({ + uri: fromUri + }); + expect(result).toEqual(UriResolutionResult.ok(redirectUri)); }); diff --git a/packages/js/client/src/__tests__/core/wasm-wrapper.spec.ts b/packages/js/client/src/__tests__/core/wasm-wrapper.spec.ts index d6a603cf83..38a12215ca 100644 --- a/packages/js/client/src/__tests__/core/wasm-wrapper.spec.ts +++ b/packages/js/client/src/__tests__/core/wasm-wrapper.spec.ts @@ -2,10 +2,12 @@ import { buildWrapper } from "@polywrap/test-env-js"; import { msgpackDecode } from "@polywrap/msgpack-js"; import { GetPathToTestWrappers } from "@polywrap/test-cases"; import fs from "fs"; -import { Uri, PluginModule, Subscription } from "../.."; +import { Uri, PluginModule, Subscription, PolywrapClient } from "../.."; import { WrapManifest } from "@polywrap/wrap-manifest-types-js"; import { getClient } from "../utils/getClient"; import { makeMemoryStoragePlugin } from "../e2e/memory-storage"; +import { ErrResult } from "../utils/resultTypes"; +import { ClientConfigBuilder } from "@polywrap/client-config-builder-js"; jest.setTimeout(200000); @@ -46,10 +48,10 @@ describe("wasm-wrapper", () => { }, }); - expect(result.error).toBeFalsy(); - expect(result.data).toBeTruthy(); - expect(typeof result.data).toBe("string"); - expect(result.data).toEqual("test"); + if (!result.ok) fail(result.error); + expect(result.value).toBeTruthy(); + expect(typeof result.value).toBe("string"); + expect(result.value).toEqual("test"); }); test("can invoke with typed URI", async () => { @@ -62,10 +64,10 @@ describe("wasm-wrapper", () => { }, }); - expect(result.error).toBeFalsy(); - expect(result.data).toBeTruthy(); - expect(typeof result.data).toBe("string"); - expect(result.data).toEqual("test"); + if (!result.ok) fail(result.error); + expect(result.value).toBeTruthy(); + expect(typeof result.value).toBe("string"); + expect(result.value).toEqual("test"); }); test("invoke with decode defaulted to true works as expected", async () => { @@ -78,10 +80,10 @@ describe("wasm-wrapper", () => { }, }); - expect(result.error).toBeFalsy(); - expect(result.data).toBeTruthy(); - expect(typeof result.data).toBe("string"); - expect(result.data).toEqual("test"); + if (!result.ok) fail(result.error); + expect(result.value).toBeTruthy(); + expect(typeof result.value).toBe("string"); + expect(result.value).toEqual("test"); }); test("invoke with decode set to false works as expected", async () => { @@ -95,10 +97,10 @@ describe("wasm-wrapper", () => { encodeResult: true, }); - expect(result.error).toBeFalsy(); - expect(result.data).toBeTruthy(); - expect(result.data instanceof Uint8Array).toBeTruthy(); - expect(msgpackDecode(result.data as Uint8Array)).toEqual("test"); + if (!result.ok) fail(result.error); + expect(result.value).toBeTruthy(); + expect(result.value instanceof Uint8Array).toBeTruthy(); + expect(msgpackDecode(result.value as Uint8Array)).toEqual("test"); }); it("should invoke wrapper with custom redirects", async () => { @@ -125,11 +127,12 @@ describe("wasm-wrapper", () => { }, }); - expect(result.data).toBeTruthy(); - expect(result.data).toEqual("plugin response"); + if (!result.ok) fail(result.error); + expect(result.value).toBeTruthy(); + expect(result.value).toEqual("plugin response"); }); - it("should allow query time redirects", async () => { + it("should allow clone + reconfigure of redirects", async () => { const client = await getClient({ plugins: [ { @@ -146,19 +149,26 @@ describe("wasm-wrapper", () => { }, ]; - const result = await client.invoke({ + const newConfig = new ClientConfigBuilder() + .add(client.getConfig()) + .add({ redirects }) + .build(); + + const newClient = new PolywrapClient( + newConfig + ); + + const result = await newClient.invoke({ uri: simpleWrapperUri.uri, method: "simpleMethod", args: { arg: "test", - }, - config: { - redirects, - }, + } }); - expect(result.data).toBeTruthy(); - expect(result.data).toEqual("plugin response"); + if (!result.ok) fail(result.error); + expect(result.value).toBeTruthy(); + expect(result.value).toEqual("plugin response"); }); test("get file from wrapper", async () => { @@ -168,12 +178,14 @@ describe("wasm-wrapper", () => { await fs.promises.readFile(`${simpleWrapperPath}/build/wrap.info`) ); - const receivedManifest: Uint8Array = (await client.getFile( + const receivedManifestResult = await client.getFile( simpleWrapperUri, { path: "./wrap.info", } - )) as Uint8Array; + ); + if (!receivedManifestResult.ok) fail(receivedManifestResult.error); + const receivedManifest = receivedManifestResult.value as Uint8Array; expect(receivedManifest).toEqual(expectedManifest); @@ -181,12 +193,14 @@ describe("wasm-wrapper", () => { await fs.promises.readFile(`${simpleWrapperPath}/build/wrap.wasm`) ); - const receivedWasmModule: Uint8Array = (await client.getFile( + const receivedWasmModuleResult = await client.getFile( simpleWrapperUri, { path: "./wrap.wasm", } - )) as Uint8Array; + ); + if (!receivedWasmModuleResult.ok) fail(receivedWasmModuleResult.error); + const receivedWasmModule = receivedWasmModuleResult.value as Uint8Array; expect(receivedWasmModule).toEqual(expectedWasmModule); @@ -202,11 +216,12 @@ describe("wasm-wrapper", () => { ], }); - await expect(() => - pluginClient.getFile("ens/mock-plugin.eth", { - path: "./index.js", - }) - ).rejects.toThrow("client.getFile(...) is not implemented for Plugins."); + let pluginGetFileResult = await pluginClient.getFile("ens/mock-plugin.eth", { + path: "./index.js", + }); + + pluginGetFileResult = pluginGetFileResult as ErrResult; + expect(pluginGetFileResult.error?.message).toContain("client.getFile(...) is not implemented for Plugins."); }); test("subscribe", async () => { @@ -243,8 +258,8 @@ describe("wasm-wrapper", () => { }); for await (let result of getSubscription) { - expect(result.error).toBeFalsy(); - const val = result.data; + if (!result.ok) fail(result.error); + const val = result.value; if (val !== undefined) { results.push(val); @@ -290,8 +305,9 @@ describe("wasm-wrapper", () => { new Promise(async () => { for await (let result of getSubscription) { - expect(result.error).toBeFalsy(); - const val = result.data; + if (!result.ok) fail(result.error); + const val = result.value; + if (val !== undefined) { results.push(val); if (val >= 2) { diff --git a/packages/js/client/src/__tests__/e2e/env.spec.ts b/packages/js/client/src/__tests__/e2e/env.spec.ts index dbb24a125a..b94e992049 100644 --- a/packages/js/client/src/__tests__/e2e/env.spec.ts +++ b/packages/js/client/src/__tests__/e2e/env.spec.ts @@ -48,9 +48,9 @@ describe("env", () => { method: "mockEnv", }); - expect(mockEnv.error).toBeFalsy(); - expect(mockEnv.data).toBeTruthy(); - expect(mockEnv.data).toMatchObject({ arg1: "10" }); + if (!mockEnv.ok) fail(mockEnv.error); + expect(mockEnv.value).toBeTruthy(); + expect(mockEnv.value).toMatchObject({ arg1: "10" }); }); }); }); diff --git a/packages/js/client/src/__tests__/e2e/test-cases.ts b/packages/js/client/src/__tests__/e2e/test-cases.ts index e3ac67c7ba..1eab2256ce 100644 --- a/packages/js/client/src/__tests__/e2e/test-cases.ts +++ b/packages/js/client/src/__tests__/e2e/test-cases.ts @@ -1,5 +1,6 @@ import { PolywrapClient, Uri } from "../../"; import { BigNumber } from "bignumber.js"; +import { ErrResult } from "../utils/resultTypes"; export const runAsyncifyTest = async ( client: PolywrapClient, @@ -15,27 +16,27 @@ export const runAsyncifyTest = async ( const expected = Array.from(new Array(40), (_, index) => index.toString()); - expect(subsequentInvokes.error).toBeFalsy(); - expect(subsequentInvokes.data).toBeTruthy(); - expect(subsequentInvokes.data).toEqual(expected); + if (!subsequentInvokes.ok) fail(subsequentInvokes.error); + expect(subsequentInvokes.value).toBeTruthy(); + expect(subsequentInvokes.value).toEqual(expected); const localVarMethod = await client.invoke({ uri: wrapperUri, method: "localVarMethod", }); - expect(localVarMethod.error).toBeFalsy(); - expect(localVarMethod.data).toBeTruthy(); - expect(localVarMethod.data).toEqual(true); + if (!localVarMethod.ok) fail(localVarMethod.error); + expect(localVarMethod.value).toBeTruthy(); + expect(localVarMethod.value).toEqual(true); const globalVarMethod = await client.invoke({ uri: wrapperUri, method: "globalVarMethod", }); - expect(globalVarMethod.error).toBeFalsy(); - expect(globalVarMethod.data).toBeTruthy(); - expect(globalVarMethod.data).toEqual(true); + if (!globalVarMethod.ok) fail(globalVarMethod.error); + expect(globalVarMethod.value).toBeTruthy(); + expect(globalVarMethod.value).toEqual(true); const largeStr = new Array(10000).join("polywrap "); const setDataWithLargeArgs = await client.invoke({ @@ -46,9 +47,9 @@ export const runAsyncifyTest = async ( }, }); - expect(setDataWithLargeArgs.error).toBeFalsy(); - expect(setDataWithLargeArgs.data).toBeTruthy(); - expect(setDataWithLargeArgs.data).toEqual(largeStr); + if (!setDataWithLargeArgs.ok) fail(setDataWithLargeArgs.error); + expect(setDataWithLargeArgs.value).toBeTruthy(); + expect(setDataWithLargeArgs.value).toEqual(largeStr); const setDataWithManyArgs = await client.invoke({ uri: wrapperUri, @@ -69,9 +70,9 @@ export const runAsyncifyTest = async ( }, }); - expect(setDataWithManyArgs.error).toBeFalsy(); - expect(setDataWithManyArgs.data).toBeTruthy(); - expect(setDataWithManyArgs.data).toEqual( + if (!setDataWithManyArgs.ok) fail(setDataWithManyArgs.error); + expect(setDataWithManyArgs.value).toBeTruthy(); + expect(setDataWithManyArgs.value).toEqual( "polywrap apolywrap bpolywrap cpolywrap dpolywrap epolywrap fpolywrap gpolywrap hpolywrap ipolywrap jpolywrap kpolywrap l" ); @@ -111,9 +112,9 @@ export const runAsyncifyTest = async ( }, }); - expect(setDataWithManyStructuredArgs.error).toBeFalsy(); - expect(setDataWithManyStructuredArgs.data).toBeTruthy(); - expect(setDataWithManyStructuredArgs.data).toBe(true); + if (!setDataWithManyStructuredArgs.ok) fail(setDataWithManyStructuredArgs.error); + expect(setDataWithManyStructuredArgs.value).toBeTruthy(); + expect(setDataWithManyStructuredArgs.value).toBe(true); }; export const runBigIntTypeTest = async ( @@ -134,9 +135,9 @@ export const runBigIntTypeTest = async ( const result = BigInt("123456789123456789") * BigInt("987654321987654321"); - expect(response.error).toBeFalsy(); - expect(response.data).toBeTruthy(); - expect(response.data).toEqual(result.toString()); + if (!response.ok) fail(response.error); + expect(response.value).toBeTruthy(); + expect(response.value).toEqual(result.toString()); } { @@ -159,9 +160,9 @@ export const runBigIntTypeTest = async ( BigInt("987654321987654321") * BigInt("987654321987654321987654321987654321"); - expect(response.error).toBeFalsy(); - expect(response.data).toBeTruthy(); - expect(response.data).toEqual(result.toString()); + if (!response.ok) fail(response.error); + expect(response.value).toBeTruthy(); + expect(response.value).toEqual(result.toString()); } }; @@ -185,9 +186,9 @@ export const runBigNumberTypeTest = async ( const prop1 = new BigNumber("98.7654321987654321"); const result = arg1.times(prop1); - expect(response.error).toBeFalsy(); - expect(response.data).toBeTruthy(); - expect(response.data).toEqual(result.toFixed()); + if (!response.ok) fail(response.error); + expect(response.value).toBeTruthy(); + expect(response.value).toEqual(result.toFixed()); } { @@ -210,9 +211,9 @@ export const runBigNumberTypeTest = async ( const prop2 = new BigNumber("987.654321987654321987654321987654321"); const result = arg1.times(arg2).times(prop1).times(prop2); - expect(response.error).toBeFalsy(); - expect(response.data).toBeTruthy(); - expect(response.data).toEqual(result.toFixed()); + if (!response.ok) fail(response.error); + expect(response.value).toBeTruthy(); + expect(response.value).toEqual(result.toFixed()); } }; @@ -227,15 +228,15 @@ export const runBytesTypeTest = async (client: PolywrapClient, uri: string) => { }, }); - expect(response.error).toBeFalsy(); - expect(response.data).toBeTruthy(); - expect(response.data).toEqual( + if (!response.ok) fail(response.error); + expect(response.value).toBeTruthy(); + expect(response.value).toEqual( new TextEncoder().encode("Argument Value Sanity!") ); }; export const runEnumTypesTest = async (client: PolywrapClient, uri: string) => { - const method1a = await client.invoke({ + let method1a = await client.invoke({ uri, method: "method1", args: { @@ -243,8 +244,9 @@ export const runEnumTypesTest = async (client: PolywrapClient, uri: string) => { }, }); + method1a = method1a as ErrResult; expect(method1a.error).toBeTruthy(); - expect((method1a.error as Error).message).toMatch( + expect(method1a.error?.message).toMatch( /__wrap_abort: Invalid value for enum 'SanityEnum': 5/gm ); @@ -257,11 +259,11 @@ export const runEnumTypesTest = async (client: PolywrapClient, uri: string) => { }, }); - expect(method1b.error).toBeFalsy(); - expect(method1b.data).toBeTruthy(); - expect(method1b.data).toEqual(2); + if (!method1b.ok) fail(method1b.error); + expect(method1b.value).toBeTruthy(); + expect(method1b.value).toEqual(2); - const method1c = await client.invoke({ + let method1c = await client.invoke({ uri, method: "method1", args: { @@ -270,6 +272,7 @@ export const runEnumTypesTest = async (client: PolywrapClient, uri: string) => { }, }); + method1c = method1c as ErrResult; expect(method1c.error).toBeTruthy(); expect(method1c.error?.message).toMatch( /__wrap_abort: Invalid key for enum 'SanityEnum': INVALID/gm @@ -283,9 +286,9 @@ export const runEnumTypesTest = async (client: PolywrapClient, uri: string) => { }, }); - expect(method2a.error).toBeFalsy(); - expect(method2a.data).toBeTruthy(); - expect(method2a.data).toEqual([0, 0, 2]); + if (!method2a.ok) fail(method2a.error); + expect(method2a.value).toBeTruthy(); + expect(method2a.value).toEqual([0, 0, 2]); }; export const runImplementationsTest = async ( @@ -293,9 +296,9 @@ export const runImplementationsTest = async ( interfaceUri: string, implementationUri: string ) => { - expect(client.getImplementations(interfaceUri)).toEqual([ - new Uri(implementationUri).uri, - ]); + const implResult = client.getImplementations(interfaceUri); + if (!implResult.ok) fail(implResult.error); + expect(implResult.value).toEqual([new Uri(implementationUri).uri]); const results = await Promise.all([ client.invoke({ @@ -319,12 +322,13 @@ export const runImplementationsTest = async ( }), ]); - expect(results.filter((x) => x.error).length).toEqual(0); - expect(results[0].data).toEqual({ + const okResults = results.filter((x) => x.ok) as { ok: true, value: unknown }[]; + expect(okResults.length).toEqual(results.length); + expect(okResults[0].value).toEqual({ uint8: 1, str: "Test String 1", }); - expect(results[1].data).toBe("Test String 2"); + expect(okResults[1].value).toBe("Test String 2"); }; export const runGetImplementationsTest = async ( @@ -334,16 +338,18 @@ export const runGetImplementationsTest = async ( implementationUri: string ) => { let implUri = new Uri(implementationUri); - expect(client.getImplementations(interfaceUri)).toEqual([implUri.uri]); + const implResult = client.getImplementations(interfaceUri); + if (!implResult.ok) fail(implResult.error); + expect(implResult.value).toEqual([implUri.uri]); const result = await client.invoke({ uri: aggregatorUri, method: "moduleImplementations", }); - expect(result.error).toBeFalsy(); - expect(result.data).toBeTruthy(); - expect(result.data).toEqual([implUri.uri]); + if (!result.ok) fail(result.error); + expect(result.value).toBeTruthy(); + expect(result.value).toEqual([implUri.uri]); const moduleMethodResult = await client.invoke({ uri: aggregatorUri, @@ -354,63 +360,68 @@ export const runGetImplementationsTest = async ( }, }, }); - expect(moduleMethodResult.error).toBeFalsy(); - expect(moduleMethodResult.data).toEqual("Test String 2"); + if (!moduleMethodResult.ok) fail(moduleMethodResult.error); + expect(moduleMethodResult.value).toEqual("Test String 2"); }; export const runInvalidTypesTest = async ( client: PolywrapClient, uri: string ) => { - const invalidBoolIntSent = await client.invoke({ + let invalidBoolIntSent = await client.invoke({ uri, method: "boolMethod", args: { arg: 10, }, }); + invalidBoolIntSent = invalidBoolIntSent as { ok: false, error: Error }; expect(invalidBoolIntSent.error).toBeTruthy(); expect(invalidBoolIntSent.error?.message).toMatch( /Property must be of type 'bool'. Found 'int'./ ); - const invalidIntBoolSent = await client.invoke({ + let invalidIntBoolSent = await client.invoke({ uri, method: "intMethod", args: { arg: true, }, }); + invalidIntBoolSent = invalidIntBoolSent as ErrResult; expect(invalidIntBoolSent.error).toBeTruthy(); expect(invalidIntBoolSent.error?.message).toMatch( /Property must be of type 'int'. Found 'bool'./ ); - const invalidUIntArraySent = await client.invoke({ + let invalidUIntArraySent = await client.invoke({ uri, method: "uIntMethod", args: { arg: [10], }, }); + invalidUIntArraySent = invalidUIntArraySent as ErrResult; expect(invalidUIntArraySent.error).toBeTruthy(); expect(invalidUIntArraySent.error?.message).toMatch( /Property must be of type 'uint'. Found 'array'./ ); - const invalidBytesFloatSent = await client.invoke({ + let invalidBytesFloatSent = await client.invoke({ uri, method: "bytesMethod", args: { arg: 10.15, }, }); + + invalidBytesFloatSent = invalidBytesFloatSent as ErrResult; expect(invalidBytesFloatSent.error).toBeTruthy(); expect(invalidBytesFloatSent.error?.message).toMatch( /Property must be of type 'bytes'. Found 'float64'./ ); - const invalidArrayMapSent = await client.invoke({ + let invalidArrayMapSent = await client.invoke({ uri, method: "arrayMethod", args: { @@ -419,6 +430,8 @@ export const runInvalidTypesTest = async ( }, }, }); + + invalidArrayMapSent = invalidArrayMapSent as ErrResult; expect(invalidArrayMapSent.error).toBeTruthy(); expect(invalidArrayMapSent.error?.message).toMatch( /Property must be of type 'array'. Found 'map'./ @@ -428,7 +441,7 @@ export const runInvalidTypesTest = async ( export const runJsonTypeTest = async (client: PolywrapClient, uri: string, testReserved: boolean = false) => { type Json = string; const value = JSON.stringify({ foo: "bar", bar: "bar" }); - const parseResponse = await client.invoke<{ parse: Json }>({ + const parseResponse = await client.invoke({ uri, method: "parse", args: { @@ -436,14 +449,15 @@ export const runJsonTypeTest = async (client: PolywrapClient, uri: string, testR }, }); - expect(parseResponse.data).toEqual(value); + if (!parseResponse.ok) fail(parseResponse.error); + expect(parseResponse.value).toEqual(value); const values = [ JSON.stringify({ bar: "foo" }), JSON.stringify({ baz: "fuz" }), ]; - const stringifyResponse = await client.invoke<{ stringify: Json }>({ + const stringifyResponse = await client.invoke({ uri, method: "stringify", args: { @@ -451,16 +465,15 @@ export const runJsonTypeTest = async (client: PolywrapClient, uri: string, testR }, }); - expect(stringifyResponse.data).toEqual(values.join("")); + if(!stringifyResponse.ok) fail(stringifyResponse.error); + expect(stringifyResponse.value).toEqual(values.join("")); const object = { jsonA: JSON.stringify({ foo: "bar" }), jsonB: JSON.stringify({ fuz: "baz" }), }; - const stringifyObjectResponse = await client.invoke<{ - stringifyObject: string; - }>({ + const stringifyObjectResponse = await client.invoke({ uri, method: "stringifyObject", args: { @@ -468,7 +481,8 @@ export const runJsonTypeTest = async (client: PolywrapClient, uri: string, testR }, }); - expect(stringifyObjectResponse.data).toEqual(object.jsonA + object.jsonB); + if (!stringifyObjectResponse.ok) fail(stringifyObjectResponse.error); + expect(stringifyObjectResponse.value).toEqual(object.jsonA + object.jsonB); const json = { valueA: 5, @@ -476,16 +490,15 @@ export const runJsonTypeTest = async (client: PolywrapClient, uri: string, testR valueC: true, }; - const methodJSONResponse = await client.invoke<{ - methodJSON: Json; - }>({ + const methodJSONResponse = await client.invoke({ uri, method: "methodJSON", args: json, }); + if (!methodJSONResponse.ok) fail(methodJSONResponse.error); const methodJSONResult = JSON.stringify(json); - expect(methodJSONResponse.data).toEqual(methodJSONResult); + expect(methodJSONResponse.value).toEqual(methodJSONResult); if (testReserved) { const reserved = { const: "hello", if: true }; @@ -496,8 +509,9 @@ export const runJsonTypeTest = async (client: PolywrapClient, uri: string, testR json: JSON.stringify(reserved) }, }); - - expect(parseReservedResponse.data).toEqual(reserved); + + if (!parseReservedResponse.ok) fail(parseReservedResponse.error); + expect(parseReservedResponse.value).toEqual(reserved); const stringifyReservedResponse = await client.invoke({ uri, @@ -506,7 +520,9 @@ export const runJsonTypeTest = async (client: PolywrapClient, uri: string, testR reserved }, }); - expect(stringifyReservedResponse.data).toEqual(JSON.stringify(reserved)); + + if (!stringifyReservedResponse.ok) fail(stringifyReservedResponse.error); + expect(stringifyReservedResponse.value).toEqual(JSON.stringify(reserved)); } }; @@ -537,8 +553,9 @@ export const runLargeTypesTest = async ( }, }); - expect(largeTypesMethodCall.data).toBeTruthy(); - expect(largeTypesMethodCall.data).toEqual({ + if (!largeTypesMethodCall.ok) fail(largeTypesMethodCall.error); + expect(largeTypesMethodCall.value).toBeTruthy(); + expect(largeTypesMethodCall.value).toEqual({ largeStr: largeStr, largeBytes: largeBytes, largeStrArray: largeStrArray, @@ -550,7 +567,7 @@ export const runNumberTypesTest = async ( client: PolywrapClient, uri: string ) => { - const i8Underflow = await client.invoke({ + let i8Underflow = await client.invoke({ uri, method: "i8Method", args: { @@ -558,13 +575,14 @@ export const runNumberTypesTest = async ( second: 10, }, }); + + i8Underflow = i8Underflow as ErrResult; expect(i8Underflow.error).toBeTruthy(); expect(i8Underflow.error?.message).toMatch( /integer overflow: value = -129; bits = 8/ ); - expect(i8Underflow.data).toBeUndefined(); - const u8Overflow = await client.invoke({ + let u8Overflow = await client.invoke({ uri, method: "u8Method", args: { @@ -572,13 +590,13 @@ export const runNumberTypesTest = async ( second: 10, }, }); + u8Overflow = u8Overflow as ErrResult; expect(u8Overflow.error).toBeTruthy(); expect(u8Overflow.error?.message).toMatch( /unsigned integer overflow: value = 256; bits = 8/ ); - expect(u8Overflow.data).toBeUndefined(); - const i16Underflow = await client.invoke({ + let i16Underflow = await client.invoke({ uri, method: "i16Method", args: { @@ -586,13 +604,13 @@ export const runNumberTypesTest = async ( second: 10, }, }); + i16Underflow = i16Underflow as ErrResult; expect(i16Underflow.error).toBeTruthy(); expect(i16Underflow.error?.message).toMatch( /integer overflow: value = -32769; bits = 16/ ); - expect(i16Underflow.data).toBeUndefined(); - const u16Overflow = await client.invoke({ + let u16Overflow = await client.invoke({ uri, method: "u16Method", args: { @@ -600,13 +618,13 @@ export const runNumberTypesTest = async ( second: 10, }, }); + u16Overflow = u16Overflow as ErrResult; expect(u16Overflow.error).toBeTruthy(); expect(u16Overflow.error?.message).toMatch( /unsigned integer overflow: value = 65536; bits = 16/ ); - expect(u16Overflow.data).toBeUndefined(); - const i32Underflow = await client.invoke({ + let i32Underflow = await client.invoke({ uri, method: "i32Method", args: { @@ -614,13 +632,13 @@ export const runNumberTypesTest = async ( second: 10, }, }); + i32Underflow = i32Underflow as ErrResult; expect(i32Underflow.error).toBeTruthy(); expect(i32Underflow.error?.message).toMatch( /integer overflow: value = -2147483649; bits = 32/ ); - expect(i32Underflow.data).toBeUndefined(); - const u32Overflow = await client.invoke({ + let u32Overflow = await client.invoke({ uri, method: "u32Method", args: { @@ -628,11 +646,11 @@ export const runNumberTypesTest = async ( second: 10, }, }); + u32Overflow = u32Overflow as ErrResult; expect(u32Overflow.error).toBeTruthy(); expect(u32Overflow.error?.message).toMatch( /unsigned integer overflow: value = 4294967296; bits = 32/ ); - expect(u32Overflow.data).toBeUndefined(); }; export const runObjectTypesTest = async ( @@ -652,9 +670,9 @@ export const runObjectTypesTest = async ( }, }); - expect(method1a.error).toBeFalsy(); - expect(method1a.data).toBeTruthy(); - expect(method1a.data).toEqual([ + if (!method1a.ok) fail(method1a.error); + expect(method1a.value).toBeTruthy(); + expect(method1a.value).toEqual([ { prop: "arg1 prop", nested: { @@ -688,9 +706,9 @@ export const runObjectTypesTest = async ( }, }); - expect(method1b.error).toBeFalsy(); - expect(method1b.data).toBeTruthy(); - expect(method1b.data).toEqual([ + if (!method1b.ok) fail(method1b.error); + expect(method1b.value).toBeTruthy(); + expect(method1b.value).toEqual([ { prop: "arg1 prop", nested: { @@ -718,9 +736,9 @@ export const runObjectTypesTest = async ( }, }); - expect(method2a.error).toBeFalsy(); - expect(method2a.data).toBeTruthy(); - expect(method2a.data).toEqual({ + if (!method2a.ok) fail(method2a.error); + expect(method2a.value).toBeTruthy(); + expect(method2a.value).toEqual({ prop: "arg prop", nested: { prop: "arg nested prop", @@ -740,8 +758,8 @@ export const runObjectTypesTest = async ( }, }); - expect(method2b.error).toBeFalsy(); - expect(method2b.data).toEqual(null); + if (!method2b.ok) fail(method2b.error); + expect(method2b.value).toEqual(null); const method3 = await client.invoke({ uri, @@ -756,9 +774,9 @@ export const runObjectTypesTest = async ( }, }); - expect(method3.error).toBeFalsy(); - expect(method3.data).toBeTruthy(); - expect(method3.data).toEqual([ + if (!method3.ok) fail(method3.error); + expect(method3.value).toBeTruthy(); + expect(method3.value).toEqual([ null, { prop: "arg prop", @@ -778,9 +796,9 @@ export const runObjectTypesTest = async ( }, }); - expect(method5.error).toBeFalsy(); - expect(method5.data).toBeTruthy(); - expect(method5.data).toEqual({ + if (!method5.ok) fail(method5.error); + expect(method5.value).toBeTruthy(); + expect(method5.value).toEqual({ prop: "1234", nested: { prop: "nested prop", @@ -809,8 +827,8 @@ export const runMapTypeTest = async (client: PolywrapClient, uri: string) => { map: mapClass, }, }); - expect(returnMapResponse1.error).toBeUndefined(); - expect(returnMapResponse1.data).toEqual(mapClass); + if (!returnMapResponse1.ok) fail(returnMapResponse1.error); + expect(returnMapResponse1.value).toEqual(mapClass); const returnMapResponse2 = await client.invoke>({ uri, @@ -819,8 +837,8 @@ export const runMapTypeTest = async (client: PolywrapClient, uri: string) => { map: mapRecord, }, }); - expect(returnMapResponse2.error).toBeUndefined(); - expect(returnMapResponse2.data).toEqual(mapClass); + if (!returnMapResponse2.ok) fail(returnMapResponse2.error); + expect(returnMapResponse2.value).toEqual(mapClass); const getKeyResponse1 = await client.invoke({ uri, @@ -833,8 +851,8 @@ export const runMapTypeTest = async (client: PolywrapClient, uri: string) => { key: "Hello", }, }); - expect(getKeyResponse1.error).toBeUndefined(); - expect(getKeyResponse1.data).toEqual(mapClass.get("Hello")); + if (!getKeyResponse1.ok) fail(getKeyResponse1.error); + expect(getKeyResponse1.value).toEqual(mapClass.get("Hello")); const getKeyResponse2 = await client.invoke({ uri, @@ -847,8 +865,8 @@ export const runMapTypeTest = async (client: PolywrapClient, uri: string) => { key: "Heyo", }, }); - expect(getKeyResponse2.error).toBeUndefined(); - expect(getKeyResponse2.data).toEqual(mapRecord.Heyo); + if (!getKeyResponse2.ok) fail(getKeyResponse2.error); + expect(getKeyResponse2.value).toEqual(mapRecord.Heyo); const returnCustomMap = await client.invoke<{ map: Map; @@ -863,8 +881,8 @@ export const runMapTypeTest = async (client: PolywrapClient, uri: string) => { }, }, }); - expect(returnCustomMap.error).toBeUndefined(); - expect(returnCustomMap.data).toEqual({ + if (!returnCustomMap.ok) fail(returnCustomMap.error); + expect(returnCustomMap.value).toEqual({ map: mapClass, nestedMap: nestedMapClass, }); @@ -878,8 +896,8 @@ export const runMapTypeTest = async (client: PolywrapClient, uri: string) => { }, } ); - expect(returnNestedMap.error).toBeUndefined(); - expect(returnNestedMap.data).toEqual(nestedMapClass); + if (!returnNestedMap.ok) fail(returnNestedMap.error); + expect(returnNestedMap.value).toEqual(nestedMapClass); }; export const runSimpleStorageTest = async ( @@ -896,15 +914,11 @@ export const runSimpleStorageTest = async ( }, }); - expect(deploy.error).toBeFalsy(); - expect(deploy.data).toBeTruthy(); - expect(deploy.data?.indexOf("0x")).toBeGreaterThan(-1); + if (!deploy.ok) fail(deploy.error); + expect(deploy.value).toBeTruthy(); + expect(deploy.value.indexOf("0x")).toBeGreaterThan(-1); - if (!deploy.data) { - return; - } - - const address = deploy.data; + const address = deploy.value; const set = await client.invoke({ uri: wrapperUri, method: "setData", @@ -917,9 +931,9 @@ export const runSimpleStorageTest = async ( }, }); - expect(set.error).toBeFalsy(); - expect(set.data).toBeTruthy(); - expect(set.data?.indexOf("0x")).toBeGreaterThan(-1); + if (!set.ok) fail(set.error); + expect(set.value).toBeTruthy(); + expect(set.value?.indexOf("0x")).toBeGreaterThan(-1); const getDataResult = await client.invoke({ uri: wrapperUri, @@ -932,8 +946,8 @@ export const runSimpleStorageTest = async ( }, }); - expect(getDataResult.error).toBeFalsy(); - expect(getDataResult.data).toEqual(55); + if (!getDataResult.ok) fail(getDataResult.error); + expect(getDataResult.value).toEqual(55); }; export const runSimpleEnvTest = async ( @@ -947,51 +961,37 @@ export const runSimpleEnvTest = async ( arg: "string", }, }); - expect(getEnvResult.error).toBeFalsy(); - expect(getEnvResult.data).toEqual({ + if (!getEnvResult.ok) fail(getEnvResult.error); + expect(getEnvResult.value).toEqual({ str: "module string", requiredInt: 1, }); - const getEnvNotSetResult = await client.invoke({ + let getEnvNotSetResult = await client.invoke({ uri: wrapperUri, method: "getEnv", args: { arg: "not set", }, - config: { - envs: [ - { - uri: wrapperUri, - env: {}, - }, - ], - }, + env: { } }); - expect(getEnvNotSetResult.data).toBeUndefined(); + getEnvNotSetResult = getEnvNotSetResult as ErrResult; expect(getEnvNotSetResult.error).toBeTruthy(); expect(getEnvNotSetResult.error?.message).toContain("requiredInt: Int"); - const envIncorrectResult = await client.invoke({ + let envIncorrectResult = await client.invoke({ uri: wrapperUri, method: "getEnv", args: { arg: "not set", }, - config: { - envs: [ - { - uri: wrapperUri, - env: { - str: "string", - requiredInt: "99", - }, - }, - ], + env: { + str: "string", + requiredInt: "99", }, }); - expect(envIncorrectResult.data).toBeUndefined(); + envIncorrectResult = envIncorrectResult as ErrResult; expect(envIncorrectResult.error).toBeTruthy(); expect(envIncorrectResult.error?.message).toContain( "Property must be of type 'int'. Found 'string'." @@ -1009,8 +1009,8 @@ export const runComplexEnvs = async ( arg: "string", }, }); - expect(methodRequireEnvResult.error).toBeFalsy(); - expect(methodRequireEnvResult.data).toEqual({ + if (!methodRequireEnvResult.ok) fail(methodRequireEnvResult.error); + expect(methodRequireEnvResult.value).toEqual({ str: "string", optFilledStr: "optional string", optStr: null, @@ -1034,8 +1034,8 @@ export const runComplexEnvs = async ( arg: "string", }, }); - expect(subinvokeEnvMethodResult.error).toBeFalsy(); - expect(subinvokeEnvMethodResult.data).toEqual({ + if (!subinvokeEnvMethodResult.ok) fail(subinvokeEnvMethodResult.error); + expect(subinvokeEnvMethodResult.value).toEqual({ local: { str: "string", optFilledStr: "optional string", @@ -1065,8 +1065,8 @@ export const runComplexEnvs = async ( arg: "string", }, }); - expect(methodRequireEnvModuleTimeResult.error).toBeFalsy(); - expect(methodRequireEnvModuleTimeResult.data).toEqual({ + if (!methodRequireEnvModuleTimeResult.ok) fail(methodRequireEnvModuleTimeResult.error); + expect(methodRequireEnvModuleTimeResult.value).toEqual({ str: "string", optFilledStr: "optional string", optStr: null, @@ -1089,27 +1089,20 @@ export const runComplexEnvs = async ( args: { arg: "string", }, - config: { - envs: [ - { - uri: wrapperUri, - env: { - object: { - prop: "object another string", - }, - str: "another string", - optFilledStr: "optional string", - number: 10, - bool: true, - en: "FIRST", - array: [32, 23], - }, - }, - ], - }, + env: { + object: { + prop: "object another string", + }, + str: "another string", + optFilledStr: "optional string", + number: 10, + bool: true, + en: "FIRST", + array: [32, 23], + } }); - expect(mockUpdatedEnvResult.error).toBeFalsy(); - expect(mockUpdatedEnvResult.data).toEqual({ + if (!mockUpdatedEnvResult.ok) fail(mockUpdatedEnvResult.error); + expect(mockUpdatedEnvResult.value).toEqual({ str: "another string", optFilledStr: "optional string", optStr: null, diff --git a/packages/js/client/src/__tests__/e2e/wasm-as.spec.ts b/packages/js/client/src/__tests__/e2e/wasm-as.spec.ts index 07bb69bf68..c4eed72b45 100644 --- a/packages/js/client/src/__tests__/e2e/wasm-as.spec.ts +++ b/packages/js/client/src/__tests__/e2e/wasm-as.spec.ts @@ -93,7 +93,7 @@ describe("wasm-as test cases", () => { await buildWrapper(wrapperPath); const ensUri = wrapperUri; - const query = await client.invoke({ + const result = await client.invoke({ uri: ensUri, method: "if", args: { @@ -103,9 +103,9 @@ describe("wasm-as test cases", () => { }, }); - expect(query.error).toBeFalsy(); - expect(query.data).toBeTruthy(); - expect(query.data).toMatchObject({ + if (!result.ok) fail(result.error); + expect(result.value).toBeTruthy(); + expect(result.value).toMatchObject({ else: "successfully used reserved keyword", }); }); @@ -195,7 +195,7 @@ describe("wasm-as test cases", () => { await buildWrapper(wrapperPath); - const query = await client.invoke({ + const result = await client.invoke({ uri: wrapperUri, method: "moduleMethod", args: { @@ -206,9 +206,9 @@ describe("wasm-as test cases", () => { }, }); - expect(query.error).toBeFalsy(); - expect(query.data).toBeTruthy(); - expect(query.data).toEqual({ + if (!result.ok) fail(result.error); + expect(result.value).toBeTruthy(); + expect(result.value).toEqual({ uint8: 1, str: "Test String 1", }); diff --git a/packages/js/client/src/__tests__/e2e/wasm-rs.spec.ts b/packages/js/client/src/__tests__/e2e/wasm-rs.spec.ts index 735d8c5c98..7e8d28fe2b 100644 --- a/packages/js/client/src/__tests__/e2e/wasm-rs.spec.ts +++ b/packages/js/client/src/__tests__/e2e/wasm-rs.spec.ts @@ -269,6 +269,31 @@ describe("wasm-rs test cases", () => { wrapperUri ); }); + + it("override rust print macros", async () => { + const wrapperPath = `${GetPathToTestWrappers()}/wasm-rs/println-logging`; + const wrapperUri = `fs/${wrapperPath}/build`; + await buildWrapper(wrapperPath); + + console.debug = jest.fn(); + const message = "foo bar baz"; + + const client = await getClient(); + const result = await client.invoke({ + uri: wrapperUri, + method: "logMessage", + args: { + message, + } + }); + + expect(result.ok).toBeTruthy(); + if (!result.ok) return; + expect(result.value).toBeTruthy(); + expect((console.debug as any).mock.calls[0][0]).toBe("__wrap_debug_log: " + message); + expect((console.debug as any).mock.calls[1][0]).toBe("__wrap_debug_log: " + message); + jest.clearAllMocks(); + }); }); describe.skip("Wasm-rs benchmarking", () => { diff --git a/packages/js/client/src/__tests__/utils/resultTypes.ts b/packages/js/client/src/__tests__/utils/resultTypes.ts new file mode 100644 index 0000000000..17a02d06d4 --- /dev/null +++ b/packages/js/client/src/__tests__/utils/resultTypes.ts @@ -0,0 +1 @@ +export type ErrResult = { ok: false; error: E | undefined }; \ No newline at end of file diff --git a/packages/js/core/package.json b/packages/js/core/package.json index d73ba7ba66..13e907f77e 100644 --- a/packages/js/core/package.json +++ b/packages/js/core/package.json @@ -26,9 +26,9 @@ "@polywrap/wrap-manifest-types-js": "0.8.0", "graphql": "15.5.0", "graphql-tag": "2.10.4", - "js-yaml": "3.14.0", "jsonschema": "1.4.0", - "semver": "7.3.5" + "semver": "7.3.5", + "yaml": "2.1.3" }, "devDependencies": { "@polywrap/os-js": "0.8.0", diff --git a/packages/js/core/src/__tests__/MaybeAsync.spec.ts b/packages/js/core/src/__tests__/MaybeAsync.spec.ts index 24ec6374fc..f23280de65 100644 --- a/packages/js/core/src/__tests__/MaybeAsync.spec.ts +++ b/packages/js/core/src/__tests__/MaybeAsync.spec.ts @@ -1,10 +1,11 @@ -import { - MaybeAsync, - executeMaybeAsyncFunction, - isPromise, -} from ".."; +import { MaybeAsync, isPromise } from ".."; -class ClassInstance { +interface IClassInterface { + normalMethod(arg: string): MaybeAsync; + asyncMethod(arg: string): MaybeAsync; +} + +class ClassInstance implements IClassInterface { constructor(private _prop: string) {} normalMethod(arg: string): string { @@ -12,29 +13,29 @@ class ClassInstance { } async asyncMethod(arg: string): Promise { - await new Promise((resolve) => - setTimeout(resolve, 200) - ); + await new Promise((resolve) => setTimeout(resolve, 200)); return this._prop + arg; } } describe("MaybeAsync", () => { - const promise: MaybeAsync = - new Promise((resolve, reject) => { return "" }); - const testFunction = (args: unknown[]) => { return "foo" }; - const testFunctionReturnPromise = (args: unknown[]) => new Promise((resolve) => { resolve("foo") }); + const testFunction = (): MaybeAsync => { + return "foo"; + }; + const testFunctionReturnPromise = (): MaybeAsync => + new Promise((resolve) => { + resolve("foo"); + }); it("sanity", async () => { - expect(isPromise(promise)).toBe(true); - expect(await executeMaybeAsyncFunction(testFunction)).toBe("foo"); - expect(await executeMaybeAsyncFunction(testFunctionReturnPromise)).toBe("foo"); + expect(await testFunction()).toBe("foo"); + expect(await testFunctionReturnPromise()).toBe("foo"); }); it("works with class instances", async () => { - const instance = new ClassInstance("bar"); - expect(await executeMaybeAsyncFunction(instance.normalMethod.bind(instance, "foo"))).toBe("barfoo") - expect(await executeMaybeAsyncFunction(instance.asyncMethod.bind(instance, "foo"))).toBe("barfoo") - }) + const instance: IClassInterface = new ClassInstance("bar"); + expect(await instance.normalMethod("foo")).toBe("barfoo"); + expect(await instance.asyncMethod("foo")).toBe("barfoo"); + }); }); diff --git a/packages/js/core/src/__tests__/Plugin.spec.ts b/packages/js/core/src/__tests__/Plugin.spec.ts index 119767b3f6..a7a965bf2f 100644 --- a/packages/js/core/src/__tests__/Plugin.spec.ts +++ b/packages/js/core/src/__tests__/Plugin.spec.ts @@ -2,6 +2,7 @@ import { Client, PluginModule } from ".."; +import { ResultOk } from "@polywrap/result"; class TestPluginModule extends PluginModule<{}> { testMethod(args: { value: number }, _client: Client): number { @@ -16,6 +17,6 @@ describe("Plugin", () => { expect(plugin).toBeTruthy(); expect ( await plugin._wrap_invoke("testMethod", { value: 5 }, {} as Client) - ).toBe(10); + ).toStrictEqual(ResultOk(10)); }); }); diff --git a/packages/js/core/src/__tests__/apply-redirects.spec.ts b/packages/js/core/src/__tests__/apply-redirects.spec.ts index c81ac071ea..b00dc8006f 100644 --- a/packages/js/core/src/__tests__/apply-redirects.spec.ts +++ b/packages/js/core/src/__tests__/apply-redirects.spec.ts @@ -9,13 +9,19 @@ describe("applyRedirects", () => { const uri1 = "wrap://ens/some-uri1.eth"; const uri2 = "wrap://ens/some-uri2.eth"; - const redirectedUri = applyRedirects(new Uri(uri1), [ + const redirectsResult = applyRedirects(new Uri(uri1), [ { from: new Uri(uri1), to: new Uri(uri2) } ]); - + + expect (redirectsResult.ok).toBeTruthy(); + if (!redirectsResult.ok) { + throw Error("This should never happen"); + } + + const redirectedUri = redirectsResult.value; expect(Uri.equals(redirectedUri, new Uri(uri2))).toBeTruthy(); }); @@ -24,7 +30,7 @@ describe("applyRedirects", () => { const uri2 = "wrap://ens/some-uri2.eth"; const uri3 = "wrap://ens/some-uri3.eth"; - const redirectedUri = applyRedirects(new Uri(uri1), [ + const redirectsResult = applyRedirects(new Uri(uri1), [ { from: new Uri(uri1), to: new Uri(uri2) @@ -34,20 +40,32 @@ describe("applyRedirects", () => { to: new Uri(uri3) } ]); - + + expect (redirectsResult.ok).toBeTruthy(); + if (!redirectsResult.ok) { + throw Error("This should never happen"); + } + + const redirectedUri = redirectsResult.value; expect(Uri.equals(redirectedUri, new Uri(uri2))).toBeTruthy(); }); it("can not redirect to self", () => { const uri = "wrap://ens/some-uri.eth"; - expect(() => { - applyRedirects(new Uri(uri), [ - { - from: new Uri(uri), - to: new Uri(uri) - } - ]); - }).toThrow(/Infinite loop while resolving URI/); + const redirectsResult = applyRedirects(new Uri(uri), [ + { + from: new Uri(uri), + to: new Uri(uri) + } + ]); + + expect(redirectsResult.ok).toBeFalsy(); + if (redirectsResult.ok) { + throw Error("This should never happen"); + } + + const err = redirectsResult.error?.message; + expect(err).toContain("Infinite loop while resolving URI"); }); }); diff --git a/packages/js/core/src/__tests__/get-implementations.spec.ts b/packages/js/core/src/__tests__/get-implementations.spec.ts index 330abed01c..470f37a8d0 100644 --- a/packages/js/core/src/__tests__/get-implementations.spec.ts +++ b/packages/js/core/src/__tests__/get-implementations.spec.ts @@ -4,6 +4,7 @@ import { UriRedirect, } from "../"; import { InterfaceImplementations } from "../types"; +import { ResultOk } from "@polywrap/result"; describe("getImplementations", () => { @@ -69,21 +70,21 @@ describe("getImplementations", () => { redirects ); - expect(getImplementationsResult1).toEqual([ + expect(getImplementationsResult1).toEqual(ResultOk([ new Uri(implementation1Uri), new Uri(implementation2Uri), new Uri(implementation3Uri) - ]); + ])); - expect(getImplementationsResult2).toEqual([ + expect(getImplementationsResult2).toEqual(ResultOk([ new Uri(implementation1Uri), new Uri(implementation2Uri), new Uri(implementation3Uri) - ]); + ])); - expect(getImplementationsResult3).toEqual([ + expect(getImplementationsResult3).toEqual(ResultOk([ new Uri(implementation3Uri) - ]); + ])); }); it("interface implementations are not redirected", () => { @@ -114,8 +115,8 @@ describe("getImplementations", () => { redirects ); - expect(getImplementationsResult).toEqual([ + expect(getImplementationsResult).toEqual(ResultOk([ new Uri(implementation1Uri) - ]); + ])); }); }); diff --git a/packages/js/core/src/__tests__/parse-query.spec.ts b/packages/js/core/src/__tests__/parse-query.spec.ts index b80bd41004..55506b17ff 100644 --- a/packages/js/core/src/__tests__/parse-query.spec.ts +++ b/packages/js/core/src/__tests__/parse-query.spec.ts @@ -1,4 +1,5 @@ import { createQueryDocument, parseQuery, QueryInvocations, Uri } from "../"; +import { ResultOk } from "@polywrap/result"; describe("parseQuery", () => { const dummy = new Uri("wrap://dumb/dummy"); @@ -59,7 +60,7 @@ describe("parseQuery", () => { } }; - expect(result).toMatchObject(expected); + expect(result).toMatchObject(ResultOk(expected)); }); it("works with multiple queries", () => { @@ -171,39 +172,63 @@ describe("parseQuery", () => { mutationAnotherMethod: method2.anotherMethod, }; - expect(result).toMatchObject(expected); + expect(result).toMatchObject(ResultOk(expected)); }); it("fails when given an empty document", () => { const doc = createQueryDocument("{ prop }"); // eslint-disable-next-line @typescript-eslint/no-explicit-any (doc.definitions as any) = []; - expect(() => parseQuery(dummy, doc)).toThrowError( - /Empty query document found/ - ); + const result = parseQuery(dummy, doc); + + expect (result.ok).toBeFalsy(); + if (result.ok) { + throw Error("This should never happen"); + } + + const error = result.error?.message; + expect(error).toContain("Empty query document found"); }); it("fails when a query operations isn't specified", () => { const doc = createQueryDocument("fragment Something on Type { something }"); - expect(() => parseQuery(dummy, doc)).toThrowError( - /Unrecognized root level definition type/ - ); + const result = parseQuery(dummy, doc); + + expect (result.ok).toBeFalsy(); + if (result.ok) { + throw Error("This should never happen"); + } + + const error = result.error?.message; + expect(error).toContain("Unrecognized root level definition type"); }); it("fails when method is missing", () => { const doc = createQueryDocument(`query { something }`); // eslint-disable-next-line @typescript-eslint/no-explicit-any (doc.definitions[0] as any).selectionSet.selections = []; - expect(() => parseQuery(dummy, doc)).toThrowError( - /Empty selection set found/ - ); + const result = parseQuery(dummy, doc); + + expect (result.ok).toBeFalsy(); + if (result.ok) { + throw Error("This should never happen"); + } + + const error = result.error?.message; + expect(error).toContain("Empty selection set found"); }); it("fails when a fragment spread is used within an operations", () => { const doc = createQueryDocument(`query { ...NamedFragment }`); - expect(() => parseQuery(dummy, doc)).toThrowError( - /Unsupported selection type found: FragmentSpread/ - ); + const result = parseQuery(dummy, doc); + + expect (result.ok).toBeFalsy(); + if (result.ok) { + throw Error("This should never happen"); + } + + const error = result.error?.message; + expect(error).toContain("Unsupported selection type found: FragmentSpread"); }); it("fails when variables were not specified", () => { @@ -214,10 +239,15 @@ describe("parseQuery", () => { ) } `); + const result = parseQuery(dummy, doc); + + expect (result.ok).toBeFalsy(); + if (result.ok) { + throw Error("This should never happen"); + } - expect(() => parseQuery(dummy, doc)).toThrowError( - /Variables were not specified/ - ); + const error = result.error?.message; + expect(error).toContain("Variables were not specified"); }); it("fails when variables is missing", () => { @@ -228,12 +258,15 @@ describe("parseQuery", () => { ) } `); + const result = parseQuery(dummy, doc, { arg2: "not arg1" }); - expect(() => - parseQuery(dummy, doc, { - arg2: "not arg1", - }) - ).toThrowError(/Missing variable/); + expect (result.ok).toBeFalsy(); + if (result.ok) { + throw Error("This should never happen"); + } + + const error = result.error?.message; + expect(error).toContain("Missing variable"); }); it("succeeds when variables is defined by falsy", () => { @@ -244,12 +277,8 @@ describe("parseQuery", () => { ) } `); - - expect(() => - parseQuery(dummy, doc, { - arg_1: 0, - }) - ).not.toThrowError(/Missing variable/); + const result = parseQuery(dummy, doc, { arg_1: 0 }); + expect (result.ok).toBeTruthy(); }); it("fails when duplicate args arguments are provided", () => { @@ -261,10 +290,15 @@ describe("parseQuery", () => { ) } `); + const result = parseQuery(dummy, doc); - expect(() => parseQuery(dummy, doc)).toThrowError( - /Duplicate arguments found/ - ); + expect (result.ok).toBeFalsy(); + if (result.ok) { + throw Error("This should never happen"); + } + + const error = result.error?.message; + expect(error).toContain("Duplicate arguments found"); }); it("fails when duplicate aliases found", () => { @@ -283,10 +317,15 @@ describe("parseQuery", () => { } } `); + const result = parseQuery(dummy, doc); + + expect (result.ok).toBeFalsy(); + if (result.ok) { + throw Error("This should never happen"); + } - expect(() => parseQuery(dummy, doc)).toThrowError( - /Duplicate query name found "alias"/ - ); + const error = result.error?.message; + expect(error).toContain(`Duplicate query name found "alias"`); }); it("fails when duplicate methods without alias found", () => { @@ -305,9 +344,14 @@ describe("parseQuery", () => { } } `); + const result = parseQuery(dummy, doc); + + expect (result.ok).toBeFalsy(); + if (result.ok) { + throw Error("This should never happen"); + } - expect(() => parseQuery(dummy, doc)).toThrowError( - /Duplicate query name found "method"/ - ); + const error = result.error?.message; + expect(error).toContain(`Duplicate query name found "method"`); }); }); diff --git a/packages/js/core/src/algorithms/apply-redirects.ts b/packages/js/core/src/algorithms/apply-redirects.ts index 0f684dc40c..fd1c60a3fe 100644 --- a/packages/js/core/src/algorithms/apply-redirects.ts +++ b/packages/js/core/src/algorithms/apply-redirects.ts @@ -1,26 +1,28 @@ import { Uri, UriRedirect } from "../types"; import { Tracer } from "@polywrap/tracing-js"; +import { Result, ResultErr, ResultOk } from "@polywrap/result"; export const applyRedirects = Tracer.traceFunc( "core: applyRedirects", - (uri: Uri, redirects: readonly UriRedirect[]): Uri => { + (uri: Uri, redirects: readonly UriRedirect[]): Result => { // Keep track of past redirects (from -> to) to find the final uri const redirectFromToMap: Record = {}; - const throwError = (message: string) => { - throw Error( + const createError = (message: string) => { + const error = Error( `${message}\nResolution Stack: ${JSON.stringify( redirectFromToMap, null, 2 )}` ); + return ResultErr(error); }; for (const redirect of redirects) { if (!redirect.from) { - throwError( + return createError( `Redirect missing the from property.\nEncountered while resolving ${uri.uri}` ); } @@ -42,10 +44,10 @@ export const applyRedirects = Tracer.traceFunc( finalUri = redirectFromToMap[finalUri.uri]; if (visitedUris[finalUri.uri]) { - throwError(`Infinite loop while resolving URI "${uri}".`); + return createError(`Infinite loop while resolving URI "${uri}".`); } } - return finalUri; + return ResultOk(finalUri); } ); diff --git a/packages/js/core/src/algorithms/get-implementations.ts b/packages/js/core/src/algorithms/get-implementations.ts index 799143f0a9..f6588a61a6 100644 --- a/packages/js/core/src/algorithms/get-implementations.ts +++ b/packages/js/core/src/algorithms/get-implementations.ts @@ -2,6 +2,7 @@ import { Uri, UriRedirect, InterfaceImplementations } from "../types"; import { applyRedirects } from "./apply-redirects"; import { Tracer } from "@polywrap/tracing-js"; +import { Result, ResultOk } from "@polywrap/result"; export const getImplementations = Tracer.traceFunc( "core: getImplementations", @@ -9,7 +10,7 @@ export const getImplementations = Tracer.traceFunc( wrapperInterfaceUri: Uri, interfaces: readonly InterfaceImplementations[], redirects?: readonly UriRedirect[] - ): Uri[] => { + ): Result => { const result: Uri[] = []; const addUniqueResult = (uri: Uri) => { @@ -22,11 +23,21 @@ export const getImplementations = Tracer.traceFunc( const addAllImplementationsFromImplementationsArray = ( implementationsArray: readonly InterfaceImplementations[], wrapperInterfaceUri: Uri - ) => { + ): Result => { for (const interfaceImplementations of implementationsArray) { - const fullyResolvedUri = redirects - ? applyRedirects(interfaceImplementations.interface, redirects) - : interfaceImplementations.interface; + let fullyResolvedUri: Uri; + if (redirects) { + const redirectsResult = applyRedirects( + interfaceImplementations.interface, + redirects + ); + if (!redirectsResult.ok) { + return redirectsResult; + } + fullyResolvedUri = redirectsResult.value; + } else { + fullyResolvedUri = interfaceImplementations.interface; + } if (Uri.equals(fullyResolvedUri, wrapperInterfaceUri)) { for (const implementation of interfaceImplementations.implementations) { @@ -34,16 +45,24 @@ export const getImplementations = Tracer.traceFunc( } } } + return ResultOk(undefined); }; let finalUri = wrapperInterfaceUri; if (redirects) { - finalUri = applyRedirects(wrapperInterfaceUri, redirects); + const redirectsResult = applyRedirects(wrapperInterfaceUri, redirects); + if (!redirectsResult.ok) { + return redirectsResult; + } + finalUri = redirectsResult.value; } - addAllImplementationsFromImplementationsArray(interfaces, finalUri); + const addAllImp = addAllImplementationsFromImplementationsArray( + interfaces, + finalUri + ); - return result; + return addAllImp.ok ? ResultOk(result) : addAllImp; } ); diff --git a/packages/js/core/src/algorithms/parse-query.ts b/packages/js/core/src/algorithms/parse-query.ts index 8016e3c0ca..db52f75990 100644 --- a/packages/js/core/src/algorithms/parse-query.ts +++ b/packages/js/core/src/algorithms/parse-query.ts @@ -2,6 +2,7 @@ import { QueryInvocations, QueryDocument, Uri } from "../types"; import { SelectionSetNode, ValueNode } from "graphql"; import { Tracer } from "@polywrap/tracing-js"; +import { Result, ResultErr, ResultOk } from "@polywrap/result"; export const parseQuery = Tracer.traceFunc( "core: parseQuery", @@ -9,19 +10,20 @@ export const parseQuery = Tracer.traceFunc( uri: Uri, doc: QueryDocument, variables?: Record - ): QueryInvocations => { + ): Result, Error> => { if (doc.definitions.length === 0) { - throw Error("Empty query document found."); + return ResultErr(Error("Empty query document found.")); } const queryInvocations: QueryInvocations = {}; for (const def of doc.definitions) { if (def.kind !== "OperationDefinition") { - throw Error( + const error = Error( `Unrecognized root level definition type: ${def.kind}\n` + "Please use a 'query' or 'mutation' operations." ); + return ResultErr(error); } // Get the method name @@ -29,26 +31,29 @@ export const parseQuery = Tracer.traceFunc( const selections = selectionSet.selections; if (selections.length === 0) { - throw Error( + const error = Error( "Empty selection set found. Please include the name of a method you'd like to query." ); + return ResultErr(error); } for (const selection of selections) { if (selection.kind !== "Field") { - throw Error( + const error = Error( `Unsupported selection type found: ${selection.kind}\n` + "Please query a method." ); + return ResultErr(error); } const method = selection.name.value; const invocationName = selection.alias ? selection.alias.value : method; if (queryInvocations[invocationName]) { - throw Error( + const error = Error( `Duplicate query name found "${invocationName}". Please use GraphQL aliases that each have unique names.` ); + return ResultErr(error); } // Get all arguments @@ -60,10 +65,14 @@ export const parseQuery = Tracer.traceFunc( const name = arg.name.value; if (args[name]) { - throw Error(`Duplicate arguments found: ${name}`); + return ResultErr(Error(`Duplicate arguments found: ${name}`)); } - args[name] = extractValue(arg.value, variables); + const extractionResult = extractValue(arg.value, variables); + if (!extractionResult.ok) { + return extractionResult; + } + args[name] = extractionResult.value; } } @@ -75,88 +84,105 @@ export const parseQuery = Tracer.traceFunc( } } - return queryInvocations; + return ResultOk(queryInvocations); } ); const extractValue = Tracer.traceFunc( "core: extractValue", - (node: ValueNode, variables?: Record): unknown => { + ( + node: ValueNode, + variables?: Record + ): Result => { if (node.kind === "Variable") { // Get the argument's value from the variables object if (!variables) { - throw Error( + const error = Error( `Variables were not specified, tried to resolve variable from query. Name: ${node.name.value}\n` ); + return ResultErr(error); } if (variables[node.name.value] === undefined) { - throw Error(`Missing variable: ${node.name.value}`); + return ResultErr(Error(`Missing variable: ${node.name.value}`)); } - return variables[node.name.value]; + return ResultOk(variables[node.name.value]); } else if ( node.kind === "StringValue" || node.kind === "EnumValue" || node.kind === "BooleanValue" ) { - return node.value; + return ResultOk(node.value); } else if (node.kind === "IntValue") { - return Number.parseInt(node.value); + return ResultOk(Number.parseInt(node.value)); } else if (node.kind === "FloatValue") { - return Number.parseFloat(node.value); + return ResultOk(Number.parseFloat(node.value)); } else if (node.kind === "NullValue") { - return null; + return ResultOk(null); } else if (node.kind === "ListValue") { const length = node.values.length; const list = []; for (let i = 0; i < length; ++i) { - list.push(extractValue(node.values[i], variables)); + const extractionResult = extractValue(node.values[i], variables); + if (!extractionResult.ok) { + return extractionResult; + } + list.push(extractionResult.value); } - return list; + return ResultOk(list); } else if (node.kind === "ObjectValue") { const length = node.fields.length; const object: Record = {}; for (let i = 0; i < length; ++i) { const field = node.fields[i]; - object[field.name.value] = extractValue(field.value, variables); + const extractionResult = extractValue(field.value, variables); + if (!extractionResult.ok) { + return extractionResult; + } + object[field.name.value] = extractionResult.value; } - return object; + return ResultOk(object); } else { - throw Error(`Unsupported value node: ${node}`); + return ResultErr(Error(`Unsupported value node: ${node}`)); } } ); export const extractSelections = Tracer.traceFunc( "core: extractSelections", - (node: SelectionSetNode): Record => { + (node: SelectionSetNode): Result, Error> => { const result: Record = {}; for (const selection of node.selections) { if (selection.kind !== "Field") { - throw Error( + const error = Error( `Unsupported result selection type found: ${selection.kind}` ); + return ResultErr(error); } const name = selection.name.value; if (result[name]) { - throw Error(`Duplicate result selections found: ${name}`); + return ResultErr(Error(`Duplicate result selections found: ${name}`)); } if (selection.selectionSet) { - result[name] = extractSelections(selection.selectionSet); + const selectionsResult = extractSelections(selection.selectionSet); + if (!selectionsResult.ok) { + return selectionsResult; + } + result[name] = selectionsResult.value; } else { result[name] = true; } } - return result; + return ResultOk(result); } ); diff --git a/packages/js/core/src/index.ts b/packages/js/core/src/index.ts index a53b68cd72..7c455fb135 100644 --- a/packages/js/core/src/index.ts +++ b/packages/js/core/src/index.ts @@ -4,3 +4,4 @@ export * from "./interfaces"; export * from "./uri-resolution"; export * from "./utils"; export * from "./plugin"; +export { Result } from "@polywrap/result"; diff --git a/packages/js/core/src/interfaces/uri-resolver.ts b/packages/js/core/src/interfaces/uri-resolver.ts index 182e27efcc..1da5fbc3ab 100644 --- a/packages/js/core/src/interfaces/uri-resolver.ts +++ b/packages/js/core/src/interfaces/uri-resolver.ts @@ -1,7 +1,7 @@ -// TODO: https://github.com/polywrap/monorepo/issues/101 -import { Uri, Invoker, InvokeResult } from "../"; +import { Uri, Invoker } from "../"; import { Tracer } from "@polywrap/tracing-js"; +import { Result } from "@polywrap/result"; export interface MaybeUriOrManifest { uri?: string; @@ -15,7 +15,7 @@ export const module = { invoker: Invoker, wrapper: Uri, uri: Uri - ): Promise> => { + ): Promise> => { return invoker.invoke({ uri: wrapper.uri, method: `tryResolveUri`, @@ -32,7 +32,7 @@ export const module = { invoker: Invoker, wrapper: Uri, path: string - ): Promise> => { + ): Promise> => { return invoker.invoke({ uri: wrapper.uri, method: "getFile", diff --git a/packages/js/core/src/plugin/PluginWrapPackage.ts b/packages/js/core/src/plugin/PluginWrapPackage.ts index 8928129e72..1172843cc6 100644 --- a/packages/js/core/src/plugin/PluginWrapPackage.ts +++ b/packages/js/core/src/plugin/PluginWrapPackage.ts @@ -2,6 +2,7 @@ import { IWrapPackage, PluginPackage, Uri, Wrapper } from "../types"; import { PluginWrapper } from "./PluginWrapper"; import { WrapManifest } from "@polywrap/wrap-manifest-types-js"; +import { Result, ResultOk } from "@polywrap/result"; // TODO: this is a temporary solution until we refactor the plugin package to be an IWrapPackage export class PluginWrapPackage implements IWrapPackage { @@ -10,11 +11,11 @@ export class PluginWrapPackage implements IWrapPackage { private readonly pluginPackage: PluginPackage ) {} - async getManifest(): Promise { - return this.pluginPackage.manifest; + async getManifest(): Promise> { + return ResultOk(this.pluginPackage.manifest); } - async createWrapper(): Promise { - return new PluginWrapper(this.pluginPackage); + async createWrapper(): Promise> { + return ResultOk(new PluginWrapper(this.pluginPackage)); } } diff --git a/packages/js/core/src/plugin/PluginWrapper.ts b/packages/js/core/src/plugin/PluginWrapper.ts index 13df1587ce..380e101fca 100644 --- a/packages/js/core/src/plugin/PluginWrapper.ts +++ b/packages/js/core/src/plugin/PluginWrapper.ts @@ -14,6 +14,7 @@ import { import { WrapManifest } from "@polywrap/wrap-manifest-types-js"; import { msgpackDecode } from "@polywrap/msgpack-js"; import { Tracer, TracingLevel } from "@polywrap/tracing-js"; +import { Result, ResultErr, ResultOk } from "@polywrap/result"; export class PluginWrapper implements Wrapper { private _instance: PluginModule | undefined; @@ -27,17 +28,15 @@ export class PluginWrapper implements Wrapper { } public async getFile( - _: GetFileOptions, - _client: Client - ): Promise { - throw Error("client.getFile(...) is not implemented for Plugins."); + _: GetFileOptions + ): Promise> { + return ResultErr( + Error("client.getFile(...) is not implemented for Plugins.") + ); } @Tracer.traceMethod("PluginWrapper: getManifest") - public async getManifest( - _: GetManifestOptions, - _client: Client - ): Promise { + public getManifest(_?: GetManifestOptions): WrapManifest { return this._plugin.manifest; } @@ -51,70 +50,62 @@ export class PluginWrapper implements Wrapper { `Plugin Wrapper invoked: ${options.uri.uri}, with method ${options.method}`, TracingLevel.High ); - try { - const { method } = options; - const args = options.args || {}; - const module = this._getInstance(); - - if (!module) { - throw new Error(`PluginWrapper: module "${module}" not found.`); - } + const { method } = options; + const args = options.args || {}; + const module = this._getInstance(); - if (!module.getMethod(method)) { - throw new Error(`PluginWrapper: method "${method}" not found.`); - } - - // Set the module's environment - await module.setEnv(options.env || {}); + if (!module) { + return ResultErr(Error(`PluginWrapper: module "${module}" not found.`)); + } - let jsArgs: Record; + if (!module.getMethod(method)) { + return ResultErr(Error(`PluginWrapper: method "${method}" not found.`)); + } - // If the args are a msgpack buffer, deserialize it - if (isBuffer(args)) { - const result = msgpackDecode(args); + // Set the module's environment + await module.setEnv(options.env || {}); - Tracer.addEvent("msgpack-decoded", result); + let jsArgs: Record; - if (typeof result !== "object") { - throw new Error( - `PluginWrapper: decoded MsgPack args did not result in an object.\nResult: ${result}` - ); - } + // If the args are a msgpack buffer, deserialize it + if (isBuffer(args)) { + const result = msgpackDecode(args); - jsArgs = result as Record; - } else { - jsArgs = args as Record; - } + Tracer.addEvent("msgpack-decoded", result); - // Invoke the function - try { - const result = await module._wrap_invoke(method, jsArgs, client); - - if (result !== undefined) { - const data = result as unknown; - - Tracer.addEvent("Result", data); - - return { - data: data, - encoded: false, - }; - } else { - return {}; - } - } catch (e) { - throw Error( - `PluginWrapper: invocation exception encountered.\n` + - `uri: ${options.uri}\nmodule: ${module}\n` + - `method: ${method}\n` + - `args: ${JSON.stringify(jsArgs, null, 2)}\n` + - `exception: ${e.message}` + if (typeof result !== "object") { + const msgPackException = Error( + `PluginWrapper: decoded MsgPack args did not result in an object.\nResult: ${result}` ); + return ResultErr(msgPackException); } - } catch (error) { + + jsArgs = result as Record; + } else { + jsArgs = args as Record; + } + + // Invoke the function + const result = await module._wrap_invoke(method, jsArgs, client); + + if (result.ok) { + const data = result.value; + + Tracer.addEvent("Result", data); + return { - error, + ...ResultOk(data), + encoded: false, }; + } else { + const invocationException = Error( + `PluginWrapper: invocation exception encountered.\n` + + `uri: ${options.uri}\nmodule: ${module}\n` + + `method: ${method}\n` + + `args: ${JSON.stringify(jsArgs, null, 2)}\n` + + `exception: ${result.error?.message}` + ); + return ResultErr(invocationException); } } diff --git a/packages/js/core/src/types/Client.ts b/packages/js/core/src/types/Client.ts index dee80eea28..a2c15c3a72 100644 --- a/packages/js/core/src/types/Client.ts +++ b/packages/js/core/src/types/Client.ts @@ -13,41 +13,26 @@ import { IUriResolver } from "../uri-resolution"; import { UriResolverHandler } from "./UriResolver"; import { WrapManifest } from "@polywrap/wrap-manifest-types-js"; +import { Result } from "@polywrap/result"; export interface ClientConfig { - redirects: UriRedirect[]; - plugins: PluginRegistration[]; - interfaces: InterfaceImplementations[]; - envs: Env[]; - resolver: IUriResolver; + readonly redirects: Readonly[]>; + readonly plugins: Readonly[]>; + readonly interfaces: Readonly[]>; + readonly envs: Readonly[]>; + readonly resolver: Readonly>; } -export interface Contextualized { - contextId?: string; -} - -export type GetRedirectsOptions = Contextualized; - -export type GetPluginsOptions = Contextualized; - -export type GetInterfacesOptions = Contextualized; - -export type GetEnvsOptions = Contextualized; - -export type GetUriResolverOptions = Contextualized; - -export interface GetManifestOptions extends Contextualized { +export interface GetManifestOptions { noValidate?: boolean; } -export type GetPluginOptions = Contextualized; - -export interface GetFileOptions extends Contextualized { +export interface GetFileOptions { path: string; encoding?: "utf-8" | string; } -export interface GetImplementationsOptions extends Contextualized { +export interface GetImplementationsOptions { applyRedirects?: boolean; } @@ -56,40 +41,36 @@ export interface Client QueryHandler, SubscriptionHandler, UriResolverHandler { - getRedirects(options?: GetRedirectsOptions): readonly UriRedirect[]; + getConfig(): ClientConfig; + + getRedirects(): readonly UriRedirect[]; - getPlugins(options?: GetPluginsOptions): readonly PluginRegistration[]; + getPlugins(): readonly PluginRegistration[]; getPluginByUri( - uri: TUri, - options?: GetPluginOptions + uri: TUri ): PluginPackage | undefined; - getInterfaces( - options?: GetInterfacesOptions - ): readonly InterfaceImplementations[]; + getInterfaces(): readonly InterfaceImplementations[]; - getEnvs(options?: GetEnvsOptions): readonly Env[]; + getEnvs(): readonly Env[]; - getEnvByUri( - uri: TUri, - options?: GetEnvsOptions - ): Env | undefined; + getEnvByUri(uri: TUri): Env | undefined; - getUriResolver(options: GetUriResolverOptions): IUriResolver; + getUriResolver(): IUriResolver; getManifest( uri: TUri, options: GetManifestOptions - ): Promise; + ): Promise>; getFile( uri: TUri, options: GetFileOptions - ): Promise; + ): Promise>; getImplementations( uri: TUri, options: GetImplementationsOptions - ): TUri[]; + ): Result; } diff --git a/packages/js/core/src/types/IWrapPackage.ts b/packages/js/core/src/types/IWrapPackage.ts index ce30d97c0f..9afe7fc5aa 100644 --- a/packages/js/core/src/types/IWrapPackage.ts +++ b/packages/js/core/src/types/IWrapPackage.ts @@ -4,8 +4,13 @@ import { DeserializeManifestOptions, WrapManifest, } from "@polywrap/wrap-manifest-types-js"; +import { Result } from "@polywrap/result"; export interface IWrapPackage { - getManifest(options?: GetManifestOptions): Promise; - createWrapper(options?: DeserializeManifestOptions): Promise; + getManifest( + options?: GetManifestOptions + ): Promise>; + createWrapper( + options?: DeserializeManifestOptions + ): Promise>; } diff --git a/packages/js/core/src/types/Invoke.ts b/packages/js/core/src/types/Invoke.ts index e1e6a61c2a..3a0214f5fb 100644 --- a/packages/js/core/src/types/Invoke.ts +++ b/packages/js/core/src/types/Invoke.ts @@ -1,11 +1,10 @@ -import { ClientConfig, Uri, Wrapper } from "."; +import { Uri, Wrapper } from "."; import { IUriResolutionContext } from "../uri-resolution"; +import { Result } from "@polywrap/result"; + /** Options required for an Wrapper invocation. */ -export interface InvokeOptions< - TUri extends Uri | string = string, - TClientConfig extends ClientConfig = ClientConfig -> { +export interface InvokeOptions { /** The Wrapper's URI */ uri: TUri; @@ -18,22 +17,12 @@ export interface InvokeOptions< */ args?: Record | Uint8Array; - /** - * Override the client's config for all invokes within this invoke. - */ - config?: Partial; - /** * Env variables for the wrapper invocation. */ env?: Record; resolutionContext?: IUriResolutionContext; - - /** - * Invoke id used to track query context data set internally. - */ - contextId?: string; } /** @@ -41,23 +30,10 @@ export interface InvokeOptions< * * @template TData Type of the invoke result data. */ -export interface InvokeResult { - /** - * Invoke result data. The type of this value is the return type - * of the method. If undefined, it means something went wrong. - * Errors should be populated with information as to what happened. - * Null is used to represent an intentionally null result. - */ - data?: TData; +export type InvokeResult = Result; - /** Errors encountered during the invocation. */ - error?: Error; -} - -export interface InvokerOptions< - TUri extends Uri | string = string, - TClientConfig extends ClientConfig = ClientConfig -> extends InvokeOptions { +export interface InvokerOptions + extends InvokeOptions { encodeResult?: boolean; } @@ -70,9 +46,9 @@ export interface Invoker { ): Promise>; } -export interface InvocableResult extends InvokeResult { +export type InvocableResult = InvokeResult & { encoded?: boolean; -} +}; export interface Invocable { invoke( diff --git a/packages/js/core/src/types/MaybeAsync.ts b/packages/js/core/src/types/MaybeAsync.ts index f713e5d4f0..1e3bb3d1ad 100644 --- a/packages/js/core/src/types/MaybeAsync.ts +++ b/packages/js/core/src/types/MaybeAsync.ts @@ -1,18 +1 @@ export type MaybeAsync = Promise | T; - -export const isPromise = ( - test?: MaybeAsync -): test is Promise => - !!test && typeof (test as Promise).then === "function"; - -// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types -export const executeMaybeAsyncFunction = async ( - func: (...args: unknown[]) => Promise | T, - ...args: unknown[] -): Promise => { - let result = func(...args); - if (isPromise(result)) { - result = await result; - } - return result; -}; diff --git a/packages/js/core/src/types/Plugin.ts b/packages/js/core/src/types/Plugin.ts index 1251ffcd1d..26e57c2efe 100644 --- a/packages/js/core/src/types/Plugin.ts +++ b/packages/js/core/src/types/Plugin.ts @@ -1,7 +1,8 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { Client, MaybeAsync, executeMaybeAsyncFunction } from "."; +import { Client, MaybeAsync } from "."; import { WrapManifest } from "@polywrap/wrap-manifest-types-js"; +import { Result, ResultErr, ResultOk } from "@polywrap/result"; /** * Invocable plugin method. @@ -42,20 +43,26 @@ export abstract class PluginModule< public async _wrap_invoke< TArgs extends Record = Record, TResult = unknown - >(method: string, args: TArgs, client: Client): Promise { + >( + method: string, + args: TArgs, + client: Client + ): Promise> { const fn = this.getMethod(method); if (!fn) { - throw Error(`Plugin missing method "${method}"`); + return ResultErr(Error(`Plugin missing method "${method}"`)); } if (typeof fn !== "function") { - throw Error(`Plugin method "${method}" must be of type 'function'`); + return ResultErr( + Error(`Plugin method "${method}" must be of type 'function'`) + ); } - return await executeMaybeAsyncFunction( - fn.bind(this, args, client) - ); + const data = await fn(args, client); + + return ResultOk(data); } public getMethod< @@ -69,7 +76,7 @@ export abstract class PluginModule< PluginMethod >)[method]; - return fn; + return fn.bind(this); } } diff --git a/packages/js/core/src/types/Query.ts b/packages/js/core/src/types/Query.ts index 0cf4cfa9cb..5bcd019e82 100644 --- a/packages/js/core/src/types/Query.ts +++ b/packages/js/core/src/types/Query.ts @@ -1,4 +1,4 @@ -import { Uri, InvokeOptions, ClientConfig } from "./"; +import { Uri, InvokeOptions } from "./"; import { Tracer } from "@polywrap/tracing-js"; import { DocumentNode } from "graphql"; @@ -18,8 +18,7 @@ export const createQueryDocument = Tracer.traceFunc( /** Options required for an Wrapper query. */ export interface QueryOptions< TVariables extends Record = Record, - TUri extends Uri | string = string, - TClientConfig extends ClientConfig = ClientConfig + TUri extends Uri | string = string > { /** The Wrapper's URI */ uri: TUri; @@ -34,16 +33,6 @@ export interface QueryOptions< * Variables referenced within the query string via GraphQL's '$variable' syntax. */ variables?: TVariables; - - /** - * Override the client's config for all invokes within this query. - */ - config?: Partial; - - /** - * Query id used to track query context data set internally. - */ - contextId?: string; } /** diff --git a/packages/js/core/src/types/Subscription.ts b/packages/js/core/src/types/Subscription.ts index bb2ee2b671..6559620b9d 100644 --- a/packages/js/core/src/types/Subscription.ts +++ b/packages/js/core/src/types/Subscription.ts @@ -1,5 +1,4 @@ import { Uri } from "./Uri"; -import { ClientConfig } from "./Client"; import { InvokeOptions, InvokeResult } from "./Invoke"; /** Defines the frequency of Wrapper invocations for an Wrapper subscription */ @@ -11,10 +10,8 @@ export interface SubscriptionFrequency { } /** Options required for an Wrapper subscription. */ -export interface SubscribeOptions< - TUri extends Uri | string = string, - TClientConfig extends ClientConfig = ClientConfig -> extends InvokeOptions { +export interface SubscribeOptions + extends InvokeOptions { /** * The frequency of Wrapper invocations. Defaults to one query per minute. */ diff --git a/packages/js/core/src/types/Uri.ts b/packages/js/core/src/types/Uri.ts index 7e215f2cbe..cc8afb7c2a 100644 --- a/packages/js/core/src/types/Uri.ts +++ b/packages/js/core/src/types/Uri.ts @@ -1,4 +1,5 @@ import { Tracer } from "@polywrap/tracing-js"; +import { Result, ResultErr, ResultOk } from "@polywrap/result"; /** URI configuration */ export interface UriConfig { @@ -36,7 +37,11 @@ export class Uri { } constructor(uri: string) { - this._config = Uri.parseUri(uri); + const result = Uri.parseUri(uri); + if (!result.ok) { + throw result.error; + } + this._config = result.value; } public static equals(a: Uri, b: Uri): boolean { @@ -48,27 +53,27 @@ export class Uri { } public static isValidUri(uri: string, parsed?: UriConfig): boolean { - try { - const result = Uri.parseUri(uri); - - if (parsed) { - parsed = Object.assign(parsed, result); - } + const result = Uri.parseUri(uri); - return true; - } catch (e) { - return false; + if (parsed && result.ok) { + Object.assign(parsed, result.value); } + + return result.ok; } public toString(): string { return this._config.uri; } + public toJSON(): string { + return this._config.uri; + } + @Tracer.traceMethod("Uri: parseUri") - public static parseUri(uri: string): UriConfig { + public static parseUri(uri: string): Result { if (!uri) { - throw Error("The provided URI is empty"); + return ResultErr(Error("The provided URI is empty")); } let processed = uri; @@ -86,10 +91,10 @@ export class Uri { processed = "wrap://" + processed; } - // If the wrap:// is not in the beginning, throw an error + // If the wrap:// is not in the beginning, return an error if (wrapSchemeIdx > -1 && wrapSchemeIdx !== 0) { - throw Error( - "The wrap:// scheme must be at the beginning of the URI string" + return ResultErr( + Error("The wrap:// scheme must be at the beginning of the URI string") ); } @@ -102,20 +107,22 @@ export class Uri { } if (!result || result.length !== 3) { - throw Error( - `URI is malformed, here are some examples of valid URIs:\n` + - `wrap://ipfs/QmHASH\n` + - `wrap://ens/domain.eth\n` + - `ens/domain.eth\n\n` + - `Invalid URI Received: ${uri}` + return ResultErr( + Error( + `URI is malformed, here are some examples of valid URIs:\n` + + `wrap://ipfs/QmHASH\n` + + `wrap://ens/domain.eth\n` + + `ens/domain.eth\n\n` + + `Invalid URI Received: ${uri}` + ) ); } - return { + return ResultOk({ uri: processed, authority: result[1], path: result[2], - }; + }); } @Tracer.traceMethod("Uri: from") diff --git a/packages/js/core/src/types/UriResolver.ts b/packages/js/core/src/types/UriResolver.ts index 356bc1415b..fb0552dc7a 100644 --- a/packages/js/core/src/types/UriResolver.ts +++ b/packages/js/core/src/types/UriResolver.ts @@ -1,31 +1,18 @@ -import { ClientConfig, Uri } from "."; +import { Uri } from "."; import { IUriResolutionContext, UriPackageOrWrapper } from "../uri-resolution"; import { Result } from "@polywrap/result"; /** Options required for an URI resolution. */ -export interface TryResolveUriOptions< - TUri extends Uri | string, - TClientConfig extends ClientConfig = ClientConfig -> { +export interface TryResolveUriOptions { /** The Wrapper's URI */ uri: TUri; resolutionContext?: IUriResolutionContext; - - /** - * Override the client's config for all resolutions. - */ - config?: Partial; - - /** - * Id used to track context data set internally. - */ - contextId?: string; } export interface UriResolverHandler { tryResolveUri( - options?: TryResolveUriOptions + options?: TryResolveUriOptions ): Promise>; } diff --git a/packages/js/core/src/types/Wrapper.ts b/packages/js/core/src/types/Wrapper.ts index e11bf2397c..1e6a1b5220 100644 --- a/packages/js/core/src/types/Wrapper.ts +++ b/packages/js/core/src/types/Wrapper.ts @@ -1,6 +1,5 @@ import { Uri, - Client, GetFileOptions, GetManifestOptions, InvokeOptions, @@ -10,6 +9,7 @@ import { } from "."; import { WrapManifest } from "@polywrap/wrap-manifest-types-js"; +import { Result } from "@polywrap/result"; /** * The Wrapper definition, which can be used to spawn @@ -37,10 +37,7 @@ export interface Wrapper extends Invocable { * @param options Configuration options for file retrieval * @param client The client instance requesting the file. */ - getFile( - options: GetFileOptions, - client: Client - ): Promise; + getFile(options: GetFileOptions): Promise>; /** * Get a manifest from the Wrapper package. @@ -48,8 +45,5 @@ export interface Wrapper extends Invocable { * * @param client The client instance requesting the manifest. */ - getManifest( - options: GetManifestOptions, - client: Client - ): Promise; + getManifest(options?: GetManifestOptions): WrapManifest; } diff --git a/packages/js/core/src/utils/getEnvFromUriHistory.ts b/packages/js/core/src/utils/getEnvFromUriHistory.ts index e7db7e6b3b..d128bcbeb4 100644 --- a/packages/js/core/src/utils/getEnvFromUriHistory.ts +++ b/packages/js/core/src/utils/getEnvFromUriHistory.ts @@ -5,7 +5,7 @@ export const getEnvFromUriHistory = ( client: Client ): Env | undefined => { for (const uri of uriHistory) { - const env = client.getEnvByUri(uri, {}); + const env = client.getEnvByUri(uri); if (env) { return env; diff --git a/packages/js/core/src/utils/index.ts b/packages/js/core/src/utils/index.ts index b9e83c77c7..1b9aa94c7d 100644 --- a/packages/js/core/src/utils/index.ts +++ b/packages/js/core/src/utils/index.ts @@ -1,5 +1,4 @@ export * from "./Queue"; export * from "./combinePaths"; export * from "./getEnvFromUriHistory"; -export * from "./initWrapper"; export * from "./is-buffer"; diff --git a/packages/js/core/src/utils/initWrapper.ts b/packages/js/core/src/utils/initWrapper.ts deleted file mode 100644 index 2f6d57be13..0000000000 --- a/packages/js/core/src/utils/initWrapper.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { IWrapPackage, Wrapper } from ".."; - -export const initWrapper = async ( - packageOrWrapper: IWrapPackage | Wrapper -): Promise => { - const wrapPackage = packageOrWrapper as Partial; - - if (wrapPackage.createWrapper) { - return await wrapPackage.createWrapper(); - } else { - return packageOrWrapper as Wrapper; - } -}; diff --git a/packages/js/manifests/polywrap/package.json b/packages/js/manifests/polywrap/package.json index 8bb1ced4fa..9f324cca35 100644 --- a/packages/js/manifests/polywrap/package.json +++ b/packages/js/manifests/polywrap/package.json @@ -17,14 +17,13 @@ }, "dependencies": { "@polywrap/polywrap-manifest-schemas": "0.8.0", - "js-yaml": "3.14.0", "jsonschema": "1.4.0", - "semver": "7.3.5" + "semver": "7.3.5", + "yaml": "2.1.3" }, "devDependencies": { "@polywrap/os-js": "0.8.0", "@types/jest": "26.0.8", - "@types/js-yaml": "3.11.1", "@types/mustache": "4.0.1", "@types/prettier": "2.6.0", "@types/semver": "7.3.8", diff --git a/packages/js/manifests/polywrap/scripts/generate.ts b/packages/js/manifests/polywrap/scripts/generate.ts index 596bbb0377..d54d6f3a87 100644 --- a/packages/js/manifests/polywrap/scripts/generate.ts +++ b/packages/js/manifests/polywrap/scripts/generate.ts @@ -61,8 +61,10 @@ async function generateFormatTypes() { // Add metadata for the root index.ts file to use formatModules.push({ + formatTypeName: formatTypeName, interface: formatSchema.id, version: formatVersion, + schemaFilePath: path.relative(schemasPackageDir, formatSchemaPath) }); } catch (error) { console.error( @@ -96,9 +98,11 @@ async function generateFormatTypes() { const formats = formatModules.map((module) => { return { type: module.interface, + formatTypeName: module.formatTypeName, isWorkflow: module.interface == "PolywrapWorkflow", version: module.version, tsVersion: versionToTs(module.version), + schemaFilePath: module.schemaFilePath, }; }); const latest = lastItem(formats); diff --git a/packages/js/manifests/polywrap/scripts/templates/deserialize-ts.mustache b/packages/js/manifests/polywrap/scripts/templates/deserialize-ts.mustache index 5ab75828f9..8f2a42a7a0 100644 --- a/packages/js/manifests/polywrap/scripts/templates/deserialize-ts.mustache +++ b/packages/js/manifests/polywrap/scripts/templates/deserialize-ts.mustache @@ -15,7 +15,7 @@ import { import { DeserializeManifestOptions } from "../../"; import * as Semver from "semver"; -import YAML from "js-yaml"; +import YAML from "yaml"; export function deserialize{{type}}( manifest: string, @@ -24,10 +24,10 @@ export function deserialize{{type}}( let any{{type}}: Any{{type}} | undefined; try { any{{type}} = JSON.parse(manifest) as Any{{type}}; - } catch (e) { - any{{type}} = YAML.safeLoad(manifest) as - | Any{{type}} - | undefined; + } catch (_) { + try { + any{{type}} = YAML.parse(manifest) as Any{{type}}; + } catch (_) { } } if (!any{{type}}) { diff --git a/packages/js/manifests/polywrap/scripts/templates/index-ts.mustache b/packages/js/manifests/polywrap/scripts/templates/index-ts.mustache index 4653dfef67..563e8cad35 100644 --- a/packages/js/manifests/polywrap/scripts/templates/index-ts.mustache +++ b/packages/js/manifests/polywrap/scripts/templates/index-ts.mustache @@ -31,6 +31,14 @@ export enum {{#latest}}{{type}}{{/latest}}Formats { {{/formats}} } +export const {{#latest}}{{type}}{{/latest}}SchemaFiles: Record = { + // NOTE: Patch fix for backwards compatability + "0.1": "formats/{{#latest}}{{formatTypeName}}{{/latest}}/0.1.0.json", + {{#formats}} + "{{version}}": "{{{schemaFilePath}}}", + {{/formats}} +} + export type Any{{#latest}}{{type}}{{/latest}} = {{#formats}} | {{type}}_{{tsVersion}} diff --git a/packages/js/manifests/polywrap/scripts/templates/migrate-ts.mustache b/packages/js/manifests/polywrap/scripts/templates/migrate-ts.mustache index 7376923064..d53a3f4bbc 100644 --- a/packages/js/manifests/polywrap/scripts/templates/migrate-ts.mustache +++ b/packages/js/manifests/polywrap/scripts/templates/migrate-ts.mustache @@ -8,24 +8,9 @@ import { Any{{#latest}}{{type}}{{/latest}}, {{#latest}}{{type}}{{/latest}}, {{#latest}}{{type}}{{/latest}}Formats, - latest{{#latest}}{{type}}{{/latest}}Format } from "."; - -{{#prevFormats}} -import { - migrate as migrate_{{tsVersion}}_to_{{#latest}}{{tsVersion}}{{/latest}} -} from "./migrators/{{version}}_to_{{#latest}}{{version}}{{/latest}}"; -{{/prevFormats}} - -type Migrator = { - [key in {{#latest}}{{type}}{{/latest}}Formats]?: (m: Any{{#latest}}{{type}}{{/latest}}) => {{#latest}}{{type}}{{/latest}}; -}; - -export const migrators: Migrator = { -{{#prevFormats}} - "{{version}}": migrate_{{tsVersion}}_to_{{#latest}}{{tsVersion}}{{/latest}}, -{{/prevFormats}} -}; +import { findShortestMigrationPath } from "../../migrations"; +import { migrators } from "./migrators"; export function migrate{{#latest}}{{type}}{{/latest}}( manifest: Any{{#latest}}{{type}}{{/latest}}, @@ -33,30 +18,26 @@ export function migrate{{#latest}}{{type}}{{/latest}}( ): {{#latest}}{{type}}{{/latest}} { let from = manifest.format as {{#latest}}{{type}}{{/latest}}Formats; - // HACK: Patch fix for backwards compatability - if(from === "0.1" && ("0.1.0" in migrators)) { - from = "0.1.0" as {{#latest}}{{type}}{{/latest}}Formats; - } - - if (from === latest{{#latest}}{{type}}{{/latest}}Format) { - return manifest as {{#latest}}{{type}}{{/latest}}; - } - if (!(Object.values({{#latest}}{{type}}{{/latest}}Formats).some(x => x === from))) { throw new Error(`Unrecognized {{#latest}}{{type}}{{/latest}}Format "${manifest.format}"`); } -{{#prevFormats.length}} - const migrator = migrators[from]; - if (!migrator) { + if (!(Object.values({{#latest}}{{type}}{{/latest}}Formats).some(x => x === to))) { + throw new Error(`Unrecognized {{#latest}}{{type}}{{/latest}}Format "${to}"`); + } + + const migrationPath = findShortestMigrationPath(migrators, from, to); + if (!migrationPath) { throw new Error( - `Migrator from {{#latest}}{{type}}{{/latest}}Format "${from}" to "${to}" is not available` + `Migration path from {{#latest}}{{type}}{{/latest}}Format "${from}" to "${to}" is not available` ); } - return migrator(manifest); -{{/prevFormats.length}} -{{^prevFormats.length}} - throw new Error(`This should never happen, {{#latest}}{{type}}{{/latest}} migrators is empty. from: ${from}, to: ${to}`); -{{/prevFormats.length}} + let newManifest = manifest; + + for(const migrator of migrationPath){ + newManifest = migrator.migrate(newManifest) as Any{{#latest}}{{type}}{{/latest}}; + } + + return newManifest as {{#latest}}{{type}}{{/latest}}; } diff --git a/packages/js/manifests/polywrap/src/__tests__/migrations.spec.ts b/packages/js/manifests/polywrap/src/__tests__/migrations.spec.ts index 49445fc31c..4b9a8f0b1d 100644 --- a/packages/js/manifests/polywrap/src/__tests__/migrations.spec.ts +++ b/packages/js/manifests/polywrap/src/__tests__/migrations.spec.ts @@ -1,11 +1,70 @@ import { deserializeDeployManifest, deserializePolywrapManifest } from "../"; import fs from "fs"; +import { findShortestMigrationPath, Migrator } from "../migrations"; -describe("Polywrap Manifest Migrations", () => { - it("Should succesfully migrate from 0.1.0 to 0.2.0", async() => { - const manifestPath = __dirname + "/manifest/polywrap/migrations/polywrap-0.1.0.yaml"; - const expectedManifestPath = __dirname + "/manifest/polywrap/migrations/polywrap-0.2.0.yaml"; +describe("Manifest migration pathfinding", () => { + const migrators: Migrator[] = [ + { + from: "0.1.0", + to: "0.2.0", + migrate: (x) => x, + }, + { + from: "0.2.0", + to: "0.3.0", + migrate: (x) => x, + }, + { + from: "0.3.0", + to: "0.4.0", + migrate: (x) => x, + }, + { + from: "0.4.0", + to: "0.5.0", + migrate: (x) => x, + }, + { + from: "0.2.0", + to: "0.4.0", + migrate: (x) => x, + }, + ]; + + it("Should return undefined when no migration path exists", async () => { + const path = findShortestMigrationPath(migrators, "0.1.0", "0.6.0"); + + expect(path).toBeUndefined(); + + const reverseUnsupportedPath = findShortestMigrationPath( + migrators, + "0.2.0", + "0.1.0" + ); + + expect(reverseUnsupportedPath).toBeUndefined(); + }); + + it("Should return an empty array when from and to are the same", async () => { + const path = findShortestMigrationPath(migrators, "0.1.0", "0.1.0"); + + expect(path).toEqual([]); + }); + + it("Should return the shortest migration path", async () => { + const path = findShortestMigrationPath(migrators, "0.1.0", "0.5.0"); + + expect(path).toEqual([migrators[0], migrators[4], migrators[3]]); + }); +}); + +describe("Polywrap Project Manifest Migrations", () => { + it("Should succesfully migrate from 0.1.0 to 0.2.0", async () => { + const manifestPath = + __dirname + "/manifest/polywrap/migrations/polywrap-0.1.0.yaml"; + const expectedManifestPath = + __dirname + "/manifest/polywrap/migrations/polywrap-0.2.0.yaml"; const manifestFile = fs.readFileSync(manifestPath, "utf-8"); const expectedManifestFile = fs.readFileSync(expectedManifestPath, "utf-8"); @@ -18,9 +77,11 @@ describe("Polywrap Manifest Migrations", () => { }); describe("Polywrap Deploy Manifest Migrations", () => { - it("Should succesfully migrate from 0.1.0 to 0.2.0", async() => { - const manifestPath = __dirname + "/manifest/deploy/migrations/polywrap-0.1.0.yaml"; - const expectedManifestPath = __dirname + "/manifest/deploy/migrations/polywrap-0.2.0.yaml"; + it("Should succesfully migrate from 0.1.0 to 0.2.0", async () => { + const manifestPath = + __dirname + "/manifest/deploy/migrations/polywrap-0.1.0.yaml"; + const expectedManifestPath = + __dirname + "/manifest/deploy/migrations/polywrap-0.2.0.yaml"; const manifestFile = fs.readFileSync(manifestPath, "utf-8"); const expectedManifestFile = fs.readFileSync(expectedManifestPath, "utf-8"); @@ -30,4 +91,4 @@ describe("Polywrap Deploy Manifest Migrations", () => { expect(manifest).toEqual(expectedManifest); }); -}); \ No newline at end of file +}); diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.app/deserialize.ts b/packages/js/manifests/polywrap/src/formats/polywrap.app/deserialize.ts index a69014e034..5fe1e79b5c 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.app/deserialize.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.app/deserialize.ts @@ -15,7 +15,7 @@ import { import { DeserializeManifestOptions } from "../../"; import * as Semver from "semver"; -import YAML from "js-yaml"; +import YAML from "yaml"; export function deserializeAppManifest( manifest: string, @@ -24,10 +24,10 @@ export function deserializeAppManifest( let anyAppManifest: AnyAppManifest | undefined; try { anyAppManifest = JSON.parse(manifest) as AnyAppManifest; - } catch (e) { - anyAppManifest = YAML.safeLoad(manifest) as - | AnyAppManifest - | undefined; + } catch (_) { + try { + anyAppManifest = YAML.parse(manifest) as AnyAppManifest; + } catch (_) { } } if (!anyAppManifest) { 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 3d731b6dd9..4a4387396a 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.app/index.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.app/index.ts @@ -24,6 +24,13 @@ export enum AppManifestFormats { "v0.2.0" = "0.2.0", } +export const AppManifestSchemaFiles: Record = { + // NOTE: Patch fix for backwards compatability + "0.1": "formats/polywrap.app/0.1.0.json", + "0.1.0": "formats/polywrap.app/0.1.0.json", + "0.2.0": "formats/polywrap.app/0.2.0.json", +} + export type AnyAppManifest = | AppManifest_0_1_0 | AppManifest_0_2_0 diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.app/migrate.ts b/packages/js/manifests/polywrap/src/formats/polywrap.app/migrate.ts index 9b162ac9de..d5223e4cdb 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.app/migrate.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.app/migrate.ts @@ -8,20 +8,9 @@ import { AnyAppManifest, AppManifest, AppManifestFormats, - latestAppManifestFormat } from "."; - -import { - migrate as migrate_0_1_0_to_0_2_0 -} from "./migrators/0.1.0_to_0.2.0"; - -type Migrator = { - [key in AppManifestFormats]?: (m: AnyAppManifest) => AppManifest; -}; - -export const migrators: Migrator = { - "0.1.0": migrate_0_1_0_to_0_2_0, -}; +import { findShortestMigrationPath } from "../../migrations"; +import { migrators } from "./migrators"; export function migrateAppManifest( manifest: AnyAppManifest, @@ -29,25 +18,26 @@ export function migrateAppManifest( ): AppManifest { let from = manifest.format as AppManifestFormats; - // HACK: Patch fix for backwards compatability - if(from === "0.1" && ("0.1.0" in migrators)) { - from = "0.1.0" as AppManifestFormats; - } - - if (from === latestAppManifestFormat) { - return manifest as AppManifest; - } - if (!(Object.values(AppManifestFormats).some(x => x === from))) { throw new Error(`Unrecognized AppManifestFormat "${manifest.format}"`); } - const migrator = migrators[from]; - if (!migrator) { + if (!(Object.values(AppManifestFormats).some(x => x === to))) { + throw new Error(`Unrecognized AppManifestFormat "${to}"`); + } + + const migrationPath = findShortestMigrationPath(migrators, from, to); + if (!migrationPath) { throw new Error( - `Migrator from AppManifestFormat "${from}" to "${to}" is not available` + `Migration path from AppManifestFormat "${from}" to "${to}" is not available` ); } - return migrator(manifest); + let newManifest = manifest; + + for(const migrator of migrationPath){ + newManifest = migrator.migrate(newManifest) as AnyAppManifest; + } + + return newManifest as AppManifest; } 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 new file mode 100644 index 0000000000..2c882af9fa --- /dev/null +++ b/packages/js/manifests/polywrap/src/formats/polywrap.app/migrators/index.ts @@ -0,0 +1,15 @@ +import { Migrator } from "../../../migrations"; +import { migrate as migrate_0_1_0_to_0_2_0 } from "./0.1.0_to_0.2.0"; + +export const migrators: Migrator[] = [ + { + from: "0.1", + to: "0.2.0", + migrate: migrate_0_1_0_to_0_2_0 + }, + { + from: "0.1.0", + to: "0.2.0", + migrate: migrate_0_1_0_to_0_2_0 + } +]; \ No newline at end of file diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.build/0.2.0.ts b/packages/js/manifests/polywrap/src/formats/polywrap.build/0.2.0.ts new file mode 100644 index 0000000000..d84c0f0d45 --- /dev/null +++ b/packages/js/manifests/polywrap/src/formats/polywrap.build/0.2.0.ts @@ -0,0 +1,101 @@ +/* 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 BuildManifest { + /** + * Polywrap build manifest format version. + */ + format: "0.2.0"; + /** + * Custom build image configurations. + */ + strategies?: { + image?: Image; + local?: Local; + vm?: Vm; + }; + /** + * Locally linked packages into docker build image. + */ + linked_packages?: { + /** + * Package name. + */ + name: string; + /** + * Path to linked package directory. + */ + path: string; + /** + * Ignore files matching this regex in linked package directory. + */ + filter?: string; + }[]; + /** + * General configurations. + */ + config?: { + [k: string]: unknown; + }; + __type: "BuildManifest"; +} +/** + * Docker image strategy configuration + */ +export interface Image { + /** + * Docker image name. + */ + name?: string; + /** + * Docker image file name. + */ + dockerfile?: string; + /** + * Configuration options for Docker Buildx, set to true for default value. + */ + buildx?: + | { + /** + * Path to cache directory, set to true for default value, set to false to disable caching. + */ + cache?: string | boolean; + /** + * Remove the builder instance. + */ + removeBuilder?: boolean; + } + | boolean; + /** + * Remove the image. + */ + removeImage?: boolean; + [k: string]: unknown; +} +/** + * Local build strategy configuration + */ +export interface Local { + /** + * Custom script path for local build + */ + scriptPath?: string; +} +/** + * Docker VM strategy configuration + */ +export interface Vm { + /** + * Base image for the Docker VM + */ + baseImage?: string; + /** + * Files to include in build VM container, by default + */ + defaultIncludes?: string[]; +} diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.build/deserialize.ts b/packages/js/manifests/polywrap/src/formats/polywrap.build/deserialize.ts index 444d52b522..2d69bb2ebd 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.build/deserialize.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.build/deserialize.ts @@ -15,7 +15,7 @@ import { import { DeserializeManifestOptions } from "../../"; import * as Semver from "semver"; -import YAML from "js-yaml"; +import YAML from "yaml"; export function deserializeBuildManifest( manifest: string, @@ -24,10 +24,10 @@ export function deserializeBuildManifest( let anyBuildManifest: AnyBuildManifest | undefined; try { anyBuildManifest = JSON.parse(manifest) as AnyBuildManifest; - } catch (e) { - anyBuildManifest = YAML.safeLoad(manifest) as - | AnyBuildManifest - | undefined; + } catch (_) { + try { + anyBuildManifest = YAML.parse(manifest) as AnyBuildManifest; + } catch (_) { } } if (!anyBuildManifest) { diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.build/index.ts b/packages/js/manifests/polywrap/src/formats/polywrap.build/index.ts index a1120a6019..ddf68f920f 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.build/index.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.build/index.ts @@ -8,25 +8,38 @@ import { BuildManifest as BuildManifest_0_1_0, } from "./0.1.0"; +import { + BuildManifest as BuildManifest_0_2_0, +} from "./0.2.0"; export { BuildManifest_0_1_0, + BuildManifest_0_2_0, }; export enum BuildManifestFormats { // NOTE: Patch fix for backwards compatability "v0.1" = "0.1", "v0.1.0" = "0.1.0", + "v0.2.0" = "0.2.0", +} + +export const BuildManifestSchemaFiles: Record = { + // NOTE: Patch fix for backwards compatability + "0.1": "formats/polywrap.build/0.1.0.json", + "0.1.0": "formats/polywrap.build/0.1.0.json", + "0.2.0": "formats/polywrap.build/0.2.0.json", } export type AnyBuildManifest = | BuildManifest_0_1_0 + | BuildManifest_0_2_0 -export type BuildManifest = BuildManifest_0_1_0; +export type BuildManifest = BuildManifest_0_2_0; -export const latestBuildManifestFormat = BuildManifestFormats["v0.1.0"] +export const latestBuildManifestFormat = BuildManifestFormats["v0.2.0"] export { migrateBuildManifest } from "./migrate"; diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.build/migrate.ts b/packages/js/manifests/polywrap/src/formats/polywrap.build/migrate.ts index 3fd31dfb03..ba82b20295 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.build/migrate.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.build/migrate.ts @@ -8,16 +8,9 @@ import { AnyBuildManifest, BuildManifest, BuildManifestFormats, - latestBuildManifestFormat } from "."; - - -type Migrator = { - [key in BuildManifestFormats]?: (m: AnyBuildManifest) => BuildManifest; -}; - -export const migrators: Migrator = { -}; +import { findShortestMigrationPath } from "../../migrations"; +import { migrators } from "./migrators"; export function migrateBuildManifest( manifest: AnyBuildManifest, @@ -25,18 +18,26 @@ export function migrateBuildManifest( ): BuildManifest { let from = manifest.format as BuildManifestFormats; - // HACK: Patch fix for backwards compatability - if(from === "0.1" && ("0.1.0" in migrators)) { - from = "0.1.0" as BuildManifestFormats; + if (!(Object.values(BuildManifestFormats).some(x => x === from))) { + throw new Error(`Unrecognized BuildManifestFormat "${manifest.format}"`); + } + + if (!(Object.values(BuildManifestFormats).some(x => x === to))) { + throw new Error(`Unrecognized BuildManifestFormat "${to}"`); } - if (from === latestBuildManifestFormat) { - return manifest as BuildManifest; + const migrationPath = findShortestMigrationPath(migrators, from, to); + if (!migrationPath) { + throw new Error( + `Migration path from BuildManifestFormat "${from}" to "${to}" is not available` + ); } - if (!(Object.values(BuildManifestFormats).some(x => x === from))) { - throw new Error(`Unrecognized BuildManifestFormat "${manifest.format}"`); + let newManifest = manifest; + + for(const migrator of migrationPath){ + newManifest = migrator.migrate(newManifest) as AnyBuildManifest; } - throw new Error(`This should never happen, BuildManifest migrators is empty. from: ${from}, to: ${to}`); + return newManifest as BuildManifest; } diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.build/migrators/0.1.0_to_0.2.0.ts b/packages/js/manifests/polywrap/src/formats/polywrap.build/migrators/0.1.0_to_0.2.0.ts new file mode 100644 index 0000000000..f076051a3d --- /dev/null +++ b/packages/js/manifests/polywrap/src/formats/polywrap.build/migrators/0.1.0_to_0.2.0.ts @@ -0,0 +1,19 @@ +/* eslint-disable @typescript-eslint/naming-convention */ + +import { BuildManifest as OldManifest } from "../0.1.0"; +import { BuildManifest as NewManifest } from "../0.2.0"; + +export function migrate(old: OldManifest): NewManifest { + return { + ...old, + __type: "BuildManifest", + format: "0.2.0", + strategies: { + image: { + ...old.docker, + node_version: (old.config?.node_version as string) ?? "16.13.0", + include: (old.config?.include as string[]) ?? ["./package.json"], + }, + }, + }; +} diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.build/migrators/index.ts b/packages/js/manifests/polywrap/src/formats/polywrap.build/migrators/index.ts new file mode 100644 index 0000000000..2c882af9fa --- /dev/null +++ b/packages/js/manifests/polywrap/src/formats/polywrap.build/migrators/index.ts @@ -0,0 +1,15 @@ +import { Migrator } from "../../../migrations"; +import { migrate as migrate_0_1_0_to_0_2_0 } from "./0.1.0_to_0.2.0"; + +export const migrators: Migrator[] = [ + { + from: "0.1", + to: "0.2.0", + migrate: migrate_0_1_0_to_0_2_0 + }, + { + from: "0.1.0", + to: "0.2.0", + migrate: migrate_0_1_0_to_0_2_0 + } +]; \ No newline at end of file diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.build/validate.ts b/packages/js/manifests/polywrap/src/formats/polywrap.build/validate.ts index 19e0940e05..6235c0a461 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.build/validate.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.build/validate.ts @@ -10,6 +10,7 @@ import { } from "."; import BuildManifestSchema_0_1_0 from "@polywrap/polywrap-manifest-schemas/formats/polywrap.build/0.1.0.json"; +import BuildManifestSchema_0_2_0 from "@polywrap/polywrap-manifest-schemas/formats/polywrap.build/0.2.0.json"; import { Schema, @@ -26,6 +27,7 @@ const schemas: BuildManifestSchemas = { // NOTE: Patch fix for backwards compatability "0.1": BuildManifestSchema_0_1_0, "0.1.0": BuildManifestSchema_0_1_0, + "0.2.0": BuildManifestSchema_0_2_0, }; const validator = new Validator(); diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.deploy/deserialize.ts b/packages/js/manifests/polywrap/src/formats/polywrap.deploy/deserialize.ts index 5c69f76e2e..19251abbf6 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.deploy/deserialize.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.deploy/deserialize.ts @@ -15,7 +15,7 @@ import { import { DeserializeManifestOptions } from "../../"; import * as Semver from "semver"; -import YAML from "js-yaml"; +import YAML from "yaml"; export function deserializeDeployManifest( manifest: string, @@ -24,10 +24,10 @@ export function deserializeDeployManifest( let anyDeployManifest: AnyDeployManifest | undefined; try { anyDeployManifest = JSON.parse(manifest) as AnyDeployManifest; - } catch (e) { - anyDeployManifest = YAML.safeLoad(manifest) as - | AnyDeployManifest - | undefined; + } catch (_) { + try { + anyDeployManifest = YAML.parse(manifest) as AnyDeployManifest; + } catch (_) { } } if (!anyDeployManifest) { diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.deploy/index.ts b/packages/js/manifests/polywrap/src/formats/polywrap.deploy/index.ts index c16703a7f4..23357f9a64 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.deploy/index.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.deploy/index.ts @@ -24,6 +24,13 @@ export enum DeployManifestFormats { "v0.2.0" = "0.2.0", } +export const DeployManifestSchemaFiles: Record = { + // NOTE: Patch fix for backwards compatability + "0.1": "formats/polywrap.deploy/0.1.0.json", + "0.1.0": "formats/polywrap.deploy/0.1.0.json", + "0.2.0": "formats/polywrap.deploy/0.2.0.json", +} + export type AnyDeployManifest = | DeployManifest_0_1_0 | DeployManifest_0_2_0 diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.deploy/migrate.ts b/packages/js/manifests/polywrap/src/formats/polywrap.deploy/migrate.ts index 8667f4ea10..09cc08fda8 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.deploy/migrate.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.deploy/migrate.ts @@ -8,20 +8,9 @@ import { AnyDeployManifest, DeployManifest, DeployManifestFormats, - latestDeployManifestFormat } from "."; - -import { - migrate as migrate_0_1_0_to_0_2_0 -} from "./migrators/0.1.0_to_0.2.0"; - -type Migrator = { - [key in DeployManifestFormats]?: (m: AnyDeployManifest) => DeployManifest; -}; - -export const migrators: Migrator = { - "0.1.0": migrate_0_1_0_to_0_2_0, -}; +import { findShortestMigrationPath } from "../../migrations"; +import { migrators } from "./migrators"; export function migrateDeployManifest( manifest: AnyDeployManifest, @@ -29,25 +18,26 @@ export function migrateDeployManifest( ): DeployManifest { let from = manifest.format as DeployManifestFormats; - // HACK: Patch fix for backwards compatability - if(from === "0.1" && ("0.1.0" in migrators)) { - from = "0.1.0" as DeployManifestFormats; - } - - if (from === latestDeployManifestFormat) { - return manifest as DeployManifest; - } - if (!(Object.values(DeployManifestFormats).some(x => x === from))) { throw new Error(`Unrecognized DeployManifestFormat "${manifest.format}"`); } - const migrator = migrators[from]; - if (!migrator) { + if (!(Object.values(DeployManifestFormats).some(x => x === to))) { + throw new Error(`Unrecognized DeployManifestFormat "${to}"`); + } + + const migrationPath = findShortestMigrationPath(migrators, from, to); + if (!migrationPath) { throw new Error( - `Migrator from DeployManifestFormat "${from}" to "${to}" is not available` + `Migration path from DeployManifestFormat "${from}" to "${to}" is not available` ); } - return migrator(manifest); + let newManifest = manifest; + + for(const migrator of migrationPath){ + newManifest = migrator.migrate(newManifest) as AnyDeployManifest; + } + + return newManifest as DeployManifest; } diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.deploy/migrators/index.ts b/packages/js/manifests/polywrap/src/formats/polywrap.deploy/migrators/index.ts new file mode 100644 index 0000000000..2c882af9fa --- /dev/null +++ b/packages/js/manifests/polywrap/src/formats/polywrap.deploy/migrators/index.ts @@ -0,0 +1,15 @@ +import { Migrator } from "../../../migrations"; +import { migrate as migrate_0_1_0_to_0_2_0 } from "./0.1.0_to_0.2.0"; + +export const migrators: Migrator[] = [ + { + from: "0.1", + to: "0.2.0", + migrate: migrate_0_1_0_to_0_2_0 + }, + { + from: "0.1.0", + to: "0.2.0", + migrate: migrate_0_1_0_to_0_2_0 + } +]; \ No newline at end of file diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.infra/deserialize.ts b/packages/js/manifests/polywrap/src/formats/polywrap.infra/deserialize.ts index 29e95727fd..ee7a3ffe78 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.infra/deserialize.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.infra/deserialize.ts @@ -15,7 +15,7 @@ import { import { DeserializeManifestOptions } from "../../"; import * as Semver from "semver"; -import YAML from "js-yaml"; +import YAML from "yaml"; export function deserializeInfraManifest( manifest: string, @@ -24,10 +24,10 @@ export function deserializeInfraManifest( let anyInfraManifest: AnyInfraManifest | undefined; try { anyInfraManifest = JSON.parse(manifest) as AnyInfraManifest; - } catch (e) { - anyInfraManifest = YAML.safeLoad(manifest) as - | AnyInfraManifest - | undefined; + } catch (_) { + try { + anyInfraManifest = YAML.parse(manifest) as AnyInfraManifest; + } catch (_) { } } if (!anyInfraManifest) { diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.infra/index.ts b/packages/js/manifests/polywrap/src/formats/polywrap.infra/index.ts index f82e70c935..5819449dda 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.infra/index.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.infra/index.ts @@ -19,6 +19,12 @@ export enum InfraManifestFormats { "v0.1.0" = "0.1.0", } +export const InfraManifestSchemaFiles: Record = { + // NOTE: Patch fix for backwards compatability + "0.1": "formats/polywrap.infra/0.1.0.json", + "0.1.0": "formats/polywrap.infra/0.1.0.json", +} + export type AnyInfraManifest = | InfraManifest_0_1_0 diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.infra/migrate.ts b/packages/js/manifests/polywrap/src/formats/polywrap.infra/migrate.ts index d9aa2bc605..ee769e3f9d 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.infra/migrate.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.infra/migrate.ts @@ -8,16 +8,9 @@ import { AnyInfraManifest, InfraManifest, InfraManifestFormats, - latestInfraManifestFormat } from "."; - - -type Migrator = { - [key in InfraManifestFormats]?: (m: AnyInfraManifest) => InfraManifest; -}; - -export const migrators: Migrator = { -}; +import { findShortestMigrationPath } from "../../migrations"; +import { migrators } from "./migrators"; export function migrateInfraManifest( manifest: AnyInfraManifest, @@ -25,18 +18,26 @@ export function migrateInfraManifest( ): InfraManifest { let from = manifest.format as InfraManifestFormats; - // HACK: Patch fix for backwards compatability - if(from === "0.1" && ("0.1.0" in migrators)) { - from = "0.1.0" as InfraManifestFormats; + if (!(Object.values(InfraManifestFormats).some(x => x === from))) { + throw new Error(`Unrecognized InfraManifestFormat "${manifest.format}"`); + } + + if (!(Object.values(InfraManifestFormats).some(x => x === to))) { + throw new Error(`Unrecognized InfraManifestFormat "${to}"`); } - if (from === latestInfraManifestFormat) { - return manifest as InfraManifest; + const migrationPath = findShortestMigrationPath(migrators, from, to); + if (!migrationPath) { + throw new Error( + `Migration path from InfraManifestFormat "${from}" to "${to}" is not available` + ); } - if (!(Object.values(InfraManifestFormats).some(x => x === from))) { - throw new Error(`Unrecognized InfraManifestFormat "${manifest.format}"`); + let newManifest = manifest; + + for(const migrator of migrationPath){ + newManifest = migrator.migrate(newManifest) as AnyInfraManifest; } - throw new Error(`This should never happen, InfraManifest migrators is empty. from: ${from}, to: ${to}`); + return newManifest as InfraManifest; } diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.infra/migrators/index.ts b/packages/js/manifests/polywrap/src/formats/polywrap.infra/migrators/index.ts new file mode 100644 index 0000000000..6fa0ce38a3 --- /dev/null +++ b/packages/js/manifests/polywrap/src/formats/polywrap.infra/migrators/index.ts @@ -0,0 +1,3 @@ +import { Migrator } from "../../../migrations"; + +export const migrators: Migrator[] = []; diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.meta/deserialize.ts b/packages/js/manifests/polywrap/src/formats/polywrap.meta/deserialize.ts index 8c8c976ea3..69908632b2 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.meta/deserialize.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.meta/deserialize.ts @@ -15,7 +15,7 @@ import { import { DeserializeManifestOptions } from "../../"; import * as Semver from "semver"; -import YAML from "js-yaml"; +import YAML from "yaml"; export function deserializeMetaManifest( manifest: string, @@ -24,10 +24,10 @@ export function deserializeMetaManifest( let anyMetaManifest: AnyMetaManifest | undefined; try { anyMetaManifest = JSON.parse(manifest) as AnyMetaManifest; - } catch (e) { - anyMetaManifest = YAML.safeLoad(manifest) as - | AnyMetaManifest - | undefined; + } catch (_) { + try { + anyMetaManifest = YAML.parse(manifest) as AnyMetaManifest; + } catch (_) { } } if (!anyMetaManifest) { diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.meta/index.ts b/packages/js/manifests/polywrap/src/formats/polywrap.meta/index.ts index aac5cf17a4..83bb1d7782 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.meta/index.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.meta/index.ts @@ -19,6 +19,12 @@ export enum MetaManifestFormats { "v0.1.0" = "0.1.0", } +export const MetaManifestSchemaFiles: Record = { + // NOTE: Patch fix for backwards compatability + "0.1": "formats/polywrap.meta/0.1.0.json", + "0.1.0": "formats/polywrap.meta/0.1.0.json", +} + export type AnyMetaManifest = | MetaManifest_0_1_0 diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.meta/migrate.ts b/packages/js/manifests/polywrap/src/formats/polywrap.meta/migrate.ts index cc1d82575a..d9066967bc 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.meta/migrate.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.meta/migrate.ts @@ -8,16 +8,9 @@ import { AnyMetaManifest, MetaManifest, MetaManifestFormats, - latestMetaManifestFormat } from "."; - - -type Migrator = { - [key in MetaManifestFormats]?: (m: AnyMetaManifest) => MetaManifest; -}; - -export const migrators: Migrator = { -}; +import { findShortestMigrationPath } from "../../migrations"; +import { migrators } from "./migrators"; export function migrateMetaManifest( manifest: AnyMetaManifest, @@ -25,18 +18,26 @@ export function migrateMetaManifest( ): MetaManifest { let from = manifest.format as MetaManifestFormats; - // HACK: Patch fix for backwards compatability - if(from === "0.1" && ("0.1.0" in migrators)) { - from = "0.1.0" as MetaManifestFormats; + if (!(Object.values(MetaManifestFormats).some(x => x === from))) { + throw new Error(`Unrecognized MetaManifestFormat "${manifest.format}"`); + } + + if (!(Object.values(MetaManifestFormats).some(x => x === to))) { + throw new Error(`Unrecognized MetaManifestFormat "${to}"`); } - if (from === latestMetaManifestFormat) { - return manifest as MetaManifest; + const migrationPath = findShortestMigrationPath(migrators, from, to); + if (!migrationPath) { + throw new Error( + `Migration path from MetaManifestFormat "${from}" to "${to}" is not available` + ); } - if (!(Object.values(MetaManifestFormats).some(x => x === from))) { - throw new Error(`Unrecognized MetaManifestFormat "${manifest.format}"`); + let newManifest = manifest; + + for(const migrator of migrationPath){ + newManifest = migrator.migrate(newManifest) as AnyMetaManifest; } - throw new Error(`This should never happen, MetaManifest migrators is empty. from: ${from}, to: ${to}`); + return newManifest as MetaManifest; } diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.meta/migrators/index.ts b/packages/js/manifests/polywrap/src/formats/polywrap.meta/migrators/index.ts new file mode 100644 index 0000000000..6fa0ce38a3 --- /dev/null +++ b/packages/js/manifests/polywrap/src/formats/polywrap.meta/migrators/index.ts @@ -0,0 +1,3 @@ +import { Migrator } from "../../../migrations"; + +export const migrators: Migrator[] = []; diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.plugin/deserialize.ts b/packages/js/manifests/polywrap/src/formats/polywrap.plugin/deserialize.ts index fc64e6376b..e2e48aa572 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.plugin/deserialize.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.plugin/deserialize.ts @@ -15,7 +15,7 @@ import { import { DeserializeManifestOptions } from "../../"; import * as Semver from "semver"; -import YAML from "js-yaml"; +import YAML from "yaml"; export function deserializePluginManifest( manifest: string, @@ -24,10 +24,10 @@ export function deserializePluginManifest( let anyPluginManifest: AnyPluginManifest | undefined; try { anyPluginManifest = JSON.parse(manifest) as AnyPluginManifest; - } catch (e) { - anyPluginManifest = YAML.safeLoad(manifest) as - | AnyPluginManifest - | undefined; + } catch (_) { + try { + anyPluginManifest = YAML.parse(manifest) as AnyPluginManifest; + } catch (_) { } } if (!anyPluginManifest) { 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 5b043f86ee..0f385f8de1 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.plugin/index.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.plugin/index.ts @@ -24,6 +24,13 @@ export enum PluginManifestFormats { "v0.2.0" = "0.2.0", } +export const PluginManifestSchemaFiles: Record = { + // NOTE: Patch fix for backwards compatability + "0.1": "formats/polywrap.plugin/0.1.0.json", + "0.1.0": "formats/polywrap.plugin/0.1.0.json", + "0.2.0": "formats/polywrap.plugin/0.2.0.json", +} + export type AnyPluginManifest = | PluginManifest_0_1_0 | PluginManifest_0_2_0 diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.plugin/migrate.ts b/packages/js/manifests/polywrap/src/formats/polywrap.plugin/migrate.ts index b925557584..462745b609 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.plugin/migrate.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.plugin/migrate.ts @@ -8,20 +8,9 @@ import { AnyPluginManifest, PluginManifest, PluginManifestFormats, - latestPluginManifestFormat } from "."; - -import { - migrate as migrate_0_1_0_to_0_2_0 -} from "./migrators/0.1.0_to_0.2.0"; - -type Migrator = { - [key in PluginManifestFormats]?: (m: AnyPluginManifest) => PluginManifest; -}; - -export const migrators: Migrator = { - "0.1.0": migrate_0_1_0_to_0_2_0, -}; +import { findShortestMigrationPath } from "../../migrations"; +import { migrators } from "./migrators"; export function migratePluginManifest( manifest: AnyPluginManifest, @@ -29,25 +18,26 @@ export function migratePluginManifest( ): PluginManifest { let from = manifest.format as PluginManifestFormats; - // HACK: Patch fix for backwards compatability - if(from === "0.1" && ("0.1.0" in migrators)) { - from = "0.1.0" as PluginManifestFormats; - } - - if (from === latestPluginManifestFormat) { - return manifest as PluginManifest; - } - if (!(Object.values(PluginManifestFormats).some(x => x === from))) { throw new Error(`Unrecognized PluginManifestFormat "${manifest.format}"`); } - const migrator = migrators[from]; - if (!migrator) { + if (!(Object.values(PluginManifestFormats).some(x => x === to))) { + throw new Error(`Unrecognized PluginManifestFormat "${to}"`); + } + + const migrationPath = findShortestMigrationPath(migrators, from, to); + if (!migrationPath) { throw new Error( - `Migrator from PluginManifestFormat "${from}" to "${to}" is not available` + `Migration path from PluginManifestFormat "${from}" to "${to}" is not available` ); } - return migrator(manifest); + let newManifest = manifest; + + for(const migrator of migrationPath){ + newManifest = migrator.migrate(newManifest) as AnyPluginManifest; + } + + return newManifest as PluginManifest; } 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 new file mode 100644 index 0000000000..2c882af9fa --- /dev/null +++ b/packages/js/manifests/polywrap/src/formats/polywrap.plugin/migrators/index.ts @@ -0,0 +1,15 @@ +import { Migrator } from "../../../migrations"; +import { migrate as migrate_0_1_0_to_0_2_0 } from "./0.1.0_to_0.2.0"; + +export const migrators: Migrator[] = [ + { + from: "0.1", + to: "0.2.0", + migrate: migrate_0_1_0_to_0_2_0 + }, + { + from: "0.1.0", + to: "0.2.0", + migrate: migrate_0_1_0_to_0_2_0 + } +]; \ No newline at end of file diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.test/deserialize.ts b/packages/js/manifests/polywrap/src/formats/polywrap.test/deserialize.ts index 25ac5fffa5..da27d002c9 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.test/deserialize.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.test/deserialize.ts @@ -15,7 +15,7 @@ import { import { DeserializeManifestOptions } from "../../"; import * as Semver from "semver"; -import YAML from "js-yaml"; +import YAML from "yaml"; export function deserializePolywrapWorkflow( manifest: string, @@ -24,10 +24,10 @@ export function deserializePolywrapWorkflow( let anyPolywrapWorkflow: AnyPolywrapWorkflow | undefined; try { anyPolywrapWorkflow = JSON.parse(manifest) as AnyPolywrapWorkflow; - } catch (e) { - anyPolywrapWorkflow = YAML.safeLoad(manifest) as - | AnyPolywrapWorkflow - | undefined; + } catch (_) { + try { + anyPolywrapWorkflow = YAML.parse(manifest) as AnyPolywrapWorkflow; + } catch (_) { } } if (!anyPolywrapWorkflow) { diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.test/index.ts b/packages/js/manifests/polywrap/src/formats/polywrap.test/index.ts index 6e727bbd93..3f2d4dea88 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.test/index.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.test/index.ts @@ -21,6 +21,12 @@ export enum PolywrapWorkflowFormats { "v0.1.0" = "0.1.0", } +export const PolywrapWorkflowSchemaFiles: Record = { + // NOTE: Patch fix for backwards compatability + "0.1": "formats/polywrap.test/0.1.0.json", + "0.1.0": "formats/polywrap.test/0.1.0.json", +} + export type AnyPolywrapWorkflow = | PolywrapWorkflow_0_1_0 diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.test/migrate.ts b/packages/js/manifests/polywrap/src/formats/polywrap.test/migrate.ts index bab7e2fbf4..fab4a75251 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap.test/migrate.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap.test/migrate.ts @@ -8,16 +8,9 @@ import { AnyPolywrapWorkflow, PolywrapWorkflow, PolywrapWorkflowFormats, - latestPolywrapWorkflowFormat } from "."; - - -type Migrator = { - [key in PolywrapWorkflowFormats]?: (m: AnyPolywrapWorkflow) => PolywrapWorkflow; -}; - -export const migrators: Migrator = { -}; +import { findShortestMigrationPath } from "../../migrations"; +import { migrators } from "./migrators"; export function migratePolywrapWorkflow( manifest: AnyPolywrapWorkflow, @@ -25,18 +18,26 @@ export function migratePolywrapWorkflow( ): PolywrapWorkflow { let from = manifest.format as PolywrapWorkflowFormats; - // HACK: Patch fix for backwards compatability - if(from === "0.1" && ("0.1.0" in migrators)) { - from = "0.1.0" as PolywrapWorkflowFormats; + if (!(Object.values(PolywrapWorkflowFormats).some(x => x === from))) { + throw new Error(`Unrecognized PolywrapWorkflowFormat "${manifest.format}"`); + } + + if (!(Object.values(PolywrapWorkflowFormats).some(x => x === to))) { + throw new Error(`Unrecognized PolywrapWorkflowFormat "${to}"`); } - if (from === latestPolywrapWorkflowFormat) { - return manifest as PolywrapWorkflow; + const migrationPath = findShortestMigrationPath(migrators, from, to); + if (!migrationPath) { + throw new Error( + `Migration path from PolywrapWorkflowFormat "${from}" to "${to}" is not available` + ); } - if (!(Object.values(PolywrapWorkflowFormats).some(x => x === from))) { - throw new Error(`Unrecognized PolywrapWorkflowFormat "${manifest.format}"`); + let newManifest = manifest; + + for(const migrator of migrationPath){ + newManifest = migrator.migrate(newManifest) as AnyPolywrapWorkflow; } - throw new Error(`This should never happen, PolywrapWorkflow migrators is empty. from: ${from}, to: ${to}`); + return newManifest as PolywrapWorkflow; } diff --git a/packages/js/manifests/polywrap/src/formats/polywrap.test/migrators/index.ts b/packages/js/manifests/polywrap/src/formats/polywrap.test/migrators/index.ts new file mode 100644 index 0000000000..6fa0ce38a3 --- /dev/null +++ b/packages/js/manifests/polywrap/src/formats/polywrap.test/migrators/index.ts @@ -0,0 +1,3 @@ +import { Migrator } from "../../../migrations"; + +export const migrators: Migrator[] = []; diff --git a/packages/js/manifests/polywrap/src/formats/polywrap/deserialize.ts b/packages/js/manifests/polywrap/src/formats/polywrap/deserialize.ts index 415a27435b..679f447dfd 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap/deserialize.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap/deserialize.ts @@ -15,7 +15,7 @@ import { import { DeserializeManifestOptions } from "../../"; import * as Semver from "semver"; -import YAML from "js-yaml"; +import YAML from "yaml"; export function deserializePolywrapManifest( manifest: string, @@ -24,10 +24,10 @@ export function deserializePolywrapManifest( let anyPolywrapManifest: AnyPolywrapManifest | undefined; try { anyPolywrapManifest = JSON.parse(manifest) as AnyPolywrapManifest; - } catch (e) { - anyPolywrapManifest = YAML.safeLoad(manifest) as - | AnyPolywrapManifest - | undefined; + } catch (_) { + try { + anyPolywrapManifest = YAML.parse(manifest) as AnyPolywrapManifest; + } catch (_) { } } if (!anyPolywrapManifest) { diff --git a/packages/js/manifests/polywrap/src/formats/polywrap/index.ts b/packages/js/manifests/polywrap/src/formats/polywrap/index.ts index 849a5fd3a3..9483c5de89 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap/index.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap/index.ts @@ -24,6 +24,13 @@ export enum PolywrapManifestFormats { "v0.2.0" = "0.2.0", } +export const PolywrapManifestSchemaFiles: Record = { + // NOTE: Patch fix for backwards compatability + "0.1": "formats/polywrap/0.1.0.json", + "0.1.0": "formats/polywrap/0.1.0.json", + "0.2.0": "formats/polywrap/0.2.0.json", +} + export type AnyPolywrapManifest = | PolywrapManifest_0_1_0 | PolywrapManifest_0_2_0 diff --git a/packages/js/manifests/polywrap/src/formats/polywrap/migrate.ts b/packages/js/manifests/polywrap/src/formats/polywrap/migrate.ts index ccce046445..300cd6dc68 100644 --- a/packages/js/manifests/polywrap/src/formats/polywrap/migrate.ts +++ b/packages/js/manifests/polywrap/src/formats/polywrap/migrate.ts @@ -8,20 +8,9 @@ import { AnyPolywrapManifest, PolywrapManifest, PolywrapManifestFormats, - latestPolywrapManifestFormat } from "."; - -import { - migrate as migrate_0_1_0_to_0_2_0 -} from "./migrators/0.1.0_to_0.2.0"; - -type Migrator = { - [key in PolywrapManifestFormats]?: (m: AnyPolywrapManifest) => PolywrapManifest; -}; - -export const migrators: Migrator = { - "0.1.0": migrate_0_1_0_to_0_2_0, -}; +import { findShortestMigrationPath } from "../../migrations"; +import { migrators } from "./migrators"; export function migratePolywrapManifest( manifest: AnyPolywrapManifest, @@ -29,25 +18,26 @@ export function migratePolywrapManifest( ): PolywrapManifest { let from = manifest.format as PolywrapManifestFormats; - // HACK: Patch fix for backwards compatability - if(from === "0.1" && ("0.1.0" in migrators)) { - from = "0.1.0" as PolywrapManifestFormats; - } - - if (from === latestPolywrapManifestFormat) { - return manifest as PolywrapManifest; - } - if (!(Object.values(PolywrapManifestFormats).some(x => x === from))) { throw new Error(`Unrecognized PolywrapManifestFormat "${manifest.format}"`); } - const migrator = migrators[from]; - if (!migrator) { + if (!(Object.values(PolywrapManifestFormats).some(x => x === to))) { + throw new Error(`Unrecognized PolywrapManifestFormat "${to}"`); + } + + const migrationPath = findShortestMigrationPath(migrators, from, to); + if (!migrationPath) { throw new Error( - `Migrator from PolywrapManifestFormat "${from}" to "${to}" is not available` + `Migration path from PolywrapManifestFormat "${from}" to "${to}" is not available` ); } - return migrator(manifest); + let newManifest = manifest; + + for(const migrator of migrationPath){ + newManifest = migrator.migrate(newManifest) as AnyPolywrapManifest; + } + + return newManifest as PolywrapManifest; } diff --git a/packages/js/manifests/polywrap/src/formats/polywrap/migrators/index.ts b/packages/js/manifests/polywrap/src/formats/polywrap/migrators/index.ts new file mode 100644 index 0000000000..2c882af9fa --- /dev/null +++ b/packages/js/manifests/polywrap/src/formats/polywrap/migrators/index.ts @@ -0,0 +1,15 @@ +import { Migrator } from "../../../migrations"; +import { migrate as migrate_0_1_0_to_0_2_0 } from "./0.1.0_to_0.2.0"; + +export const migrators: Migrator[] = [ + { + from: "0.1", + to: "0.2.0", + migrate: migrate_0_1_0_to_0_2_0 + }, + { + from: "0.1.0", + to: "0.2.0", + migrate: migrate_0_1_0_to_0_2_0 + } +]; \ No newline at end of file diff --git a/packages/js/manifests/polywrap/src/migrations/findShortestMigrationPath.ts b/packages/js/manifests/polywrap/src/migrations/findShortestMigrationPath.ts new file mode 100644 index 0000000000..d97580d897 --- /dev/null +++ b/packages/js/manifests/polywrap/src/migrations/findShortestMigrationPath.ts @@ -0,0 +1,52 @@ +import { Migrator } from "./migration"; + +type MigrationWithSearchHistory = [Migrator, Migrator[]]; + +// A simple BFS intended to find the shortest migration path from one version to another +// Returns an array of migrations in the order they need to be performed to migrate from one version to another +export function findShortestMigrationPath( + nodes: Migrator[], + from: string, + to: string +): Migrator[] | undefined { + if (from === to) { + return []; + } + + const possibleStarts = nodes.filter((x) => x.from === from); + + if (!possibleStarts.length) { + return undefined; + } + + const visited = [...possibleStarts]; + + const queue: MigrationWithSearchHistory[] = possibleStarts.map((start) => [ + start, + [start], + ]); + + while (queue.length) { + const [node, path] = queue.shift() as MigrationWithSearchHistory; + + if (node.to === to) { + return path; + } + + const neighbours = nodes.filter( + (x) => !visited.includes(x) && x.from === node.to + ); + + for (const neighbour of neighbours) { + visited.push(neighbour); + + if (neighbour.to === to) { + return [...path, neighbour]; + } + + queue.push([neighbour, [...path, neighbour]]); + } + } + + return undefined; +} diff --git a/packages/js/manifests/polywrap/src/migrations/index.ts b/packages/js/manifests/polywrap/src/migrations/index.ts new file mode 100644 index 0000000000..712bb35572 --- /dev/null +++ b/packages/js/manifests/polywrap/src/migrations/index.ts @@ -0,0 +1,2 @@ +export * from "./findShortestMigrationPath"; +export * from "./migration"; diff --git a/packages/js/manifests/polywrap/src/migrations/migration.ts b/packages/js/manifests/polywrap/src/migrations/migration.ts new file mode 100644 index 0000000000..145ec43ff7 --- /dev/null +++ b/packages/js/manifests/polywrap/src/migrations/migration.ts @@ -0,0 +1,26 @@ +import { + AnyAppManifest, + AnyBuildManifest, + AnyDeployManifest, + AnyInfraManifest, + AnyMetaManifest, + AnyPluginManifest, + AnyPolywrapManifest, + AnyPolywrapWorkflow, +} from "../formats"; + +type AnyManifest = + | AnyPolywrapManifest + | AnyPluginManifest + | AnyAppManifest + | AnyInfraManifest + | AnyDeployManifest + | AnyBuildManifest + | AnyMetaManifest + | AnyPolywrapWorkflow; + +export type Migrator = { + from: string; + to: string; + migrate: (manifest: AnyManifest) => AnyManifest; +}; diff --git a/packages/js/plugins/ethereum/src/__tests__/contracts/SimpleStorage.ABI.json b/packages/js/plugins/ethereum/src/__tests__/contracts/SimpleStorage.ABI.json index 805f715500..8e699ec92b 100644 --- a/packages/js/plugins/ethereum/src/__tests__/contracts/SimpleStorage.ABI.json +++ b/packages/js/plugins/ethereum/src/__tests__/contracts/SimpleStorage.ABI.json @@ -37,6 +37,32 @@ "name": "HashSet", "type": "event" }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "addJob", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "element", + "type": "uint256" + } + ], + "name": "addSimple", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "get", @@ -63,6 +89,44 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "getJobs", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct SimpleStorage.Job[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSimple", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { diff --git a/packages/js/plugins/ethereum/src/__tests__/contracts/SimpleStorage.Bytecode.json b/packages/js/plugins/ethereum/src/__tests__/contracts/SimpleStorage.Bytecode.json index 1f4e098aeb..4b87c3a7e7 100644 --- a/packages/js/plugins/ethereum/src/__tests__/contracts/SimpleStorage.Bytecode.json +++ b/packages/js/plugins/ethereum/src/__tests__/contracts/SimpleStorage.Bytecode.json @@ -1,7 +1,7 @@ { "generatedSources": [], "linkReferences": {}, - "object": "608060405234801561001057600080fd5b506105d9806100206000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80631ed83fd41461005157806360fe47b11461006d5780636d4ce63c14610089578063d13319c4146100a7575b600080fd5b61006b600480360381019061006691906102f6565b6100c5565b005b6100876004803603810190610082919061033b565b610116565b005b610091610159565b60405161009e9190610465565b60405180910390f35b6100af610162565b6040516100bc9190610443565b60405180910390f35b8181600191906100d69291906101f4565b507f7701f49eb9aabe8890631508a9092eabb511a34566c30f2d94ff4420da1ccb1333838360405161010a939291906103e8565b60405180910390a15050565b806000819055507f7c94a94848d5859b1a30c887dc5740bf8d1cf789779be90adda1d0d34dd25022338260405161014e92919061041a565b60405180910390a150565b60008054905090565b6060600180546101719061051a565b80601f016020809104026020016040519081016040528092919081815260200182805461019d9061051a565b80156101ea5780601f106101bf576101008083540402835291602001916101ea565b820191906000526020600020905b8154815290600101906020018083116101cd57829003601f168201915b5050505050905090565b8280546102009061051a565b90600052602060002090601f0160209004810192826102225760008555610269565b82601f1061023b57803560ff1916838001178555610269565b82800160010185558215610269579182015b8281111561026857823582559160200191906001019061024d565b5b509050610276919061027a565b5090565b5b8082111561029357600081600090555060010161027b565b5090565b60008083601f8401126102a957600080fd5b8235905067ffffffffffffffff8111156102c257600080fd5b6020830191508360018202830111156102da57600080fd5b9250929050565b6000813590506102f08161058c565b92915050565b6000806020838503121561030957600080fd5b600083013567ffffffffffffffff81111561032357600080fd5b61032f85828601610297565b92509250509250929050565b60006020828403121561034d57600080fd5b600061035b848285016102e1565b91505092915050565b61036d8161049c565b82525050565b600061037f838561048b565b935061038c8385846104d8565b6103958361057b565b840190509392505050565b60006103ab82610480565b6103b5818561048b565b93506103c58185602086016104e7565b6103ce8161057b565b840191505092915050565b6103e2816104ce565b82525050565b60006040820190506103fd6000830186610364565b8181036020830152610410818486610373565b9050949350505050565b600060408201905061042f6000830185610364565b61043c60208301846103d9565b9392505050565b6000602082019050818103600083015261045d81846103a0565b905092915050565b600060208201905061047a60008301846103d9565b92915050565b600081519050919050565b600082825260208201905092915050565b60006104a7826104ae565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b838110156105055780820151818401526020810190506104ea565b83811115610514576000848401525b50505050565b6000600282049050600182168061053257607f821691505b602082108114156105465761054561054c565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b610595816104ce565b81146105a057600080fd5b5056fea2646970667358221220c4f17cfe4d6a923f7fe078b7a437375b22035b7b57ef7a2bdc086bdc1be15c3564736f6c63430008030033", - "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x5D9 DUP1 PUSH2 0x20 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x4C JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x1ED83FD4 EQ PUSH2 0x51 JUMPI DUP1 PUSH4 0x60FE47B1 EQ PUSH2 0x6D JUMPI DUP1 PUSH4 0x6D4CE63C EQ PUSH2 0x89 JUMPI DUP1 PUSH4 0xD13319C4 EQ PUSH2 0xA7 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x6B PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x66 SWAP2 SWAP1 PUSH2 0x2F6 JUMP JUMPDEST PUSH2 0xC5 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x87 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x82 SWAP2 SWAP1 PUSH2 0x33B JUMP JUMPDEST PUSH2 0x116 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x91 PUSH2 0x159 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x9E SWAP2 SWAP1 PUSH2 0x465 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0xAF PUSH2 0x162 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xBC SWAP2 SWAP1 PUSH2 0x443 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST DUP2 DUP2 PUSH1 0x1 SWAP2 SWAP1 PUSH2 0xD6 SWAP3 SWAP2 SWAP1 PUSH2 0x1F4 JUMP JUMPDEST POP PUSH32 0x7701F49EB9AABE8890631508A9092EABB511A34566C30F2D94FF4420DA1CCB13 CALLER DUP4 DUP4 PUSH1 0x40 MLOAD PUSH2 0x10A SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x3E8 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP POP JUMP JUMPDEST DUP1 PUSH1 0x0 DUP2 SWAP1 SSTORE POP PUSH32 0x7C94A94848D5859B1A30C887DC5740BF8D1CF789779BE90ADDA1D0D34DD25022 CALLER DUP3 PUSH1 0x40 MLOAD PUSH2 0x14E SWAP3 SWAP2 SWAP1 PUSH2 0x41A JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x1 DUP1 SLOAD PUSH2 0x171 SWAP1 PUSH2 0x51A JUMP JUMPDEST DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH2 0x19D SWAP1 PUSH2 0x51A JUMP JUMPDEST DUP1 ISZERO PUSH2 0x1EA JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x1BF JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x1EA JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x1CD JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH2 0x200 SWAP1 PUSH2 0x51A JUMP JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH2 0x222 JUMPI PUSH1 0x0 DUP6 SSTORE PUSH2 0x269 JUMP JUMPDEST DUP3 PUSH1 0x1F LT PUSH2 0x23B JUMPI DUP1 CALLDATALOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x269 JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x269 JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x268 JUMPI DUP3 CALLDATALOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x24D JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH2 0x276 SWAP2 SWAP1 PUSH2 0x27A JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0x293 JUMPI PUSH1 0x0 DUP2 PUSH1 0x0 SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH2 0x27B JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP4 PUSH1 0x1F DUP5 ADD SLT PUSH2 0x2A9 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLDATALOAD SWAP1 POP PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x2C2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x20 DUP4 ADD SWAP2 POP DUP4 PUSH1 0x1 DUP3 MUL DUP4 ADD GT ISZERO PUSH2 0x2DA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x2F0 DUP2 PUSH2 0x58C JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x20 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x309 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP4 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x323 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x32F DUP6 DUP3 DUP7 ADD PUSH2 0x297 JUMP JUMPDEST SWAP3 POP SWAP3 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x34D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x35B DUP5 DUP3 DUP6 ADD PUSH2 0x2E1 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x36D DUP2 PUSH2 0x49C JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x37F DUP4 DUP6 PUSH2 0x48B JUMP JUMPDEST SWAP4 POP PUSH2 0x38C DUP4 DUP6 DUP5 PUSH2 0x4D8 JUMP JUMPDEST PUSH2 0x395 DUP4 PUSH2 0x57B JUMP JUMPDEST DUP5 ADD SWAP1 POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x3AB DUP3 PUSH2 0x480 JUMP JUMPDEST PUSH2 0x3B5 DUP2 DUP6 PUSH2 0x48B JUMP JUMPDEST SWAP4 POP PUSH2 0x3C5 DUP2 DUP6 PUSH1 0x20 DUP7 ADD PUSH2 0x4E7 JUMP JUMPDEST PUSH2 0x3CE DUP2 PUSH2 0x57B JUMP JUMPDEST DUP5 ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x3E2 DUP2 PUSH2 0x4CE JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 DUP3 ADD SWAP1 POP PUSH2 0x3FD PUSH1 0x0 DUP4 ADD DUP7 PUSH2 0x364 JUMP JUMPDEST DUP2 DUP2 SUB PUSH1 0x20 DUP4 ADD MSTORE PUSH2 0x410 DUP2 DUP5 DUP7 PUSH2 0x373 JUMP JUMPDEST SWAP1 POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 DUP3 ADD SWAP1 POP PUSH2 0x42F PUSH1 0x0 DUP4 ADD DUP6 PUSH2 0x364 JUMP JUMPDEST PUSH2 0x43C PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x3D9 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x45D DUP2 DUP5 PUSH2 0x3A0 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x47A PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x3D9 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x4A7 DUP3 PUSH2 0x4AE JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST DUP3 DUP2 DUP4 CALLDATACOPY PUSH1 0x0 DUP4 DUP4 ADD MSTORE POP POP POP JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x505 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x4EA JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH2 0x514 JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x2 DUP3 DIV SWAP1 POP PUSH1 0x1 DUP3 AND DUP1 PUSH2 0x532 JUMPI PUSH1 0x7F DUP3 AND SWAP2 POP JUMPDEST PUSH1 0x20 DUP3 LT DUP2 EQ ISZERO PUSH2 0x546 JUMPI PUSH2 0x545 PUSH2 0x54C JUMP JUMPDEST JUMPDEST POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x22 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x595 DUP2 PUSH2 0x4CE JUMP JUMPDEST DUP2 EQ PUSH2 0x5A0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xC4 CALL PUSH29 0xFE4D6A923F7FE078B7A437375B22035B7B57EF7A2BDC086BDC1BE15C35 PUSH5 0x736F6C6343 STOP ADDMOD SUB STOP CALLER ", - "sourceMap": "24:501:0:-:0;;;;;;;;;;;;;;;;;;;" + "object": "608060405234801561001057600080fd5b50610c07806100206000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806368581ebd1161005b57806368581ebd146100ff5780636d4ce63c1461011d578063d13319c41461013b578063fe5afd631461015957610088565b806301644ea71461008d578063072796f4146100ab5780631ed83fd4146100c757806360fe47b1146100e3575b600080fd5b610095610175565b6040516100a29190610941565b60405180910390f35b6100c560048036038101906100c091906106de565b6101cd565b005b6100e160048036038101906100dc9190610670565b6101f9565b005b6100fd60048036038101906100f891906106de565b61024a565b005b61010761028d565b604051610114919061091f565b60405180910390f35b61012561034c565b6040516101329190610985565b60405180910390f35b610143610355565b6040516101509190610963565b60405180910390f35b610173600480360381019061016e919061062b565b6103e7565b005b606060038054806020026020016040519081016040528092919081815260200182805480156101c357602002820191906000526020600020905b8154815260200190600101908083116101af575b5050505050905090565b600381908060018154018082558091505060019003906000526020600020016000909190919091505550565b81816001919061020a92919061047e565b507f7701f49eb9aabe8890631508a9092eabb511a34566c30f2d94ff4420da1ccb1333838360405161023e939291906108c4565b60405180910390a15050565b806000819055507f7c94a94848d5859b1a30c887dc5740bf8d1cf789779be90adda1d0d34dd2502233826040516102829291906108f6565b60405180910390a150565b60606002805480602002602001604051908101604052809291908181526020016000905b8282101561034357838290600052602060002090600202016040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015481525050815260200190600101906102b1565b50505050905090565b60008054905090565b60606001805461036490610ad1565b80601f016020809104026020016040519081016040528092919081815260200182805461039090610ad1565b80156103dd5780601f106103b2576101008083540402835291602001916103dd565b820191906000526020600020905b8154815290600101906020018083116103c057829003601f168201915b5050505050905090565b600082828101906103f891906106b5565b9050600281908060018154018082558091505060019003906000526020600020906002020160009091909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101555050505050565b82805461048a90610ad1565b90600052602060002090601f0160209004810192826104ac57600085556104f3565b82601f106104c557803560ff19168380011785556104f3565b828001600101855582156104f3579182015b828111156104f25782358255916020019190600101906104d7565b5b5090506105009190610504565b5090565b5b8082111561051d576000816000905550600101610505565b5090565b60008135905061053081610ba3565b92915050565b60008083601f84011261054857600080fd5b8235905067ffffffffffffffff81111561056157600080fd5b60208301915083600182028301111561057957600080fd5b9250929050565b60008083601f84011261059257600080fd5b8235905067ffffffffffffffff8111156105ab57600080fd5b6020830191508360018202830111156105c357600080fd5b9250929050565b6000604082840312156105dc57600080fd5b6105e660406109a0565b905060006105f684828501610521565b600083015250602061060a84828501610616565b60208301525092915050565b60008135905061062581610bba565b92915050565b6000806020838503121561063e57600080fd5b600083013567ffffffffffffffff81111561065857600080fd5b61066485828601610536565b92509250509250929050565b6000806020838503121561068357600080fd5b600083013567ffffffffffffffff81111561069d57600080fd5b6106a985828601610580565b92509250509250929050565b6000604082840312156106c757600080fd5b60006106d5848285016105ca565b91505092915050565b6000602082840312156106f057600080fd5b60006106fe84828501610616565b91505092915050565b60006107138383610877565b60408301905092915050565b600061072b83836108a6565b60208301905092915050565b61074081610a53565b82525050565b61074f81610a53565b82525050565b6000610760826109e5565b61076a8185610a20565b9350610775836109c5565b8060005b838110156107a657815161078d8882610707565b975061079883610a06565b925050600181019050610779565b5085935050505092915050565b60006107be826109f0565b6107c88185610a31565b93506107d3836109d5565b8060005b838110156108045781516107eb888261071f565b97506107f683610a13565b9250506001810190506107d7565b5085935050505092915050565b600061081d8385610a42565b935061082a838584610a8f565b61083383610b92565b840190509392505050565b6000610849826109fb565b6108538185610a42565b9350610863818560208601610a9e565b61086c81610b92565b840191505092915050565b60408201600082015161088d6000850182610737565b5060208201516108a060208501826108a6565b50505050565b6108af81610a85565b82525050565b6108be81610a85565b82525050565b60006040820190506108d96000830186610746565b81810360208301526108ec818486610811565b9050949350505050565b600060408201905061090b6000830185610746565b61091860208301846108b5565b9392505050565b600060208201905081810360008301526109398184610755565b905092915050565b6000602082019050818103600083015261095b81846107b3565b905092915050565b6000602082019050818103600083015261097d818461083e565b905092915050565b600060208201905061099a60008301846108b5565b92915050565b60006109aa6109bb565b90506109b68282610b03565b919050565b6000604051905090565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b6000610a5e82610a65565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015610abc578082015181840152602081019050610aa1565b83811115610acb576000848401525b50505050565b60006002820490506001821680610ae957607f821691505b60208210811415610afd57610afc610b34565b5b50919050565b610b0c82610b92565b810181811067ffffffffffffffff82111715610b2b57610b2a610b63565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b610bac81610a53565b8114610bb757600080fd5b50565b610bc381610a85565b8114610bce57600080fd5b5056fea2646970667358221220974e93c48c7a53edfb8788c5a8403fb43075e6b0f510c02c8a9311158d88f22464736f6c63430008030033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xC07 DUP1 PUSH2 0x20 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x88 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x68581EBD GT PUSH2 0x5B JUMPI DUP1 PUSH4 0x68581EBD EQ PUSH2 0xFF JUMPI DUP1 PUSH4 0x6D4CE63C EQ PUSH2 0x11D JUMPI DUP1 PUSH4 0xD13319C4 EQ PUSH2 0x13B JUMPI DUP1 PUSH4 0xFE5AFD63 EQ PUSH2 0x159 JUMPI PUSH2 0x88 JUMP JUMPDEST DUP1 PUSH4 0x1644EA7 EQ PUSH2 0x8D JUMPI DUP1 PUSH4 0x72796F4 EQ PUSH2 0xAB JUMPI DUP1 PUSH4 0x1ED83FD4 EQ PUSH2 0xC7 JUMPI DUP1 PUSH4 0x60FE47B1 EQ PUSH2 0xE3 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x95 PUSH2 0x175 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0xA2 SWAP2 SWAP1 PUSH2 0x941 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0xC5 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0xC0 SWAP2 SWAP1 PUSH2 0x6DE JUMP JUMPDEST PUSH2 0x1CD JUMP JUMPDEST STOP JUMPDEST PUSH2 0xE1 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0xDC SWAP2 SWAP1 PUSH2 0x670 JUMP JUMPDEST PUSH2 0x1F9 JUMP JUMPDEST STOP JUMPDEST PUSH2 0xFD PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0xF8 SWAP2 SWAP1 PUSH2 0x6DE JUMP JUMPDEST PUSH2 0x24A JUMP JUMPDEST STOP JUMPDEST PUSH2 0x107 PUSH2 0x28D JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x114 SWAP2 SWAP1 PUSH2 0x91F JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x125 PUSH2 0x34C JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x132 SWAP2 SWAP1 PUSH2 0x985 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x143 PUSH2 0x355 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x150 SWAP2 SWAP1 PUSH2 0x963 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x173 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x16E SWAP2 SWAP1 PUSH2 0x62B JUMP JUMPDEST PUSH2 0x3E7 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x60 PUSH1 0x3 DUP1 SLOAD DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD DUP1 ISZERO PUSH2 0x1C3 JUMPI PUSH1 0x20 MUL DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 DUP1 DUP4 GT PUSH2 0x1AF JUMPI JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x3 DUP2 SWAP1 DUP1 PUSH1 0x1 DUP2 SLOAD ADD DUP1 DUP3 SSTORE DUP1 SWAP2 POP POP PUSH1 0x1 SWAP1 SUB SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SWAP2 SWAP1 SWAP2 SWAP1 SWAP2 POP SSTORE POP JUMP JUMPDEST DUP2 DUP2 PUSH1 0x1 SWAP2 SWAP1 PUSH2 0x20A SWAP3 SWAP2 SWAP1 PUSH2 0x47E JUMP JUMPDEST POP PUSH32 0x7701F49EB9AABE8890631508A9092EABB511A34566C30F2D94FF4420DA1CCB13 CALLER DUP4 DUP4 PUSH1 0x40 MLOAD PUSH2 0x23E SWAP4 SWAP3 SWAP2 SWAP1 PUSH2 0x8C4 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP POP JUMP JUMPDEST DUP1 PUSH1 0x0 DUP2 SWAP1 SSTORE POP PUSH32 0x7C94A94848D5859B1A30C887DC5740BF8D1CF789779BE90ADDA1D0D34DD25022 CALLER DUP3 PUSH1 0x40 MLOAD PUSH2 0x282 SWAP3 SWAP2 SWAP1 PUSH2 0x8F6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 POP JUMP JUMPDEST PUSH1 0x60 PUSH1 0x2 DUP1 SLOAD DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 SWAP1 JUMPDEST DUP3 DUP3 LT ISZERO PUSH2 0x343 JUMPI DUP4 DUP3 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x2 MUL ADD PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE SWAP1 DUP2 PUSH1 0x0 DUP3 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x1 DUP3 ADD SLOAD DUP2 MSTORE POP POP DUP2 MSTORE PUSH1 0x20 ADD SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x2B1 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x60 PUSH1 0x1 DUP1 SLOAD PUSH2 0x364 SWAP1 PUSH2 0xAD1 JUMP JUMPDEST DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH2 0x390 SWAP1 PUSH2 0xAD1 JUMP JUMPDEST DUP1 ISZERO PUSH2 0x3DD JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x3B2 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x3DD JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x3C0 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 DUP2 ADD SWAP1 PUSH2 0x3F8 SWAP2 SWAP1 PUSH2 0x6B5 JUMP JUMPDEST SWAP1 POP PUSH1 0x2 DUP2 SWAP1 DUP1 PUSH1 0x1 DUP2 SLOAD ADD DUP1 DUP3 SSTORE DUP1 SWAP2 POP POP PUSH1 0x1 SWAP1 SUB SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x2 MUL ADD PUSH1 0x0 SWAP1 SWAP2 SWAP1 SWAP2 SWAP1 SWAP2 POP PUSH1 0x0 DUP3 ADD MLOAD DUP2 PUSH1 0x0 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x20 DUP3 ADD MLOAD DUP2 PUSH1 0x1 ADD SSTORE POP POP POP POP POP JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH2 0x48A SWAP1 PUSH2 0xAD1 JUMP JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH2 0x4AC JUMPI PUSH1 0x0 DUP6 SSTORE PUSH2 0x4F3 JUMP JUMPDEST DUP3 PUSH1 0x1F LT PUSH2 0x4C5 JUMPI DUP1 CALLDATALOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x4F3 JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x4F3 JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x4F2 JUMPI DUP3 CALLDATALOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x4D7 JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH2 0x500 SWAP2 SWAP1 PUSH2 0x504 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0x51D JUMPI PUSH1 0x0 DUP2 PUSH1 0x0 SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH2 0x505 JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x530 DUP2 PUSH2 0xBA3 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP4 PUSH1 0x1F DUP5 ADD SLT PUSH2 0x548 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLDATALOAD SWAP1 POP PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x561 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x20 DUP4 ADD SWAP2 POP DUP4 PUSH1 0x1 DUP3 MUL DUP4 ADD GT ISZERO PUSH2 0x579 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP4 PUSH1 0x1F DUP5 ADD SLT PUSH2 0x592 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLDATALOAD SWAP1 POP PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x5AB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x20 DUP4 ADD SWAP2 POP DUP4 PUSH1 0x1 DUP3 MUL DUP4 ADD GT ISZERO PUSH2 0x5C3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x5DC JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x5E6 PUSH1 0x40 PUSH2 0x9A0 JUMP JUMPDEST SWAP1 POP PUSH1 0x0 PUSH2 0x5F6 DUP5 DUP3 DUP6 ADD PUSH2 0x521 JUMP JUMPDEST PUSH1 0x0 DUP4 ADD MSTORE POP PUSH1 0x20 PUSH2 0x60A DUP5 DUP3 DUP6 ADD PUSH2 0x616 JUMP JUMPDEST PUSH1 0x20 DUP4 ADD MSTORE POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x625 DUP2 PUSH2 0xBBA JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x20 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x63E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP4 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x658 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x664 DUP6 DUP3 DUP7 ADD PUSH2 0x536 JUMP JUMPDEST SWAP3 POP SWAP3 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x20 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x683 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 DUP4 ADD CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT ISZERO PUSH2 0x69D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x6A9 DUP6 DUP3 DUP7 ADD PUSH2 0x580 JUMP JUMPDEST SWAP3 POP SWAP3 POP POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x6C7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x6D5 DUP5 DUP3 DUP6 ADD PUSH2 0x5CA JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x6F0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH2 0x6FE DUP5 DUP3 DUP6 ADD PUSH2 0x616 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x713 DUP4 DUP4 PUSH2 0x877 JUMP JUMPDEST PUSH1 0x40 DUP4 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x72B DUP4 DUP4 PUSH2 0x8A6 JUMP JUMPDEST PUSH1 0x20 DUP4 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x740 DUP2 PUSH2 0xA53 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x74F DUP2 PUSH2 0xA53 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x760 DUP3 PUSH2 0x9E5 JUMP JUMPDEST PUSH2 0x76A DUP2 DUP6 PUSH2 0xA20 JUMP JUMPDEST SWAP4 POP PUSH2 0x775 DUP4 PUSH2 0x9C5 JUMP JUMPDEST DUP1 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x7A6 JUMPI DUP2 MLOAD PUSH2 0x78D DUP9 DUP3 PUSH2 0x707 JUMP JUMPDEST SWAP8 POP PUSH2 0x798 DUP4 PUSH2 0xA06 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x1 DUP2 ADD SWAP1 POP PUSH2 0x779 JUMP JUMPDEST POP DUP6 SWAP4 POP POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x7BE DUP3 PUSH2 0x9F0 JUMP JUMPDEST PUSH2 0x7C8 DUP2 DUP6 PUSH2 0xA31 JUMP JUMPDEST SWAP4 POP PUSH2 0x7D3 DUP4 PUSH2 0x9D5 JUMP JUMPDEST DUP1 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x804 JUMPI DUP2 MLOAD PUSH2 0x7EB DUP9 DUP3 PUSH2 0x71F JUMP JUMPDEST SWAP8 POP PUSH2 0x7F6 DUP4 PUSH2 0xA13 JUMP JUMPDEST SWAP3 POP POP PUSH1 0x1 DUP2 ADD SWAP1 POP PUSH2 0x7D7 JUMP JUMPDEST POP DUP6 SWAP4 POP POP POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x81D DUP4 DUP6 PUSH2 0xA42 JUMP JUMPDEST SWAP4 POP PUSH2 0x82A DUP4 DUP6 DUP5 PUSH2 0xA8F JUMP JUMPDEST PUSH2 0x833 DUP4 PUSH2 0xB92 JUMP JUMPDEST DUP5 ADD SWAP1 POP SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x849 DUP3 PUSH2 0x9FB JUMP JUMPDEST PUSH2 0x853 DUP2 DUP6 PUSH2 0xA42 JUMP JUMPDEST SWAP4 POP PUSH2 0x863 DUP2 DUP6 PUSH1 0x20 DUP7 ADD PUSH2 0xA9E JUMP JUMPDEST PUSH2 0x86C DUP2 PUSH2 0xB92 JUMP JUMPDEST DUP5 ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x40 DUP3 ADD PUSH1 0x0 DUP3 ADD MLOAD PUSH2 0x88D PUSH1 0x0 DUP6 ADD DUP3 PUSH2 0x737 JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD PUSH2 0x8A0 PUSH1 0x20 DUP6 ADD DUP3 PUSH2 0x8A6 JUMP JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH2 0x8AF DUP2 PUSH2 0xA85 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x8BE DUP2 PUSH2 0xA85 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 DUP3 ADD SWAP1 POP PUSH2 0x8D9 PUSH1 0x0 DUP4 ADD DUP7 PUSH2 0x746 JUMP JUMPDEST DUP2 DUP2 SUB PUSH1 0x20 DUP4 ADD MSTORE PUSH2 0x8EC DUP2 DUP5 DUP7 PUSH2 0x811 JUMP JUMPDEST SWAP1 POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 DUP3 ADD SWAP1 POP PUSH2 0x90B PUSH1 0x0 DUP4 ADD DUP6 PUSH2 0x746 JUMP JUMPDEST PUSH2 0x918 PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x8B5 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x939 DUP2 DUP5 PUSH2 0x755 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x95B DUP2 DUP5 PUSH2 0x7B3 JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x97D DUP2 DUP5 PUSH2 0x83E JUMP JUMPDEST SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x99A PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x8B5 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x9AA PUSH2 0x9BB JUMP JUMPDEST SWAP1 POP PUSH2 0x9B6 DUP3 DUP3 PUSH2 0xB03 JUMP JUMPDEST SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 MLOAD SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0xA5E DUP3 PUSH2 0xA65 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST DUP3 DUP2 DUP4 CALLDATACOPY PUSH1 0x0 DUP4 DUP4 ADD MSTORE POP POP POP JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xABC JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xAA1 JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH2 0xACB JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x2 DUP3 DIV SWAP1 POP PUSH1 0x1 DUP3 AND DUP1 PUSH2 0xAE9 JUMPI PUSH1 0x7F DUP3 AND SWAP2 POP JUMPDEST PUSH1 0x20 DUP3 LT DUP2 EQ ISZERO PUSH2 0xAFD JUMPI PUSH2 0xAFC PUSH2 0xB34 JUMP JUMPDEST JUMPDEST POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0xB0C DUP3 PUSH2 0xB92 JUMP JUMPDEST DUP2 ADD DUP2 DUP2 LT PUSH8 0xFFFFFFFFFFFFFFFF DUP3 GT OR ISZERO PUSH2 0xB2B JUMPI PUSH2 0xB2A PUSH2 0xB63 JUMP JUMPDEST JUMPDEST DUP1 PUSH1 0x40 MSTORE POP POP POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x22 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x41 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0xBAC DUP2 PUSH2 0xA53 JUMP JUMPDEST DUP2 EQ PUSH2 0xBB7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH2 0xBC3 DUP2 PUSH2 0xA85 JUMP JUMPDEST DUP2 EQ PUSH2 0xBCE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 SWAP8 0x4E SWAP4 0xC4 DUP13 PUSH27 0x53EDFB8788C5A8403FB43075E6B0F510C02C8A9311158D88F22464 PUSH20 0x6F6C634300080300330000000000000000000000 ", + "sourceMap": "24:1021:0:-:0;;;;;;;;;;;;;;;;;;;" } \ No newline at end of file diff --git a/packages/js/plugins/ethereum/src/__tests__/contracts/SimpleStorage.sol b/packages/js/plugins/ethereum/src/__tests__/contracts/SimpleStorage.sol index 415b2686c7..b4328e81d6 100644 --- a/packages/js/plugins/ethereum/src/__tests__/contracts/SimpleStorage.sol +++ b/packages/js/plugins/ethereum/src/__tests__/contracts/SimpleStorage.sol @@ -3,6 +3,13 @@ pragma solidity 0.8.3; contract SimpleStorage { uint256 data; string ipfsHash; + Job[] jobs; + uint256[] primitives; + + struct Job { + address to; + uint256 amount; + } event DataSet(address from, uint256 data); event HashSet(address from, string ipfsHash); @@ -24,4 +31,26 @@ contract SimpleStorage { function getHash() public view returns (string memory) { return ipfsHash; } + + // Structs array + + function addJob(bytes calldata _data) public { + Job memory job = abi.decode(_data, (Job)); + jobs.push(job); + } + + function getJobs() public view returns (Job[] memory) { + return jobs; + } + + // Primitives array + + function addSimple(uint256 element) public { + return primitives.push(element); + } + + function getSimple() public view returns (uint256[] memory) { + return primitives; + } + } diff --git a/packages/js/plugins/ethereum/src/__tests__/e2e.spec.ts b/packages/js/plugins/ethereum/src/__tests__/e2e.spec.ts index 9c9d079d04..7095ae9907 100644 --- a/packages/js/plugins/ethereum/src/__tests__/e2e.spec.ts +++ b/packages/js/plugins/ethereum/src/__tests__/e2e.spec.ts @@ -2,7 +2,7 @@ import { ethereumPlugin } from ".."; import * as Schema from "../wrap"; import { PolywrapClient } from "@polywrap/client-js"; -import { defaultIpfsProviders } from "@polywrap/client-config-builder-js"; +import { ClientConfigBuilder, defaultIpfsProviders } from "@polywrap/client-config-builder-js"; import { ensResolverPlugin } from "@polywrap/ens-resolver-plugin-js"; import { ipfsPlugin } from "@polywrap/ipfs-plugin-js"; import { @@ -12,9 +12,14 @@ import { ensAddresses, providers, } from "@polywrap/test-env-js"; -import { Wallet } from "ethers"; +import { + deployStorage, + addPrimitiveToArrayStorage, + addStructToStorage, + setPrimitiveToStorage +} from './utils/storage'; -import { ethers } from "ethers"; +import { ethers, Wallet } from "ethers"; import { keccak256 } from "js-sha3"; import { Connections } from "../Connections"; import { Connection } from "../Connection"; @@ -28,6 +33,9 @@ const contracts = { SimpleStorage: { abi: require("./contracts/SimpleStorage.ABI.json"), bytecode: `0x${require("./contracts/SimpleStorage.Bytecode.json").object}`, + abiSinglePrimitiveMethod: '[{"inputs":[],"name":"get","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]', + abiArrayPrimitivesMethod: '[{"inputs":[],"name":"getSimple","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"}]', + abiArrayStructsMethod: '[{"inputs":[],"name":"getJobs","outputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct SimpleStorage.Job[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"}]', }, }; @@ -79,7 +87,7 @@ describe("Ethereum Plugin", () => { }, { uri: "wrap://ens/ipfs.polywrap.eth", - plugin: ipfsPlugin({}), + plugin: ipfsPlugin({ }), }, { uri: "wrap://ens/ens-resolver.polywrap.eth", @@ -113,9 +121,202 @@ describe("Ethereum Plugin", () => { }, }); - expect(response.error).toBeUndefined(); - expect(response.data).toBeDefined(); - expect(response.data).toBe("0x0000000000000000000000000000000000000000"); + if (!response.ok) fail(response.error); + expect(response.value).toBeDefined(); + expect(response.value).toBe("0x0000000000000000000000000000000000000000"); + }); + + it("callContractView (primitive value - string ABI)", async () => { + const storageAddress = await deployStorage(contracts.SimpleStorage.abi, contracts.SimpleStorage.bytecode) + await setPrimitiveToStorage(contracts.SimpleStorage.abi, storageAddress, "100"); + + const response = await client.invoke({ + uri, + method: "callContractView", + args: { + address: storageAddress, + method: 'function get() public view returns (uint256)', + args: [], + }, + }); + + if (!response.ok) fail(response.error); + expect(response.value).toBeDefined(); + const num = ethers.BigNumber.from(response.value); + expect(num.eq("100")).toBeTruthy(); + }); + + it("callContractView (primitive value - JSON ABI)", async () => { + const storageAddress = await deployStorage(contracts.SimpleStorage.abi, contracts.SimpleStorage.bytecode) + await setPrimitiveToStorage(contracts.SimpleStorage.abi, storageAddress, "100"); + + const response = await client.invoke({ + uri, + method: "callContractView", + args: { + address: storageAddress, + method: contracts.SimpleStorage.abiSinglePrimitiveMethod, + args: [], + }, + }); + + if (!response.ok) fail(response.error); + expect(response.value).toBeDefined(); + const num = ethers.BigNumber.from(response.value); + expect(num.eq("100")).toBeTruthy(); + }); + + it("callContractView (primitives array - string ABI)", async () => { + const storageAddress = await deployStorage(contracts.SimpleStorage.abi, contracts.SimpleStorage.bytecode) + await addPrimitiveToArrayStorage(contracts.SimpleStorage.abi, storageAddress, "100"); + await addPrimitiveToArrayStorage(contracts.SimpleStorage.abi, storageAddress, "90"); + + const response = await client.invoke({ + uri, + method: "callContractView", + args: { + address: storageAddress, + method: 'function getSimple() public view returns (uint256[] memory)', + args: [], + }, + }); + + if (!response.ok) fail(response.error); + + if (!response.value) { + throw new Error('Empty data on view call, expecting JSON'); + } + const result = JSON.parse(response.value); + + expect(result.length).toEqual(2); + expect(result[0]).toEqual("100"); + expect(result[1]).toEqual("90"); + }); + + it("callContractView (primitives array - JSON ABI)", async () => { + const storageAddress = await deployStorage(contracts.SimpleStorage.abi, contracts.SimpleStorage.bytecode) + await addPrimitiveToArrayStorage(contracts.SimpleStorage.abi, storageAddress, "100"); + await addPrimitiveToArrayStorage(contracts.SimpleStorage.abi, storageAddress, "90"); + + const response = await client.invoke({ + uri, + method: "callContractView", + args: { + address: storageAddress, + method: contracts.SimpleStorage.abiArrayPrimitivesMethod, + args: [], + }, + }); + + if (!response.ok) fail(response.error); + + if (!response.value) { + throw new Error('Empty data on view call, expecting JSON'); + } + const result = JSON.parse(response.value); + + expect(result.length).toEqual(2); + expect(result[0]).toEqual("100"); + expect(result[1]).toEqual("90"); + }); + + it("callContractView (primitives array - non-array JSON ABI)", async () => { + const storageAddress = await deployStorage(contracts.SimpleStorage.abi, contracts.SimpleStorage.bytecode) + await addPrimitiveToArrayStorage(contracts.SimpleStorage.abi, storageAddress, "100"); + await addPrimitiveToArrayStorage(contracts.SimpleStorage.abi, storageAddress, "90"); + + const response = await client.invoke({ + uri, + method: "callContractView", + args: { + address: storageAddress, + method: '{"inputs":[],"name":"getSimple","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"}', + args: [], + }, + }); + + if (!response.ok) fail(response.error); + + if (!response.value) { + throw new Error('Empty data on view call, expecting JSON'); + } + const result = JSON.parse(response.value); + + expect(result.length).toEqual(2); + expect(result[0]).toEqual("100"); + expect(result[1]).toEqual("90"); + }); + + it("callContractView (struct array empty)", async () => { + const queueAddress = await deployStorage(contracts.SimpleStorage.abi, contracts.SimpleStorage.bytecode) + + const response = await client.invoke({ + uri, + method: "callContractView", + args: { + address: queueAddress, + method: contracts.SimpleStorage.abiArrayStructsMethod, + args: [], + }, + }); + + if (!response.ok) fail(response.error); + expect(response.value).toEqual('[]'); + }); + + it("callContractView (struct array single element)", async () => { + const queueAddress = await deployStorage(contracts.SimpleStorage.abi, contracts.SimpleStorage.bytecode) + await addStructToStorage(contracts.SimpleStorage.abi, queueAddress, [queueAddress, "100"]); + + const response = await client.invoke({ + uri, + method: "callContractView", + args: { + address: queueAddress, + method: contracts.SimpleStorage.abiArrayStructsMethod, + args: [], + }, + }); + + if (!response.ok) fail(response.error); + + if (!response.value) { + throw new Error('Empty data on view call, expecting JSON'); + } + const result = JSON.parse(response.value); + + expect(result.length).toEqual(1); + expect(result[0].to).toEqual(queueAddress); + expect(result[0].amount).toEqual("100"); + }); + + it("callContractView (struct array multiple elements)", async () => { + const queueAddress = await deployStorage(contracts.SimpleStorage.abi, contracts.SimpleStorage.bytecode) + await addStructToStorage(contracts.SimpleStorage.abi, queueAddress, [queueAddress, "100"]); + await addStructToStorage(contracts.SimpleStorage.abi, queueAddress, [ensAddress, "99"]); + + const response = await client.invoke({ + uri, + method: "callContractView", + args: { + address: queueAddress, + method: contracts.SimpleStorage.abiArrayStructsMethod, + args: [], + }, + }); + + if (!response.ok) fail(response.error); + + if (!response.value) { + throw new Error('Empty data on view call, expecting JSON'); + } + const result = JSON.parse(response.value); + + expect(result.length).toEqual(2); + expect(result[0].to).toEqual(queueAddress); + expect(result[0].amount).toEqual("100"); + expect(result[1].to).toEqual(ensAddress); + expect(result[1].amount).toEqual("99"); }); it("callContractStatic (no error)", async () => { @@ -136,9 +337,9 @@ describe("Ethereum Plugin", () => { }, }); - expect(response.error).toBeUndefined(); - expect(response.data?.error).toBeFalsy(); - expect(response.data?.result).toBe(""); + if (!response.ok) fail(response.error); + expect(response.value?.error).toBeFalsy(); + expect(response.value?.result).toBe(""); }); it("callContractStatic (expecting error)", async () => { @@ -159,10 +360,9 @@ describe("Ethereum Plugin", () => { }, }); - expect(response.error).toBeUndefined(); - expect(response.data).toBeDefined(); - expect(response.data?.error).toBeTruthy(); - expect(response.data?.result).toContain( + if (!response.ok) fail(response.error); + expect(response.value?.error).toBeTruthy(); + expect(response.value?.result).toContain( "missing revert data in call exception" ); }); @@ -172,17 +372,18 @@ describe("Ethereum Plugin", () => { uri, method: "getSignerAddress", }); + if (!signerAddressQuery.ok) fail(signerAddressQuery.error); const response = await client.invoke({ uri, method: "getBalance", args: { - address: signerAddressQuery.data, + address: signerAddressQuery.value, }, }); - expect(response.error).toBeUndefined(); - expect(response.data).toBeDefined(); + if (!response.ok) fail(response.error); + expect(response.value).toBeDefined(); }); it("encodeParams", async () => { @@ -195,7 +396,8 @@ describe("Ethereum Plugin", () => { }, }); - expect(response.data).toBe( + if (!response.ok) fail(response.error); + expect(response.value).toBe( "0x000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000" ); @@ -214,7 +416,7 @@ describe("Ethereum Plugin", () => { }, }); - expect(acceptsTupleArg.error).toBeUndefined(); + if (!acceptsTupleArg.ok) fail(acceptsTupleArg.error); }); it("encodeFunction", async () => { @@ -227,8 +429,8 @@ describe("Ethereum Plugin", () => { }, }); - expect(response.error).toBeUndefined(); - expect(response.data).toBe( + if (!response.ok) fail(response.error); + expect(response.value).toBe( "0x46d4adf20000000000000000000000000000000000000000000000000000000000000064" ); @@ -241,7 +443,7 @@ describe("Ethereum Plugin", () => { }, }); - expect(acceptsArrayArg.error).toBeUndefined(); + if (!acceptsArrayArg.ok) fail(acceptsArrayArg.error); }); it("solidityPack", async () => { @@ -268,9 +470,9 @@ describe("Ethereum Plugin", () => { }, }); - expect(result.error).toBeFalsy(); - expect(result.data).toBeTruthy(); - expect(result.data).toBe( + if (!result.ok) fail(result.error); + expect(result.value).toBeTruthy(); + expect(result.value).toBe( "0x0000000000000000000000000000000000000001000bb80000000000000000000000000000000000000002000bb8c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" ); }); @@ -299,9 +501,9 @@ describe("Ethereum Plugin", () => { }, }); - expect(result.error).toBeFalsy(); - expect(result.data).toBeTruthy(); - expect(result.data).toBe( + if (!result.ok) fail(result.error); + expect(result.value).toBeTruthy(); + expect(result.value).toBe( "0x5dd4ee83f9bab0157f0e929b6dddd106fd7de6e5089f0f05c2c0b861e3807588" ); }); @@ -330,9 +532,9 @@ describe("Ethereum Plugin", () => { }, }); - expect(result.error).toBeFalsy(); - expect(result.data).toBeTruthy(); - expect(result.data).toBe( + if (!result.ok) fail(result.error); + expect(result.value).toBeTruthy(); + expect(result.value).toBe( "0x8652504faf6e0d175e62c1d9c7e10d636d5ab8f153ec3257dab1726639058d27" ); }); @@ -343,9 +545,9 @@ describe("Ethereum Plugin", () => { method: "getSignerAddress", }); - expect(response.error).toBeUndefined(); - expect(response.data).toBeDefined(); - expect(response.data?.startsWith("0x")).toBe(true); + if (!response.ok) fail(response.error); + expect(response.value).toBeDefined(); + expect(response.value?.startsWith("0x")).toBe(true); }); it("getSignerBalance", async () => { @@ -354,8 +556,8 @@ describe("Ethereum Plugin", () => { method: "getSignerBalance", }); - expect(response.error).toBeUndefined(); - expect(response.data).toBeDefined(); + if (!response.ok) fail(response.error); + expect(response.value).toBeDefined(); }); it("getSignerTransactionCount", async () => { @@ -364,9 +566,9 @@ describe("Ethereum Plugin", () => { method: "getSignerTransactionCount", }); - expect(response.error).toBeUndefined(); - expect(response.data).toBeDefined(); - expect(Number(response.data)).toBeTruthy(); + if (!response.ok) fail(response.error); + expect(response.value).toBeDefined(); + expect(Number(response.value)).toBeTruthy(); }); it("getGasPrice", async () => { @@ -375,9 +577,9 @@ describe("Ethereum Plugin", () => { method: "getGasPrice", }); - expect(response.error).toBeUndefined(); - expect(response.data).toBeDefined(); - expect(Number(response.data)).toBeTruthy(); + if (!response.ok) fail(response.error); + expect(response.value).toBeDefined(); + expect(Number(response.value)).toBeTruthy(); }); it("estimateTransactionGas", async () => { @@ -393,9 +595,9 @@ describe("Ethereum Plugin", () => { }, }); - expect(response.error).toBeUndefined(); - expect(response.data).toBeDefined(); - const num = ethers.BigNumber.from(response.data); + if (!response.ok) fail(response.error); + expect(response.value).toBeDefined(); + const num = ethers.BigNumber.from(response.value); expect(num.gt(0)).toBeTruthy(); }); @@ -411,9 +613,9 @@ describe("Ethereum Plugin", () => { }, }); - expect(response.data).toBeDefined(); - expect(response.error).toBeUndefined(); - const num = ethers.BigNumber.from(response.data); + if (!response.ok) fail(response.error); + expect(response.value).toBeDefined(); + const num = ethers.BigNumber.from(response.value); expect(num.gt(0)).toBeTruthy(); }); @@ -426,9 +628,9 @@ describe("Ethereum Plugin", () => { }, }); - expect(response.error).toBeUndefined(); - expect(response.data).toBeDefined(); - expect(response.data).toEqual(true); + if (!response.ok) fail(response.error); + expect(response.value).toBeDefined(); + expect(response.value).toEqual(true); }); it("toWei", async () => { @@ -440,9 +642,9 @@ describe("Ethereum Plugin", () => { }, }); - expect(response.error).toBeUndefined(); - expect(response.data).toBeDefined(); - expect(response.data).toEqual("20000000000000000000"); + if (!response.ok) fail(response.error); + expect(response.value).toBeDefined(); + expect(response.value).toEqual("20000000000000000000"); }); it("toEth", async () => { @@ -454,9 +656,9 @@ describe("Ethereum Plugin", () => { }, }); - expect(response.error).toBeUndefined(); - expect(response.data).toBeDefined(); - expect(response.data).toEqual("20.0"); + if (!response.ok) fail(response.error); + expect(response.value).toBeDefined(); + expect(response.value).toEqual("20.0"); }); it("awaitTransaction", async () => { @@ -472,9 +674,9 @@ describe("Ethereum Plugin", () => { }, }); - expect(response.error).toBeUndefined(); - expect(response.data?.hash).toBeTruthy(); - const txHash = response.data?.hash as string; + if (!response.ok) fail(response.error); + expect(response.value?.hash).toBeTruthy(); + const txHash = response.value?.hash as string; const awaitResponse = await client.invoke({ uri, @@ -486,9 +688,9 @@ describe("Ethereum Plugin", () => { }, }); - expect(awaitResponse.error).toBeUndefined(); - expect(awaitResponse.data).toBeDefined(); - expect(awaitResponse.data?.transactionHash).toBeDefined(); + if (!awaitResponse.ok) fail(awaitResponse.error); + expect(awaitResponse.value).toBeDefined(); + expect(awaitResponse.value.transactionHash).toBeDefined(); }); it("waitForEvent (NameTransfer)", async () => { @@ -497,8 +699,7 @@ describe("Ethereum Plugin", () => { const domain = "testwhatever10.eth"; const newOwner = "0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0"; - const listenerPromise = client - .invoke({ + const listenerPromise = client.invoke({ uri, method: "waitForEvent", args: { @@ -508,11 +709,15 @@ describe("Ethereum Plugin", () => { timeout: 20000, }, }) - .then((result: { data: Schema.EventNotification }) => { - expect(typeof result.data?.data === "string").toBe(true); - expect(typeof result.data?.address === "string").toBe(true); - expect(result.data?.log).toBeDefined(); - expect(typeof result.data?.log.transactionHash === "string").toBe( + .then((result) => { + if (result.ok) return result.value + else fail(result.error) + }) + .then((result: Schema.EventNotification) => { + expect(typeof result.data === "string").toBe(true); + expect(typeof result.address === "string").toBe(true); + expect(result.log).toBeDefined(); + expect(typeof result.log.transactionHash === "string").toBe( true ); }); @@ -556,15 +761,17 @@ describe("Ethereum Plugin", () => { timeout: 20000, }, }) - .then((result: { data: Schema.EventNotification }) => { - expect(typeof result.data?.data === "string").toBe(true); - expect(typeof result.data?.address === "string").toBe(true); - expect(result.data?.log).toBeDefined(); - expect(typeof result.data?.log.transactionHash === "string").toBe( + .then((result) => { + if (result.ok) return result.value + else fail(result.error) + }) + .then((result: Schema.EventNotification) => { + expect(typeof result.data === "string").toBe(true); + expect(typeof result.address === "string").toBe(true); + expect(result.log).toBeDefined(); + expect(typeof result.log.transactionHash === "string").toBe( true ); - - return; }); await client.invoke({ @@ -601,11 +808,11 @@ describe("Ethereum Plugin", () => { } }); - expect(mainnetNetwork.data).toBeTruthy(); - expect(mainnetNetwork.error).toBeFalsy(); - expect(mainnetNetwork.data?.chainId).toBe("1"); - expect(mainnetNetwork.data?.name).toBe("homestead"); - expect(mainnetNetwork.data?.ensAddress).toBe( + if (!mainnetNetwork.ok) fail(mainnetNetwork.error); + expect(mainnetNetwork.value).toBeTruthy(); + expect(mainnetNetwork.value?.chainId).toBe("1"); + expect(mainnetNetwork.value?.name).toBe("homestead"); + expect(mainnetNetwork.value?.ensAddress).toBe( "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" ); }); @@ -619,19 +826,18 @@ describe("Ethereum Plugin", () => { } } }); - - expect(polygonNetwork.data).toBeTruthy(); - expect(polygonNetwork.error).toBeFalsy(); - expect(polygonNetwork.data?.chainId).toBe("137"); - expect(polygonNetwork.data?.name).toBe("matic"); - expect(polygonNetwork.data?.ensAddress).toBeFalsy(); + + if (!polygonNetwork.ok) fail(polygonNetwork.error); + expect(polygonNetwork.value).toBeTruthy(); + expect(polygonNetwork.value?.chainId).toBe("137"); + expect(polygonNetwork.value?.name).toBe("matic"); + expect(polygonNetwork.value?.ensAddress).toBeFalsy(); }); it("getNetwork - mainnet with env", async () => { - const mainnetNetwork = await client.invoke({ - uri, - method: "getNetwork", - config: { + const config = new ClientConfigBuilder() + .add(client.getConfig()) + .add({ envs: [ { uri: "wrap://ens/ethereum.polywrap.eth", @@ -642,23 +848,29 @@ describe("Ethereum Plugin", () => { }, }, ], - }, + }) + .build(); + const mainnetClient = new PolywrapClient( + config + ); + const mainnetNetwork = await mainnetClient.invoke({ + uri, + method: "getNetwork", }); - expect(mainnetNetwork.data).toBeTruthy(); - expect(mainnetNetwork.error).toBeFalsy(); - expect(mainnetNetwork.data?.chainId).toBe("1"); - expect(mainnetNetwork.data?.name).toBe("homestead"); - expect(mainnetNetwork.data?.ensAddress).toBe( + if (!mainnetNetwork.ok) fail(mainnetNetwork.error); + expect(mainnetNetwork.value).toBeTruthy(); + expect(mainnetNetwork.value?.chainId).toBe("1"); + expect(mainnetNetwork.value?.name).toBe("homestead"); + expect(mainnetNetwork.value?.ensAddress).toBe( "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" ); }); it("getNetwork - polygon with env", async () => { - const polygonNetwork = await client.invoke({ - uri, - method: "getNetwork", - config: { + const config = new ClientConfigBuilder() + .add(client.getConfig()) + .add({ envs: [ { uri: "wrap://ens/ethereum.polywrap.eth", @@ -669,28 +881,31 @@ describe("Ethereum Plugin", () => { }, }, ], - }, + }) + .build(); + const polygonClient = new PolywrapClient( + config + ); + const polygonNetwork = await polygonClient.invoke({ + uri, + method: "getNetwork", }); - expect(polygonNetwork.data).toBeTruthy(); - expect(polygonNetwork.error).toBeFalsy(); - expect(polygonNetwork.data?.chainId).toBe("137"); - expect(polygonNetwork.data?.name).toBe("matic"); + if (!polygonNetwork.ok) fail(polygonNetwork.error); + expect(polygonNetwork.value).toBeTruthy(); + expect(polygonNetwork.value?.chainId).toBe("137"); + expect(polygonNetwork.value?.name).toBe("matic"); }); it("requestAccounts", async () => { - const { error } = await client.invoke({ + let result = await client.invoke({ uri, method: "requestAccounts", }) - + result = result as { ok: false; error: Error | undefined }; // eth_requestAccounts is not supported by Ganache // this RPC error indicates that the method call was attempted - expect(error?.message.indexOf("Method eth_requestAccounts not supported")).toBeGreaterThanOrEqual(0); - - // expect(error).toBeFalsy(); - // expect(data).toBeTruthy(); - // expect(data?.length).toBeGreaterThan(0); + expect(result.error?.message.indexOf("Method eth_requestAccounts not supported")).toBeGreaterThanOrEqual(0); }); }); @@ -713,8 +928,8 @@ describe("Ethereum Plugin", () => { } }); - expect(response.error).toBeUndefined(); - expect(response.data).toBeDefined(); + if (!response.ok) fail(response.error); + expect(response.value).toBeDefined(); }); it("callContractMethodAndWait", async () => { @@ -735,8 +950,8 @@ describe("Ethereum Plugin", () => { } }); - expect(response.error).toBeUndefined(); - expect(response.data).toBeDefined(); + if (!response.ok) fail(response.error); + expect(response.value).toBeDefined(); }); it("sendTransaction", async () => { @@ -748,9 +963,9 @@ describe("Ethereum Plugin", () => { } }); - expect(response.error).toBeUndefined(); - expect(response.data).toBeDefined(); - expect(response.data?.hash).toBeDefined(); + if (!response.ok) fail(response.error); + expect(response.value).toBeDefined(); + expect(response.value?.hash).toBeDefined(); }); it("sendTransactionAndWait", async () => { @@ -762,10 +977,10 @@ describe("Ethereum Plugin", () => { } }); - expect(response.error).toBeUndefined(); - expect(response.data).toBeDefined(); + if (!response.ok) fail(response.error); + expect(response.value).toBeDefined(); expect( - response.data?.transactionHash + response.value?.transactionHash ).toBeDefined(); }); @@ -779,9 +994,9 @@ describe("Ethereum Plugin", () => { } }); - expect(response.error).toBeUndefined(); - expect(response.data).toBeDefined(); - expect(response.data).toContain("0x"); + if (!response.ok) fail(response.error); + expect(response.value).toBeDefined(); + expect(response.value).toContain("0x"); }); it("signMessage", async () => { @@ -793,8 +1008,8 @@ describe("Ethereum Plugin", () => { } }); - expect(response.error).toBeUndefined(); - expect(response.data).toBe( + if (!response.ok) fail(response.error); + expect(response.value).toBe( "0xa4708243bf782c6769ed04d83e7192dbcf4fc131aa54fde9d889d8633ae39dab03d7babd2392982dff6bc20177f7d887e27e50848c851320ee89c6c63d18ca761c" ); }); @@ -808,8 +1023,8 @@ describe("Ethereum Plugin", () => { } }); - expect(res.error).toBeUndefined(); - expect(res.data).toBeDefined(); + if (!res.ok) fail(res.error); + expect(res.value).toBeDefined(); }); }); @@ -824,11 +1039,11 @@ describe("Ethereum Plugin", () => { } }); - expect(response1.error).toBeUndefined(); - expect(response1.data).toBeDefined(); - expect(response1.data).toContain("0x"); + if (!response1.ok) fail(response1.error); + expect(response1.value).toBeDefined(); + expect(response1.value).toContain("0x"); - const address = response1.data as string; + const address = response1.value; const structArg = JSON.stringify({ str: "foo bar", unsigned256: 123456, @@ -845,11 +1060,11 @@ describe("Ethereum Plugin", () => { } }); - expect(response2.error).toBeUndefined(); - expect(response2.data).toBeDefined(); + if (!response2.ok) fail(response2.error); + expect(response2.value).toBeDefined(); expect( - response2.data?.transactionHash + response2.value?.transactionHash ).toBeDefined(); }); }); -}); +}); \ No newline at end of file diff --git a/packages/js/plugins/ethereum/src/__tests__/integration/polywrap.build.yaml b/packages/js/plugins/ethereum/src/__tests__/integration/polywrap.build.yaml index 5b7b10a7c5..c3dcbe22cb 100644 --- a/packages/js/plugins/ethereum/src/__tests__/integration/polywrap.build.yaml +++ b/packages/js/plugins/ethereum/src/__tests__/integration/polywrap.build.yaml @@ -1,6 +1,9 @@ -format: 0.1.0 -config: - node_version: "16.13.0" +format: 0.2.0 +strategies: + image: + node_version: "14.16.0" + include: + - ./package.json linked_packages: - name: "@polywrap/wasm-as" path: ../../../../../../wasm/as diff --git a/packages/js/plugins/ethereum/src/__tests__/utils/storage.ts b/packages/js/plugins/ethereum/src/__tests__/utils/storage.ts new file mode 100644 index 0000000000..988e0e4659 --- /dev/null +++ b/packages/js/plugins/ethereum/src/__tests__/utils/storage.ts @@ -0,0 +1,53 @@ +import { Connection } from "@polywrap/ethereum-plugin-js"; +import { ContractFactory, Contract, Signer, ethers } from "ethers"; +import { providers } from "@polywrap/test-env-js"; + +export async function deployStorage( + abi: string[], + bytecode: string +): Promise { + const signer = getSigner(); + const factory = new ContractFactory(abi, bytecode, signer); + const contract = await factory.deploy(); + await contract.deployed(); + return contract.address; +} + +export async function addStructToStorage( + abi: string[], + address: string, + args: string[] +): Promise { + const signer = getSigner(); + const contract = new Contract(address, abi); + const calldata = ethers.utils.defaultAbiCoder.encode( + ["address", "uint256"], + args + ); + await contract.connect(signer).addJob(calldata); +} + +export async function addPrimitiveToArrayStorage( + abi: string[], + address: string, + data: string +): Promise { + const signer = getSigner(); + const contract = new Contract(address, abi); + await contract.connect(signer).addSimple(data); +} + +export async function setPrimitiveToStorage( + abi: string[], + address: string, + data: string +): Promise { + const signer = getSigner(); + const contract = new Contract(address, abi); + await contract.connect(signer).set(data); +} + +function getSigner(): Signer { + const connection = new Connection({ provider: providers.ethereum }); + return connection.getSigner(); +} diff --git a/packages/js/plugins/ethereum/src/index.ts b/packages/js/plugins/ethereum/src/index.ts index 445cb64b75..a9ff725846 100644 --- a/packages/js/plugins/ethereum/src/index.ts +++ b/packages/js/plugins/ethereum/src/index.ts @@ -40,7 +40,7 @@ import { } from "./wrap"; import { Connection } from "./Connection"; import * as Mapping from "./utils/mapping"; -import { parseArgs } from "./utils/parsing"; +import { constructAbi, parseArgs, parseResult } from "./utils/parsing"; import { Connections } from "./Connections"; import { ethers } from "ethers"; @@ -67,10 +67,11 @@ export class EthereumPlugin extends Module { _client: Client ): Promise { const connection = await this._getConnection(args.connection); - const contract = connection.getContract(args.address, [args.method], false); + const abi = constructAbi(args.method); + const contract = connection.getContract(args.address, abi, false); const funcs = Object.keys(contract.interface.functions); - const res = await contract[funcs[0]](...parseArgs(args.args)); - return res.toString(); + const result = await contract[funcs[0]](...parseArgs(args.args)); + return parseResult(abi, result); } async callContractStatic( @@ -78,23 +79,27 @@ export class EthereumPlugin extends Module { _client: Client ): Promise { const connection = await this._getConnection(args.connection); - const contract = connection.getContract(args.address, [args.method]); + const abi = constructAbi(args.method); + const contract = connection.getContract(args.address, abi); const funcs = Object.keys(contract.interface.functions); try { - const res = await contract.callStatic[funcs[0]](...parseArgs(args.args), { - gasPrice: args.txOverrides?.gasPrice - ? ethers.BigNumber.from(args.txOverrides.gasPrice) - : undefined, - gasLimit: args.txOverrides?.gasLimit - ? ethers.BigNumber.from(args.txOverrides.gasLimit) - : undefined, - value: args.txOverrides?.value - ? ethers.BigNumber.from(args.txOverrides.value) - : undefined, - }); + const result = await contract.callStatic[funcs[0]]( + ...parseArgs(args.args), + { + gasPrice: args.txOverrides?.gasPrice + ? ethers.BigNumber.from(args.txOverrides.gasPrice) + : undefined, + gasLimit: args.txOverrides?.gasLimit + ? ethers.BigNumber.from(args.txOverrides.gasLimit) + : undefined, + value: args.txOverrides?.value + ? ethers.BigNumber.from(args.txOverrides.value) + : undefined, + } + ); return { - result: res.toString(), + result: result.length ? parseResult(abi, result) : "", error: false, }; } catch (e) { @@ -203,7 +208,8 @@ export class EthereumPlugin extends Module { _client: Client ): Promise { const connection = await this._getConnection(args.connection); - const contract = connection.getContract(args.address, [args.method]); + const abi = constructAbi(args.method); + const contract = connection.getContract(args.address, abi); const funcs = Object.keys(contract.interface.functions); const gasPrice: string | null | undefined = args.txOverrides?.gasPrice; @@ -257,7 +263,8 @@ export class EthereumPlugin extends Module { _client: Client ): Promise { const connection = await this._getConnection(args.connection); - const contract = connection.getContract(args.address, [args.event]); + const abi = constructAbi(args.event); + const contract = connection.getContract(args.address, abi); const events = Object.keys(contract.interface.events); const filter = contract.filters[events[0]](...parseArgs(args.args)); @@ -392,7 +399,8 @@ export class EthereumPlugin extends Module { args: Args_callContractMethod ): Promise { const connection = await this._getConnection(args.connection); - const contract = connection.getContract(args.address, [args.method]); + const abi = constructAbi(args.method); + const contract = connection.getContract(args.address, abi); const funcs = Object.keys(contract.interface.functions); const gasPrice: string | null | undefined = args.txOverrides?.gasPrice; diff --git a/packages/js/plugins/ethereum/src/utils/parsing.ts b/packages/js/plugins/ethereum/src/utils/parsing.ts index fadaad22f0..c9f1f1c143 100644 --- a/packages/js/plugins/ethereum/src/utils/parsing.ts +++ b/packages/js/plugins/ethereum/src/utils/parsing.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ + export function parseArgs(args?: string[] | null): unknown[] { if (!args) { return []; @@ -10,3 +12,55 @@ export function parseArgs(args?: string[] | null): unknown[] { : arg ); } + +export function constructAbi(method: string): any[] { + let abi; + try { + abi = JSON.parse(method); + if (!(abi instanceof Array)) { + abi = [abi]; + } + } catch (e) { + abi = [method]; + } + return abi; +} + +export function parseResult(abi: any[], result: any[] | any): string { + if (!(result instanceof Array)) { + // if not array, return single value + return result.toString(); + } + const isRawAbi = abi[0] instanceof Object; + if (!isRawAbi) { + return stringifySimpleArray(result); + } + const outputs = abi[0].outputs; + const returnIsStruct = outputs.length > 0 && "components" in outputs[0]; + if (returnIsStruct) { + return stringifyStruct(abi, result); + } else { + return stringifySimpleArray(result); + } +} + +function stringifyStruct(abi: any[], result: any): string { + const objects: Record[] = []; + for (const element of result) { + const object: Record = {}; + const output = abi[0].outputs[0]; + for (const component of output.components) { + object[component.name] = element[component.name].toString(); + } + objects.push(object); + } + return JSON.stringify(objects); +} + +function stringifySimpleArray(result: any): string { + const objects: string[] = []; + for (const element of result) { + objects.push(element.toString()); + } + return JSON.stringify(objects); +} diff --git a/packages/js/plugins/file-system/src/__tests__/e2e.spec.ts b/packages/js/plugins/file-system/src/__tests__/e2e.spec.ts index d7547c07a7..f86ff77a17 100644 --- a/packages/js/plugins/file-system/src/__tests__/e2e.spec.ts +++ b/packages/js/plugins/file-system/src/__tests__/e2e.spec.ts @@ -48,21 +48,22 @@ describe("FileSystem plugin", () => { { path: sampleFilePath }, client ); - - expect(result.error).toBeFalsy(); - expect(result.data).toEqual(new Uint8Array(expectedContents)); + + if (!result.ok) fail(result.error); + expect(result.value).toEqual(new Uint8Array(expectedContents)); }); it("should fail reading a nonexistent file", async () => { const nonExistentFilePath = path.resolve(__dirname, "nonexistent.txt"); - const result = await FileSystem_Module.readFile( + let result = await FileSystem_Module.readFile( { path: nonExistentFilePath }, client ); - expect(result.data).toBeFalsy(); + result = result as { ok: false, error: Error | undefined }; expect(result.error).toBeTruthy(); + expect(result.ok).toBeFalsy(); }); it("should read a UTF8-encoded file as a string", async () => { @@ -77,8 +78,8 @@ describe("FileSystem plugin", () => { client ); - expect(result.error).toBeFalsy(); - expect(result.data).toBe(expectedContents); + if (!result.ok) fail(result.error); + expect(result.value).toBe(expectedContents); }); it("should read a file using supported encodings as a string", async () => { @@ -100,13 +101,13 @@ describe("FileSystem plugin", () => { client ); - expect(result.error).toBeFalsy(); + if (!result.ok) fail(result.error); const expectedContents = await fs.promises.readFile(sampleFilePath, { encoding: fileSystemEncodingToBufferEncoding(encoding), }); - expect(result.data).toBe(expectedContents); + expect(result.value).toBe(expectedContents); } }); @@ -116,8 +117,8 @@ describe("FileSystem plugin", () => { client ); - expect(result_fileExists.error).toBeFalsy(); - expect(result_fileExists.data).toBe(true); + if (!result_fileExists.ok) fail(result_fileExists.error); + expect(result_fileExists.value).toBe(true); const nonExistentFilePath = path.resolve( __dirname, @@ -129,8 +130,8 @@ describe("FileSystem plugin", () => { client ); - expect(result_fileMissing.error).toBeFalsy(); - expect(result_fileMissing.data).toBe(false); + if (!result_fileMissing.ok) fail(result_fileMissing.error); + expect(result_fileMissing.value).toBe(false); }); it("should write byte data to a file", async () => { @@ -145,8 +146,8 @@ describe("FileSystem plugin", () => { await fs.promises.readFile(tempFilePath) ); - expect(result.error).toBeFalsy(); - expect(result.data).toBe(true); + if (!result.ok) fail(result.error); + expect(result.value).toBe(true); expect(expectedFileContents).toEqual(bytes); }); @@ -157,8 +158,8 @@ describe("FileSystem plugin", () => { const result = await FileSystem_Module.rm({ path: tempFilePath }, client); - expect(result.error).toBeFalsy(); - expect(result.data).toBe(true); + if (!result.ok) fail(result.error); + expect(result.value).toBe(true); const fileExists = fs.existsSync(tempFilePath); @@ -179,8 +180,8 @@ describe("FileSystem plugin", () => { client ); - expect(result.error).toBeFalsy(); - expect(result.data).toBe(true); + if (!result.ok) fail(result.error); + expect(result.value).toBe(true); const fileExists = fs.existsSync(fileInDirPath); @@ -190,7 +191,8 @@ describe("FileSystem plugin", () => { it("should create a directory", async () => { const result = await FileSystem_Module.mkdir({ path: tempDirPath }, client); - expect(result.data).toBe(true); + if (!result.ok) fail(result.error); + expect(result.value).toBe(true); let directoryExists = fs.existsSync(tempDirPath); @@ -205,7 +207,8 @@ describe("FileSystem plugin", () => { client ); - expect(result.data).toBe(true); + if (!result.ok) fail(result.error); + expect(result.value).toBe(true); let directoryExists = fs.existsSync(dirInDirPath); @@ -217,7 +220,8 @@ describe("FileSystem plugin", () => { const result = await FileSystem_Module.rmdir({ path: tempDirPath }, client); - expect(result.data).toBe(true); + if (!result.ok) fail(result.error); + expect(result.value).toBe(true); const directoryExists = fs.existsSync(tempDirPath); diff --git a/packages/js/plugins/http/src/__tests__/e2e/e2e.spec.ts b/packages/js/plugins/http/src/__tests__/e2e/e2e.spec.ts index f0b6fee523..4b1b896d5d 100644 --- a/packages/js/plugins/http/src/__tests__/e2e/e2e.spec.ts +++ b/packages/js/plugins/http/src/__tests__/e2e/e2e.spec.ts @@ -42,12 +42,12 @@ describe("e2e tests for HttpPlugin", () => { }, }, }); - - expect(response.error).toBeUndefined(); - expect(response.data).toBeDefined(); - expect(response.data?.status).toBe(200); - expect(response.data?.body).toBe('{data: "test-response"}'); - expect(response.data?.headers?.size).toEqual(2); // default reply headers + + if (!response.ok) fail(response.error); + expect(response.value).toBeDefined(); + expect(response.value?.status).toBe(200); + expect(response.value?.body).toBe('{data: "test-response"}'); + expect(response.value?.headers?.size).toEqual(2); // default reply headers }); test("successful request with response type as BINARY", async () => { @@ -67,13 +67,13 @@ describe("e2e tests for HttpPlugin", () => { }, }); - expect(response.error).toBeUndefined(); - expect(response.data).toBeDefined(); - expect(response.data?.status).toBe(200); - expect(response.data?.body).toBe( + if (!response.ok) fail(response.error); + expect(response.value).toBeDefined(); + expect(response.value?.status).toBe(200); + expect(response.value?.body).toBe( Buffer.from('{data: "test-response"}').toString("base64") ); - expect(response.data?.headers?.size).toEqual(2); // default reply headers + expect(response.value?.headers?.size).toEqual(2); // default reply headers }); test("successful request with query params and request headers", async () => { @@ -100,11 +100,11 @@ describe("e2e tests for HttpPlugin", () => { }, }); - expect(response.error).toBeUndefined(); - expect(response.data).toBeDefined(); - expect(response.data?.status).toBe(200); - expect(response.data?.body).toBe('{data: "test-response"}'); - expect(response.data?.headers).toEqual( + if (!response.ok) fail(response.error); + expect(response.value).toBeDefined(); + expect(response.value?.status).toBe(200); + expect(response.value?.body).toBe('{data: "test-response"}'); + expect(response.value?.headers).toEqual( new Map([ ["x-response-header", "resp-foo"], ["access-control-allow-origin", "*"], @@ -119,7 +119,7 @@ describe("e2e tests for HttpPlugin", () => { .get("/api") .reply(404); - const response = await polywrapClient.invoke({ + let response = await polywrapClient.invoke({ uri: "wrap://ens/http.polywrap.eth", method: "get", args: { @@ -130,8 +130,9 @@ describe("e2e tests for HttpPlugin", () => { }, }); - expect(response.data).toBeUndefined(); + response = response as { ok: false, error: Error | undefined }; expect(response.error).toBeDefined(); + expect(response.ok).toBeFalsy(); }); }); @@ -165,11 +166,11 @@ describe("e2e tests for HttpPlugin", () => { }, }); - expect(response.error).toBeUndefined(); - expect(response.data).toBeDefined(); - expect(response.data?.status).toBe(200); - expect(response.data?.body).toBe(resPayloadStringfified); - expect(response.data?.headers?.size).toEqual(2); // default reply headers + if (!response.ok) fail(response.error); + expect(response.value).toBeDefined(); + expect(response.value?.status).toBe(200); + expect(response.value?.body).toBe(resPayloadStringfified); + expect(response.value?.headers?.size).toEqual(2); // default reply headers }); test("successful request with response type as TEXT", async () => { @@ -190,11 +191,11 @@ describe("e2e tests for HttpPlugin", () => { }, }); - expect(response.error).toBeUndefined(); - expect(response.data).toBeDefined(); - expect(response.data?.status).toBe(200); - expect(response.data?.body).toBe('{data: "test-response"}'); - expect(response.data?.headers?.size).toEqual(2); // default reply headers + if (!response.ok) fail(response.error); + expect(response.value).toBeDefined(); + expect(response.value?.status).toBe(200); + expect(response.value?.body).toBe('{data: "test-response"}'); + expect(response.value?.headers?.size).toEqual(2); // default reply headers }); test("successful request with response type as BINARY", async () => { @@ -215,13 +216,13 @@ describe("e2e tests for HttpPlugin", () => { }, }); - expect(response.error).toBeUndefined(); - expect(response.data).toBeDefined(); - expect(response.data?.status).toBe(200); - expect(response.data?.body).toBe( + if (!response.ok) fail(response.error); + expect(response.value).toBeDefined(); + expect(response.value?.status).toBe(200); + expect(response.value?.body).toBe( Buffer.from('{data: "test-response"}').toString("base64") ); - expect(response.data?.headers?.size).toEqual(2); // default reply headers + expect(response.value?.headers?.size).toEqual(2); // default reply headers }); test("successful request with query params and request headers", async () => { @@ -249,11 +250,11 @@ describe("e2e tests for HttpPlugin", () => { }, }); - expect(response.data).toBeDefined(); - expect(response.error).toBeUndefined(); - expect(response.data?.status).toBe(200); - expect(response.data?.body).toBe('{data: "test-response"}'); - expect(response.data?.headers).toEqual( + if (!response.ok) fail(response.error); + expect(response.value).toBeDefined(); + expect(response.value?.status).toBe(200); + expect(response.value?.body).toBe('{data: "test-response"}'); + expect(response.value?.headers).toEqual( new Map([ ["x-response-header", "resp-foo"], ["access-control-allow-origin", "*"], @@ -268,7 +269,7 @@ describe("e2e tests for HttpPlugin", () => { .post("/api") .reply(404); - const response = await polywrapClient.invoke({ + let response = await polywrapClient.invoke({ uri: "wrap://ens/http.polywrap.eth", method: "post", args: { @@ -279,8 +280,9 @@ describe("e2e tests for HttpPlugin", () => { }, }); - expect(response.data).toBeUndefined(); + response = response as { ok: false, error: Error | undefined }; expect(response.error).toBeDefined(); + expect(response.ok).toBeFalsy(); }); }); }); diff --git a/packages/js/plugins/http/src/__tests__/e2e/integration.spec.ts b/packages/js/plugins/http/src/__tests__/e2e/integration.spec.ts index 29f79215f2..3cdbfbf1cb 100644 --- a/packages/js/plugins/http/src/__tests__/e2e/integration.spec.ts +++ b/packages/js/plugins/http/src/__tests__/e2e/integration.spec.ts @@ -56,9 +56,9 @@ describe("e2e tests for HttpPlugin", () => { }, }); - expect(response.error).toBeUndefined(); - expect(response.data).toBeDefined(); - expect(response.data?.status).toBe(200); + if (!response.ok) fail(response.error); + expect(response.value).toBeDefined(); + expect(response.value?.status).toBe(200); }); it("post", async () => { @@ -86,10 +86,10 @@ describe("e2e tests for HttpPlugin", () => { }, }); - expect(response.error).toBeFalsy(); - expect(response.data).toBeTruthy(); - expect(response.data?.status).toBe(200); - expect(response.data?.body).toBeTruthy(); + if (!response.ok) fail(response.error); + expect(response.value).toBeTruthy(); + expect(response.value?.status).toBe(200); + expect(response.value?.body).toBeTruthy(); }); }); }); diff --git a/packages/js/plugins/http/src/__tests__/e2e/integration/polywrap.build.yaml b/packages/js/plugins/http/src/__tests__/e2e/integration/polywrap.build.yaml index d61799c1d7..197f0e11e5 100644 --- a/packages/js/plugins/http/src/__tests__/e2e/integration/polywrap.build.yaml +++ b/packages/js/plugins/http/src/__tests__/e2e/integration/polywrap.build.yaml @@ -1,6 +1,9 @@ -format: 0.1.0 -config: - node_version: "14.16.0" +format: 0.2.0 +strategies: + image: + node_version: "14.16.0" + include: + - ./package.json linked_packages: - name: "@polywrap/wasm-as" path: ../../../../../../../wasm/as diff --git a/packages/js/plugins/ipfs/README.md b/packages/js/plugins/ipfs/README.md index 0b99de30c6..985c58d2ab 100644 --- a/packages/js/plugins/ipfs/README.md +++ b/packages/js/plugins/ipfs/README.md @@ -12,8 +12,7 @@ import { stopTestEnvironment, } from "@polywrap/test-env-js"; import { ipfsPlugin } from "@polywrap/ipfs-plugin-js"; - -const createIpfsClient = require("@dorgjelli-test/ipfs-http-client-lite"); +import createIpfsClient from "@polywrap/ipfs-http-client-lite"; // IPFS export async function foo({ diff --git a/packages/js/plugins/ipfs/package.json b/packages/js/plugins/ipfs/package.json index 0bb9dd355b..f732089949 100644 --- a/packages/js/plugins/ipfs/package.json +++ b/packages/js/plugins/ipfs/package.json @@ -20,7 +20,7 @@ "test:watch": "jest --watch --passWithNoTests --verbose" }, "dependencies": { - "@dorgjelli-test/ipfs-http-client-lite": "0.3.1", + "@polywrap/ipfs-http-client-lite": "0.3.0", "@polywrap/core-js": "0.8.0", "abort-controller": "3.0.0", "is-ipfs": "1.0.3", diff --git a/packages/js/plugins/ipfs/src/__tests__/e2e.spec.ts b/packages/js/plugins/ipfs/src/__tests__/e2e.spec.ts index 8cbb88e4f5..6edecfd100 100644 --- a/packages/js/plugins/ipfs/src/__tests__/e2e.spec.ts +++ b/packages/js/plugins/ipfs/src/__tests__/e2e.spec.ts @@ -1,4 +1,4 @@ -import { InvokeResult } from "@polywrap/core-js"; +import { Result } from "@polywrap/core-js"; import { PolywrapClient } from "@polywrap/client-js"; import { initTestEnvironment, @@ -7,10 +7,9 @@ import { } from "@polywrap/test-env-js"; import { ipfsPlugin } from ".."; -import { IpfsClient, IpfsFileInfo } from "../utils/IpfsClient"; import { Ipfs_Module } from "../wrap"; - -const createIpfsClient = require("@dorgjelli-test/ipfs-http-client-lite"); +import { ResultOk } from "@polywrap/result"; +import createIpfsClient, { IpfsClient, IpfsFileInfo } from "@polywrap/ipfs-http-client-lite"; jest.setTimeout(300000); @@ -58,10 +57,10 @@ describe("IPFS Plugin", () => { { cid: sampleFileIpfsInfo.hash.toString() }, client ); + + if (!result.ok) fail(result.error); - expect(result.error).toBeFalsy(); - - expect(result.data).toEqual(sampleFileBuffer); + expect(result.value).toEqual(sampleFileBuffer); }); it("Should resolve a file successfully", async () => { @@ -72,9 +71,9 @@ describe("IPFS Plugin", () => { client ); - expect(result.error).toBeFalsy(); + if (!result.ok) fail(result.error); - expect(result.data).toEqual({ + expect(result.value).toEqual({ cid: `/ipfs/${sampleFileIpfsInfo.hash.toString()}`, provider: providers.ipfs, }); @@ -86,11 +85,11 @@ describe("IPFS Plugin", () => { let result = await Ipfs_Module.addFile({ data: contentsBuffer }, client); - expect(result.error).toBeFalsy(); + if (!result.ok) fail(result.error); - expect(result.data).toBeTruthy(); + expect(result.value).toBeTruthy(); - const addedFileBuffer = await ipfs.cat(result.data as string); + const addedFileBuffer = await ipfs.cat(result.value as string); expect(contentsBuffer).toEqual(addedFileBuffer); }); @@ -98,13 +97,12 @@ describe("IPFS Plugin", () => { it("Should timeout within a specified amount of time - env and options", async () => { const createRacePromise = ( timeout: number - ): Promise> => { - return new Promise>((resolve) => + ): Promise> => { + return new Promise>((resolve) => setTimeout(() => { - resolve({ - data: Uint8Array.from([1, 2, 3, 4]), - error: undefined, - }); + resolve( + ResultOk(Uint8Array.from([1, 2, 3, 4])) + ); }, timeout) ); }; @@ -133,10 +131,10 @@ describe("IPFS Plugin", () => { let racePromise = createRacePromise(1100); - const result = await Promise.race([catPromise, racePromise]); + let result = await Promise.race([catPromise, racePromise]); expect(result).toBeTruthy(); - expect(result.data).toBeFalsy(); + result = result as { ok: false; error: Error | undefined }; expect(result.error).toBeTruthy(); expect(result.error?.stack).toMatch("Timeout has been reached"); expect(result.error?.stack).toMatch("Timeout: 1000"); @@ -151,13 +149,13 @@ describe("IPFS Plugin", () => { racePromise = createRacePromise(600); - const resultForOverride = await Promise.race([ + let resultForOverride = await Promise.race([ catPromiseWithTimeoutOverride, racePromise, ]); expect(resultForOverride).toBeTruthy(); - expect(resultForOverride.data).toBeFalsy(); + resultForOverride = resultForOverride as { ok: false; error: Error | undefined }; expect(resultForOverride.error).toBeTruthy(); expect(resultForOverride.error?.stack).toMatch("Timeout has been reached"); expect(resultForOverride.error?.stack).toMatch("Timeout: 500"); @@ -189,8 +187,8 @@ describe("IPFS Plugin", () => { clientWithBadProvider ); - expect(catResult.error).toBeFalsy(); - expect(catResult.data).toEqual(sampleFileBuffer); + if (!catResult.ok) fail(catResult.error); + expect(catResult.value).toEqual(sampleFileBuffer); const resolveResult = await Ipfs_Module.resolve( { @@ -200,8 +198,8 @@ describe("IPFS Plugin", () => { clientWithBadProvider ); - expect(resolveResult.error).toBeFalsy(); - expect(resolveResult.data).toEqual({ + if (!resolveResult.ok) fail(resolveResult.error); + expect(resolveResult.value).toEqual({ cid: `/ipfs/${sampleFileIpfsInfo.hash.toString()}`, provider: providers.ipfs, }); @@ -236,8 +234,8 @@ describe("IPFS Plugin", () => { clientWithBadProvider ); - expect(catResult.error).toBeFalsy(); - expect(catResult.data).toEqual(sampleFileBuffer); + if (!catResult.ok) fail(catResult.error); + expect(catResult.value).toEqual(sampleFileBuffer); const resolveResult = await Ipfs_Module.resolve( { @@ -250,8 +248,8 @@ describe("IPFS Plugin", () => { clientWithBadProvider ); - expect(resolveResult.error).toBeFalsy(); - expect(resolveResult.data).toEqual({ + if (!resolveResult.ok) fail(resolveResult.error); + expect(resolveResult.value).toEqual({ cid: `/ipfs/${sampleFileIpfsInfo.hash.toString()}`, provider: providers.ipfs, }); diff --git a/packages/js/plugins/ipfs/src/declarations.d.ts b/packages/js/plugins/ipfs/src/declarations.d.ts new file mode 100644 index 0000000000..5b3bf1b96f --- /dev/null +++ b/packages/js/plugins/ipfs/src/declarations.d.ts @@ -0,0 +1,25 @@ +declare module "@polywrap/ipfs-http-client-lite" { + import { CID } from "multiformats"; + + export interface IpfsClient { + add(data: Uint8Array, options?: unknown): Promise; + + cat(cid: string, options?: unknown): Promise; + + resolve( + cid: string, + options?: unknown + ): Promise<{ + path: string; + }>; + } + + export interface IpfsFileInfo { + name: string; + hash: CID; + } + + const createIpfsClient: (opts: unknown) => IpfsClient; + + export default createIpfsClient; +} diff --git a/packages/js/plugins/ipfs/src/index.ts b/packages/js/plugins/ipfs/src/index.ts index 18aba44ddb..18bf9a6d82 100644 --- a/packages/js/plugins/ipfs/src/index.ts +++ b/packages/js/plugins/ipfs/src/index.ts @@ -8,14 +8,11 @@ import { manifest, Env, } from "./wrap"; -import { IpfsClient } from "./utils/IpfsClient"; import { execSimple, execFallbacks } from "./utils/exec"; +import createIpfsClient, { IpfsClient } from "@polywrap/ipfs-http-client-lite"; import { Client, PluginFactory } from "@polywrap/core-js"; -// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports, @typescript-eslint/naming-convention -const createIpfsClient = require("@dorgjelli-test/ipfs-http-client-lite"); - const isNullOrUndefined = (arg: unknown) => { return arg === undefined || arg === null; }; @@ -111,13 +108,14 @@ export class IpfsPlugin extends Module { ): Promise { const defaultIpfsClient = createIpfsClient(this.env.provider); - if (!options) { - // Default behavior if no options are provided + if (!options?.fallbackProviders) { + // Default behavior if no fallback providers are provided + // Note that options.timeout is already set by getOptions return await execSimple( operation, defaultIpfsClient, this.config.provider, - 0, + options?.timeout ?? 0, func ); } diff --git a/packages/js/plugins/ipfs/src/utils/IpfsClient.ts b/packages/js/plugins/ipfs/src/utils/IpfsClient.ts deleted file mode 100644 index 80d63207b4..0000000000 --- a/packages/js/plugins/ipfs/src/utils/IpfsClient.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { CID } from "multiformats"; - -export interface IpfsClient { - add(data: Uint8Array, options?: unknown): Promise; - - cat(cid: string, options?: unknown): Promise; - - resolve( - cid: string, - options?: unknown - ): Promise<{ - path: string; - }>; -} - -export type IpfsFileInfo = { - name: string; - hash: CID; -}; diff --git a/packages/js/plugins/ipfs/src/utils/exec/abortable.ts b/packages/js/plugins/ipfs/src/utils/exec/abortable.ts index 47d276c310..44f1180d34 100644 --- a/packages/js/plugins/ipfs/src/utils/exec/abortable.ts +++ b/packages/js/plugins/ipfs/src/utils/exec/abortable.ts @@ -1,5 +1,4 @@ -import { IpfsClient } from "../IpfsClient"; - +import { IpfsClient } from "@polywrap/ipfs-http-client-lite"; import AbortController from "abort-controller"; const abortErrorMessage = "The user aborted a request."; @@ -77,7 +76,7 @@ export const execAbortable = ( provider, abort: () => { controller.abort(); - timer && clearTimeout(); + timer && clearTimeout(timer); }, }; }; diff --git a/packages/js/plugins/ipfs/src/utils/exec/fallbacks.ts b/packages/js/plugins/ipfs/src/utils/exec/fallbacks.ts index 78606a312c..4e7497dceb 100644 --- a/packages/js/plugins/ipfs/src/utils/exec/fallbacks.ts +++ b/packages/js/plugins/ipfs/src/utils/exec/fallbacks.ts @@ -1,8 +1,6 @@ -import { IpfsClient } from "../IpfsClient"; import { execAbortable, AbortablePromise } from "./abortable"; -// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports, @typescript-eslint/naming-convention -const createIpfsClient = require("@dorgjelli-test/ipfs-http-client-lite"); +import createIpfsClient, { IpfsClient } from "@polywrap/ipfs-http-client-lite"; export const execFallbacks = async ( operation: string, diff --git a/packages/js/plugins/ipfs/src/utils/exec/simple.ts b/packages/js/plugins/ipfs/src/utils/exec/simple.ts index 086bc6fba7..d7e822d976 100644 --- a/packages/js/plugins/ipfs/src/utils/exec/simple.ts +++ b/packages/js/plugins/ipfs/src/utils/exec/simple.ts @@ -1,6 +1,7 @@ -import { IpfsClient } from "../IpfsClient"; import { execAbortable } from "./abortable"; +import { IpfsClient } from "@polywrap/ipfs-http-client-lite"; + // Executes function in a try catch and returns error (if any) and result // If timeout is reached, it will return an error // If timeout is 0 then it will wait until the operation is complete diff --git a/packages/js/plugins/logger/src/__tests__/e2e/e2e.spec.ts b/packages/js/plugins/logger/src/__tests__/e2e/e2e.spec.ts index 90aaf76cad..889e5e9b06 100644 --- a/packages/js/plugins/logger/src/__tests__/e2e/e2e.spec.ts +++ b/packages/js/plugins/logger/src/__tests__/e2e/e2e.spec.ts @@ -13,8 +13,8 @@ describe("log method", () => { }, }); - expect(response.error).toBeUndefined(); - expect(response.data).toBeDefined(); - expect(response.data).toBe(true); + if (!response.ok) fail(response.error); + expect(response.value).toBeDefined(); + expect(response.value).toBe(true); }); }); diff --git a/packages/js/plugins/uri-resolvers/ens-resolver/src/__tests__/e2e.spec.ts b/packages/js/plugins/uri-resolvers/ens-resolver/src/__tests__/e2e.spec.ts index 846c8ff369..58a2c19021 100644 --- a/packages/js/plugins/uri-resolvers/ens-resolver/src/__tests__/e2e.spec.ts +++ b/packages/js/plugins/uri-resolvers/ens-resolver/src/__tests__/e2e.spec.ts @@ -89,7 +89,7 @@ describe("ENS Resolver Plugin", () => { fail("Expected response to be a wrapper"); } - const manifest = await result.value.wrapper.getManifest({}, client); + const manifest = await result.value.wrapper.getManifest({}); expect(manifest?.name).toBe("SimpleStorage"); }); diff --git a/packages/js/plugins/uri-resolvers/ens-resolver/src/index.ts b/packages/js/plugins/uri-resolvers/ens-resolver/src/index.ts index 17dcc81de5..ea337a5b90 100644 --- a/packages/js/plugins/uri-resolvers/ens-resolver/src/index.ts +++ b/packages/js/plugins/uri-resolvers/ens-resolver/src/index.ts @@ -111,7 +111,7 @@ export class EnsResolverPlugin extends Module { args: string[], networkNameOrChainId?: string ): Promise => { - const { data, error } = await Ethereum_Module.callContractView( + const result = await Ethereum_Module.callContractView( { address, method, @@ -125,22 +125,22 @@ export class EnsResolverPlugin extends Module { client ); - if (error) { - throw error; + if (!result.ok) { + throw result.error; } - if (data) { - if (typeof data !== "string") { + if (result.value) { + if (typeof result.value !== "string") { throw Error( - `Malformed data returned from Ethereum.callContractView: ${data}` + `Malformed data returned from Ethereum.callContractView: ${result.value}` ); } - return data; + return result.value; } throw Error( - `Ethereum.callContractView returned nothing.\nData: ${data}\nError: ${error}` + `Ethereum.callContractView returned nothing.\nData: \nError: ` ); }; diff --git a/packages/js/plugins/uri-resolvers/file-system-resolver/src/__tests__/e2e.spec.ts b/packages/js/plugins/uri-resolvers/file-system-resolver/src/__tests__/e2e.spec.ts index 98cf2150d0..87eef4dfda 100644 --- a/packages/js/plugins/uri-resolvers/file-system-resolver/src/__tests__/e2e.spec.ts +++ b/packages/js/plugins/uri-resolvers/file-system-resolver/src/__tests__/e2e.spec.ts @@ -95,25 +95,26 @@ describe("Filesystem plugin", () => { }, }); - expect(deploy.error).toBeFalsy(); - expect(deploy.data).toBeTruthy(); - expect(deploy.data?.indexOf("0x")).toBeGreaterThan(-1); + if (!deploy.ok) fail(deploy.error); + expect(deploy.value).toBeTruthy(); + expect(deploy.value.indexOf("0x")).toBeGreaterThan(-1); // get the manifest const manifest = await client.getManifest(fsUri); - expect(manifest).toBeTruthy(); - expect(manifest.version).toBe("0.1"); - expect(manifest.type).toEqual("wasm"); + if (!manifest.ok) fail(manifest.error); + expect(manifest.value.version).toBe("0.1"); + expect(manifest.value.type).toEqual("wasm"); // get a file const file = await client.getFile(fsUri, { path: "wrap.info", }); + if (!file.ok) fail(file.error); const expectedFile = await fs.promises.readFile(`${fsPath}/wrap.info`); const expectedInfo = Uint8Array.from(expectedFile); - expect(file).toStrictEqual(expectedInfo); + expect(file.value).toStrictEqual(expectedInfo); }); }); diff --git a/packages/js/plugins/uri-resolvers/file-system-resolver/src/index.ts b/packages/js/plugins/uri-resolvers/file-system-resolver/src/index.ts index 9638d5dbe9..80ad27882c 100644 --- a/packages/js/plugins/uri-resolvers/file-system-resolver/src/index.ts +++ b/packages/js/plugins/uri-resolvers/file-system-resolver/src/index.ts @@ -33,16 +33,17 @@ export class FileSystemResolverPlugin extends Module { _client ); - if (manifestExistsResult.data) { + if (manifestExistsResult.ok && manifestExistsResult.value) { try { const manifestResult = await FileSystem_Module.readFile( { path: manifestPath }, _client ); - if (manifestResult.error) { + if (!manifestResult.ok) { console.warn(manifestResult.error); + return { uri: null, manifest: undefined }; } - manifest = manifestResult.data; + manifest = manifestResult.value; } catch (e) { // TODO: logging } @@ -57,8 +58,11 @@ export class FileSystemResolverPlugin extends Module { { path: args.path }, _client ); + if (!fileResult.ok) { + return null; + } - return fileResult.data ?? null; + return fileResult.value; } catch (e) { return null; } diff --git a/packages/js/plugins/uri-resolvers/http-resolver/src/__tests__/e2e.spec.ts b/packages/js/plugins/uri-resolvers/http-resolver/src/__tests__/e2e.spec.ts index 0ad6a63c58..c4e0659ae1 100644 --- a/packages/js/plugins/uri-resolvers/http-resolver/src/__tests__/e2e.spec.ts +++ b/packages/js/plugins/uri-resolvers/http-resolver/src/__tests__/e2e.spec.ts @@ -68,13 +68,16 @@ describe("HTTP Plugin", () => { if (result.value.type !== "wrapper") { fail("Expected response to be a wrapper"); } - - const { data } = await axios.get(`${providers.http}/wrappers/local/${wrapperName}/wrap.info`, { - responseType: "arraybuffer" - }); + + const { data } = await axios.get( + `${providers.http}/wrappers/local/${wrapperName}/wrap.info`, + { + responseType: "arraybuffer", + } + ); const expectedManifest = await deserializeWrapManifest(data); - const manifest = await result.value.wrapper.getManifest({}, client); + const manifest = await result.value.wrapper.getManifest({}); expect(manifest?.name).toBe("SimpleStorage"); expect(manifest).toEqual(expectedManifest); @@ -93,12 +96,15 @@ describe("HTTP Plugin", () => { fail("Expected response to be a wrapper"); } - const { data } = await axios.get(`${providers.http}/wrappers/local/${wrapperName}/wrap.info`, { - responseType: "arraybuffer" - }); + const { data } = await axios.get( + `${providers.http}/wrappers/local/${wrapperName}/wrap.info`, + { + responseType: "arraybuffer", + } + ); const expectedManifest = await deserializeWrapManifest(data); - const manifest = await result.value.wrapper.getManifest({}, client); + const manifest = await result.value.wrapper.getManifest({}); expect(manifest?.name).toBe("SimpleStorage"); expect(manifest).toEqual(expectedManifest); diff --git a/packages/js/plugins/uri-resolvers/http-resolver/src/index.ts b/packages/js/plugins/uri-resolvers/http-resolver/src/index.ts index edccc857a5..9dc0003e72 100644 --- a/packages/js/plugins/uri-resolvers/http-resolver/src/index.ts +++ b/packages/js/plugins/uri-resolvers/http-resolver/src/index.ts @@ -37,7 +37,10 @@ export class HttpResolverPlugin extends Module { _client ); - const result = manifestResult.data; + if (!manifestResult.ok) { + return { uri: null, manifest: null }; + } + const result = manifestResult.value; if (result && result.body) { manifest = Buffer.from(result.body, "base64"); @@ -65,7 +68,10 @@ export class HttpResolverPlugin extends Module { client ); - const result = resolveResult.data; + if (!resolveResult.ok) { + return null; + } + const result = resolveResult.value; if (!result || !result.body) { return null; diff --git a/packages/js/plugins/uri-resolvers/ipfs-resolver/README.md b/packages/js/plugins/uri-resolvers/ipfs-resolver/README.md index e34123a3bd..1c032974d1 100644 --- a/packages/js/plugins/uri-resolvers/ipfs-resolver/README.md +++ b/packages/js/plugins/uri-resolvers/ipfs-resolver/README.md @@ -15,8 +15,7 @@ import { import { ipfsPlugin } from "@polywrap/ipfs-plugin-js"; import { ipfsResolverPlugin } from "@polywrap/ipfs-resolver-plugin-js"; - -const createIpfsClient = require("@dorgjelli-test/ipfs-http-client-lite"); +import createIpfsClient from "@polywrap/ipfs-http-client-lite"; // query wrapper at IPFS path export async function foo({ diff --git a/packages/js/plugins/uri-resolvers/ipfs-resolver/package.json b/packages/js/plugins/uri-resolvers/ipfs-resolver/package.json index 0c76f0b73e..e0eddcb1b3 100644 --- a/packages/js/plugins/uri-resolvers/ipfs-resolver/package.json +++ b/packages/js/plugins/uri-resolvers/ipfs-resolver/package.json @@ -20,7 +20,7 @@ "test:watch": "jest --watch --passWithNoTests --verbose" }, "dependencies": { - "@dorgjelli-test/ipfs-http-client-lite": "0.3.1", + "@polywrap/ipfs-http-client-lite": "0.3.0", "@polywrap/core-js": "0.8.0", "abort-controller": "3.0.0", "is-ipfs": "1.0.3" diff --git a/packages/js/plugins/uri-resolvers/ipfs-resolver/src/__tests__/e2e.spec.ts b/packages/js/plugins/uri-resolvers/ipfs-resolver/src/__tests__/e2e.spec.ts index 60f9b95659..48e7239a7c 100644 --- a/packages/js/plugins/uri-resolvers/ipfs-resolver/src/__tests__/e2e.spec.ts +++ b/packages/js/plugins/uri-resolvers/ipfs-resolver/src/__tests__/e2e.spec.ts @@ -9,15 +9,13 @@ import { import { ipfsResolverPlugin } from ".."; import { ipfsPlugin } from "@polywrap/ipfs-plugin-js"; -import { IpfsClient } from "./helpers/IpfsClient"; -import { createIpfsClient } from "./helpers/createIpfsClient"; -import { InvokeResult } from "@polywrap/core-js"; +import { Result } from "@polywrap/core-js"; +import { ResultOk } from "@polywrap/result"; jest.setTimeout(300000); describe("IPFS Plugin", () => { let ipfsResolverUri = "wrap://ens/ipfs-resolver.polywrap.eth"; - let ipfs: IpfsClient; let wrapperIpfsCid: string; @@ -51,8 +49,6 @@ describe("IPFS Plugin", () => { beforeAll(async () => { await initTestEnvironment(); - ipfs = createIpfsClient(providers.ipfs); - let { ipfsCid } = await buildAndDeployWrapper({ wrapperAbsPath: `${GetPathToTestWrappers()}/wasm-as/simple-storage`, ipfsProvider: providers.ipfs, @@ -82,20 +78,17 @@ describe("IPFS Plugin", () => { fail("Expected response to be a wrapper"); } - const manifest = await result.value.wrapper.getManifest({}, client); + const manifest = await result.value.wrapper.getManifest({}); expect(manifest?.name).toBe("SimpleStorage"); }); const createRacePromise = ( timeout: number - ): Promise> => { - return new Promise>((resolve) => + ): Promise> => { + return new Promise>((resolve) => setTimeout(() => { - resolve({ - data: Uint8Array.from([1, 2, 3, 4]), - error: undefined, - }); + resolve(ResultOk(Uint8Array.from([1, 2, 3, 4]))); }, timeout) ); }; @@ -128,8 +121,15 @@ describe("IPFS Plugin", () => { slowerRacePromise, ]); - expect(fasterRaceResult.data).toStrictEqual((await fasterRacePromise).data); - expect(slowerRaceResult.data).toStrictEqual((await getFilePromise).data); + if (!fasterRaceResult.ok) fail(fasterRaceResult.error); + const expectedFasterResult = await fasterRacePromise; + if (!expectedFasterResult.ok) fail(expectedFasterResult.error) + expect(fasterRaceResult.value).toStrictEqual(expectedFasterResult.value); + + if (!slowerRaceResult.ok) fail(slowerRaceResult.error); + const expectedSlowerResult = await getFilePromise; + if (!expectedSlowerResult.ok) fail(expectedSlowerResult.error); + expect(slowerRaceResult.value).toStrictEqual(expectedSlowerResult.value); }; const timeout = 1000; @@ -187,8 +187,15 @@ describe("IPFS Plugin", () => { slowerRacePromise, ]); - expect(fasterRaceResult.data).toStrictEqual((await fasterRacePromise).data); - expect(slowerRaceResult.data).toStrictEqual((await getFilePromise).data); + if (!fasterRaceResult.ok) fail(fasterRaceResult.error); + const expectedFasterResult = await fasterRacePromise; + if (!expectedFasterResult.ok) fail(expectedFasterResult.error) + expect(fasterRaceResult.value).toStrictEqual(expectedFasterResult.value); + + if (!slowerRaceResult.ok) fail(slowerRaceResult.error); + const expectedSlowerResult = await getFilePromise; + if (!expectedSlowerResult.ok) fail(expectedSlowerResult.error); + expect(slowerRaceResult.value).toStrictEqual(expectedSlowerResult.value); }; const timeout = 1000; diff --git a/packages/js/plugins/uri-resolvers/ipfs-resolver/src/__tests__/helpers/IpfsClient.ts b/packages/js/plugins/uri-resolvers/ipfs-resolver/src/__tests__/helpers/IpfsClient.ts deleted file mode 100644 index 80d63207b4..0000000000 --- a/packages/js/plugins/uri-resolvers/ipfs-resolver/src/__tests__/helpers/IpfsClient.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { CID } from "multiformats"; - -export interface IpfsClient { - add(data: Uint8Array, options?: unknown): Promise; - - cat(cid: string, options?: unknown): Promise; - - resolve( - cid: string, - options?: unknown - ): Promise<{ - path: string; - }>; -} - -export type IpfsFileInfo = { - name: string; - hash: CID; -}; diff --git a/packages/js/plugins/uri-resolvers/ipfs-resolver/src/__tests__/helpers/createIpfsClient.ts b/packages/js/plugins/uri-resolvers/ipfs-resolver/src/__tests__/helpers/createIpfsClient.ts deleted file mode 100644 index d4bccf83d6..0000000000 --- a/packages/js/plugins/uri-resolvers/ipfs-resolver/src/__tests__/helpers/createIpfsClient.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { IpfsClient } from "./IpfsClient"; - -export const createIpfsClient: ( - ipfsProvider: string -) => IpfsClient = require("@dorgjelli-test/ipfs-http-client-lite"); diff --git a/packages/js/plugins/uri-resolvers/ipfs-resolver/src/declarations.d.ts b/packages/js/plugins/uri-resolvers/ipfs-resolver/src/declarations.d.ts new file mode 100644 index 0000000000..a210bc31d7 --- /dev/null +++ b/packages/js/plugins/uri-resolvers/ipfs-resolver/src/declarations.d.ts @@ -0,0 +1,11 @@ +declare module "is-ipfs" { + export interface IsIpfs { + cid(value: string): boolean; + cidPath(value: string): boolean; + ipfsPath(value: string): boolean; + } + + const isIpfs: IsIpfs; + + export default isIpfs; +} diff --git a/packages/js/plugins/uri-resolvers/ipfs-resolver/src/index.ts b/packages/js/plugins/uri-resolvers/ipfs-resolver/src/index.ts index 5daa7bf78d..7914ac975a 100644 --- a/packages/js/plugins/uri-resolvers/ipfs-resolver/src/index.ts +++ b/packages/js/plugins/uri-resolvers/ipfs-resolver/src/index.ts @@ -10,9 +10,7 @@ import { } from "./wrap"; import { PluginFactory } from "@polywrap/core-js"; - -// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports -const isIPFS = require("is-ipfs"); +import isIpfs from "is-ipfs"; type NoConfig = Record; @@ -47,10 +45,8 @@ export class IpfsResolverPlugin extends Module { _client ); - if (manifestResult.data) { - manifest = Buffer.from(manifestResult.data); - } else { - throw new Error(); + if (manifestResult.ok) { + manifest = Buffer.from(manifestResult.value); } } catch (e) { // TODO: logging @@ -79,13 +75,11 @@ export class IpfsResolverPlugin extends Module { client ); - const result = resolveResult.data; - - if (!result) { + if (!resolveResult.ok || !resolveResult.value) { return null; } - provider = result.provider; + provider = resolveResult.value.provider; } const catResult = await Ipfs_Module.cat( @@ -100,14 +94,18 @@ export class IpfsResolverPlugin extends Module { client ); - return catResult.data ?? null; + if (!catResult.ok) { + return null; + } + + return catResult.value; } catch (e) { return null; } } private static isCID(cid: string): boolean { - return isIPFS.cid(cid) || isIPFS.cidPath(cid) || isIPFS.ipfsPath(cid); + return isIpfs.cid(cid) || isIpfs.cidPath(cid) || isIpfs.ipfsPath(cid); } } diff --git a/packages/js/plugins/ws/src/__tests__/e2e/e2e.spec.ts b/packages/js/plugins/ws/src/__tests__/e2e/e2e.spec.ts index df8e969fd9..f3c3c00140 100644 --- a/packages/js/plugins/ws/src/__tests__/e2e/e2e.spec.ts +++ b/packages/js/plugins/ws/src/__tests__/e2e/e2e.spec.ts @@ -75,19 +75,20 @@ describe("WebSocket plugin", () => { }); it("should close a websocket connection", async () => { - const { data: id } = await polywrapClient.invoke({ + const result = await polywrapClient.invoke({ uri: "wrap://ens/ws.polywrap.eth", method: "open", args: { url: "ws://localhost:1234" } }) + if (!result.ok) fail(result.error); await polywrapClient.invoke({ uri: "wrap://ens/ws.polywrap.eth", method: "close", args: { - id + id: result.value } }) @@ -106,19 +107,20 @@ describe("WebSocket plugin", () => { it("should send a message to the server", async () => { - const { data: id } = await polywrapClient.invoke({ + const result = await polywrapClient.invoke({ uri: "wrap://ens/ws.polywrap.eth", method: "open", args: { url: "ws://localhost:1234" } }) + if (!result.ok) fail(result.error); await polywrapClient.invoke({ uri: "wrap://ens/ws.polywrap.eth", method: "send", args: { - id, + id: result.value, message: "test" } }) @@ -175,19 +177,20 @@ describe("WebSocket plugin", () => { it("should pass messages to a callback", async () => { - const { data: id } = await polywrapClient.invoke({ + const result = await polywrapClient.invoke({ uri: "wrap://ens/ws.polywrap.eth", method: "open", args: { url: "ws://localhost:1234" } }) + if (!result.ok) fail(result.error); await polywrapClient.invoke({ uri: "wrap://ens/ws.polywrap.eth", method: "addCallback", args: { - id, + id: result.value, callback: { uri: "wrap://ens/stub.polywrap.eth", method: "callback" @@ -201,19 +204,20 @@ describe("WebSocket plugin", () => { }); it("should remove callback", async () => { - const { data: id } = await polywrapClient.invoke({ + const result = await polywrapClient.invoke({ uri: "wrap://ens/ws.polywrap.eth", method: "open", args: { url: "ws://localhost:1234" } }) + if (!result.ok) fail(result.error); await polywrapClient.invoke({ uri: "wrap://ens/ws.polywrap.eth", method: "addCallback", args: { - id, + id: result.value, callback: { uri: "wrap://ens/stub.polywrap.eth", method: "callback" @@ -226,7 +230,7 @@ describe("WebSocket plugin", () => { uri: "wrap://ens/ws.polywrap.eth", method: "removeCallback", args: { - id, + id: result.value, callback: { uri: "wrap://ens/stub.polywrap.eth", method: "callback" @@ -253,19 +257,20 @@ describe("WebSocket plugin", () => { it("should receive a message", async () => { - const { data: id } = await polywrapClient.invoke({ + const result = await polywrapClient.invoke({ uri: "wrap://ens/ws.polywrap.eth", method: "open", args: { url: "ws://localhost:1234" } }) + if (!result.ok) fail(result.error); await polywrapClient.invoke({ uri: "wrap://ens/ws.polywrap.eth", method: "addCache", args: { - id + id: result.value } }) @@ -275,28 +280,30 @@ describe("WebSocket plugin", () => { uri: "wrap://ens/ws.polywrap.eth", method: "receive", args: { - id + id: result.value } }) + if (!response.ok) fail(response.error); - let data = response?.data?.map((msg) => msg.data) + let data = response.value.map((msg) => msg.data) expect(data).toEqual(["1", "2"]); }); it("should remove cache callback", async () => { - const { data: id } = await polywrapClient.invoke({ + const result = await polywrapClient.invoke({ uri: "wrap://ens/ws.polywrap.eth", method: "open", args: { url: "ws://localhost:1234" } }) + if (!result.ok) fail(result.error); await polywrapClient.invoke({ uri: "wrap://ens/ws.polywrap.eth", method: "addCache", args: { - id + id: result.value } }) @@ -305,7 +312,7 @@ describe("WebSocket plugin", () => { uri: "wrap://ens/ws.polywrap.eth", method: "removeCache", args: { - id + id: result.value } }) resolve() @@ -317,28 +324,30 @@ describe("WebSocket plugin", () => { uri: "wrap://ens/ws.polywrap.eth", method: "receive", args: { - id + id: result.value } }) - let data = response?.data?.map((msg) => msg.data) + if (!response.ok) fail(response.error); + let data = response.value.map((msg) => msg.data) expect(data).toEqual(["1", "2"]); }); it("should receive messages when a timeout is reached", async () => { - const { data: id } = await polywrapClient.invoke({ + const result = await polywrapClient.invoke({ uri: "wrap://ens/ws.polywrap.eth", method: "open", args: { url: "ws://localhost:1234" } }) + if (!result.ok) fail(result.error); await polywrapClient.invoke({ uri: "wrap://ens/ws.polywrap.eth", method: "addCache", args: { - id + id: result.value } }) @@ -346,30 +355,31 @@ describe("WebSocket plugin", () => { uri: "wrap://ens/ws.polywrap.eth", method: "receive", args: { - id, + id: result.value, timeout: 250 } }) - - let data = response?.data?.map((msg) => msg.data) + if (!response.ok) fail(response.error); + let data = response.value.map((msg) => msg.data) expect(data).toEqual(["1", "2"]); }); it("should receive messages when min is reached", async () => { - const { data: id } = await polywrapClient.invoke({ + const result = await polywrapClient.invoke({ uri: "wrap://ens/ws.polywrap.eth", method: "open", args: { url: "ws://localhost:1234" } }) + if (!result.ok) fail(result.error); await polywrapClient.invoke({ uri: "wrap://ens/ws.polywrap.eth", method: "addCache", args: { - id + id: result.value } }) @@ -377,29 +387,31 @@ describe("WebSocket plugin", () => { uri: "wrap://ens/ws.polywrap.eth", method: "receive", args: { - id, + id: result.value, min: 2 } }) - let data = response?.data?.map((msg) => msg.data) + if (!response.ok) fail(response.error); + let data = response.value.map((msg) => msg.data) expect(data).toEqual(["1", "2"]); }); it("should reach timeout before min", async () => { - const { data: id } = await polywrapClient.invoke({ + const result = await polywrapClient.invoke({ uri: "wrap://ens/ws.polywrap.eth", method: "open", args: { url: "ws://localhost:1234" } }) + if (!result.ok) fail(result.error); await polywrapClient.invoke({ uri: "wrap://ens/ws.polywrap.eth", method: "addCache", args: { - id + id: result.value } }) @@ -407,30 +419,32 @@ describe("WebSocket plugin", () => { uri: "wrap://ens/ws.polywrap.eth", method: "receive", args: { - id, + id: result.value, timeout: 110, min: 2 } }) - let data = response?.data?.map((msg) => msg.data) + if (!response.ok) fail(response.error); + let data = response.value.map((msg) => msg.data) expect(data).toEqual(["1"]); }); it("should reach min before timeout", async () => { - const { data: id } = await polywrapClient.invoke({ + const result = await polywrapClient.invoke({ uri: "wrap://ens/ws.polywrap.eth", method: "open", args: { url: "ws://localhost:1234" } }) + if (!result.ok) fail(result.error); await polywrapClient.invoke({ uri: "wrap://ens/ws.polywrap.eth", method: "addCache", args: { - id + id: result.value } }) @@ -438,31 +452,33 @@ describe("WebSocket plugin", () => { uri: "wrap://ens/ws.polywrap.eth", method: "receive", args: { - id, + id: result.value, timeout: 300, min: 1 } }) - let data = response?.data?.map((msg) => msg.data) + if (!response.ok) fail(response.error); + let data = response.value.map((msg) => msg.data) expect(data).toEqual(["1"]); }); it("should receive messages in batches", async () => { - const { data: id } = await polywrapClient.invoke({ + const result = await polywrapClient.invoke({ uri: "wrap://ens/ws.polywrap.eth", method: "open", args: { url: "ws://localhost:1234" } }) + if (!result.ok) fail(result.error); await polywrapClient.invoke({ uri: "wrap://ens/ws.polywrap.eth", method: "addCache", args: { - id + id: result.value } }) @@ -472,7 +488,7 @@ describe("WebSocket plugin", () => { uri: "wrap://ens/ws.polywrap.eth", method: "receive", args: { - id + id: result.value } }) @@ -482,7 +498,7 @@ describe("WebSocket plugin", () => { uri: "wrap://ens/ws.polywrap.eth", method: "receive", args: { - id + id: result.value } }) @@ -492,17 +508,20 @@ describe("WebSocket plugin", () => { uri: "wrap://ens/ws.polywrap.eth", method: "receive", args: { - id + id: result.value } }) - let data1 = response1?.data?.map((msg) => msg.data) + if (!response1.ok) fail(response1.error); + let data1 = response1.value.map((msg) => msg.data) expect(data1).toEqual(["1", "2"]); - let data2 = response2?.data?.map((msg) => msg.data) + if (!response2.ok) fail(response2.error); + let data2 = response2.value.map((msg) => msg.data) expect(data2).toEqual(["3"]); - let data3 = response3?.data?.map((msg) => msg.data) + if (!response3.ok) fail(response3.error); + let data3 = response3.value.map((msg) => msg.data) expect(data3).toEqual([]); }); }); diff --git a/packages/js/plugins/ws/src/__tests__/e2e/integration.spec.ts b/packages/js/plugins/ws/src/__tests__/e2e/integration.spec.ts index 4578dddeda..d1efdcca64 100644 --- a/packages/js/plugins/ws/src/__tests__/e2e/integration.spec.ts +++ b/packages/js/plugins/ws/src/__tests__/e2e/integration.spec.ts @@ -170,8 +170,9 @@ describe("e2e tests for WsPlugin", () => { timeout: 20 } }); + if (!response.ok) fail(response.error); - expect(response.data).toEqual(["1","2"]) + expect(response.value).toEqual(["1","2"]) clearTimeout(t1) clearTimeout(t2) diff --git a/packages/js/plugins/ws/src/__tests__/e2e/integration/polywrap.build.yaml b/packages/js/plugins/ws/src/__tests__/e2e/integration/polywrap.build.yaml index d61799c1d7..197f0e11e5 100644 --- a/packages/js/plugins/ws/src/__tests__/e2e/integration/polywrap.build.yaml +++ b/packages/js/plugins/ws/src/__tests__/e2e/integration/polywrap.build.yaml @@ -1,6 +1,9 @@ -format: 0.1.0 -config: - node_version: "14.16.0" +format: 0.2.0 +strategies: + image: + node_version: "14.16.0" + include: + - ./package.json linked_packages: - name: "@polywrap/wasm-as" path: ../../../../../../../wasm/as diff --git a/packages/js/react/src/__tests__/usePolywrapInvoke.spec.tsx b/packages/js/react/src/__tests__/usePolywrapInvoke.spec.tsx index ebf096769d..db46dfd36b 100644 --- a/packages/js/react/src/__tests__/usePolywrapInvoke.spec.tsx +++ b/packages/js/react/src/__tests__/usePolywrapInvoke.spec.tsx @@ -93,34 +93,6 @@ describe("usePolywrapInvoke hook", () => { return result; } - it("Should support passing env to client", async () => { - const deployQuery: UsePolywrapInvokeProps = { - uri: envUri, - method: "getEnv", - args: { - arg: "Alice" - }, - config: { - envs: [{ - uri: envUri, - env: { - str: "Hello World!", - requiredInt: 2, - } - }] - } - }; - - const { data, error } = await sendQuery<{ - str: string; - requiredInt: number; - }>(deployQuery); - - expect(error).toBeFalsy(); - expect(data?.str).toBe("Hello World!"); - expect(data?.requiredInt).toBe(2); - }); - it("Should update storage data to five", async () => { const deployInvoke: UsePolywrapInvokeProps = { uri, diff --git a/packages/js/react/src/__tests__/usePolywrapQuery.spec.tsx b/packages/js/react/src/__tests__/usePolywrapQuery.spec.tsx index 728e766dbd..6591acf6a4 100644 --- a/packages/js/react/src/__tests__/usePolywrapQuery.spec.tsx +++ b/packages/js/react/src/__tests__/usePolywrapQuery.spec.tsx @@ -91,35 +91,6 @@ describe("usePolywrapQuery hook", () => { return result; } - it("Should support passing env to client", async () => { - const deployQuery: UsePolywrapQueryProps = { - uri: envUri, - query: `query { - getEnv(arg: "Alice") - }`, - config: { - envs: [{ - uri: envUri, - env: { - str: "Hello World!", - requiredInt: 2, - } - }] - } - }; - - const { data, errors } = await sendQuery<{ - getEnv: { - str: string; - requiredInt: number; - } - }>(deployQuery); - - expect(errors).toBeFalsy(); - expect(data?.getEnv.str).toBe("Hello World!"); - expect(data?.getEnv.requiredInt).toBe(2); - }); - it("Should update storage data to five with hard coded value", async () => { const deployQuery: UsePolywrapQueryProps = { uri, diff --git a/packages/js/react/src/invoke.tsx b/packages/js/react/src/invoke.tsx index 3b11f1509c..7b75ccf4b0 100644 --- a/packages/js/react/src/invoke.tsx +++ b/packages/js/react/src/invoke.tsx @@ -1,15 +1,11 @@ import { usePolywrapClient } from "./client"; import { useStateReducer } from "./state"; -import { - InvokeOptions, - InvokeResult, - isBuffer -} from "@polywrap/core-js"; +import { InvokeOptions, isBuffer, InvokeResult } from "@polywrap/core-js"; -export interface UsePolywrapInvokeState< - TData = unknown -> extends InvokeResult { +export interface UsePolywrapInvokeState { + data?: TData; + error?: Error loading: boolean; } @@ -27,9 +23,8 @@ export interface UsePolywrapInvokeProps extends InvokeOptions { Note that the initial values passed into the usePolywrapInvoke hook will be ignored when an Uint8Array is passed into execute(...). */ -export interface UsePolywrapInvoke< - TData = unknown -> extends UsePolywrapInvokeState { +export interface UsePolywrapInvoke + extends UsePolywrapInvokeState { execute: ( args?: Record | Uint8Array ) => Promise>; @@ -48,15 +43,19 @@ export function usePolywrapInvoke< const execute = async (args?: Record | Uint8Array) => { dispatch({ loading: true }); - const { data, error } = await client.invoke({ + const result = await client.invoke({ ...props, args: isBuffer(args) ? args : { ...props.args, ...args, }, }); - dispatch({ data, error, loading: false }); - return { data, error }; + if (result.ok) { + dispatch({ data: result.value, loading: false }); + } else { + dispatch({ error: result.error, loading: false }); + } + return result; }; return { diff --git a/packages/js/test-env/package.json b/packages/js/test-env/package.json index 608f79b36d..496915fce1 100644 --- a/packages/js/test-env/package.json +++ b/packages/js/test-env/package.json @@ -20,11 +20,10 @@ "@polywrap/core-js": "0.8.0", "@polywrap/polywrap-manifest-types-js": "0.8.0", "axios": "0.21.2", - "js-yaml": "4.1.0", - "spawn-command": "0.0.2-1" + "spawn-command": "0.0.2-1", + "yaml": "2.1.3" }, "devDependencies": { - "@types/js-yaml": "3.11.1", "copyfiles": "2.4.1", "rimraf": "3.0.2", "ts-node": "8.10.2", diff --git a/packages/js/test-env/src/index.ts b/packages/js/test-env/src/index.ts index ac4616d833..1ca2f6a320 100644 --- a/packages/js/test-env/src/index.ts +++ b/packages/js/test-env/src/index.ts @@ -5,7 +5,7 @@ import path from "path"; import spawn from "spawn-command"; import axios from "axios"; import fs from "fs"; -import yaml from "js-yaml"; +import yaml from "yaml"; import { Uri } from "@polywrap/core-js"; import { DeployManifest, @@ -265,13 +265,17 @@ export async function buildAndDeployWrapper({ fs.writeFileSync( tempManifestPath, - yaml.dump({ - ...polywrapManifest, - extensions: { - ...polywrapManifest.extensions, - deploy: `./${tempDeployManifestFilename}`, + yaml.stringify( + { + ...polywrapManifest, + extensions: { + ...polywrapManifest.extensions, + deploy: `./${tempDeployManifestFilename}`, + }, }, - }) + null, + 2 + ) ); const deployManifest: Omit = { @@ -310,7 +314,10 @@ export async function buildAndDeployWrapper({ }, }, }; - fs.writeFileSync(tempDeployManifestPath, yaml.dump(deployManifest)); + fs.writeFileSync( + tempDeployManifestPath, + yaml.stringify(deployManifest, null, 2) + ); // deploy Wrapper @@ -385,7 +392,10 @@ export async function buildAndDeployWrapperToHttp({ ...polywrapManifest.extensions, deploy: `./${tempDeployManifestFilename}`, }; - fs.writeFileSync(tempManifestPath, yaml.dump({ ...polywrapManifest })); + fs.writeFileSync( + tempManifestPath, + yaml.stringify({ ...polywrapManifest }, null, 2) + ); const deployManifest: Omit = { format: "0.2.0", @@ -404,7 +414,10 @@ export async function buildAndDeployWrapperToHttp({ }, }, }; - fs.writeFileSync(tempDeployManifestPath, yaml.dump(deployManifest)); + fs.writeFileSync( + tempDeployManifestPath, + yaml.stringify(deployManifest, null, 2) + ); // deploy Wrapper diff --git a/packages/js/tracing/package.json b/packages/js/tracing/package.json index 78bc39dcfe..3c27aa3e27 100644 --- a/packages/js/tracing/package.json +++ b/packages/js/tracing/package.json @@ -16,23 +16,15 @@ "lint": "eslint --color -c ../../../.eslintrc.js src/" }, "dependencies": { - "@fetsorn/opentelemetry-console-exporter": "0.0.1", - "@opentelemetry/api": "1.1.0", - "@opentelemetry/context-zone": "1.4.0", - "@opentelemetry/core": "1.4.0", - "@opentelemetry/exporter-trace-otlp-http": "^0.28.0", - "@opentelemetry/exporter-zipkin": "1.4.0", - "@opentelemetry/propagator-b3": "1.4.0", - "@opentelemetry/sdk-trace-base": "1.4.0", - "@opentelemetry/sdk-trace-node": "1.4.0", - "@opentelemetry/sdk-trace-web": "1.4.0", - "browser-util-inspect": "0.2.0" + "@fetsorn/opentelemetry-console-exporter": "0.0.3", + "@opentelemetry/api": "1.2.0", + "@opentelemetry/exporter-trace-otlp-http": "0.32.0", + "@opentelemetry/resources": "1.6.0", + "@opentelemetry/sdk-trace-base": "1.6.0", + "@opentelemetry/sdk-trace-web": "1.6.0" }, "devDependencies": { - "@types/prettier": "2.6.0", - "@types/uuid": "3.4.3", "rimraf": "3.0.2", - "ts-node": "8.10.2", "typescript": "4.0.7" }, "gitHead": "7346adaf5adb7e6bbb70d9247583e995650d390a", diff --git a/packages/js/tracing/src/index.ts b/packages/js/tracing/src/index.ts index 0b6a284183..48c02cea7c 100644 --- a/packages/js/tracing/src/index.ts +++ b/packages/js/tracing/src/index.ts @@ -6,10 +6,9 @@ import { } from "@opentelemetry/sdk-trace-base"; import { WebTracerProvider } from "@opentelemetry/sdk-trace-web"; import * as api from "@opentelemetry/api"; -import { ConsoleExporter } from "@fetsorn/opentelemetry-console-exporter"; -// workaround until we can upgrade to 0.30.0 -// https://github.com/open-telemetry/opentelemetry-js/issues/2943#issuecomment-1114265125 -import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http/build/src/platform/browser/OTLPTraceExporter"; +import { Resource } from "@opentelemetry/resources"; +import { ConsoleExporterIcon } from "@fetsorn/opentelemetry-console-exporter"; +import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http"; type MaybeAsync = Promise | T; export enum TracingLevel { @@ -59,7 +58,7 @@ export class Tracer { config.consoleDetailed ?? this._config.consoleDetailed; this._config.httpEnabled = config.httpEnabled ?? this._config.httpEnabled; this._config.httpUrl = config.httpUrl ?? this._config.httpUrl; - this._initProvider(); + this._initProvider(tracerName); if (this._provider) { this._tracer = this._provider.getTracer(tracerName) as otTracer; @@ -236,11 +235,19 @@ export class Tracer { }; } - static _initProvider(): void { + static _initProvider(name: string): void { + const providerResources = new Resource({ + "service.name": name, + }); + if (typeof window === "undefined") { - this._provider = new BasicTracerProvider(); + this._provider = new BasicTracerProvider({ + resource: providerResources, + }); } else { - this._provider = new WebTracerProvider(); + this._provider = new WebTracerProvider({ + resource: providerResources, + }); } // Configure span processor to send spans to the exporter @@ -254,7 +261,7 @@ export class Tracer { if (this._config.consoleEnabled) { this._provider.addSpanProcessor( new BatchSpanProcessor( - new ConsoleExporter({ isDetailed: this._config.consoleDetailed }) + new ConsoleExporterIcon({ isDetailed: this._config.consoleDetailed }) ) ); } diff --git a/packages/js/uri-resolver-extensions/src/ExtendableUriResolver.ts b/packages/js/uri-resolver-extensions/src/ExtendableUriResolver.ts index 5e3820418d..36eaf67397 100644 --- a/packages/js/uri-resolver-extensions/src/ExtendableUriResolver.ts +++ b/packages/js/uri-resolver-extensions/src/ExtendableUriResolver.ts @@ -13,7 +13,10 @@ import { import { Result, ResultOk } from "@polywrap/result"; import { UriResolverAggregatorBase } from "@polywrap/uri-resolvers-js"; -export class ExtendableUriResolver extends UriResolverAggregatorBase { +export class ExtendableUriResolver extends UriResolverAggregatorBase< + Error, + Error +> { private readonly resolverName: string; constructor(resolverName?: string) { @@ -25,13 +28,19 @@ export class ExtendableUriResolver extends UriResolverAggregatorBase { uri: Uri, client: Client, resolutionContext: IUriResolutionContext - ): Promise[]>> { - const uriResolverImpls = getImplementations( + ): Promise[], Error>> { + const getImplementationsResult = getImplementations( coreInterfaceUris.uriResolver, - client.getInterfaces({}), - client.getRedirects({}) + client.getInterfaces(), + client.getRedirects() ); + if (!getImplementationsResult.ok) { + return getImplementationsResult; + } + + const uriResolverImpls = getImplementationsResult.value; + const resolvers: UriResolverWrapper[] = uriResolverImpls .filter((x) => !resolutionContext.isResolving(x)) .map((implementationUri) => new UriResolverWrapper(implementationUri)); @@ -43,12 +52,12 @@ export class ExtendableUriResolver extends UriResolverAggregatorBase { uri: Uri, client: Client, resolutionContext: IUriResolutionContext - ): Promise> { + ): Promise> { const result = await this.getUriResolvers(uri, client, resolutionContext); - const resolvers = (result as { - ok: true; - value: UriResolverWrapper[]; - }).value; + if (!result.ok) { + return UriResolutionResult.err(result.error); + } + const resolvers = result.value as UriResolverWrapper[]; if (resolvers.length === 0) { return UriResolutionResult.ok(uri); diff --git a/packages/js/uri-resolver-extensions/src/ResolverExtensionLoader.ts b/packages/js/uri-resolver-extensions/src/ResolverExtensionLoader.ts index e0dfc64503..efc2c12d6e 100644 --- a/packages/js/uri-resolver-extensions/src/ResolverExtensionLoader.ts +++ b/packages/js/uri-resolver-extensions/src/ResolverExtensionLoader.ts @@ -1,11 +1,4 @@ -import { - Uri, - Client, - IWrapPackage, - Wrapper, - initWrapper, - IUriResolutionContext, -} from "@polywrap/core-js"; +import { Uri, Client, Wrapper, IUriResolutionContext } from "@polywrap/core-js"; import { Result, ResultErr, ResultOk } from "@polywrap/result"; export const loadResolverExtension = async ( @@ -33,15 +26,15 @@ export const loadResolverExtension = async ( ); } - let wrapperOrPackage: IWrapPackage | Wrapper; - if (uriPackageOrWrapper.type === "package") { - wrapperOrPackage = uriPackageOrWrapper.package; - } else { - wrapperOrPackage = uriPackageOrWrapper.wrapper; - } + const result = await uriPackageOrWrapper.package.createWrapper(); - const wrapper = await initWrapper(wrapperOrPackage); + if (!result.ok) { + return result; + } - return ResultOk(wrapper); + return ResultOk(result.value); + } else { + return ResultOk(uriPackageOrWrapper.wrapper); + } }; diff --git a/packages/js/uri-resolver-extensions/src/UriResolverExtensionFileReader.ts b/packages/js/uri-resolver-extensions/src/UriResolverExtensionFileReader.ts index 52431c219e..646149caf3 100644 --- a/packages/js/uri-resolver-extensions/src/UriResolverExtensionFileReader.ts +++ b/packages/js/uri-resolver-extensions/src/UriResolverExtensionFileReader.ts @@ -8,6 +8,7 @@ import { Wrapper, } from "@polywrap/core-js"; import { IFileReader } from "@polywrap/wasm-js"; +import { Result } from "@polywrap/result"; export class UriResolverExtensionFileReader implements IFileReader { constructor( @@ -16,8 +17,8 @@ export class UriResolverExtensionFileReader implements IFileReader { private readonly client: Client ) {} - async readFile(filePath: string): Promise { - const { data, error } = await UriResolverInterface.module.getFile( + async readFile(filePath: string): Promise> { + return await UriResolverInterface.module.getFile( { invoke: ( options: InvokeOptions @@ -31,11 +32,5 @@ export class UriResolverExtensionFileReader implements IFileReader { this.resolverExtensionUri, combinePaths(this.wrapperUri.path, filePath) ); - - if (error) { - throw error; - } - - return data; } } diff --git a/packages/js/uri-resolver-extensions/src/UriResolverWrapper.ts b/packages/js/uri-resolver-extensions/src/UriResolverWrapper.ts index 7dd4172a9b..d01aeb6a2e 100644 --- a/packages/js/uri-resolver-extensions/src/UriResolverWrapper.ts +++ b/packages/js/uri-resolver-extensions/src/UriResolverWrapper.ts @@ -10,7 +10,7 @@ import { UriPackageOrWrapper, getEnvFromUriHistory, } from "@polywrap/core-js"; -import { Result, ResultOk, ResultErr } from "@polywrap/result"; +import { Result, ResultOk } from "@polywrap/result"; import { WasmPackage } from "@polywrap/wasm-js"; import { ResolverWithHistory } from "@polywrap/uri-resolvers-js"; @@ -91,13 +91,10 @@ const tryResolveUriWithImplementation = async ( } ); - const { data, error } = invokeResult; - - const uriOrManifest = data as UriResolverInterface.MaybeUriOrManifest; - - if (error) { - return ResultErr(error); + if (!invokeResult.ok) { + return invokeResult; } + const uriOrManifest = invokeResult.value as UriResolverInterface.MaybeUriOrManifest; return ResultOk(uriOrManifest ?? undefined); }; diff --git a/packages/js/uri-resolvers/src/cache/PackageToWrapperCacheResolver.ts b/packages/js/uri-resolvers/src/cache/PackageToWrapperCacheResolver.ts index 0d4711801c..d670ff88b3 100644 --- a/packages/js/uri-resolvers/src/cache/PackageToWrapperCacheResolver.ts +++ b/packages/js/uri-resolvers/src/cache/PackageToWrapperCacheResolver.ts @@ -6,8 +6,6 @@ import { IUriResolver, Uri, Client, - executeMaybeAsyncFunction, - Wrapper, IUriResolutionContext, UriPackageOrWrapper, UriResolutionResult, @@ -15,10 +13,9 @@ import { import { DeserializeManifestOptions } from "@polywrap/wrap-manifest-types-js"; import { Result } from "@polywrap/result"; -export class PackageToWrapperCacheResolver - implements IUriResolver { +export class PackageToWrapperCacheResolver implements IUriResolver { name: string; - resolverToCache: IUriResolver; + resolverToCache: IUriResolver; constructor( private cache: IWrapperCache, @@ -39,10 +36,8 @@ export class PackageToWrapperCacheResolver uri: Uri, client: Client, resolutionContext: IUriResolutionContext - ): Promise> { - const wrapper = await executeMaybeAsyncFunction( - this.cache.get.bind(this.cache, uri) - ); + ): Promise> { + const wrapper = await this.cache.get(uri); if (wrapper) { const result = UriResolutionResult.ok(uri, wrapper); @@ -68,14 +63,18 @@ export class PackageToWrapperCacheResolver const wrapPackage = result.value.package; const resolutionPath: Uri[] = subContext.getResolutionPath(); - const wrapper = await wrapPackage.createWrapper({ + const createResult = await wrapPackage.createWrapper({ noValidate: this.options?.deserializeManifestOptions?.noValidate, }); + if (!createResult.ok) { + return createResult; + } + + const wrapper = createResult.value; + for (const uri of resolutionPath) { - await executeMaybeAsyncFunction( - this.cache.set.bind(this.cache, uri, wrapper) - ); + await this.cache.set(uri, wrapper); } result = UriResolutionResult.ok(result.value.uri, wrapper); @@ -84,9 +83,7 @@ export class PackageToWrapperCacheResolver const resolutionPath: Uri[] = subContext.getResolutionPath(); for (const uri of resolutionPath) { - await executeMaybeAsyncFunction( - this.cache.set.bind(this.cache, uri, wrapper) - ); + await this.cache.set(uri, wrapper); } } } diff --git a/packages/js/uri-resolvers/src/legacy/LegacyPluginsResolver.ts b/packages/js/uri-resolvers/src/legacy/LegacyPluginsResolver.ts index 9a5c52affb..683a3ca5b9 100644 --- a/packages/js/uri-resolvers/src/legacy/LegacyPluginsResolver.ts +++ b/packages/js/uri-resolvers/src/legacy/LegacyPluginsResolver.ts @@ -6,7 +6,7 @@ export class LegacyPluginsResolver extends UriResolverAggregator { constructor() { super( async (_: Uri, client: Client) => - client.getPlugins({}).map((x) => new PluginResolver(x)), + client.getPlugins().map((x) => new PluginResolver(x)), "LegacyPluginsResolver" ); } diff --git a/packages/js/uri-resolvers/src/legacy/LegacyRedirectsResolver.ts b/packages/js/uri-resolvers/src/legacy/LegacyRedirectsResolver.ts index 9600454c20..3452816a37 100644 --- a/packages/js/uri-resolvers/src/legacy/LegacyRedirectsResolver.ts +++ b/packages/js/uri-resolvers/src/legacy/LegacyRedirectsResolver.ts @@ -8,7 +8,7 @@ export class LegacyRedirectsResolver extends UriResolverAggregator { super( async (uri: Uri, client: Client) => client - .getRedirects({}) + .getRedirects() .map((redirect) => new RedirectResolver(redirect.from, redirect.to)), "LegacyRedirectsResolver" ); diff --git a/packages/js/wasm/src/IFileReader.ts b/packages/js/wasm/src/IFileReader.ts index c93503f6f3..3d7f868337 100644 --- a/packages/js/wasm/src/IFileReader.ts +++ b/packages/js/wasm/src/IFileReader.ts @@ -1,3 +1,5 @@ +import { Result } from "@polywrap/result"; + export interface IFileReader { - readFile(filePath: string): Promise; + readFile(filePath: string): Promise>; } diff --git a/packages/js/wasm/src/IWasmPackage.ts b/packages/js/wasm/src/IWasmPackage.ts index 656ff04006..d534f69b16 100644 --- a/packages/js/wasm/src/IWasmPackage.ts +++ b/packages/js/wasm/src/IWasmPackage.ts @@ -1,5 +1,6 @@ import { IWrapPackage } from "@polywrap/core-js"; +import { Result } from "@polywrap/result"; export interface IWasmPackage extends IWrapPackage { - getWasmModule(): Promise; + getWasmModule(): Promise>; } diff --git a/packages/js/wasm/src/InMemoryFileReader.ts b/packages/js/wasm/src/InMemoryFileReader.ts index ae23ae5c08..1546db06ea 100644 --- a/packages/js/wasm/src/InMemoryFileReader.ts +++ b/packages/js/wasm/src/InMemoryFileReader.ts @@ -1,15 +1,17 @@ import { WRAP_MANIFEST_PATH, WRAP_MODULE_PATH } from "./constants"; import { IFileReader } from "./IFileReader"; +import { Result, ResultErr, ResultOk } from "@polywrap/result"; + export class InMemoryFileReader { static fromManifest( manifest: Uint8Array, baseFileReader: IFileReader ): IFileReader { return { - async readFile(filePath: string): Promise { + async readFile(filePath: string): Promise> { if (filePath === WRAP_MANIFEST_PATH) { - return manifest; + return ResultOk(manifest); } else { return baseFileReader.readFile(filePath); } @@ -22,9 +24,9 @@ export class InMemoryFileReader { baseFileReader: IFileReader ): IFileReader { return { - async readFile(filePath: string): Promise { + async readFile(filePath: string): Promise> { if (filePath === WRAP_MODULE_PATH) { - return wasmModule; + return ResultOk(wasmModule); } else { return baseFileReader.readFile(filePath); } @@ -37,15 +39,15 @@ export class InMemoryFileReader { baseFileReader?: IFileReader ): IFileReader { return { - async readFile(filePath: string): Promise { + async readFile(filePath: string): Promise> { if (filePath === WRAP_MANIFEST_PATH) { - return manifest; + return ResultOk(manifest); } else if (filePath === WRAP_MODULE_PATH) { - return wasmModule; + return ResultOk(wasmModule); } else if (baseFileReader) { return baseFileReader.readFile(filePath); } else { - return undefined; + return ResultErr(Error(`File not found at ${filePath}.`)); } }, }; diff --git a/packages/js/wasm/src/WasmPackage.ts b/packages/js/wasm/src/WasmPackage.ts index e564546fa8..3ab37e17a5 100644 --- a/packages/js/wasm/src/WasmPackage.ts +++ b/packages/js/wasm/src/WasmPackage.ts @@ -2,16 +2,17 @@ import { IFileReader } from "./IFileReader"; import { IWasmPackage } from "./IWasmPackage"; import { WasmWrapper } from "./WasmWrapper"; import { WRAP_MODULE_PATH, WRAP_MANIFEST_PATH } from "./constants"; -import { InMemoryFileReader } from "./InMemoryFileReader"; +import { createWasmPackage } from "./helpers/createWasmPackage"; import { deserializeWrapManifest, WrapManifest, } from "@polywrap/wrap-manifest-types-js"; import { GetManifestOptions, Wrapper } from "@polywrap/core-js"; +import { Result, ResultErr, ResultOk } from "@polywrap/result"; export class WasmPackage implements IWasmPackage { - protected constructor(private readonly fileReader: IFileReader) {} + constructor(private readonly fileReader: IFileReader) {} static from(manifestBuffer: Uint8Array, wasmModule: Uint8Array): WasmPackage; static from( @@ -23,69 +24,48 @@ export class WasmPackage implements IWasmPackage { static from(fileReader: IFileReader): WasmPackage; static from( manifestBufferOrFileReader: Uint8Array | IFileReader, - wasmModuleOrFileReader?: Uint8Array | IFileReader + wasmModuleOrFileReader?: Uint8Array | IFileReader, + fileReader?: IFileReader ): WasmPackage { - let manifestBuffer: Uint8Array | undefined; - let wasmModule: Uint8Array | undefined; - let fileReader: IFileReader | undefined; + return createWasmPackage( + manifestBufferOrFileReader, + wasmModuleOrFileReader, + fileReader + ); + } - if (Array.isArray(manifestBufferOrFileReader)) { - manifestBuffer = manifestBufferOrFileReader as Uint8Array; - } else { - fileReader = manifestBufferOrFileReader as IFileReader; - } + async getManifest( + options?: GetManifestOptions + ): Promise> { + const result = await this.fileReader.readFile(WRAP_MANIFEST_PATH); - if (Array.isArray(wasmModuleOrFileReader)) { - wasmModule = wasmModuleOrFileReader as Uint8Array; - } else if ((wasmModuleOrFileReader as Partial).readFile) { - fileReader = wasmModuleOrFileReader as IFileReader; + if (!result.ok) { + return result; } - if (manifestBuffer) { - if (wasmModule) { - return new WasmPackage( - InMemoryFileReader.from( - manifestBuffer, - wasmModule, - fileReader as IFileReader - ) - ); - } else { - return new WasmPackage( - InMemoryFileReader.fromManifest( - manifestBuffer, - fileReader as IFileReader - ) - ); - } - } else { - return new WasmPackage(fileReader as IFileReader); - } + const wrapManifest = result.value; + return ResultOk(await deserializeWrapManifest(wrapManifest, options)); } - async getManifest(options?: GetManifestOptions): Promise { - const wrapManifest = await this.fileReader.readFile(WRAP_MANIFEST_PATH); + async getWasmModule(): Promise> { + const result = await this.fileReader.readFile(WRAP_MODULE_PATH); - if (!wrapManifest) { - throw Error(`WRAP manifest not found`); + if (!result.ok) { + return ResultErr(Error(`Wrapper does not contain a wasm module`)); } - return deserializeWrapManifest(wrapManifest, options); + return result; } - async getWasmModule(): Promise { - const wasmModule = await this.fileReader.readFile(WRAP_MODULE_PATH); + async createWrapper( + options?: GetManifestOptions + ): Promise> { + const result = await this.getManifest(options); - if (!wasmModule) { - throw Error(`Wrapper does not contain a wasm module`); + if (!result.ok) { + return result; } - return wasmModule; - } - - async createWrapper(options?: GetManifestOptions): Promise { - const manifest = await this.getManifest(options); - - return new WasmWrapper(manifest, this.fileReader); + return ResultOk(new WasmWrapper(result.value, this.fileReader)); } } diff --git a/packages/js/wasm/src/WasmWrapper.ts b/packages/js/wasm/src/WasmWrapper.ts index 2619042663..84bab85961 100644 --- a/packages/js/wasm/src/WasmWrapper.ts +++ b/packages/js/wasm/src/WasmWrapper.ts @@ -3,13 +3,13 @@ import { WrapExports } from "./types"; import { createImports } from "./imports"; import { IFileReader } from "./IFileReader"; import { WRAP_MODULE_PATH } from "./constants"; +import { createWasmWrapper } from "./helpers/createWasmWrapper"; import { WrapManifest } from "@polywrap/wrap-manifest-types-js"; import { msgpackEncode } from "@polywrap/msgpack-js"; import { Tracer, TracingLevel } from "@polywrap/tracing-js"; import { AsyncWasmInstance } from "@polywrap/asyncify-js"; import { - InvokeResult, Wrapper, Uri, InvokeOptions, @@ -17,11 +17,9 @@ import { InvocableResult, isBuffer, GetFileOptions, + GetManifestOptions, } from "@polywrap/core-js"; - -type InvokeResultOrError = - | { type: "InvokeResult"; invokeResult: Uint8Array } - | { type: "InvokeError"; invokeError: string }; +import { Result, ResultErr, ResultOk } from "@polywrap/result"; export interface State { method: string; @@ -40,7 +38,7 @@ export interface State { error?: string; args: unknown[]; }; - invokeResult: InvokeResult; + invokeResult?: Result; getImplementationsResult?: Uint8Array; env: Uint8Array; } @@ -64,33 +62,77 @@ export class WasmWrapper implements Wrapper { Tracer.endSpan(); } + static async from( + manifestBuffer: Uint8Array, + wasmModule: Uint8Array, + options?: GetManifestOptions + ): Promise; + static async from( + manifestBuffer: Uint8Array, + wasmModule: Uint8Array, + fileReader: IFileReader, + options?: GetManifestOptions + ): Promise; + static async from( + manifestBuffer: Uint8Array, + fileReader: IFileReader, + options?: GetManifestOptions + ): Promise; + static async from( + fileReader: IFileReader, + options?: GetManifestOptions + ): Promise; + static async from( + manifestBufferOrFileReader: Uint8Array | IFileReader, + wasmModuleOrFileReaderOrManifestOptions?: + | Uint8Array + | IFileReader + | GetManifestOptions, + fileReaderOrManifestOptions?: IFileReader | GetManifestOptions, + manifestOptions?: GetManifestOptions + ): Promise { + return createWasmWrapper( + manifestBufferOrFileReader, + wasmModuleOrFileReaderOrManifestOptions, + fileReaderOrManifestOptions, + manifestOptions + ); + } + @Tracer.traceMethod("WasmWrapper: getFile") - public async getFile(options: GetFileOptions): Promise { + public async getFile( + options: GetFileOptions + ): Promise> { const { path, encoding } = options; - const data = await this._fileReader.readFile(path); + const dataResult = await this._fileReader.readFile(path); // If nothing is returned, the file was not found - if (!data) { - throw Error(`WasmWrapper: File was not found.\nSubpath: ${path}`); + if (!dataResult.ok) { + return ResultErr( + Error(`WasmWrapper: File was not found.\nSubpath: ${path}`) + ); } + const data = dataResult.value; + if (encoding) { const decoder = new TextDecoder(encoding); const text = decoder.decode(data); if (!text) { - throw Error( + const error = Error( `WasmWrapper: Decoding the file's bytes array failed.\nBytes: ${data}` ); + return ResultErr(error); } - return text; + return ResultOk(text); } - return data; + return ResultOk(data); } @Tracer.traceMethod("WasmWrapper: getManifest") - public async getManifest(): Promise { + public getManifest(): WrapManifest { return this._manifest; } @@ -107,7 +149,11 @@ export class WasmWrapper implements Wrapper { try { const { method } = options; const args = options.args || {}; - const wasm = await this._getWasmModule(); + const wasmResult = await this._getWasmModule(); + if (!wasmResult.ok) { + return wasmResult; + } + const wasm = wasmResult.value; const state: State = { invoke: {}, @@ -117,7 +163,6 @@ export class WasmWrapper implements Wrapper { subinvokeImplementation: { args: [], }, - invokeResult: {} as InvokeResult, method, args: args ? isBuffer(args) @@ -128,7 +173,7 @@ export class WasmWrapper implements Wrapper { }; const abort = (message: string) => { - throw new Error( + throw Error( `WasmWrapper: Wasm module aborted execution.\nURI: ${options.uri.uri}\n` + `Method: ${method}\n` + `Args: ${JSON.stringify(args, null, 2)}\nMessage: ${message}.\n` @@ -157,30 +202,23 @@ export class WasmWrapper implements Wrapper { const invokeResult = this._processInvokeResult(state, result, abort); - switch (invokeResult.type) { - case "InvokeError": { - throw Error( - `WasmWrapper: invocation exception encountered.\n` + - `uri: ${options.uri.uri}\n` + - `method: ${method}\n` + - `args: ${JSON.stringify(args, null, 2)}\n` + - `exception: ${invokeResult.invokeError}` - ); - } - case "InvokeResult": { - return { - data: invokeResult.invokeResult, - encoded: true, - }; - } - default: { - throw Error(`WasmWrapper: Unknown state "${state}"`); - } + if (invokeResult.ok) { + return { + ...invokeResult, + encoded: true, + }; + } else { + const error = Error( + `WasmWrapper: invocation exception encountered.\n` + + `uri: ${options.uri.uri}\n` + + `method: ${method}\n` + + `args: ${JSON.stringify(args, null, 2)}\n` + + `exception: ${invokeResult.error?.message}` + ); + return ResultErr(error); } } catch (error) { - return { - error, - }; + return ResultErr(error); } } @@ -189,38 +227,34 @@ export class WasmWrapper implements Wrapper { state: State, result: boolean, abort: (message: string) => never - ): InvokeResultOrError { + ): Result { if (result) { if (!state.invoke.result) { abort("Invoke result is missing."); } - return { - type: "InvokeResult", - invokeResult: state.invoke.result, - }; + return ResultOk(state.invoke.result); } else { if (!state.invoke.error) { abort("Invoke error is missing."); } - return { - type: "InvokeError", - invokeError: state.invoke.error, - }; + return ResultErr(Error(state.invoke.error)); } } @Tracer.traceMethod("WasmWrapper: getWasmModule") - private async _getWasmModule(): Promise { + private async _getWasmModule(): Promise> { if (this._wasmModule === undefined) { - this._wasmModule = await this._fileReader.readFile(WRAP_MODULE_PATH); + const result = await this._fileReader.readFile(WRAP_MODULE_PATH); - if (!this._wasmModule) { - throw Error(`Wrapper does not contain a wasm module`); + if (!result.ok) { + return ResultErr(Error(`Wrapper does not contain a wasm module`)); } + + this._wasmModule = result.value; } - return this._wasmModule; + return ResultOk(this._wasmModule); } } diff --git a/packages/js/wasm/src/__tests__/in-memory-file-reader.spec.ts b/packages/js/wasm/src/__tests__/in-memory-file-reader.spec.ts new file mode 100644 index 0000000000..056b1d2073 --- /dev/null +++ b/packages/js/wasm/src/__tests__/in-memory-file-reader.spec.ts @@ -0,0 +1,134 @@ +import { buildWrapper } from "@polywrap/test-env-js"; +import { GetPathToTestWrappers } from "@polywrap/test-cases"; +import fs from "fs"; +import { InMemoryFileReader } from "../InMemoryFileReader"; +import { Result, ResultErr, ResultOk } from "@polywrap/result"; +import { WRAP_MANIFEST_PATH, WRAP_MODULE_PATH } from "../constants"; + +jest.setTimeout(200000); + +const simpleWrapperPath = `${GetPathToTestWrappers()}/wasm-as/simple`; + +describe("In-memory file reader", () => { + beforeAll(async () => { + await buildWrapper(simpleWrapperPath); + }); + + it("can create in-memory file reader from buffers", async () => { + const manifest = await fs.promises.readFile( + `${simpleWrapperPath}/build/${WRAP_MANIFEST_PATH}` + ); + + const wasmModule = await fs.promises.readFile( + `${simpleWrapperPath}/build/${WRAP_MODULE_PATH}` + ); + const fileReader = InMemoryFileReader.from(manifest, wasmModule); + + expect(await fileReader.readFile(WRAP_MANIFEST_PATH)).toEqual( + ResultOk(manifest) + ); + expect(await fileReader.readFile(WRAP_MODULE_PATH)).toEqual( + ResultOk(wasmModule) + ); + }); + + it("can create in-memory file reader from manifest and file reader", async () => { + const testEncoded = new TextEncoder().encode("test"); + + const manifest = await fs.promises.readFile( + `${simpleWrapperPath}/build/${WRAP_MANIFEST_PATH}` + ); + + const wasmModule = await fs.promises.readFile( + `${simpleWrapperPath}/build/${WRAP_MODULE_PATH}` + ); + + const fileReader = InMemoryFileReader.fromManifest(manifest, { + readFile: async (path: string): Promise> => { + if (path === WRAP_MODULE_PATH) { + return ResultOk(wasmModule); + } else if (path === "test.txt") { + return ResultOk(testEncoded); + } else { + return ResultErr(Error(`File ${path} not found`)); + } + }, + }); + + expect(await fileReader.readFile(WRAP_MANIFEST_PATH)).toEqual( + ResultOk(manifest) + ); + expect(await fileReader.readFile(WRAP_MODULE_PATH)).toEqual( + ResultOk(wasmModule) + ); + expect(await fileReader.readFile("test.txt")).toEqual( + ResultOk(testEncoded) + ); + }); + + it("can create in-memory file reader from wasm module and file reader", async () => { + const testEncoded = new TextEncoder().encode("test"); + + const manifest = await fs.promises.readFile( + `${simpleWrapperPath}/build/${WRAP_MANIFEST_PATH}` + ); + + const wasmModule = await fs.promises.readFile( + `${simpleWrapperPath}/build/${WRAP_MODULE_PATH}` + ); + + const fileReader = InMemoryFileReader.fromWasmModule(wasmModule, { + readFile: async (path: string): Promise> => { + if (path === WRAP_MANIFEST_PATH) { + return ResultOk(manifest); + } else if (path === "test.txt") { + return ResultOk(testEncoded); + } else { + return ResultErr(Error(`File ${path} not found`)); + } + }, + }); + + expect(await fileReader.readFile(WRAP_MANIFEST_PATH)).toEqual( + ResultOk(manifest) + ); + expect(await fileReader.readFile(WRAP_MODULE_PATH)).toEqual( + ResultOk(wasmModule) + ); + expect(await fileReader.readFile("test.txt")).toEqual( + ResultOk(testEncoded) + ); + }); + + it("can create in-memory file reader from manifest, wasm module and file reader", async () => { + const testEncoded = new TextEncoder().encode("test"); + + const manifest = await fs.promises.readFile( + `${simpleWrapperPath}/build/${WRAP_MANIFEST_PATH}` + ); + + const wasmModule = await fs.promises.readFile( + `${simpleWrapperPath}/build/${WRAP_MODULE_PATH}` + ); + + const fileReader = InMemoryFileReader.from(manifest, wasmModule, { + readFile: async (path: string): Promise> => { + if (path === "test.txt") { + return ResultOk(testEncoded); + } else { + return ResultErr(Error(`File ${path} not found`)); + } + }, + }); + + expect(await fileReader.readFile(WRAP_MANIFEST_PATH)).toEqual( + ResultOk(manifest) + ); + expect(await fileReader.readFile(WRAP_MODULE_PATH)).toEqual( + ResultOk(wasmModule) + ); + expect(await fileReader.readFile("test.txt")).toEqual( + ResultOk(testEncoded) + ); + }); +}); diff --git a/packages/js/wasm/src/__tests__/in-memory-packages.spec.ts b/packages/js/wasm/src/__tests__/in-memory-packages.spec.ts new file mode 100644 index 0000000000..6bf8460c21 --- /dev/null +++ b/packages/js/wasm/src/__tests__/in-memory-packages.spec.ts @@ -0,0 +1,160 @@ +import { buildWrapper } from "@polywrap/test-env-js"; +import { GetPathToTestWrappers } from "@polywrap/test-cases"; +import fs from "fs"; +import { WasmPackage } from "../WasmPackage"; +import { InMemoryFileReader } from "../InMemoryFileReader"; +import { deserializeWrapManifest } from "@polywrap/wrap-manifest-types-js"; +import { ResultErr, ResultOk } from "@polywrap/result"; +import { WRAP_MANIFEST_PATH, WRAP_MODULE_PATH } from "../constants"; + +jest.setTimeout(200000); + +const simpleWrapperPath = `${GetPathToTestWrappers()}/wasm-as/simple`; + +describe("In-memory packages", () => { + beforeAll(async () => { + await buildWrapper(simpleWrapperPath); + }); + + it("can create in-memory packages from buffers", async () => { + const manifest = await fs.promises.readFile( + `${simpleWrapperPath}/build/${WRAP_MANIFEST_PATH}` + ); + const wrapManifest = await deserializeWrapManifest(manifest); + + const wasmModule = await fs.promises.readFile( + `${simpleWrapperPath}/build/${WRAP_MODULE_PATH}` + ); + const wasmPackage = WasmPackage.from(manifest, wasmModule); + + expect(await wasmPackage.getManifest()).toEqual(ResultOk(wrapManifest)); + expect(await wasmPackage.getWasmModule()).toEqual(ResultOk(wasmModule)); + + const wrapperResult = await wasmPackage.createWrapper(); + + if (!wrapperResult.ok) { + throw wrapperResult.error; + } + + const wrapper = wrapperResult.value; + + expect(wrapManifest).toEqual(wrapper.getManifest()); + expect(await wrapper.getFile({ path: WRAP_MANIFEST_PATH })).toEqual( + ResultOk(manifest) + ); + expect(await wrapper.getFile({ path: WRAP_MODULE_PATH })).toEqual( + ResultOk(wasmModule) + ); + }); + + it("can create in-memory packages from file reader", async () => { + const manifest = await fs.promises.readFile( + `${simpleWrapperPath}/build/${WRAP_MANIFEST_PATH}` + ); + const wrapManifest = await deserializeWrapManifest(manifest); + + const wasmModule = await fs.promises.readFile( + `${simpleWrapperPath}/build/${WRAP_MODULE_PATH}` + ); + + const fileReader = InMemoryFileReader.from(manifest, wasmModule); + const wasmPackage = WasmPackage.from(fileReader); + + expect(await wasmPackage.getManifest()).toEqual(ResultOk(wrapManifest)); + expect(await wasmPackage.getWasmModule()).toEqual(ResultOk(wasmModule)); + + const wrapperResult = await wasmPackage.createWrapper(); + + if (!wrapperResult.ok) { + throw wrapperResult.error; + } + + const wrapper = wrapperResult.value; + + expect(wrapManifest).toEqual(wrapper.getManifest()); + expect(await wrapper.getFile({ path: WRAP_MANIFEST_PATH })).toEqual( + ResultOk(manifest) + ); + expect(await wrapper.getFile({ path: WRAP_MODULE_PATH })).toEqual( + ResultOk(wasmModule) + ); + }); + + it("can create in-memory packages from manifest and file reader", async () => { + const manifest = await fs.promises.readFile( + `${simpleWrapperPath}/build/${WRAP_MANIFEST_PATH}` + ); + const wrapManifest = await deserializeWrapManifest(manifest); + + const wasmModule = await fs.promises.readFile( + `${simpleWrapperPath}/build/${WRAP_MODULE_PATH}` + ); + + const fileReader = InMemoryFileReader.from(manifest, wasmModule); + const wasmPackage = WasmPackage.from(manifest, fileReader); + + expect(await wasmPackage.getManifest()).toEqual(ResultOk(wrapManifest)); + expect(await wasmPackage.getWasmModule()).toEqual(ResultOk(wasmModule)); + + const wrapperResult = await wasmPackage.createWrapper(); + + if (!wrapperResult.ok) { + throw wrapperResult.error; + } + + const wrapper = wrapperResult.value; + + expect(wrapManifest).toEqual(wrapper.getManifest()); + expect(await wrapper.getFile({ path: WRAP_MANIFEST_PATH })).toEqual( + ResultOk(manifest) + ); + expect(await wrapper.getFile({ path: WRAP_MODULE_PATH })).toEqual( + ResultOk(wasmModule) + ); + }); + + it("can create in-memory packages from manifest, wasm module and file reader", async () => { + const testEncoded = new TextEncoder().encode("test"); + + const manifest = await fs.promises.readFile( + `${simpleWrapperPath}/build/${WRAP_MANIFEST_PATH}` + ); + const wrapManifest = await deserializeWrapManifest(manifest); + + const wasmModule = await fs.promises.readFile( + `${simpleWrapperPath}/build/${WRAP_MODULE_PATH}` + ); + + const wasmPackage = WasmPackage.from(manifest, wasmModule, { + readFile: async (path: string) => { + if (path === "test.txt") { + return ResultOk(testEncoded); + } else { + return ResultErr(Error(`File ${path} not found`)); + } + }, + }); + + expect(await wasmPackage.getManifest()).toEqual(ResultOk(wrapManifest)); + expect(await wasmPackage.getWasmModule()).toEqual(ResultOk(wasmModule)); + + const wrapperResult = await wasmPackage.createWrapper(); + + if (!wrapperResult.ok) { + throw wrapperResult.error; + } + + const wrapper = wrapperResult.value; + + expect(wrapManifest).toEqual(wrapper.getManifest()); + expect(await wrapper.getFile({ path: WRAP_MANIFEST_PATH })).toEqual( + ResultOk(manifest) + ); + expect(await wrapper.getFile({ path: WRAP_MODULE_PATH })).toEqual( + ResultOk(wasmModule) + ); + expect(await wrapper.getFile({ path: "test.txt" })).toEqual( + ResultOk(testEncoded) + ); + }); +}); diff --git a/packages/js/wasm/src/__tests__/in-memory-wrappers.spec.ts b/packages/js/wasm/src/__tests__/in-memory-wrappers.spec.ts new file mode 100644 index 0000000000..848fb983b7 --- /dev/null +++ b/packages/js/wasm/src/__tests__/in-memory-wrappers.spec.ts @@ -0,0 +1,116 @@ +import { buildWrapper } from "@polywrap/test-env-js"; +import { GetPathToTestWrappers } from "@polywrap/test-cases"; +import fs from "fs"; +import { InMemoryFileReader } from "../InMemoryFileReader"; +import { deserializeWrapManifest } from "@polywrap/wrap-manifest-types-js"; +import { WasmWrapper } from "../WasmWrapper"; +import { Result, ResultErr, ResultOk } from "@polywrap/result"; +import { WRAP_MANIFEST_PATH, WRAP_MODULE_PATH } from "../constants"; + +jest.setTimeout(200000); + +const simpleWrapperPath = `${GetPathToTestWrappers()}/wasm-as/simple`; + +describe("In-memory wrappers", () => { + beforeAll(async () => { + await buildWrapper(simpleWrapperPath); + }); + + it("can create in-memory wrappers from buffers", async () => { + const manifest = await fs.promises.readFile( + `${simpleWrapperPath}/build/${WRAP_MANIFEST_PATH}` + ); + const wrapManifest = await deserializeWrapManifest(manifest); + + const wasmModule = await fs.promises.readFile( + `${simpleWrapperPath}/build/${WRAP_MODULE_PATH}` + ); + const wrapper = await WasmWrapper.from(manifest, wasmModule); + + expect(wrapper.getManifest()).toEqual(wrapManifest); + expect(await wrapper.getFile({ path: WRAP_MANIFEST_PATH })).toEqual( + ResultOk(manifest) + ); + expect(await wrapper.getFile({ path: WRAP_MODULE_PATH })).toEqual( + ResultOk(wasmModule) + ); + }); + + it("can create in-memory wrappers from file reader", async () => { + const manifest = await fs.promises.readFile( + `${simpleWrapperPath}/build/${WRAP_MANIFEST_PATH}` + ); + const wrapManifest = await deserializeWrapManifest(manifest); + + const wasmModule = await fs.promises.readFile( + `${simpleWrapperPath}/build/${WRAP_MODULE_PATH}` + ); + + const fileReader = InMemoryFileReader.from(manifest, wasmModule); + const wrapper = await WasmWrapper.from(fileReader); + + expect(wrapper.getManifest()).toEqual(wrapManifest); + expect(await wrapper.getFile({ path: WRAP_MANIFEST_PATH })).toEqual( + ResultOk(manifest) + ); + expect(await wrapper.getFile({ path: WRAP_MODULE_PATH })).toEqual( + ResultOk(wasmModule) + ); + }); + + it("can create in-memory wrappers from manifest and file reader", async () => { + const manifest = await fs.promises.readFile( + `${simpleWrapperPath}/build/${WRAP_MANIFEST_PATH}` + ); + const wrapManifest = await deserializeWrapManifest(manifest); + + const wasmModule = await fs.promises.readFile( + `${simpleWrapperPath}/build/${WRAP_MODULE_PATH}` + ); + + const fileReader = InMemoryFileReader.from(manifest, wasmModule); + const wrapper = await WasmWrapper.from(manifest, fileReader); + + expect(wrapper.getManifest()).toEqual(wrapManifest); + expect(await wrapper.getFile({ path: WRAP_MANIFEST_PATH })).toEqual( + ResultOk(manifest) + ); + expect(await wrapper.getFile({ path: WRAP_MODULE_PATH })).toEqual( + ResultOk(wasmModule) + ); + }); + + it("can create in-memory wrappers from manifest, wasm module and file reader", async () => { + const testEncoded = new TextEncoder().encode("test"); + + const manifest = await fs.promises.readFile( + `${simpleWrapperPath}/build/${WRAP_MANIFEST_PATH}` + ); + const wrapManifest = await deserializeWrapManifest(manifest); + + const wasmModule = await fs.promises.readFile( + `${simpleWrapperPath}/build/${WRAP_MODULE_PATH}` + ); + + const wrapper = await WasmWrapper.from(manifest, wasmModule, { + readFile: async (path: string): Promise> => { + if (path === "test.txt") { + return ResultOk(testEncoded); + } else { + return ResultErr(Error(`File ${path} not found`)); + } + }, + }); + + expect(await wrapper.getManifest()).toEqual(wrapManifest); + expect(await wrapper.getFile({ path: WRAP_MANIFEST_PATH })).toEqual( + ResultOk(manifest) + ); + expect(await wrapper.getFile({ path: WRAP_MODULE_PATH })).toEqual( + ResultOk(wasmModule) + ); + expect(await wrapper.getFile({ path: "test.txt" })).toEqual( + ResultOk(testEncoded) + ); + }); +}); diff --git a/packages/js/wasm/src/helpers/createWasmPackage.ts b/packages/js/wasm/src/helpers/createWasmPackage.ts new file mode 100644 index 0000000000..67b909aef5 --- /dev/null +++ b/packages/js/wasm/src/helpers/createWasmPackage.ts @@ -0,0 +1,48 @@ +import { IFileReader, WasmPackage, InMemoryFileReader } from ".."; + +// Helper function for creating wasm packages +// Not meant for exporting out of this library +export const createWasmPackage = ( + manifestBufferOrFileReader: Uint8Array | IFileReader, + wasmModuleOrFileReader?: Uint8Array | IFileReader, + fileReader?: IFileReader +): WasmPackage => { + let manifestBuffer: Uint8Array | undefined; + let wasmModule: Uint8Array | undefined; + let builtFileReader: IFileReader | undefined = fileReader; + + if (manifestBufferOrFileReader instanceof Uint8Array) { + manifestBuffer = manifestBufferOrFileReader as Uint8Array; + } else { + builtFileReader = manifestBufferOrFileReader as IFileReader; + } + + if (wasmModuleOrFileReader) { + if (wasmModuleOrFileReader instanceof Uint8Array) { + wasmModule = wasmModuleOrFileReader as Uint8Array; + } else if ((wasmModuleOrFileReader as Partial).readFile) { + builtFileReader = wasmModuleOrFileReader as IFileReader; + } + } + + if (manifestBuffer) { + if (wasmModule) { + return new WasmPackage( + InMemoryFileReader.from( + manifestBuffer, + wasmModule, + builtFileReader as IFileReader + ) + ); + } else { + return new WasmPackage( + InMemoryFileReader.fromManifest( + manifestBuffer, + builtFileReader as IFileReader + ) + ); + } + } else { + return new WasmPackage(builtFileReader as IFileReader); + } +}; diff --git a/packages/js/wasm/src/helpers/createWasmWrapper.ts b/packages/js/wasm/src/helpers/createWasmWrapper.ts new file mode 100644 index 0000000000..15adc3df7d --- /dev/null +++ b/packages/js/wasm/src/helpers/createWasmWrapper.ts @@ -0,0 +1,59 @@ +import { IFileReader, WasmWrapper } from ".."; +import { createWasmPackage } from "./createWasmPackage"; + +import { GetManifestOptions } from "@polywrap/core-js"; + +// Helper function for creating wasm wrappers +// Not meant for exporting out of this library +export const createWasmWrapper = async ( + manifestBufferOrFileReader: Uint8Array | IFileReader, + wasmModuleOrFileReaderOrManifestOptions?: + | Uint8Array + | IFileReader + | GetManifestOptions, + fileReaderOrManifestOptions?: IFileReader | GetManifestOptions, + manifestOptions?: GetManifestOptions +): Promise => { + if ( + !wasmModuleOrFileReaderOrManifestOptions || + (wasmModuleOrFileReaderOrManifestOptions as GetManifestOptions) + .noValidate !== undefined + ) { + const result = await createWasmPackage( + manifestBufferOrFileReader + ).createWrapper( + wasmModuleOrFileReaderOrManifestOptions as GetManifestOptions + ); + + if (!result.ok) { + throw result.error; + } + return result.value as WasmWrapper; + } else if ( + !fileReaderOrManifestOptions || + (fileReaderOrManifestOptions as GetManifestOptions).noValidate !== undefined + ) { + const result = await createWasmPackage( + manifestBufferOrFileReader, + wasmModuleOrFileReaderOrManifestOptions as Uint8Array | IFileReader + ).createWrapper(fileReaderOrManifestOptions as GetManifestOptions); + + if (!result.ok) { + throw result.error; + } + + return result.value as WasmWrapper; + } else { + const result = await createWasmPackage( + manifestBufferOrFileReader, + wasmModuleOrFileReaderOrManifestOptions as Uint8Array, + fileReaderOrManifestOptions as IFileReader + ).createWrapper(manifestOptions); + + if (!result.ok) { + throw result.error; + } + + return result.value as WasmWrapper; + } +}; diff --git a/packages/js/wasm/src/imports.ts b/packages/js/wasm/src/imports.ts index 1e1ee4cc81..0ec6338fe2 100644 --- a/packages/js/wasm/src/imports.ts +++ b/packages/js/wasm/src/imports.ts @@ -33,20 +33,20 @@ export const createImports = (config: { const method = readString(memory.buffer, methodPtr, methodLen); const args = readBytes(memory.buffer, argsPtr, argsLen); - const { data, error } = await client.invoke({ + const result = await client.invoke({ uri: uri, method: method, args: new Uint8Array(args), encodeResult: true, }); - if (!error) { - state.subinvoke.result = data; + if (result.ok) { + state.subinvoke.result = result.value; } else { - state.subinvoke.error = `${error.name}: ${error.message}`; + state.subinvoke.error = `${result.error?.name}: ${result.error?.message}`; } - return !error; + return result.ok; }, // Give WASM the size of the result __wrap_subinvoke_result_len: (): u32 => { @@ -99,20 +99,20 @@ export const createImports = (config: { state.subinvokeImplementation.args = [implUri, method, args]; - const { data, error } = await client.invoke({ + const result = await client.invoke({ uri: implUri, method: method, args: new Uint8Array(args), encodeResult: true, }); - if (!error) { - state.subinvokeImplementation.result = data; + if (result.ok) { + state.subinvokeImplementation.result = result.value; } else { - state.subinvokeImplementation.error = `${error.name}: ${error.message}`; + state.subinvokeImplementation.error = `${result.error?.name}: ${result.error?.message}`; } - return !error; + return result.ok; }, __wrap_subinvokeImplementation_result_len: (): u32 => { if (!state.subinvokeImplementation.result) { @@ -176,8 +176,13 @@ export const createImports = (config: { __wrap_getImplementations: (uriPtr: u32, uriLen: u32): boolean => { const uri = readString(memory.buffer, uriPtr, uriLen); const result = client.getImplementations(uri, {}); - state.getImplementationsResult = msgpackEncode(result); - return result.length > 0; + if (!result.ok) { + abort(result.error?.message as string); + return false; + } + const implementations = result.value; + state.getImplementationsResult = msgpackEncode(implementations); + return implementations.length > 0; }, __wrap_getImplementations_result_len: (): u32 => { if (!state.getImplementationsResult) { diff --git a/packages/js/wasm/src/index.ts b/packages/js/wasm/src/index.ts index 87f538d5b5..1309eab0b6 100644 --- a/packages/js/wasm/src/index.ts +++ b/packages/js/wasm/src/index.ts @@ -2,4 +2,6 @@ export { WasmWrapper } from "./WasmWrapper"; export { WasmPackage } from "./WasmPackage"; export { IWasmPackage } from "./IWasmPackage"; export { IFileReader } from "./IFileReader"; +export { InMemoryFileReader } from "./InMemoryFileReader"; export { WrapImports } from "./types"; +export * from "./constants"; diff --git a/packages/manifests/polywrap/formats/polywrap.build/0.2.0.json b/packages/manifests/polywrap/formats/polywrap.build/0.2.0.json new file mode 100644 index 0000000000..2e32744141 --- /dev/null +++ b/packages/manifests/polywrap/formats/polywrap.build/0.2.0.json @@ -0,0 +1,124 @@ +{ + "id": "BuildManifest", + "type": "object", + "additionalProperties": false, + "required": ["format"], + "properties": { + "format": { + "description": "Polywrap build manifest format version.", + "type": "string", + "enum": ["0.2.0"] + }, + "strategies": { + "description": "Custom build image configurations.", + "type": "object", + "additionalProperties": false, + "properties": { + "image": { + "$ref": "#/definitions/image" + }, + "local": { + "$ref": "#/definitions/local" + }, + "vm": { + "$ref": "#/definitions/vm" + } + } + }, + "linked_packages": { + "description": "Locally linked packages into docker build image.", + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "description": "Package name.", + "type": "string" + }, + "path": { + "description": "Path to linked package directory.", + "type": "string" + }, + "filter": { + "description": "Ignore files matching this regex in linked package directory.", + "type": "string" + } + }, + "required": ["name", "path"] + } + }, + "config": { + "description": "General configurations.", + "type": "object" + } + }, + "definitions": { + "image": { + "description": "Docker image strategy configuration", + "type": "object", + "properties": { + "name": { + "description": "Docker image name.", + "type": "string", + "pattern": "^[a-zA-Z0-9\\-\\_]+$" + }, + "dockerfile": { + "description": "Docker image file name.", + "type": "string", + "pattern": "^\\.?\\.?(\\/[\\w\\-\\.]+|\\/\\.\\.|\\/\\.)*\\/Dockerfile(.mustache)?$" + }, + "buildx": { + "description": "Configuration options for Docker Buildx, set to true for default value.", + "type": ["object", "boolean"], + "additionalProperties": false, + "properties": { + "cache": { + "description": "Path to cache directory, set to true for default value, set to false to disable caching.", + "type": ["string", "boolean"], + "pattern": "^\\.?\\.?\\/?((\\/[\\w\\-\\.]+|\\/\\.\\.|\\/\\.)+\\/)?[\\w\\-\\.]+\\.?[\\w\\-\\.]*$" + }, + "removeBuilder": { + "description": "Remove the builder instance.", + "type": "boolean" + } + } + }, + "removeImage": { + "description": "Remove the image.", + "type": "boolean" + } + } + }, + "local": { + "description": "Local build strategy configuration", + "type": "object", + "additionalProperties": false, + "properties": { + "scriptPath": { + "description": "Custom script path for local build", + "type": "string" + } + } + }, + "vm": { + "description": "Docker VM strategy configuration", + "type": "object", + "additionalProperties": false, + "properties": { + "baseImage": { + "description": "Base image for the Docker VM", + "type": "string", + "pattern": "^([a-zA-Z0-9\\-\\_]+\\/)?[a-zA-Z0-9\\-\\_]+:[a-zA-Z0-9\\-\\_\\.]+$" + }, + "defaultIncludes": { + "description": "Files to include in build VM container, by default", + "type": "array", + "items": { + "type": "string" + } + } + } + } + } +} diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/mod-rs.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/mod-rs.mustache index 4dbeb3ab1d..339bbbded6 100644 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/mod-rs.mustache +++ b/packages/schema/bind/src/bindings/rust/wasm/templates/mod-rs.mustache @@ -50,4 +50,10 @@ pub use {{#detectKeyword}}{{#toLower}}{{type}}{{/toLower}}{{/detectKeyword}}::{ Args{{#detectKeyword}}{{#toUpper}}{{name}}{{/toUpper}}{{/detectKeyword}}{{^last}},{{/last}} {{/methods}} }; -{{/moduleType}} \ No newline at end of file +{{/moduleType}} + +// Override print!(...) & println!(...) macros +#[macro_export] +macro_rules! println { ($($args:tt)*) => { polywrap_wasm_rs::wrap_debug_log(format!($($args)*).as_str()); } } +#[macro_export] +macro_rules! print { ($($args:tt)*) => { polywrap_wasm_rs::wrap_debug_log(format!($($args)*).as_str()); } } diff --git a/packages/schema/bind/src/bindings/typescript/plugin/templates/types-ts.mustache b/packages/schema/bind/src/bindings/typescript/plugin/templates/types-ts.mustache index 50875ebe45..fe7452afe4 100644 --- a/packages/schema/bind/src/bindings/typescript/plugin/templates/types-ts.mustache +++ b/packages/schema/bind/src/bindings/typescript/plugin/templates/types-ts.mustache @@ -6,7 +6,8 @@ import * as Types from "./"; // @ts-ignore import { - Client, + Client,{{#interfaceTypes.length}} + Result,{{/interfaceTypes.length}} InvokeResult } from "@polywrap/core-js"; @@ -162,7 +163,7 @@ export class {{#detectKeyword}}{{namespace}}{{/detectKeyword}} { {{#capabilities}} {{#getImplementations}} {{#enabled}} - public static getImplementations(client: Client): string[] { + public static getImplementations(client: Client): Result { return client.getImplementations(this.uri, {}); } {{/enabled}} diff --git a/packages/templates/app/typescript-node/polywrap.app.yaml b/packages/templates/app/typescript-node/polywrap.yaml similarity index 100% rename from packages/templates/app/typescript-node/polywrap.app.yaml rename to packages/templates/app/typescript-node/polywrap.yaml diff --git a/packages/templates/plugin/typescript/polywrap.plugin.yaml b/packages/templates/plugin/typescript/polywrap.yaml similarity index 100% rename from packages/templates/plugin/typescript/polywrap.plugin.yaml rename to packages/templates/plugin/typescript/polywrap.yaml diff --git a/packages/templates/polywrap.wasm-linked.build.yaml b/packages/templates/polywrap.wasm-linked.build.yaml index 959488ab0c..0f093b2a62 100644 --- a/packages/templates/polywrap.wasm-linked.build.yaml +++ b/packages/templates/polywrap.wasm-linked.build.yaml @@ -1,11 +1,11 @@ -format: 0.1.0 -docker: - name: template-wasm-as -config: - node_version: "16.13.0" - include: - - ./package.json - - ./src +format: 0.2.0 +strategies: + image: + node_version: "16.13.0" + include: + - ./package.json + - ./src + name: template-wasm-as linked_packages: - name: "@polywrap/wasm-as" path: ../../../wasm/as diff --git a/packages/templates/wasm/assemblyscript/polywrap.build.yaml b/packages/templates/wasm/assemblyscript/polywrap.build.yaml index 5b290b8f94..6851c30146 100644 --- a/packages/templates/wasm/assemblyscript/polywrap.build.yaml +++ b/packages/templates/wasm/assemblyscript/polywrap.build.yaml @@ -1,8 +1,8 @@ -format: 0.1.0 -docker: - name: template-wasm-as -config: - node_version: "16.13.0" - include: - - ./package.json - - ./src \ No newline at end of file +format: 0.2.0 +strategies: + image: + name: template-wasm-as + node_version: "16.13.0" + include: + - ./package.json + - ./src \ No newline at end of file diff --git a/packages/templates/wasm/assemblyscript/polywrap.wasm-linked.build.yaml b/packages/templates/wasm/assemblyscript/polywrap.wasm-linked.build.yaml new file mode 100644 index 0000000000..aabb15b6ed --- /dev/null +++ b/packages/templates/wasm/assemblyscript/polywrap.wasm-linked.build.yaml @@ -0,0 +1,11 @@ +format: 0.2.0 +strategies: + image: + name: template-wasm-as + node_version: "16.13.0" + include: + - ./src + - ./package.json +linked_packages: + - name: "@polywrap/wasm-as" + path: ../../../wasm/as diff --git a/packages/templates/wasm/assemblyscript/polywrap.wasm-linked.yaml b/packages/templates/wasm/assemblyscript/polywrap.wasm-linked.yaml new file mode 100644 index 0000000000..294a567ae7 --- /dev/null +++ b/packages/templates/wasm/assemblyscript/polywrap.wasm-linked.yaml @@ -0,0 +1,9 @@ +format: 0.2.0 +project: + name: template-wasm-as + type: wasm/assemblyscript +source: + module: ./src/index.ts + schema: ./src/schema.graphql +extensions: + build: ./polywrap.wasm-linked.build.yaml diff --git a/packages/templates/wasm/rust/polywrap.build.yaml b/packages/templates/wasm/rust/polywrap.build.yaml index 5ee50d0ea6..875939c725 100644 --- a/packages/templates/wasm/rust/polywrap.build.yaml +++ b/packages/templates/wasm/rust/polywrap.build.yaml @@ -1,8 +1,4 @@ -format: 0.1.0 -docker: - name: template-wasm-rs -config: - node_version: "16.13.0" - include: - - ./package.json - - ./src \ No newline at end of file +format: 0.2.0 +strategies: + image: + name: template-wasm-rs \ No newline at end of file diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-ts/types.ts b/packages/test-cases/cases/bind/sanity/output/plugin-ts/types.ts index 9b0cddff40..bea42392d8 100644 --- a/packages/test-cases/cases/bind/sanity/output/plugin-ts/types.ts +++ b/packages/test-cases/cases/bind/sanity/output/plugin-ts/types.ts @@ -7,6 +7,7 @@ import * as Types from "./"; // @ts-ignore import { Client, + Result, InvokeResult } from "@polywrap/core-js"; @@ -212,7 +213,7 @@ export class TestImport_Module { export class TestImport { static uri: string = "testimport.uri.eth"; - public static getImplementations(client: Client): string[] { + public static getImplementations(client: Client): Result { return client.getImplementations(this.uri, {}); } } diff --git a/packages/test-cases/cases/bind/sanity/output/wasm-rs/mod.rs b/packages/test-cases/cases/bind/sanity/output/wasm-rs/mod.rs index 78dd0267c8..aee6b16684 100644 --- a/packages/test-cases/cases/bind/sanity/output/wasm-rs/mod.rs +++ b/packages/test-cases/cases/bind/sanity/output/wasm-rs/mod.rs @@ -55,3 +55,9 @@ pub use module::{ if_wrapped, ArgsIf }; + +// Override print!(...) & println!(...) macros +#[macro_export] +macro_rules! println { ($($args:tt)*) => { polywrap_wasm_rs::wrap_debug_log(format!($($args)*).as_str()); } } +#[macro_export] +macro_rules! print { ($($args:tt)*) => { polywrap_wasm_rs::wrap_debug_log(format!($($args)*).as_str()); } } diff --git a/packages/test-cases/cases/cli/docgen/001-sanity/polywrap.build.yaml b/packages/test-cases/cases/cli/docgen/001-sanity/polywrap.build.yaml index 3edf63339a..c3dcbe22cb 100644 --- a/packages/test-cases/cases/cli/docgen/001-sanity/polywrap.build.yaml +++ b/packages/test-cases/cases/cli/docgen/001-sanity/polywrap.build.yaml @@ -1,6 +1,9 @@ -format: 0.1.0 -config: - node_version: "14.16.0" +format: 0.2.0 +strategies: + image: + node_version: "14.16.0" + include: + - ./package.json linked_packages: - name: "@polywrap/wasm-as" path: ../../../../../../wasm/as diff --git a/packages/test-cases/cases/cli/docgen/002-custom-config/polywrap.build.yaml b/packages/test-cases/cases/cli/docgen/002-custom-config/polywrap.build.yaml index 3edf63339a..c3dcbe22cb 100644 --- a/packages/test-cases/cases/cli/docgen/002-custom-config/polywrap.build.yaml +++ b/packages/test-cases/cases/cli/docgen/002-custom-config/polywrap.build.yaml @@ -1,6 +1,9 @@ -format: 0.1.0 -config: - node_version: "14.16.0" +format: 0.2.0 +strategies: + image: + node_version: "14.16.0" + include: + - ./package.json linked_packages: - name: "@polywrap/wasm-as" path: ../../../../../../wasm/as diff --git a/packages/test-cases/cases/cli/docgen/003-custom-manifest-file/polywrap.custom.build.yaml b/packages/test-cases/cases/cli/docgen/003-custom-manifest-file/polywrap.custom.build.yaml index 3edf63339a..c3dcbe22cb 100644 --- a/packages/test-cases/cases/cli/docgen/003-custom-manifest-file/polywrap.custom.build.yaml +++ b/packages/test-cases/cases/cli/docgen/003-custom-manifest-file/polywrap.custom.build.yaml @@ -1,6 +1,9 @@ -format: 0.1.0 -config: - node_version: "14.16.0" +format: 0.2.0 +strategies: + image: + node_version: "14.16.0" + include: + - ./package.json linked_packages: - name: "@polywrap/wasm-as" path: ../../../../../../wasm/as diff --git a/packages/test-cases/cases/cli/docgen/005-wasm/polywrap.build.yaml b/packages/test-cases/cases/cli/docgen/005-wasm/polywrap.build.yaml index 3edf63339a..c3dcbe22cb 100644 --- a/packages/test-cases/cases/cli/docgen/005-wasm/polywrap.build.yaml +++ b/packages/test-cases/cases/cli/docgen/005-wasm/polywrap.build.yaml @@ -1,6 +1,9 @@ -format: 0.1.0 -config: - node_version: "14.16.0" +format: 0.2.0 +strategies: + image: + node_version: "14.16.0" + include: + - ./package.json linked_packages: - name: "@polywrap/wasm-as" path: ../../../../../../wasm/as diff --git a/packages/test-cases/cases/cli/docgen/007-docusaurus/polywrap.build.yaml b/packages/test-cases/cases/cli/docgen/007-docusaurus/polywrap.build.yaml index 5b7b10a7c5..479e3042fe 100644 --- a/packages/test-cases/cases/cli/docgen/007-docusaurus/polywrap.build.yaml +++ b/packages/test-cases/cases/cli/docgen/007-docusaurus/polywrap.build.yaml @@ -1,6 +1,9 @@ -format: 0.1.0 -config: - node_version: "16.13.0" +format: 0.2.0 +strategies: + image: + node_version: "16.13.0" + include: + - ./package.json linked_packages: - name: "@polywrap/wasm-as" path: ../../../../../../wasm/as diff --git a/packages/test-cases/cases/cli/docgen/008-jsdoc/polywrap.build.yaml b/packages/test-cases/cases/cli/docgen/008-jsdoc/polywrap.build.yaml index 5b7b10a7c5..479e3042fe 100644 --- a/packages/test-cases/cases/cli/docgen/008-jsdoc/polywrap.build.yaml +++ b/packages/test-cases/cases/cli/docgen/008-jsdoc/polywrap.build.yaml @@ -1,6 +1,9 @@ -format: 0.1.0 -config: - node_version: "16.13.0" +format: 0.2.0 +strategies: + image: + node_version: "16.13.0" + include: + - ./package.json linked_packages: - name: "@polywrap/wasm-as" path: ../../../../../../wasm/as diff --git a/packages/test-cases/cases/cli/docgen/009-schema/polywrap.build.yaml b/packages/test-cases/cases/cli/docgen/009-schema/polywrap.build.yaml index 5b7b10a7c5..479e3042fe 100644 --- a/packages/test-cases/cases/cli/docgen/009-schema/polywrap.build.yaml +++ b/packages/test-cases/cases/cli/docgen/009-schema/polywrap.build.yaml @@ -1,6 +1,9 @@ -format: 0.1.0 -config: - node_version: "16.13.0" +format: 0.2.0 +strategies: + image: + node_version: "16.13.0" + include: + - ./package.json linked_packages: - name: "@polywrap/wasm-as" path: ../../../../../../wasm/as diff --git a/packages/test-cases/cases/cli/manifest/samples/invalid-format.yaml b/packages/test-cases/cases/cli/manifest/samples/invalid-format.yaml new file mode 100644 index 0000000000..e8f136e503 --- /dev/null +++ b/packages/test-cases/cases/cli/manifest/samples/invalid-format.yaml @@ -0,0 +1,4 @@ +format: invalid +project: + name: test + type: wasm/assemblyscript \ No newline at end of file diff --git a/packages/test-cases/cases/cli/manifest/samples/polywrap.app.yaml b/packages/test-cases/cases/cli/manifest/samples/polywrap.app.yaml new file mode 100644 index 0000000000..6bf878cdce --- /dev/null +++ b/packages/test-cases/cases/cli/manifest/samples/polywrap.app.yaml @@ -0,0 +1,4 @@ +format: 0.1.0 +name: Sample +language: app/typescript +schema: ./schema.graphql diff --git a/packages/test-cases/cases/cli/manifest/samples/polywrap.build.yaml b/packages/test-cases/cases/cli/manifest/samples/polywrap.build.yaml new file mode 100644 index 0000000000..7ba7c279fa --- /dev/null +++ b/packages/test-cases/cases/cli/manifest/samples/polywrap.build.yaml @@ -0,0 +1,8 @@ +format: 0.2.0 +strategies: + image: + name: template-wasm-as + node_version: 16.13.0 + include: + - ./package.json + - ./src \ No newline at end of file diff --git a/packages/test-cases/cases/cli/manifest/samples/polywrap.deploy.yaml b/packages/test-cases/cases/cli/manifest/samples/polywrap.deploy.yaml new file mode 100644 index 0000000000..1a7eb834d6 --- /dev/null +++ b/packages/test-cases/cases/cli/manifest/samples/polywrap.deploy.yaml @@ -0,0 +1,7 @@ +format: 0.1.0 +stages: + ipfs_deploy: + package: ipfs + uri: fs/./build + config: + gatewayUri: 'https://ipfs.wrappers.io' diff --git a/packages/test-cases/cases/cli/manifest/samples/polywrap.infra.yaml b/packages/test-cases/cases/cli/manifest/samples/polywrap.infra.yaml new file mode 100644 index 0000000000..135042f417 --- /dev/null +++ b/packages/test-cases/cases/cli/manifest/samples/polywrap.infra.yaml @@ -0,0 +1,12 @@ +format: 0.1.0 +env: + IPFS_PORT: $ENV_IPFS_PORT + DEV_SERVER_PORT: 4040 + DEV_SERVER_ETH_TESTNET_PORT: 8545 +modules: + ipfs: + package: "@namestys/ipfs-infra" + version: "0.0.1" + registry: npm + dev-server: + path: ../local-packages/dev-server diff --git a/packages/test-cases/cases/cli/manifest/samples/polywrap.meta.yaml b/packages/test-cases/cases/cli/manifest/samples/polywrap.meta.yaml new file mode 100644 index 0000000000..6ffb9aea98 --- /dev/null +++ b/packages/test-cases/cases/cli/manifest/samples/polywrap.meta.yaml @@ -0,0 +1,14 @@ +format: 0.1.0 +displayName: Polywrap Meta Sample +subtext: A Sample Meta Manifest Ext +description: A Sample Meta Manifest Ext +tags: + - polywrap + - web3 + - sample +repository: https://github.com/test/test +icon: ./meta/icon.png +links: + - name: test link + icon: ./meta/link.svg + url: http://link.com/path diff --git a/packages/test-cases/cases/cli/manifest/samples/polywrap.plugin.yaml b/packages/test-cases/cases/cli/manifest/samples/polywrap.plugin.yaml new file mode 100644 index 0000000000..3a47e8d94c --- /dev/null +++ b/packages/test-cases/cases/cli/manifest/samples/polywrap.plugin.yaml @@ -0,0 +1,5 @@ +format: 0.1.0 +name: Sample +language: plugin/typescript +schema: ./src/schema.graphql +module: ./src/index.ts \ No newline at end of file diff --git a/packages/test-cases/cases/cli/manifest/samples/polywrap.test.yaml b/packages/test-cases/cases/cli/manifest/samples/polywrap.test.yaml new file mode 100644 index 0000000000..40b784b1af --- /dev/null +++ b/packages/test-cases/cases/cli/manifest/samples/polywrap.test.yaml @@ -0,0 +1,33 @@ +name: run-test-wrapper +format: 0.1.0 +jobs: + cases: + steps: + - uri: fs/../run-test-wrapper/build + method: add + args: + x: 1 + y: 1 + jobs: + case1: + steps: + - uri: fs/../run-test-wrapper/build + method: add + args: + x: "$cases.0.data" + y: 1 + jobs: + case12: + steps: + - uri: fs/../run-test-wrapper/build + method: add + args: + x: "$cases.case1.0.data" + y: 1 + case2: + steps: + - uri: fs/../run-test-wrapper/build + method: add + args: + x: "$cases.0.data" + y: "$cases.0.data" diff --git a/packages/test-cases/cases/cli/manifest/samples/polywrap.yaml b/packages/test-cases/cases/cli/manifest/samples/polywrap.yaml new file mode 100644 index 0000000000..71d27b5e8e --- /dev/null +++ b/packages/test-cases/cases/cli/manifest/samples/polywrap.yaml @@ -0,0 +1,8 @@ +format: 0.1.0 +name: sample-wasm-as +language: wasm/assemblyscript +schema: ./src/schema.graphql +module: ./src/index.ts +build: ./polywrap.build.yaml +deploy: ./polywrap.deploy.yaml +meta: ./polywrap.meta.yaml diff --git a/packages/test-cases/cases/cli/run/002-json-workflow/cmd.json b/packages/test-cases/cases/cli/run/002-json-workflow/cmd.json index 5a8ca8cd1c..c0876d14c0 100644 --- a/packages/test-cases/cases/cli/run/002-json-workflow/cmd.json +++ b/packages/test-cases/cases/cli/run/002-json-workflow/cmd.json @@ -1,3 +1,3 @@ { - "args": ["--manifest", "./polywrap.test.json"] + "args": ["--manifest-file", "./polywrap.test.json"] } \ No newline at end of file diff --git a/packages/test-cases/cases/cli/run/run-test-wrapper/polywrap.build.yaml b/packages/test-cases/cases/cli/run/run-test-wrapper/polywrap.build.yaml index 66be618ca5..a5f252a0d3 100644 --- a/packages/test-cases/cases/cli/run/run-test-wrapper/polywrap.build.yaml +++ b/packages/test-cases/cases/cli/run/run-test-wrapper/polywrap.build.yaml @@ -1,6 +1,9 @@ -format: 0.1.0 -config: - node_version: "14.16.0" +format: 0.2.0 +strategies: + image: + node_version: "14.16.0" + include: + - ./package.json linked_packages: - name: "@polywrap/wasm-as" path: ../../../../../wasm/as diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/001-sanity/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/001-sanity/polywrap.build.yaml deleted file mode 100644 index 3edf63339a..0000000000 --- a/packages/test-cases/cases/cli/wasm/build-cmd/001-sanity/polywrap.build.yaml +++ /dev/null @@ -1,6 +0,0 @@ -format: 0.1.0 -config: - node_version: "14.16.0" -linked_packages: - - name: "@polywrap/wasm-as" - path: ../../../../../../wasm/as diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/002-invalid-manifest-1/expected/stdout.json b/packages/test-cases/cases/cli/wasm/build-cmd/002-invalid-manifest-1/expected/stdout.json deleted file mode 100644 index d92ea5d141..0000000000 --- a/packages/test-cases/cases/cli/wasm/build-cmd/002-invalid-manifest-1/expected/stdout.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "stdout": [ - "ENOENT: no such file or directory", - "wrong/schema.graphql" - ], - "exitCode": 1 -} diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/003-invalid-manifest-2/expected/stdout.json b/packages/test-cases/cases/cli/wasm/build-cmd/003-invalid-manifest-2/expected/stdout.json deleted file mode 100644 index 64fc59922b..0000000000 --- a/packages/test-cases/cases/cli/wasm/build-cmd/003-invalid-manifest-2/expected/stdout.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "stdout": "instance is not allowed to have the additional property \"wrong\"", - "exitCode": 1 -} diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/004-default-build/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/004-default-build/polywrap.build.yaml deleted file mode 100644 index 5721b14ee1..0000000000 --- a/packages/test-cases/cases/cli/wasm/build-cmd/004-default-build/polywrap.build.yaml +++ /dev/null @@ -1,10 +0,0 @@ -format: 0.1.0 -config: - node_version: "14.16.0" - include: - - ./src - - ./package.json -linked_packages: - - name: "@polywrap/wasm-as" - path: ../../../../../../wasm/as - filter: /\.(test|spec)\.(js|ts)$/gm diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/005-default-dockerfile/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/005-default-dockerfile/polywrap.build.yaml deleted file mode 100644 index 73f91b39a8..0000000000 --- a/packages/test-cases/cases/cli/wasm/build-cmd/005-default-dockerfile/polywrap.build.yaml +++ /dev/null @@ -1,9 +0,0 @@ -format: 0.1.0 -config: - 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/wasm/build-cmd/006-custom-dockerfile/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/006-custom-dockerfile/polywrap.build.yaml deleted file mode 100644 index a8d9b27b60..0000000000 --- a/packages/test-cases/cases/cli/wasm/build-cmd/006-custom-dockerfile/polywrap.build.yaml +++ /dev/null @@ -1,11 +0,0 @@ -format: 0.1.0 -docker: - dockerfile: ./Dockerfile -config: - 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/wasm/build-cmd/007-linked-packages/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/007-linked-packages/polywrap.build.yaml deleted file mode 100644 index 5721b14ee1..0000000000 --- a/packages/test-cases/cases/cli/wasm/build-cmd/007-linked-packages/polywrap.build.yaml +++ /dev/null @@ -1,10 +0,0 @@ -format: 0.1.0 -config: - node_version: "14.16.0" - include: - - ./src - - ./package.json -linked_packages: - - name: "@polywrap/wasm-as" - path: ../../../../../../wasm/as - filter: /\.(test|spec)\.(js|ts)$/gm diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/008-metadata/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/008-metadata/polywrap.build.yaml deleted file mode 100644 index 3edf63339a..0000000000 --- a/packages/test-cases/cases/cli/wasm/build-cmd/008-metadata/polywrap.build.yaml +++ /dev/null @@ -1,6 +0,0 @@ -format: 0.1.0 -config: - node_version: "14.16.0" -linked_packages: - - name: "@polywrap/wasm-as" - path: ../../../../../../wasm/as diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/009-docker-buildx/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/009-docker-buildx/polywrap.build.yaml deleted file mode 100644 index bcf2086585..0000000000 --- a/packages/test-cases/cases/cli/wasm/build-cmd/009-docker-buildx/polywrap.build.yaml +++ /dev/null @@ -1,14 +0,0 @@ -format: 0.1.0 -docker: - buildx: - cache: true - removeBuilder: true - removeImage: true -config: - 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/wasm/build-cmd/010-custom-config/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/010-custom-config/polywrap.build.yaml deleted file mode 100644 index 5b7b10a7c5..0000000000 --- a/packages/test-cases/cases/cli/wasm/build-cmd/010-custom-config/polywrap.build.yaml +++ /dev/null @@ -1,6 +0,0 @@ -format: 0.1.0 -config: - node_version: "16.13.0" -linked_packages: - - name: "@polywrap/wasm-as" - path: ../../../../../../wasm/as diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/011-custom-config/expected/stdout.json b/packages/test-cases/cases/cli/wasm/build-cmd/011-custom-config/expected/stdout.json deleted file mode 100644 index f010d65eea..0000000000 --- a/packages/test-cases/cases/cli/wasm/build-cmd/011-custom-config/expected/stdout.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "stdout": [ - "Artifacts written to ./build from the image `polywrap-build-env-", - "WRAP manifest written in ./build" - ], - "exitCode": 0 -} diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/011-custom-config/polywrap.custom.build.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/011-custom-config/polywrap.custom.build.yaml deleted file mode 100644 index 3edf63339a..0000000000 --- a/packages/test-cases/cases/cli/wasm/build-cmd/011-custom-config/polywrap.custom.build.yaml +++ /dev/null @@ -1,6 +0,0 @@ -format: 0.1.0 -config: - node_version: "14.16.0" -linked_packages: - - name: "@polywrap/wasm-as" - path: ../../../../../../wasm/as diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/012-no-codegen/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/012-no-codegen/polywrap.build.yaml deleted file mode 100644 index 3edf63339a..0000000000 --- a/packages/test-cases/cases/cli/wasm/build-cmd/012-no-codegen/polywrap.build.yaml +++ /dev/null @@ -1,6 +0,0 @@ -format: 0.1.0 -config: - node_version: "14.16.0" -linked_packages: - - name: "@polywrap/wasm-as" - path: ../../../../../../wasm/as diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/001-sanity/expected/output.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/001-sanity/expected/output.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/001-sanity/expected/output.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/001-sanity/expected/output.json diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/010-custom-config/expected/stdout.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/001-sanity/expected/stdout.json similarity index 52% rename from packages/test-cases/cases/cli/wasm/build-cmd/010-custom-config/expected/stdout.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/001-sanity/expected/stdout.json index f010d65eea..6cbc97b938 100644 --- a/packages/test-cases/cases/cli/wasm/build-cmd/010-custom-config/expected/stdout.json +++ b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/001-sanity/expected/stdout.json @@ -1,6 +1,6 @@ { "stdout": [ - "Artifacts written to ./build from the image `polywrap-build-env-", + "Artifacts written to ./build", "WRAP manifest written in ./build" ], "exitCode": 0 diff --git a/packages/test-cases/cases/cli/wasm/codegen/005-custom-manifest-file/package.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/001-sanity/package.json similarity index 80% rename from packages/test-cases/cases/cli/wasm/codegen/005-custom-manifest-file/package.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/001-sanity/package.json index 0e7747dc4a..cb32d921d0 100644 --- a/packages/test-cases/cases/cli/wasm/codegen/005-custom-manifest-file/package.json +++ b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/001-sanity/package.json @@ -7,7 +7,7 @@ "build": "polywrap build" }, "dependencies": { - "@polywrap/wasm-as": "0.3.0" + "@polywrap/wasm-as": "../../../../../../../wasm/as" }, "devDependencies": { "assemblyscript": "0.19.5" diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/001-sanity/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/001-sanity/polywrap.build.yaml new file mode 100644 index 0000000000..de1e44ebac --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/001-sanity/polywrap.build.yaml @@ -0,0 +1,9 @@ +format: 0.2.0 +strategies: + image: + node_version: "14.16.0" + include: + - ./package.json +linked_packages: + - name: "@polywrap/wasm-as" + path: ../../../../../../../wasm/as \ No newline at end of file diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/001-sanity/polywrap.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/001-sanity/polywrap.yaml similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/001-sanity/polywrap.yaml rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/001-sanity/polywrap.yaml diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/001-sanity/src/index.ts b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/001-sanity/src/index.ts similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/001-sanity/src/index.ts rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/001-sanity/src/index.ts diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/001-sanity/src/schema.graphql b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/001-sanity/src/schema.graphql similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/001-sanity/src/schema.graphql rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/001-sanity/src/schema.graphql diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/002-invalid-manifest-1/expected/stdout.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/002-invalid-manifest-1/expected/stdout.json new file mode 100644 index 0000000000..1f9d76aae0 --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/002-invalid-manifest-1/expected/stdout.json @@ -0,0 +1,7 @@ +{ + "stderr": [ + "ENOENT", + "wrong/schema.graphql" + ], + "exitCode": 1 +} diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/002-invalid-manifest-1/polywrap.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/002-invalid-manifest-1/polywrap.yaml similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/002-invalid-manifest-1/polywrap.yaml rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/002-invalid-manifest-1/polywrap.yaml diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/003-invalid-manifest-2/expected/stdout.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/003-invalid-manifest-2/expected/stdout.json new file mode 100644 index 0000000000..c42fd3acda --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/003-invalid-manifest-2/expected/stdout.json @@ -0,0 +1,4 @@ +{ + "stderr": "instance is not allowed to have the additional property \"wrong\"", + "exitCode": 1 +} diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/003-invalid-manifest-2/polywrap.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/003-invalid-manifest-2/polywrap.yaml similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/003-invalid-manifest-2/polywrap.yaml rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/003-invalid-manifest-2/polywrap.yaml diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/004-default-build/expected/output.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/004-default-build/expected/output.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/004-default-build/expected/output.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/004-default-build/expected/output.json diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/007-linked-packages/expected/stdout.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/004-default-build/expected/stdout.json similarity index 52% rename from packages/test-cases/cases/cli/wasm/build-cmd/007-linked-packages/expected/stdout.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/004-default-build/expected/stdout.json index f010d65eea..6cbc97b938 100644 --- a/packages/test-cases/cases/cli/wasm/build-cmd/007-linked-packages/expected/stdout.json +++ b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/004-default-build/expected/stdout.json @@ -1,6 +1,6 @@ { "stdout": [ - "Artifacts written to ./build from the image `polywrap-build-env-", + "Artifacts written to ./build", "WRAP manifest written in ./build" ], "exitCode": 0 diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/001-sanity/package.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/004-default-build/package.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/001-sanity/package.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/004-default-build/package.json diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/004-default-build/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/004-default-build/polywrap.build.yaml new file mode 100644 index 0000000000..ee0f37828c --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/004-default-build/polywrap.build.yaml @@ -0,0 +1,11 @@ +format: 0.2.0 +strategies: + image: + node_version: "14.16.0" + include: + - ./src + - ./package.json +linked_packages: + - name: "@polywrap/wasm-as" + path: ../../../../../../../wasm/as + filter: /\.(test|spec)\.(js|ts)$/gm diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/004-default-build/polywrap.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/004-default-build/polywrap.yaml similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/004-default-build/polywrap.yaml rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/004-default-build/polywrap.yaml diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/004-default-build/src/index.ts b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/004-default-build/src/index.ts similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/004-default-build/src/index.ts rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/004-default-build/src/index.ts diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/004-default-build/src/schema.graphql b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/004-default-build/src/schema.graphql similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/004-default-build/src/schema.graphql rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/004-default-build/src/schema.graphql diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/005-default-dockerfile/cmd.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/005-default-dockerfile/cmd.json new file mode 100644 index 0000000000..b918a1f2ab --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/005-default-dockerfile/cmd.json @@ -0,0 +1,3 @@ +{ + "args": ["-s", "image"] +} \ No newline at end of file diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/005-default-dockerfile/expected/output.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/005-default-dockerfile/expected/output.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/005-default-dockerfile/expected/output.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/005-default-dockerfile/expected/output.json diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/005-default-dockerfile/expected/stdout.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/005-default-dockerfile/expected/stdout.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/005-default-dockerfile/expected/stdout.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/005-default-dockerfile/expected/stdout.json diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/004-default-build/package.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/005-default-dockerfile/package.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/004-default-build/package.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/005-default-dockerfile/package.json diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/005-default-dockerfile/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/005-default-dockerfile/polywrap.build.yaml new file mode 100644 index 0000000000..baf96101d3 --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/005-default-dockerfile/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/wasm/build-cmd/005-default-dockerfile/polywrap.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/005-default-dockerfile/polywrap.yaml similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/005-default-dockerfile/polywrap.yaml rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/005-default-dockerfile/polywrap.yaml diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/005-default-dockerfile/src/index.ts b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/005-default-dockerfile/src/index.ts similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/005-default-dockerfile/src/index.ts rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/005-default-dockerfile/src/index.ts diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/005-default-dockerfile/src/schema.graphql b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/005-default-dockerfile/src/schema.graphql similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/005-default-dockerfile/src/schema.graphql rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/005-default-dockerfile/src/schema.graphql diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/006-custom-dockerfile/Dockerfile b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/006-custom-dockerfile/Dockerfile similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/006-custom-dockerfile/Dockerfile rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/006-custom-dockerfile/Dockerfile diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/006-custom-dockerfile/cmd.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/006-custom-dockerfile/cmd.json new file mode 100644 index 0000000000..b918a1f2ab --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/006-custom-dockerfile/cmd.json @@ -0,0 +1,3 @@ +{ + "args": ["-s", "image"] +} \ No newline at end of file diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/006-custom-dockerfile/expected/output.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/006-custom-dockerfile/expected/output.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/006-custom-dockerfile/expected/output.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/006-custom-dockerfile/expected/output.json diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/001-sanity/expected/stdout.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/006-custom-dockerfile/expected/stdout.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/001-sanity/expected/stdout.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/006-custom-dockerfile/expected/stdout.json diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/005-default-dockerfile/package.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/006-custom-dockerfile/package.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/005-default-dockerfile/package.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/006-custom-dockerfile/package.json diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/006-custom-dockerfile/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/006-custom-dockerfile/polywrap.build.yaml new file mode 100644 index 0000000000..835f6709a2 --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/006-custom-dockerfile/polywrap.build.yaml @@ -0,0 +1,11 @@ +format: 0.2.0 +strategies: + image: + dockerfile: ./Dockerfile + 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/wasm/build-cmd/006-custom-dockerfile/polywrap.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/006-custom-dockerfile/polywrap.yaml similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/006-custom-dockerfile/polywrap.yaml rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/006-custom-dockerfile/polywrap.yaml diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/006-custom-dockerfile/src/index.ts b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/006-custom-dockerfile/src/index.ts similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/006-custom-dockerfile/src/index.ts rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/006-custom-dockerfile/src/index.ts diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/006-custom-dockerfile/src/schema.graphql b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/006-custom-dockerfile/src/schema.graphql similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/006-custom-dockerfile/src/schema.graphql rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/006-custom-dockerfile/src/schema.graphql diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/007-linked-packages/expected/output.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/007-linked-packages/expected/output.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/007-linked-packages/expected/output.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/007-linked-packages/expected/output.json diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/004-default-build/expected/stdout.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/007-linked-packages/expected/stdout.json similarity index 52% rename from packages/test-cases/cases/cli/wasm/build-cmd/004-default-build/expected/stdout.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/007-linked-packages/expected/stdout.json index f010d65eea..6cbc97b938 100644 --- a/packages/test-cases/cases/cli/wasm/build-cmd/004-default-build/expected/stdout.json +++ b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/007-linked-packages/expected/stdout.json @@ -1,6 +1,6 @@ { "stdout": [ - "Artifacts written to ./build from the image `polywrap-build-env-", + "Artifacts written to ./build", "WRAP manifest written in ./build" ], "exitCode": 0 diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/006-custom-dockerfile/package.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/007-linked-packages/package.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/006-custom-dockerfile/package.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/007-linked-packages/package.json diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/007-linked-packages/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/007-linked-packages/polywrap.build.yaml new file mode 100644 index 0000000000..ee0f37828c --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/007-linked-packages/polywrap.build.yaml @@ -0,0 +1,11 @@ +format: 0.2.0 +strategies: + image: + node_version: "14.16.0" + include: + - ./src + - ./package.json +linked_packages: + - name: "@polywrap/wasm-as" + path: ../../../../../../../wasm/as + filter: /\.(test|spec)\.(js|ts)$/gm diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/007-linked-packages/polywrap.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/007-linked-packages/polywrap.yaml similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/007-linked-packages/polywrap.yaml rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/007-linked-packages/polywrap.yaml diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/007-linked-packages/src/index.ts b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/007-linked-packages/src/index.ts similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/007-linked-packages/src/index.ts rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/007-linked-packages/src/index.ts diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/007-linked-packages/src/schema.graphql b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/007-linked-packages/src/schema.graphql similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/007-linked-packages/src/schema.graphql rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/007-linked-packages/src/schema.graphql diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/008-metadata/expected/output.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/008-metadata/expected/output.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/008-metadata/expected/output.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/008-metadata/expected/output.json diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/008-metadata/expected/stdout.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/008-metadata/expected/stdout.json similarity index 70% rename from packages/test-cases/cases/cli/wasm/build-cmd/008-metadata/expected/stdout.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/008-metadata/expected/stdout.json index f880aedbd6..bbedbb8b04 100644 --- a/packages/test-cases/cases/cli/wasm/build-cmd/008-metadata/expected/stdout.json +++ b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/008-metadata/expected/stdout.json @@ -1,6 +1,6 @@ { "stdout": [ - "Artifacts written to ./build from the image `polywrap-build-env-", + "Artifacts written to ./build", "build/polywrap.meta.json", "build/meta/links/link.svg", "build/meta/icon/icon.png", diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/008-metadata/meta/icon.png b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/008-metadata/meta/icon.png similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/008-metadata/meta/icon.png rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/008-metadata/meta/icon.png diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/008-metadata/meta/link.svg b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/008-metadata/meta/link.svg similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/008-metadata/meta/link.svg rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/008-metadata/meta/link.svg diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/008-metadata/meta/test.graphql b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/008-metadata/meta/test.graphql similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/008-metadata/meta/test.graphql rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/008-metadata/meta/test.graphql diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/008-metadata/meta/test.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/008-metadata/meta/test.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/008-metadata/meta/test.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/008-metadata/meta/test.json diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/007-linked-packages/package.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/008-metadata/package.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/007-linked-packages/package.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/008-metadata/package.json diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/008-metadata/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/008-metadata/polywrap.build.yaml new file mode 100644 index 0000000000..baf96101d3 --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/008-metadata/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/wasm/build-cmd/008-metadata/polywrap.meta.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/008-metadata/polywrap.meta.yaml similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/008-metadata/polywrap.meta.yaml rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/008-metadata/polywrap.meta.yaml diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/008-metadata/polywrap.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/008-metadata/polywrap.yaml similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/008-metadata/polywrap.yaml rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/008-metadata/polywrap.yaml diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/008-metadata/src/index.ts b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/008-metadata/src/index.ts similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/008-metadata/src/index.ts rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/008-metadata/src/index.ts diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/008-metadata/src/schema.graphql b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/008-metadata/src/schema.graphql similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/008-metadata/src/schema.graphql rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/008-metadata/src/schema.graphql diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/009-docker-buildx/cmd.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/009-docker-buildx/cmd.json new file mode 100644 index 0000000000..b918a1f2ab --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/009-docker-buildx/cmd.json @@ -0,0 +1,3 @@ +{ + "args": ["-s", "image"] +} \ No newline at end of file diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/009-docker-buildx/expected/output.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/009-docker-buildx/expected/output.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/009-docker-buildx/expected/output.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/009-docker-buildx/expected/output.json diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/009-docker-buildx/expected/stdout.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/009-docker-buildx/expected/stdout.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/009-docker-buildx/expected/stdout.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/009-docker-buildx/expected/stdout.json diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/009-docker-buildx/package.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/009-docker-buildx/package.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/009-docker-buildx/package.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/009-docker-buildx/package.json diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/009-docker-buildx/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/009-docker-buildx/polywrap.build.yaml new file mode 100644 index 0000000000..f326253f19 --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/009-docker-buildx/polywrap.build.yaml @@ -0,0 +1,14 @@ +format: 0.2.0 +strategies: + image: + buildx: + cache: true + removeBuilder: true + removeImage: true + 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/wasm/build-cmd/009-docker-buildx/polywrap.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/009-docker-buildx/polywrap.yaml similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/009-docker-buildx/polywrap.yaml rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/009-docker-buildx/polywrap.yaml diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/009-docker-buildx/src/index.ts b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/009-docker-buildx/src/index.ts similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/009-docker-buildx/src/index.ts rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/009-docker-buildx/src/index.ts diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/009-docker-buildx/src/schema.graphql b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/009-docker-buildx/src/schema.graphql similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/009-docker-buildx/src/schema.graphql rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/009-docker-buildx/src/schema.graphql diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/010-custom-config/cmd.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/010-custom-config/cmd.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/010-custom-config/cmd.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/010-custom-config/cmd.json diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/010-custom-config/config.ts b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/010-custom-config/config.ts similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/010-custom-config/config.ts rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/010-custom-config/config.ts diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/010-custom-config/expected/output.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/010-custom-config/expected/output.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/010-custom-config/expected/output.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/010-custom-config/expected/output.json diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/006-custom-dockerfile/expected/stdout.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/010-custom-config/expected/stdout.json similarity index 52% rename from packages/test-cases/cases/cli/wasm/build-cmd/006-custom-dockerfile/expected/stdout.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/010-custom-config/expected/stdout.json index f010d65eea..6cbc97b938 100644 --- a/packages/test-cases/cases/cli/wasm/build-cmd/006-custom-dockerfile/expected/stdout.json +++ b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/010-custom-config/expected/stdout.json @@ -1,6 +1,6 @@ { "stdout": [ - "Artifacts written to ./build from the image `polywrap-build-env-", + "Artifacts written to ./build", "WRAP manifest written in ./build" ], "exitCode": 0 diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/008-metadata/package.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/010-custom-config/package.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/008-metadata/package.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/010-custom-config/package.json diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/010-custom-config/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/010-custom-config/polywrap.build.yaml new file mode 100644 index 0000000000..28c005efc2 --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/010-custom-config/polywrap.build.yaml @@ -0,0 +1,10 @@ +format: 0.2.0 +strategies: + image: + node_version: "16.13.0" + include: + - ./src + - ./package.json +linked_packages: + - name: "@polywrap/wasm-as" + path: ../../../../../../../wasm/as diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/010-custom-config/polywrap.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/010-custom-config/polywrap.yaml similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/010-custom-config/polywrap.yaml rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/010-custom-config/polywrap.yaml diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/010-custom-config/src/index.ts b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/010-custom-config/src/index.ts similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/010-custom-config/src/index.ts rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/010-custom-config/src/index.ts diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/010-custom-config/src/schema.graphql b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/010-custom-config/src/schema.graphql similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/010-custom-config/src/schema.graphql rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/010-custom-config/src/schema.graphql diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/011-custom-config/cmd.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/011-custom-config/cmd.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/011-custom-config/cmd.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/011-custom-config/cmd.json diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/011-custom-config/expected/output.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/011-custom-config/expected/output.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/011-custom-config/expected/output.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/011-custom-config/expected/output.json diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/011-custom-config/expected/stdout.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/011-custom-config/expected/stdout.json new file mode 100644 index 0000000000..6cbc97b938 --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/011-custom-config/expected/stdout.json @@ -0,0 +1,7 @@ +{ + "stdout": [ + "Artifacts written to ./build", + "WRAP manifest written in ./build" + ], + "exitCode": 0 +} diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/010-custom-config/package.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/011-custom-config/package.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/010-custom-config/package.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/011-custom-config/package.json diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/011-custom-config/polywrap.custom.build.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/011-custom-config/polywrap.custom.build.yaml new file mode 100644 index 0000000000..baf96101d3 --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/011-custom-config/polywrap.custom.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/wasm/build-cmd/011-custom-config/polywrap.custom.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/011-custom-config/polywrap.custom.yaml similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/011-custom-config/polywrap.custom.yaml rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/011-custom-config/polywrap.custom.yaml diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/011-custom-config/src/index.ts b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/011-custom-config/src/index.ts similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/011-custom-config/src/index.ts rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/011-custom-config/src/index.ts diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/011-custom-config/src/schema.graphql b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/011-custom-config/src/schema.graphql similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/011-custom-config/src/schema.graphql rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/011-custom-config/src/schema.graphql diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/012-no-codegen/cmd.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/012-no-codegen/cmd.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/012-no-codegen/cmd.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/012-no-codegen/cmd.json diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/012-no-codegen/expected/stdout.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/012-no-codegen/expected/stdout.json similarity index 87% rename from packages/test-cases/cases/cli/wasm/build-cmd/012-no-codegen/expected/stdout.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/012-no-codegen/expected/stdout.json index 2dbc75c10c..5bdbe4e6b9 100644 --- a/packages/test-cases/cases/cli/wasm/build-cmd/012-no-codegen/expected/stdout.json +++ b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/012-no-codegen/expected/stdout.json @@ -1,5 +1,5 @@ { - "stdout": [ + "stderr": [ "Failed to compile Polywrap", "File 'src/wrap/entry.ts' not found" ], diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/011-custom-config/package.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/012-no-codegen/package.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/011-custom-config/package.json rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/012-no-codegen/package.json diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/012-no-codegen/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/012-no-codegen/polywrap.build.yaml new file mode 100644 index 0000000000..baf96101d3 --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/012-no-codegen/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/wasm/build-cmd/012-no-codegen/polywrap.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/012-no-codegen/polywrap.yaml similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/012-no-codegen/polywrap.yaml rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/012-no-codegen/polywrap.yaml diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/012-no-codegen/src/index.ts b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/012-no-codegen/src/index.ts similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/012-no-codegen/src/index.ts rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/012-no-codegen/src/index.ts diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/012-no-codegen/src/schema.graphql b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/012-no-codegen/src/schema.graphql similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/012-no-codegen/src/schema.graphql rename to packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/012-no-codegen/src/schema.graphql diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/013-wrong-language-specific-config/expected/stdout.json b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/013-wrong-language-specific-config/expected/stdout.json new file mode 100644 index 0000000000..c9d7a1f0b9 --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/013-wrong-language-specific-config/expected/stdout.json @@ -0,0 +1,4 @@ +{ + "stderr": "requires property \"include\"", + "exitCode": 1 +} diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/013-wrong-language-specific-config/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/013-wrong-language-specific-config/polywrap.build.yaml new file mode 100644 index 0000000000..f2ba66b01f --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/013-wrong-language-specific-config/polywrap.build.yaml @@ -0,0 +1,4 @@ +format: 0.2.0 +strategies: + image: + node_version: "14.16.0" \ No newline at end of file diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/013-wrong-language-specific-config/polywrap.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/013-wrong-language-specific-config/polywrap.yaml new file mode 100644 index 0000000000..bc49fac9ee --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/013-wrong-language-specific-config/polywrap.yaml @@ -0,0 +1,9 @@ +format: 0.2.0 +project: + name: test-project + type: wasm/assemblyscript +source: + module: ./src/index.ts + schema: ./src/schema.graphql +extensions: + build: ./polywrap.build.yaml \ No newline at end of file diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/013-wrong-language-specific-config/src/schema.graphql b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/013-wrong-language-specific-config/src/schema.graphql new file mode 100644 index 0000000000..3dc66d388a --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/build-cmd/assemblyscript/013-wrong-language-specific-config/src/schema.graphql @@ -0,0 +1,5 @@ +type Module { + method( + arg: String! + ): String! +} \ No newline at end of file diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/rust/001-sanity/Cargo.toml b/packages/test-cases/cases/cli/wasm/build-cmd/rust/001-sanity/Cargo.toml new file mode 100644 index 0000000000..0604b9b1a7 --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/build-cmd/rust/001-sanity/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "module" +version = "0.1.0" +description = "Query module of object-types e2e test" +authors = [ + "Kobby Pentangeli ", + "Jordan Ellis " +] +repository = "https://github.com/polywrap/monorepo" +license = "MIT" +edition = "2021" + +[dependencies] +polywrap-wasm-rs = { path = "../../../../../../../wasm/rs" } +serde = { version = "1.0", features = ["derive"] } + +[lib] +crate-type = ["cdylib"] + +[profile.release] +opt-level = 's' +lto = true +panic = 'abort' diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/rust/001-sanity/expected/output.json b/packages/test-cases/cases/cli/wasm/build-cmd/rust/001-sanity/expected/output.json new file mode 100644 index 0000000000..d91a8e5545 --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/build-cmd/rust/001-sanity/expected/output.json @@ -0,0 +1,4 @@ +[ + "wrap.wasm", + "wrap.info" +] \ No newline at end of file diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/rust/001-sanity/expected/stdout.json b/packages/test-cases/cases/cli/wasm/build-cmd/rust/001-sanity/expected/stdout.json new file mode 100644 index 0000000000..6cbc97b938 --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/build-cmd/rust/001-sanity/expected/stdout.json @@ -0,0 +1,7 @@ +{ + "stdout": [ + "Artifacts written to ./build", + "WRAP manifest written in ./build" + ], + "exitCode": 0 +} diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/rust/001-sanity/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/rust/001-sanity/polywrap.build.yaml new file mode 100644 index 0000000000..0c4cb4ddd3 --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/build-cmd/rust/001-sanity/polywrap.build.yaml @@ -0,0 +1,7 @@ +format: 0.2.0 +strategies: + image: + name: object-types-wasm-rs +linked_packages: + - name: polywrap-wasm-rs + path: ../../../../../../../wasm/rs \ No newline at end of file diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/rust/001-sanity/polywrap.yaml b/packages/test-cases/cases/cli/wasm/build-cmd/rust/001-sanity/polywrap.yaml new file mode 100644 index 0000000000..1c2ee7dcc9 --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/build-cmd/rust/001-sanity/polywrap.yaml @@ -0,0 +1,9 @@ +format: 0.2.0 +project: + name: ObjectTypes + type: wasm/rust +source: + schema: ./schema.graphql + module: ./Cargo.toml +extensions: + build: ./polywrap.build.yaml \ No newline at end of file diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/rust/001-sanity/schema.graphql b/packages/test-cases/cases/cli/wasm/build-cmd/rust/001-sanity/schema.graphql new file mode 100644 index 0000000000..3dc66d388a --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/build-cmd/rust/001-sanity/schema.graphql @@ -0,0 +1,5 @@ +type Module { + method( + arg: String! + ): String! +} \ No newline at end of file diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/rust/001-sanity/src/lib.rs b/packages/test-cases/cases/cli/wasm/build-cmd/rust/001-sanity/src/lib.rs new file mode 100644 index 0000000000..b46b844f2a --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/build-cmd/rust/001-sanity/src/lib.rs @@ -0,0 +1,6 @@ +pub mod wrap; +pub use wrap::*; + +pub fn method(args: wrap::module::ArgsMethod) -> String { + args.arg +} \ No newline at end of file diff --git a/packages/test-cases/cases/cli/wasm/codegen/001-sanity/expected/stdout.json b/packages/test-cases/cases/cli/wasm/codegen/001-sanity-assemblyscript/expected/stdout.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/001-sanity/expected/stdout.json rename to packages/test-cases/cases/cli/wasm/codegen/001-sanity-assemblyscript/expected/stdout.json diff --git a/packages/test-cases/cases/cli/wasm/build-cmd/012-no-codegen/package.json b/packages/test-cases/cases/cli/wasm/codegen/001-sanity-assemblyscript/package.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/build-cmd/012-no-codegen/package.json rename to packages/test-cases/cases/cli/wasm/codegen/001-sanity-assemblyscript/package.json diff --git a/packages/test-cases/cases/cli/wasm/codegen/001-sanity-assemblyscript/polywrap-norun.gen.js b/packages/test-cases/cases/cli/wasm/codegen/001-sanity-assemblyscript/polywrap-norun.gen.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/test-cases/cases/cli/wasm/codegen/001-sanity-assemblyscript/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/codegen/001-sanity-assemblyscript/polywrap.build.yaml new file mode 100644 index 0000000000..42190a0512 --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/codegen/001-sanity-assemblyscript/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/wasm/codegen/001-sanity/polywrap.yaml b/packages/test-cases/cases/cli/wasm/codegen/001-sanity-assemblyscript/polywrap.yaml similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/001-sanity/polywrap.yaml rename to packages/test-cases/cases/cli/wasm/codegen/001-sanity-assemblyscript/polywrap.yaml diff --git a/packages/test-cases/cases/cli/wasm/codegen/001-sanity/schema.graphql b/packages/test-cases/cases/cli/wasm/codegen/001-sanity-assemblyscript/schema.graphql similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/001-sanity/schema.graphql rename to packages/test-cases/cases/cli/wasm/codegen/001-sanity-assemblyscript/schema.graphql diff --git a/packages/test-cases/cases/cli/wasm/codegen/001-sanity/src/index.ts b/packages/test-cases/cases/cli/wasm/codegen/001-sanity-assemblyscript/src/index.ts similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/001-sanity/src/index.ts rename to packages/test-cases/cases/cli/wasm/codegen/001-sanity-assemblyscript/src/index.ts diff --git a/packages/test-cases/cases/cli/wasm/codegen/001-sanity/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/codegen/001-sanity/polywrap.build.yaml deleted file mode 100644 index 3edf63339a..0000000000 --- a/packages/test-cases/cases/cli/wasm/codegen/001-sanity/polywrap.build.yaml +++ /dev/null @@ -1,6 +0,0 @@ -format: 0.1.0 -config: - node_version: "14.16.0" -linked_packages: - - name: "@polywrap/wasm-as" - path: ../../../../../../wasm/as diff --git a/packages/test-cases/cases/cli/wasm/codegen/002-invalid-codegen-script/expected/stdout.json b/packages/test-cases/cases/cli/wasm/codegen/002-invalid-codegen-script/expected/stdout.json deleted file mode 100644 index 6061f31755..0000000000 --- a/packages/test-cases/cases/cli/wasm/codegen/002-invalid-codegen-script/expected/stdout.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "stdout": "Failed to generate types: The generation file provided doesn't have the 'generateBinding' method.", - "exitCode": 1 -} diff --git a/packages/test-cases/cases/cli/wasm/codegen/002-invalid-codegen-script/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/codegen/002-invalid-codegen-script/polywrap.build.yaml deleted file mode 100644 index 3edf63339a..0000000000 --- a/packages/test-cases/cases/cli/wasm/codegen/002-invalid-codegen-script/polywrap.build.yaml +++ /dev/null @@ -1,6 +0,0 @@ -format: 0.1.0 -config: - node_version: "14.16.0" -linked_packages: - - name: "@polywrap/wasm-as" - path: ../../../../../../wasm/as diff --git a/packages/test-cases/cases/cli/wasm/codegen/002-sanity-rust/Cargo.toml b/packages/test-cases/cases/cli/wasm/codegen/002-sanity-rust/Cargo.toml new file mode 100644 index 0000000000..c665c1350b --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/codegen/002-sanity-rust/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "module" +version = "0.1.0" +description = "Query module of object-types e2e test" +authors = [ + "Kobby Pentangeli ", + "Jordan Ellis " +] +repository = "https://github.com/polywrap/monorepo" +license = "MIT" +edition = "2021" + +[dependencies] +polywrap-wasm-rs = "0.6.0" +serde = { version = "1.0", features = ["derive"] } + +[lib] +crate-type = ["cdylib"] + +[profile.release] +opt-level = 's' +lto = true +panic = 'abort' diff --git a/packages/test-cases/cases/cli/wasm/codegen/005-custom-manifest-file/expected/stdout.json b/packages/test-cases/cases/cli/wasm/codegen/002-sanity-rust/expected/stdout.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/005-custom-manifest-file/expected/stdout.json rename to packages/test-cases/cases/cli/wasm/codegen/002-sanity-rust/expected/stdout.json diff --git a/packages/test-cases/cases/cli/wasm/codegen/002-sanity-rust/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/codegen/002-sanity-rust/polywrap.build.yaml new file mode 100644 index 0000000000..c506920d92 --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/codegen/002-sanity-rust/polywrap.build.yaml @@ -0,0 +1,4 @@ +format: 0.2.0 +strategies: + image: + name: object-types-wasm-rs \ No newline at end of file diff --git a/packages/test-cases/cases/cli/wasm/codegen/002-sanity-rust/polywrap.yaml b/packages/test-cases/cases/cli/wasm/codegen/002-sanity-rust/polywrap.yaml new file mode 100644 index 0000000000..1c2ee7dcc9 --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/codegen/002-sanity-rust/polywrap.yaml @@ -0,0 +1,9 @@ +format: 0.2.0 +project: + name: ObjectTypes + type: wasm/rust +source: + schema: ./schema.graphql + module: ./Cargo.toml +extensions: + build: ./polywrap.build.yaml \ No newline at end of file diff --git a/packages/test-cases/cases/cli/wasm/codegen/002-sanity-rust/schema.graphql b/packages/test-cases/cases/cli/wasm/codegen/002-sanity-rust/schema.graphql new file mode 100644 index 0000000000..3dc66d388a --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/codegen/002-sanity-rust/schema.graphql @@ -0,0 +1,5 @@ +type Module { + method( + arg: String! + ): String! +} \ No newline at end of file diff --git a/packages/test-cases/cases/cli/wasm/codegen/002-sanity-rust/src/lib.rs b/packages/test-cases/cases/cli/wasm/codegen/002-sanity-rust/src/lib.rs new file mode 100644 index 0000000000..b46b844f2a --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/codegen/002-sanity-rust/src/lib.rs @@ -0,0 +1,6 @@ +pub mod wrap; +pub use wrap::*; + +pub fn method(args: wrap::module::ArgsMethod) -> String { + args.arg +} \ No newline at end of file diff --git a/packages/test-cases/cases/cli/wasm/codegen/003-codegen-script/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/codegen/003-codegen-script/polywrap.build.yaml deleted file mode 100644 index 3edf63339a..0000000000 --- a/packages/test-cases/cases/cli/wasm/codegen/003-codegen-script/polywrap.build.yaml +++ /dev/null @@ -1,6 +0,0 @@ -format: 0.1.0 -config: - node_version: "14.16.0" -linked_packages: - - name: "@polywrap/wasm-as" - path: ../../../../../../wasm/as diff --git a/packages/test-cases/cases/cli/wasm/codegen/002-invalid-codegen-script/cmd.json b/packages/test-cases/cases/cli/wasm/codegen/003-invalid-codegen-script/cmd.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/002-invalid-codegen-script/cmd.json rename to packages/test-cases/cases/cli/wasm/codegen/003-invalid-codegen-script/cmd.json diff --git a/packages/test-cases/cases/cli/wasm/codegen/003-invalid-codegen-script/expected/stdout.json b/packages/test-cases/cases/cli/wasm/codegen/003-invalid-codegen-script/expected/stdout.json new file mode 100644 index 0000000000..91a3e377a4 --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/codegen/003-invalid-codegen-script/expected/stdout.json @@ -0,0 +1,4 @@ +{ + "stderr": "The generation file provided doesn't have the 'generateBinding' method.", + "exitCode": 1 +} diff --git a/packages/test-cases/cases/cli/wasm/codegen/001-sanity/package.json b/packages/test-cases/cases/cli/wasm/codegen/003-invalid-codegen-script/package.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/001-sanity/package.json rename to packages/test-cases/cases/cli/wasm/codegen/003-invalid-codegen-script/package.json diff --git a/packages/test-cases/cases/cli/wasm/codegen/002-invalid-codegen-script/polywrap-norun.gen.js b/packages/test-cases/cases/cli/wasm/codegen/003-invalid-codegen-script/polywrap-norun.gen.js similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/002-invalid-codegen-script/polywrap-norun.gen.js rename to packages/test-cases/cases/cli/wasm/codegen/003-invalid-codegen-script/polywrap-norun.gen.js diff --git a/packages/test-cases/cases/cli/wasm/codegen/003-invalid-codegen-script/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/codegen/003-invalid-codegen-script/polywrap.build.yaml new file mode 100644 index 0000000000..42190a0512 --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/codegen/003-invalid-codegen-script/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/wasm/codegen/002-invalid-codegen-script/polywrap.yaml b/packages/test-cases/cases/cli/wasm/codegen/003-invalid-codegen-script/polywrap.yaml similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/002-invalid-codegen-script/polywrap.yaml rename to packages/test-cases/cases/cli/wasm/codegen/003-invalid-codegen-script/polywrap.yaml diff --git a/packages/test-cases/cases/cli/wasm/codegen/002-invalid-codegen-script/schema.graphql b/packages/test-cases/cases/cli/wasm/codegen/003-invalid-codegen-script/schema.graphql similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/002-invalid-codegen-script/schema.graphql rename to packages/test-cases/cases/cli/wasm/codegen/003-invalid-codegen-script/schema.graphql diff --git a/packages/test-cases/cases/cli/wasm/codegen/002-invalid-codegen-script/src/index.ts b/packages/test-cases/cases/cli/wasm/codegen/003-invalid-codegen-script/src/index.ts similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/002-invalid-codegen-script/src/index.ts rename to packages/test-cases/cases/cli/wasm/codegen/003-invalid-codegen-script/src/index.ts diff --git a/packages/test-cases/cases/cli/wasm/codegen/002-invalid-codegen-script/templates/schema.mustache b/packages/test-cases/cases/cli/wasm/codegen/003-invalid-codegen-script/templates/schema.mustache similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/002-invalid-codegen-script/templates/schema.mustache rename to packages/test-cases/cases/cli/wasm/codegen/003-invalid-codegen-script/templates/schema.mustache diff --git a/packages/test-cases/cases/cli/wasm/codegen/003-codegen-script/cmd.json b/packages/test-cases/cases/cli/wasm/codegen/004-codegen-script/cmd.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/003-codegen-script/cmd.json rename to packages/test-cases/cases/cli/wasm/codegen/004-codegen-script/cmd.json diff --git a/packages/test-cases/cases/cli/wasm/codegen/003-codegen-script/expected/stdout.json b/packages/test-cases/cases/cli/wasm/codegen/004-codegen-script/expected/stdout.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/003-codegen-script/expected/stdout.json rename to packages/test-cases/cases/cli/wasm/codegen/004-codegen-script/expected/stdout.json diff --git a/packages/test-cases/cases/cli/wasm/codegen/002-invalid-codegen-script/package.json b/packages/test-cases/cases/cli/wasm/codegen/004-codegen-script/package.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/002-invalid-codegen-script/package.json rename to packages/test-cases/cases/cli/wasm/codegen/004-codegen-script/package.json diff --git a/packages/test-cases/cases/cli/wasm/codegen/004-codegen-script/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/codegen/004-codegen-script/polywrap.build.yaml new file mode 100644 index 0000000000..42190a0512 --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/codegen/004-codegen-script/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/wasm/codegen/003-codegen-script/polywrap.gen.ts b/packages/test-cases/cases/cli/wasm/codegen/004-codegen-script/polywrap.gen.ts similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/003-codegen-script/polywrap.gen.ts rename to packages/test-cases/cases/cli/wasm/codegen/004-codegen-script/polywrap.gen.ts diff --git a/packages/test-cases/cases/cli/wasm/codegen/003-codegen-script/polywrap.yaml b/packages/test-cases/cases/cli/wasm/codegen/004-codegen-script/polywrap.yaml similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/003-codegen-script/polywrap.yaml rename to packages/test-cases/cases/cli/wasm/codegen/004-codegen-script/polywrap.yaml diff --git a/packages/test-cases/cases/cli/wasm/codegen/003-codegen-script/schema.graphql b/packages/test-cases/cases/cli/wasm/codegen/004-codegen-script/schema.graphql similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/003-codegen-script/schema.graphql rename to packages/test-cases/cases/cli/wasm/codegen/004-codegen-script/schema.graphql diff --git a/packages/test-cases/cases/cli/wasm/codegen/003-codegen-script/src/index.ts b/packages/test-cases/cases/cli/wasm/codegen/004-codegen-script/src/index.ts similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/003-codegen-script/src/index.ts rename to packages/test-cases/cases/cli/wasm/codegen/004-codegen-script/src/index.ts diff --git a/packages/test-cases/cases/cli/wasm/codegen/003-codegen-script/templates/schema.mustache b/packages/test-cases/cases/cli/wasm/codegen/004-codegen-script/templates/schema.mustache similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/003-codegen-script/templates/schema.mustache rename to packages/test-cases/cases/cli/wasm/codegen/004-codegen-script/templates/schema.mustache diff --git a/packages/test-cases/cases/cli/wasm/codegen/004-custom-config/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/codegen/004-custom-config/polywrap.build.yaml deleted file mode 100644 index 3edf63339a..0000000000 --- a/packages/test-cases/cases/cli/wasm/codegen/004-custom-config/polywrap.build.yaml +++ /dev/null @@ -1,6 +0,0 @@ -format: 0.1.0 -config: - node_version: "14.16.0" -linked_packages: - - name: "@polywrap/wasm-as" - path: ../../../../../../wasm/as diff --git a/packages/test-cases/cases/cli/wasm/codegen/004-custom-config/cmd.json b/packages/test-cases/cases/cli/wasm/codegen/005-custom-config/cmd.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/004-custom-config/cmd.json rename to packages/test-cases/cases/cli/wasm/codegen/005-custom-config/cmd.json diff --git a/packages/test-cases/cases/cli/wasm/codegen/004-custom-config/config.ts b/packages/test-cases/cases/cli/wasm/codegen/005-custom-config/config.ts similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/004-custom-config/config.ts rename to packages/test-cases/cases/cli/wasm/codegen/005-custom-config/config.ts diff --git a/packages/test-cases/cases/cli/wasm/codegen/004-custom-config/expected/stdout.json b/packages/test-cases/cases/cli/wasm/codegen/005-custom-config/expected/stdout.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/004-custom-config/expected/stdout.json rename to packages/test-cases/cases/cli/wasm/codegen/005-custom-config/expected/stdout.json diff --git a/packages/test-cases/cases/cli/wasm/codegen/003-codegen-script/package.json b/packages/test-cases/cases/cli/wasm/codegen/005-custom-config/package.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/003-codegen-script/package.json rename to packages/test-cases/cases/cli/wasm/codegen/005-custom-config/package.json diff --git a/packages/test-cases/cases/cli/wasm/codegen/005-custom-config/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/codegen/005-custom-config/polywrap.build.yaml new file mode 100644 index 0000000000..42190a0512 --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/codegen/005-custom-config/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/wasm/codegen/004-custom-config/polywrap.yaml b/packages/test-cases/cases/cli/wasm/codegen/005-custom-config/polywrap.yaml similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/004-custom-config/polywrap.yaml rename to packages/test-cases/cases/cli/wasm/codegen/005-custom-config/polywrap.yaml diff --git a/packages/test-cases/cases/cli/wasm/codegen/004-custom-config/schema.graphql b/packages/test-cases/cases/cli/wasm/codegen/005-custom-config/schema.graphql similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/004-custom-config/schema.graphql rename to packages/test-cases/cases/cli/wasm/codegen/005-custom-config/schema.graphql diff --git a/packages/test-cases/cases/cli/wasm/codegen/004-custom-config/src/index.ts b/packages/test-cases/cases/cli/wasm/codegen/005-custom-config/src/index.ts similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/004-custom-config/src/index.ts rename to packages/test-cases/cases/cli/wasm/codegen/005-custom-config/src/index.ts diff --git a/packages/test-cases/cases/cli/wasm/codegen/005-custom-manifest-file/polywrap.custom.build.yaml b/packages/test-cases/cases/cli/wasm/codegen/005-custom-manifest-file/polywrap.custom.build.yaml deleted file mode 100644 index 3edf63339a..0000000000 --- a/packages/test-cases/cases/cli/wasm/codegen/005-custom-manifest-file/polywrap.custom.build.yaml +++ /dev/null @@ -1,6 +0,0 @@ -format: 0.1.0 -config: - node_version: "14.16.0" -linked_packages: - - name: "@polywrap/wasm-as" - path: ../../../../../../wasm/as diff --git a/packages/test-cases/cases/cli/wasm/codegen/005-custom-manifest-file/cmd.json b/packages/test-cases/cases/cli/wasm/codegen/006-custom-manifest-file/cmd.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/005-custom-manifest-file/cmd.json rename to packages/test-cases/cases/cli/wasm/codegen/006-custom-manifest-file/cmd.json diff --git a/packages/test-cases/cases/cli/wasm/codegen/006-custom-manifest-file/expected/stdout.json b/packages/test-cases/cases/cli/wasm/codegen/006-custom-manifest-file/expected/stdout.json new file mode 100644 index 0000000000..735a6dca2c --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/codegen/006-custom-manifest-file/expected/stdout.json @@ -0,0 +1,4 @@ +{ + "stdout": "Types were generated successfully", + "exitCode": 0 +} diff --git a/packages/test-cases/cases/cli/wasm/codegen/004-custom-config/package.json b/packages/test-cases/cases/cli/wasm/codegen/006-custom-manifest-file/package.json similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/004-custom-config/package.json rename to packages/test-cases/cases/cli/wasm/codegen/006-custom-manifest-file/package.json diff --git a/packages/test-cases/cases/cli/wasm/codegen/006-custom-manifest-file/polywrap.custom.build.yaml b/packages/test-cases/cases/cli/wasm/codegen/006-custom-manifest-file/polywrap.custom.build.yaml new file mode 100644 index 0000000000..42190a0512 --- /dev/null +++ b/packages/test-cases/cases/cli/wasm/codegen/006-custom-manifest-file/polywrap.custom.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/wasm/codegen/005-custom-manifest-file/polywrap.custom.yaml b/packages/test-cases/cases/cli/wasm/codegen/006-custom-manifest-file/polywrap.custom.yaml similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/005-custom-manifest-file/polywrap.custom.yaml rename to packages/test-cases/cases/cli/wasm/codegen/006-custom-manifest-file/polywrap.custom.yaml diff --git a/packages/test-cases/cases/cli/wasm/codegen/005-custom-manifest-file/schema.graphql b/packages/test-cases/cases/cli/wasm/codegen/006-custom-manifest-file/schema.graphql similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/005-custom-manifest-file/schema.graphql rename to packages/test-cases/cases/cli/wasm/codegen/006-custom-manifest-file/schema.graphql diff --git a/packages/test-cases/cases/cli/wasm/codegen/005-custom-manifest-file/src/index.ts b/packages/test-cases/cases/cli/wasm/codegen/006-custom-manifest-file/src/index.ts similarity index 100% rename from packages/test-cases/cases/cli/wasm/codegen/005-custom-manifest-file/src/index.ts rename to packages/test-cases/cases/cli/wasm/codegen/006-custom-manifest-file/src/index.ts diff --git a/packages/test-cases/cases/cli/wasm/deploy/001-sanity/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/deploy/001-sanity/polywrap.build.yaml index 66be618ca5..85012ffe6c 100644 --- a/packages/test-cases/cases/cli/wasm/deploy/001-sanity/polywrap.build.yaml +++ b/packages/test-cases/cases/cli/wasm/deploy/001-sanity/polywrap.build.yaml @@ -1,6 +1,10 @@ -format: 0.1.0 -config: - node_version: "14.16.0" +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/wasm/deploy/002-no-ext/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/deploy/002-no-ext/polywrap.build.yaml index 3edf63339a..42190a0512 100644 --- a/packages/test-cases/cases/cli/wasm/deploy/002-no-ext/polywrap.build.yaml +++ b/packages/test-cases/cases/cli/wasm/deploy/002-no-ext/polywrap.build.yaml @@ -1,6 +1,10 @@ -format: 0.1.0 -config: - node_version: "14.16.0" +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/wasm/deploy/003-invalid-config/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/deploy/003-invalid-config/polywrap.build.yaml index 66be618ca5..85012ffe6c 100644 --- a/packages/test-cases/cases/cli/wasm/deploy/003-invalid-config/polywrap.build.yaml +++ b/packages/test-cases/cases/cli/wasm/deploy/003-invalid-config/polywrap.build.yaml @@ -1,6 +1,10 @@ -format: 0.1.0 -config: - node_version: "14.16.0" +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/wasm/deploy/004-fail-between/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/deploy/004-fail-between/polywrap.build.yaml index 66be618ca5..85012ffe6c 100644 --- a/packages/test-cases/cases/cli/wasm/deploy/004-fail-between/polywrap.build.yaml +++ b/packages/test-cases/cases/cli/wasm/deploy/004-fail-between/polywrap.build.yaml @@ -1,6 +1,10 @@ -format: 0.1.0 -config: - node_version: "14.16.0" +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/wasm/deploy/005-non-loaded-env-var/polywrap.build.yaml b/packages/test-cases/cases/cli/wasm/deploy/005-non-loaded-env-var/polywrap.build.yaml index 66be618ca5..85012ffe6c 100644 --- a/packages/test-cases/cases/cli/wasm/deploy/005-non-loaded-env-var/polywrap.build.yaml +++ b/packages/test-cases/cases/cli/wasm/deploy/005-non-loaded-env-var/polywrap.build.yaml @@ -1,6 +1,10 @@ -format: 0.1.0 -config: - node_version: "14.16.0" +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/wrappers/wasm-as/asyncify/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-as/asyncify/polywrap.build.yaml index 556b3c10d4..ca4fdc7bcf 100644 --- a/packages/test-cases/cases/wrappers/wasm-as/asyncify/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-as/asyncify/polywrap.build.yaml @@ -1,8 +1,10 @@ -format: 0.1.0 -docker: - name: asyncify-wasm-as -config: - node_version: "14.16.0" +format: 0.2.0 +strategies: + image: + name: asyncify-wasm-as + node_version: "14.16.0" + include: + - ./package.json linked_packages: - name: "@polywrap/wasm-as" path: ../../../../../wasm/as diff --git a/packages/test-cases/cases/wrappers/wasm-as/bigint-type/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-as/bigint-type/polywrap.build.yaml index 91d51bc08f..e3559b2e91 100644 --- a/packages/test-cases/cases/wrappers/wasm-as/bigint-type/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-as/bigint-type/polywrap.build.yaml @@ -1,8 +1,10 @@ -format: 0.1.0 -docker: - name: bigint-type-wasm-as -config: - node_version: "14.16.0" +format: 0.2.0 +strategies: + image: + name: bigint-type-wasm-as + node_version: "14.16.0" + include: + - ./package.json linked_packages: - name: "@polywrap/wasm-as" path: ../../../../../wasm/as diff --git a/packages/test-cases/cases/wrappers/wasm-as/bignumber-type/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-as/bignumber-type/polywrap.build.yaml index 53c5caa649..25dd42b6d4 100644 --- a/packages/test-cases/cases/wrappers/wasm-as/bignumber-type/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-as/bignumber-type/polywrap.build.yaml @@ -1,8 +1,10 @@ -format: 0.1.0 -docker: - name: bignumber-type-wasm-as -config: - node_version: "14.16.0" +format: 0.2.0 +strategies: + image: + name: bignumber-type-wasm-as + node_version: "14.16.0" + include: + - ./package.json linked_packages: - name: "@polywrap/wasm-as" path: ../../../../../wasm/as diff --git a/packages/test-cases/cases/wrappers/wasm-as/bytes-type/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-as/bytes-type/polywrap.build.yaml index bc5f2dedcb..20b3987380 100644 --- a/packages/test-cases/cases/wrappers/wasm-as/bytes-type/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-as/bytes-type/polywrap.build.yaml @@ -1,8 +1,10 @@ -format: 0.1.0 -docker: - name: bytes-type-wasm-as -config: - node_version: "14.16.0" +format: 0.2.0 +strategies: + image: + name: bytes-type-wasm-as + node_version: "14.16.0" + include: + - ./package.json linked_packages: - name: "@polywrap/wasm-as" path: ../../../../../wasm/as diff --git a/packages/test-cases/cases/wrappers/wasm-as/enum-types/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-as/enum-types/polywrap.build.yaml index 66be618ca5..85012ffe6c 100644 --- a/packages/test-cases/cases/wrappers/wasm-as/enum-types/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-as/enum-types/polywrap.build.yaml @@ -1,6 +1,10 @@ -format: 0.1.0 -config: - node_version: "14.16.0" +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/wrappers/wasm-as/env-types/external/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-as/env-types/external/polywrap.build.yaml index b4b579cce2..59521cf0fa 100644 --- a/packages/test-cases/cases/wrappers/wasm-as/env-types/external/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-as/env-types/external/polywrap.build.yaml @@ -1,8 +1,10 @@ -format: 0.1.0 -config: - node_version: "16.13.0" - include: - - ./src +format: 0.2.0 +strategies: + image: + node_version: "16.13.0" + include: + - ./src + - ./package.json linked_packages: - name: "@polywrap/wasm-as" path: ../../../../../../wasm/as diff --git a/packages/test-cases/cases/wrappers/wasm-as/env-types/main/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-as/env-types/main/polywrap.build.yaml index b4b579cce2..59521cf0fa 100644 --- a/packages/test-cases/cases/wrappers/wasm-as/env-types/main/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-as/env-types/main/polywrap.build.yaml @@ -1,8 +1,10 @@ -format: 0.1.0 -config: - node_version: "16.13.0" - include: - - ./src +format: 0.2.0 +strategies: + image: + node_version: "16.13.0" + include: + - ./src + - ./package.json linked_packages: - name: "@polywrap/wasm-as" path: ../../../../../../wasm/as diff --git a/packages/test-cases/cases/wrappers/wasm-as/implementations/test-use-getImpl/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-as/implementations/test-use-getImpl/polywrap.build.yaml index 4c3780ab1f..103a23f553 100644 --- a/packages/test-cases/cases/wrappers/wasm-as/implementations/test-use-getImpl/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-as/implementations/test-use-getImpl/polywrap.build.yaml @@ -1,8 +1,11 @@ -format: 0.1.0 -docker: - name: test-use-get-impl-wasm-as -config: - node_version: "14.16.0" +format: 0.2.0 +strategies: + image: + name: test-use-get-impl-wasm-as + 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/wrappers/wasm-as/implementations/test-wrapper/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-as/implementations/test-wrapper/polywrap.build.yaml index 3edf63339a..42190a0512 100644 --- a/packages/test-cases/cases/wrappers/wasm-as/implementations/test-wrapper/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-as/implementations/test-wrapper/polywrap.build.yaml @@ -1,6 +1,10 @@ -format: 0.1.0 -config: - node_version: "14.16.0" +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/wrappers/wasm-as/interface-invoke/test-implementation/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-as/interface-invoke/test-implementation/polywrap.build.yaml index 3edf63339a..42190a0512 100644 --- a/packages/test-cases/cases/wrappers/wasm-as/interface-invoke/test-implementation/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-as/interface-invoke/test-implementation/polywrap.build.yaml @@ -1,6 +1,10 @@ -format: 0.1.0 -config: - node_version: "14.16.0" +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/wrappers/wasm-as/interface-invoke/test-wrapper/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-as/interface-invoke/test-wrapper/polywrap.build.yaml index 3edf63339a..42190a0512 100644 --- a/packages/test-cases/cases/wrappers/wasm-as/interface-invoke/test-wrapper/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-as/interface-invoke/test-wrapper/polywrap.build.yaml @@ -1,6 +1,10 @@ -format: 0.1.0 -config: - node_version: "14.16.0" +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/wrappers/wasm-as/invalid-types/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-as/invalid-types/polywrap.build.yaml index 66be618ca5..85012ffe6c 100644 --- a/packages/test-cases/cases/wrappers/wasm-as/invalid-types/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-as/invalid-types/polywrap.build.yaml @@ -1,6 +1,10 @@ -format: 0.1.0 -config: - node_version: "14.16.0" +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/wrappers/wasm-as/json-type/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-as/json-type/polywrap.build.yaml index 66be618ca5..85012ffe6c 100644 --- a/packages/test-cases/cases/wrappers/wasm-as/json-type/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-as/json-type/polywrap.build.yaml @@ -1,6 +1,10 @@ -format: 0.1.0 -config: - node_version: "14.16.0" +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/wrappers/wasm-as/large-types/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-as/large-types/polywrap.build.yaml index 66be618ca5..85012ffe6c 100644 --- a/packages/test-cases/cases/wrappers/wasm-as/large-types/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-as/large-types/polywrap.build.yaml @@ -1,6 +1,10 @@ -format: 0.1.0 -config: - node_version: "14.16.0" +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/wrappers/wasm-as/map-type/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-as/map-type/polywrap.build.yaml index 66be618ca5..85012ffe6c 100644 --- a/packages/test-cases/cases/wrappers/wasm-as/map-type/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-as/map-type/polywrap.build.yaml @@ -1,6 +1,10 @@ -format: 0.1.0 -config: - node_version: "14.16.0" +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/wrappers/wasm-as/number-types/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-as/number-types/polywrap.build.yaml index 66be618ca5..85012ffe6c 100644 --- a/packages/test-cases/cases/wrappers/wasm-as/number-types/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-as/number-types/polywrap.build.yaml @@ -1,6 +1,10 @@ -format: 0.1.0 -config: - node_version: "14.16.0" +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/wrappers/wasm-as/object-types/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-as/object-types/polywrap.build.yaml index 66be618ca5..85012ffe6c 100644 --- a/packages/test-cases/cases/wrappers/wasm-as/object-types/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-as/object-types/polywrap.build.yaml @@ -1,6 +1,10 @@ -format: 0.1.0 -config: - node_version: "14.16.0" +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/wrappers/wasm-as/reserved-words/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-as/reserved-words/polywrap.build.yaml index 66be618ca5..8adbc7f80e 100644 --- a/packages/test-cases/cases/wrappers/wasm-as/reserved-words/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-as/reserved-words/polywrap.build.yaml @@ -1,6 +1,11 @@ -format: 0.1.0 -config: - node_version: "14.16.0" +format: 0.2.0 +strategies: + image: + name: template-wasm-as + 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/wrappers/wasm-as/simple-calculator/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-as/simple-calculator/polywrap.build.yaml index 6b6299c520..460dad866f 100644 --- a/packages/test-cases/cases/wrappers/wasm-as/simple-calculator/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-as/simple-calculator/polywrap.build.yaml @@ -1,8 +1,10 @@ -format: 0.1.0 -config: - node_version: "16.13.0" - include: - - ./src +format: 0.2.0 +strategies: + image: + node_version: "16.13.0" + include: + - ./src + - ./package.json linked_packages: - name: "@polywrap/wasm-as" path: ../../../../../wasm/as diff --git a/packages/test-cases/cases/wrappers/wasm-as/simple-env-types/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-as/simple-env-types/polywrap.build.yaml index 6b6299c520..460dad866f 100644 --- a/packages/test-cases/cases/wrappers/wasm-as/simple-env-types/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-as/simple-env-types/polywrap.build.yaml @@ -1,8 +1,10 @@ -format: 0.1.0 -config: - node_version: "16.13.0" - include: - - ./src +format: 0.2.0 +strategies: + image: + node_version: "16.13.0" + include: + - ./src + - ./package.json linked_packages: - name: "@polywrap/wasm-as" path: ../../../../../wasm/as diff --git a/packages/test-cases/cases/wrappers/wasm-as/simple-fs-resolver/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-as/simple-fs-resolver/polywrap.build.yaml index 6b6299c520..460dad866f 100644 --- a/packages/test-cases/cases/wrappers/wasm-as/simple-fs-resolver/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-as/simple-fs-resolver/polywrap.build.yaml @@ -1,8 +1,10 @@ -format: 0.1.0 -config: - node_version: "16.13.0" - include: - - ./src +format: 0.2.0 +strategies: + image: + node_version: "16.13.0" + include: + - ./src + - ./package.json linked_packages: - name: "@polywrap/wasm-as" path: ../../../../../wasm/as diff --git a/packages/test-cases/cases/wrappers/wasm-as/simple-memory/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-as/simple-memory/polywrap.build.yaml index 6b6299c520..460dad866f 100644 --- a/packages/test-cases/cases/wrappers/wasm-as/simple-memory/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-as/simple-memory/polywrap.build.yaml @@ -1,8 +1,10 @@ -format: 0.1.0 -config: - node_version: "16.13.0" - include: - - ./src +format: 0.2.0 +strategies: + image: + node_version: "16.13.0" + include: + - ./src + - ./package.json linked_packages: - name: "@polywrap/wasm-as" path: ../../../../../wasm/as diff --git a/packages/test-cases/cases/wrappers/wasm-as/simple-redirect-resolver/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-as/simple-redirect-resolver/polywrap.build.yaml index 6b6299c520..460dad866f 100644 --- a/packages/test-cases/cases/wrappers/wasm-as/simple-redirect-resolver/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-as/simple-redirect-resolver/polywrap.build.yaml @@ -1,8 +1,10 @@ -format: 0.1.0 -config: - node_version: "16.13.0" - include: - - ./src +format: 0.2.0 +strategies: + image: + node_version: "16.13.0" + include: + - ./src + - ./package.json linked_packages: - name: "@polywrap/wasm-as" path: ../../../../../wasm/as diff --git a/packages/test-cases/cases/wrappers/wasm-as/simple-storage/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-as/simple-storage/polywrap.build.yaml index b9194be16c..85012ffe6c 100644 --- a/packages/test-cases/cases/wrappers/wasm-as/simple-storage/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-as/simple-storage/polywrap.build.yaml @@ -1,8 +1,10 @@ -format: 0.1.0 -config: - node_version: "14.16.0" - include: - - ./src +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/wrappers/wasm-as/simple/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-as/simple/polywrap.build.yaml index 6b6299c520..85012ffe6c 100644 --- a/packages/test-cases/cases/wrappers/wasm-as/simple/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-as/simple/polywrap.build.yaml @@ -1,8 +1,10 @@ -format: 0.1.0 -config: - node_version: "16.13.0" - include: - - ./src +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/wrappers/wasm-rs/asyncify/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-rs/asyncify/polywrap.build.yaml index 1372f332bc..76ec41bfbc 100644 --- a/packages/test-cases/cases/wrappers/wasm-rs/asyncify/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-rs/asyncify/polywrap.build.yaml @@ -1,6 +1,7 @@ -format: 0.1.0 -docker: - name: asyncify-wasm-rs +format: 0.2.0 +strategies: + image: + name: asyncify-wasm-rs linked_packages: - name: polywrap-wasm-rs path: ../../../../../wasm/rs diff --git a/packages/test-cases/cases/wrappers/wasm-rs/benchmarks/polywrap-current.build.yaml b/packages/test-cases/cases/wrappers/wasm-rs/benchmarks/polywrap-current.build.yaml index 34273c0f89..732ad4622d 100644 --- a/packages/test-cases/cases/wrappers/wasm-rs/benchmarks/polywrap-current.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-rs/benchmarks/polywrap-current.build.yaml @@ -1,6 +1,7 @@ -format: 0.1.0 -docker: - name: benchmark-type-wasm-rs +format: 0.2.0 +strategies: + image: + name: benchmark-type-wasm-rs dockerfile: ./Dockerfile linked_packages: - name: polywrap-wasm-rs diff --git a/packages/test-cases/cases/wrappers/wasm-rs/benchmarks/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-rs/benchmarks/polywrap.build.yaml index 32d37799e7..ca70952a7d 100644 --- a/packages/test-cases/cases/wrappers/wasm-rs/benchmarks/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-rs/benchmarks/polywrap.build.yaml @@ -1,6 +1,7 @@ -format: 0.1.0 -docker: - name: benchmark-type-wasm-rs +format: 0.2.0 +strategies: + image: + name: benchmark-type-wasm-rs linked_packages: - name: polywrap-wasm-rs path: ../../../../../wasm/rs diff --git a/packages/test-cases/cases/wrappers/wasm-rs/bigint-type/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-rs/bigint-type/polywrap.build.yaml index 9ca4fbdb48..87de85ff73 100644 --- a/packages/test-cases/cases/wrappers/wasm-rs/bigint-type/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-rs/bigint-type/polywrap.build.yaml @@ -1,6 +1,7 @@ -format: 0.1.0 -docker: - name: bigint-type-wasm-rs +format: 0.2.0 +strategies: + image: + name: bigint-type-wasm-rs linked_packages: - name: polywrap-wasm-rs path: ../../../../../wasm/rs diff --git a/packages/test-cases/cases/wrappers/wasm-rs/bignumber-type/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-rs/bignumber-type/polywrap.build.yaml index 0220ec489c..57e7c5be86 100644 --- a/packages/test-cases/cases/wrappers/wasm-rs/bignumber-type/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-rs/bignumber-type/polywrap.build.yaml @@ -1,6 +1,7 @@ -format: 0.1.0 -docker: - name: bignumber-type-wasm-rs +format: 0.2.0 +strategies: + image: + name: bignumber-type-wasm-rs linked_packages: - name: polywrap-wasm-rs path: ../../../../../wasm/rs diff --git a/packages/test-cases/cases/wrappers/wasm-rs/bytes-type/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-rs/bytes-type/polywrap.build.yaml index 51d6fb1b9a..a5bd18b72c 100644 --- a/packages/test-cases/cases/wrappers/wasm-rs/bytes-type/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-rs/bytes-type/polywrap.build.yaml @@ -1,6 +1,7 @@ -format: 0.1.0 -docker: - name: bytes-type-wasm-rs +format: 0.2.0 +strategies: + image: + name: bytes-type-wasm-rs linked_packages: - name: polywrap-wasm-rs path: ../../../../../wasm/rs diff --git a/packages/test-cases/cases/wrappers/wasm-rs/enum-types/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-rs/enum-types/polywrap.build.yaml index ddd8e032f0..a062703495 100644 --- a/packages/test-cases/cases/wrappers/wasm-rs/enum-types/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-rs/enum-types/polywrap.build.yaml @@ -1,6 +1,7 @@ -format: 0.1.0 -docker: - name: enum-types-wasm-rs +format: 0.2.0 +strategies: + image: + name: enum-types-wasm-rs linked_packages: - name: polywrap-wasm-rs path: ../../../../../wasm/rs diff --git a/packages/test-cases/cases/wrappers/wasm-rs/env-types/external/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-rs/env-types/external/polywrap.build.yaml index c2e7c01d50..d2dd4903a9 100644 --- a/packages/test-cases/cases/wrappers/wasm-rs/env-types/external/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-rs/env-types/external/polywrap.build.yaml @@ -1,6 +1,7 @@ -format: 0.1.0 -docker: - name: env-type-wasm-rs +format: 0.2.0 +strategies: + image: + name: env-type-wasm-rs linked_packages: - name: polywrap-wasm-rs path: ../../../../../../wasm/rs diff --git a/packages/test-cases/cases/wrappers/wasm-rs/env-types/main/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-rs/env-types/main/polywrap.build.yaml index c2e7c01d50..d2dd4903a9 100644 --- a/packages/test-cases/cases/wrappers/wasm-rs/env-types/main/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-rs/env-types/main/polywrap.build.yaml @@ -1,6 +1,7 @@ -format: 0.1.0 -docker: - name: env-type-wasm-rs +format: 0.2.0 +strategies: + image: + name: env-type-wasm-rs linked_packages: - name: polywrap-wasm-rs path: ../../../../../../wasm/rs diff --git a/packages/test-cases/cases/wrappers/wasm-rs/implementations/test-use-getImpl/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-rs/implementations/test-use-getImpl/polywrap.build.yaml index 88d68dd991..a98b54ac2e 100644 --- a/packages/test-cases/cases/wrappers/wasm-rs/implementations/test-use-getImpl/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-rs/implementations/test-use-getImpl/polywrap.build.yaml @@ -1,6 +1,7 @@ -format: 0.1.0 -docker: - name: test-use-get-impl-wasm-rs +format: 0.2.0 +strategies: + image: + name: test-use-get-impl-wasm-rs linked_packages: - name: polywrap-wasm-rs path: ../../../../../../wasm/rs \ No newline at end of file diff --git a/packages/test-cases/cases/wrappers/wasm-rs/implementations/test-wrapper/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-rs/implementations/test-wrapper/polywrap.build.yaml index ba827e13d2..591e73105e 100644 --- a/packages/test-cases/cases/wrappers/wasm-rs/implementations/test-wrapper/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-rs/implementations/test-wrapper/polywrap.build.yaml @@ -1,6 +1,7 @@ -format: 0.1.0 -docker: - name: test-wrapper-wasm-rs +format: 0.2.0 +strategies: + image: + name: test-wrapper-wasm-rs linked_packages: - name: polywrap-wasm-rs path: ../../../../../../wasm/rs diff --git a/packages/test-cases/cases/wrappers/wasm-rs/invalid-types/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-rs/invalid-types/polywrap.build.yaml index 7fbe1a4cf3..5abc34b624 100644 --- a/packages/test-cases/cases/wrappers/wasm-rs/invalid-types/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-rs/invalid-types/polywrap.build.yaml @@ -1,6 +1,7 @@ -format: 0.1.0 -docker: - name: invalid-types-wasm-rs +format: 0.2.0 +strategies: + image: + name: invalid-types-wasm-rs linked_packages: - name: polywrap-wasm-rs path: ../../../../../wasm/rs diff --git a/packages/test-cases/cases/wrappers/wasm-rs/json-type/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-rs/json-type/polywrap.build.yaml index 758480bb3a..6d9b8cb18d 100644 --- a/packages/test-cases/cases/wrappers/wasm-rs/json-type/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-rs/json-type/polywrap.build.yaml @@ -1,6 +1,7 @@ -format: 0.1.0 -docker: - name: json-type-wasm-rs +format: 0.2.0 +strategies: + image: + name: json-type-wasm-rs linked_packages: - name: polywrap-wasm-rs path: ../../../../../wasm/rs diff --git a/packages/test-cases/cases/wrappers/wasm-rs/large-types/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-rs/large-types/polywrap.build.yaml index 77db7c63af..6193c743ef 100644 --- a/packages/test-cases/cases/wrappers/wasm-rs/large-types/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-rs/large-types/polywrap.build.yaml @@ -1,6 +1,7 @@ -format: 0.1.0 -docker: - name: large-types-wasm-rs +format: 0.2.0 +strategies: + image: + name: large-types-wasm-rs linked_packages: - name: polywrap-wasm-rs path: ../../../../../wasm/rs diff --git a/packages/test-cases/cases/wrappers/wasm-rs/map-type/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-rs/map-type/polywrap.build.yaml index ecad7ac61a..7cb6421085 100644 --- a/packages/test-cases/cases/wrappers/wasm-rs/map-type/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-rs/map-type/polywrap.build.yaml @@ -1,6 +1,7 @@ -format: 0.1.0 -docker: - name: map-type-wasm-rs +format: 0.2.0 +strategies: + image: + name: map-type-wasm-rs linked_packages: - name: polywrap-wasm-rs path: ../../../../../wasm/rs diff --git a/packages/test-cases/cases/wrappers/wasm-rs/number-types/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-rs/number-types/polywrap.build.yaml index 4a9f95fc7e..bec1bd831b 100644 --- a/packages/test-cases/cases/wrappers/wasm-rs/number-types/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-rs/number-types/polywrap.build.yaml @@ -1,6 +1,7 @@ -format: 0.1.0 -docker: - name: number-types-wasm-rs +format: 0.2.0 +strategies: + image: + name: number-types-wasm-rs linked_packages: - name: polywrap-wasm-rs path: ../../../../../wasm/rs diff --git a/packages/test-cases/cases/wrappers/wasm-rs/object-types/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-rs/object-types/polywrap.build.yaml index f35ab256c8..a935a5efb7 100644 --- a/packages/test-cases/cases/wrappers/wasm-rs/object-types/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-rs/object-types/polywrap.build.yaml @@ -1,6 +1,7 @@ -format: 0.1.0 -docker: - name: object-types-wasm-rs +format: 0.2.0 +strategies: + image: + name: object-types-wasm-rs linked_packages: - name: polywrap-wasm-rs path: ../../../../../wasm/rs diff --git a/packages/test-cases/cases/wrappers/wasm-rs/println-logging/Cargo.toml b/packages/test-cases/cases/wrappers/wasm-rs/println-logging/Cargo.toml new file mode 100644 index 0000000000..384e2d56fa --- /dev/null +++ b/packages/test-cases/cases/wrappers/wasm-rs/println-logging/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "query" +version = "0.1.0" +description = "Query module of bigint-type e2e test" +authors = [ + "Kobby Pentangeli ", + "Jordan Ellis " +] +repository = "https://github.com/polywrap/monorepo" +license = "MIT" +edition = "2021" + +[dependencies] +polywrap-wasm-rs = { path = "../../../../../wasm/rs" } +serde = { version = "1.0", features = ["derive"] } + +[lib] +crate-type = ["cdylib"] + +[profile.release] +opt-level = 's' +lto = true +panic = 'abort' diff --git a/packages/test-cases/cases/wrappers/wasm-rs/println-logging/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-rs/println-logging/polywrap.build.yaml new file mode 100644 index 0000000000..468b571352 --- /dev/null +++ b/packages/test-cases/cases/wrappers/wasm-rs/println-logging/polywrap.build.yaml @@ -0,0 +1,7 @@ +format: 0.2.0 +strategies: + image: + name: println-logging-wasm-rs +linked_packages: + - name: polywrap-wasm-rs + path: ../../../../../wasm/rs diff --git a/packages/test-cases/cases/wrappers/wasm-rs/println-logging/polywrap.yaml b/packages/test-cases/cases/wrappers/wasm-rs/println-logging/polywrap.yaml new file mode 100644 index 0000000000..a93a9b522c --- /dev/null +++ b/packages/test-cases/cases/wrappers/wasm-rs/println-logging/polywrap.yaml @@ -0,0 +1,9 @@ +format: 0.2.0 +project: + name: println-logging + type: wasm/rust +source: + schema: ./schema.graphql + module: ./Cargo.toml +extensions: + build: ./polywrap.build.yaml \ No newline at end of file diff --git a/packages/test-cases/cases/wrappers/wasm-rs/println-logging/schema.graphql b/packages/test-cases/cases/wrappers/wasm-rs/println-logging/schema.graphql new file mode 100644 index 0000000000..c56fb7f7fb --- /dev/null +++ b/packages/test-cases/cases/wrappers/wasm-rs/println-logging/schema.graphql @@ -0,0 +1,5 @@ +type Module { + logMessage( + message: String! + ): Boolean! +} diff --git a/packages/test-cases/cases/wrappers/wasm-rs/println-logging/src/lib.rs b/packages/test-cases/cases/wrappers/wasm-rs/println-logging/src/lib.rs new file mode 100644 index 0000000000..0dde361b18 --- /dev/null +++ b/packages/test-cases/cases/wrappers/wasm-rs/println-logging/src/lib.rs @@ -0,0 +1,11 @@ +pub mod wrap; +pub use wrap::*; + +pub fn log_message(args: ArgsLogMessage) -> bool { + let message = args.message.as_str(); + + println!("{}", message); + print!("{}", message); + + true +} diff --git a/packages/test-cases/cases/wrappers/wasm-rs/reserved-words/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-rs/reserved-words/polywrap.build.yaml index f35ab256c8..a935a5efb7 100644 --- a/packages/test-cases/cases/wrappers/wasm-rs/reserved-words/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-rs/reserved-words/polywrap.build.yaml @@ -1,6 +1,7 @@ -format: 0.1.0 -docker: - name: object-types-wasm-rs +format: 0.2.0 +strategies: + image: + name: object-types-wasm-rs linked_packages: - name: polywrap-wasm-rs path: ../../../../../wasm/rs diff --git a/packages/test-cases/cases/wrappers/wasm-rs/simple-env-types/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-rs/simple-env-types/polywrap.build.yaml index 6a8b8c36e1..c69adede47 100644 --- a/packages/test-cases/cases/wrappers/wasm-rs/simple-env-types/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-rs/simple-env-types/polywrap.build.yaml @@ -1,6 +1,7 @@ -format: 0.1.0 -docker: - name: env-type-wasm-rs +format: 0.2.0 +strategies: + image: + name: env-type-wasm-rs linked_packages: - name: polywrap-wasm-rs path: ../../../../../wasm/rs diff --git a/packages/test-cases/cases/wrappers/wasm-rs/simple-storage/polywrap.build.yaml b/packages/test-cases/cases/wrappers/wasm-rs/simple-storage/polywrap.build.yaml index fadada91ca..d38232bdcf 100644 --- a/packages/test-cases/cases/wrappers/wasm-rs/simple-storage/polywrap.build.yaml +++ b/packages/test-cases/cases/wrappers/wasm-rs/simple-storage/polywrap.build.yaml @@ -1,6 +1,7 @@ -format: 0.1.0 -docker: - name: simple-storage-wasm-rs +format: 0.2.0 +strategies: + image: + name: simple-storage-wasm-rs linked_packages: - name: polywrap-wasm-rs path: ../../../../../wasm/rs diff --git a/yarn.lock b/yarn.lock index 7ef11dac91..8b92191287 100644 --- a/yarn.lock +++ b/yarn.lock @@ -124,10 +124,10 @@ dependencies: "@babel/highlight" "^7.18.6" -"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.18.8", "@babel/compat-data@^7.19.1", "@babel/compat-data@^7.9.0": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.19.1.tgz#72d647b4ff6a4f82878d184613353af1dd0290f9" - integrity sha512-72a9ghR0gnESIa7jBN53U32FOVCEoztyIlKaNoU05zRhEecduGK9L9c3ww7Mp06JiR+0ls0GBPFJQwwtjn9ksg== +"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.18.8", "@babel/compat-data@^7.19.3", "@babel/compat-data@^7.9.0": + version "7.19.3" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.19.3.tgz#707b939793f867f5a73b2666e6d9a3396eb03151" + integrity sha512-prBHMK4JYYK+wDjJF1q99KK4JLL+egWS4nmNqdlMUgCExMZ+iZW0hGhyC3VEbsPjvaN0TBhW//VIFwBrk8sEiw== "@babel/core@7.9.0": version "7.9.0" @@ -152,32 +152,32 @@ source-map "^0.5.0" "@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.4.5", "@babel/core@^7.7.5": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.19.1.tgz#c8fa615c5e88e272564ace3d42fbc8b17bfeb22b" - integrity sha512-1H8VgqXme4UXCRv7/Wa1bq7RVymKOzC7znjyFM8KiEzwFqcKUKYNoQef4GhdklgNvoBXyW4gYhuBNCM5o1zImw== + version "7.19.3" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.19.3.tgz#2519f62a51458f43b682d61583c3810e7dcee64c" + integrity sha512-WneDJxdsjEvyKtXKsaBGbDeiyOjR5vYq4HcShxnIbG0qixpoHjI3MqeZM9NDvsojNCEBItQE4juOo/bU6e72gQ== dependencies: "@ampproject/remapping" "^2.1.0" "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.19.0" - "@babel/helper-compilation-targets" "^7.19.1" + "@babel/generator" "^7.19.3" + "@babel/helper-compilation-targets" "^7.19.3" "@babel/helper-module-transforms" "^7.19.0" "@babel/helpers" "^7.19.0" - "@babel/parser" "^7.19.1" + "@babel/parser" "^7.19.3" "@babel/template" "^7.18.10" - "@babel/traverse" "^7.19.1" - "@babel/types" "^7.19.0" + "@babel/traverse" "^7.19.3" + "@babel/types" "^7.19.3" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.1" semver "^6.3.0" -"@babel/generator@^7.19.0", "@babel/generator@^7.4.0", "@babel/generator@^7.9.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.19.0.tgz#785596c06425e59334df2ccee63ab166b738419a" - integrity sha512-S1ahxf1gZ2dpoiFgA+ohK9DIpz50bJ0CWs7Zlzb54Z4sG8qmdIrGrVqmy1sAtTVRb+9CU6U8VqT9L0Zj7hxHVg== +"@babel/generator@^7.19.3", "@babel/generator@^7.4.0", "@babel/generator@^7.9.0": + version "7.19.3" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.19.3.tgz#d7f4d1300485b4547cb6f94b27d10d237b42bf59" + integrity sha512-fqVZnmp1ncvZU757UzDheKZpfPgatqY59XtW2/j/18H7u76akb8xqvjw82f+i2UKd/ksYsSick/BCLQUUtJ/qQ== dependencies: - "@babel/types" "^7.19.0" + "@babel/types" "^7.19.3" "@jridgewell/gen-mapping" "^0.3.2" jsesc "^2.5.1" @@ -196,12 +196,12 @@ "@babel/helper-explode-assignable-expression" "^7.18.6" "@babel/types" "^7.18.9" -"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9", "@babel/helper-compilation-targets@^7.19.0", "@babel/helper-compilation-targets@^7.19.1", "@babel/helper-compilation-targets@^7.8.7": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.19.1.tgz#7f630911d83b408b76fe584831c98e5395d7a17c" - integrity sha512-LlLkkqhCMyz2lkQPvJNdIYU7O5YjWRgC2R4omjCTpZd8u8KMQzZvX4qce+/BluN1rcQiV7BoGUpmQ0LeHerbhg== +"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9", "@babel/helper-compilation-targets@^7.19.0", "@babel/helper-compilation-targets@^7.19.3", "@babel/helper-compilation-targets@^7.8.7": + version "7.19.3" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.19.3.tgz#a10a04588125675d7c7ae299af86fa1b2ee038ca" + integrity sha512-65ESqLGyGmLvgR0mst5AdW1FkNlj9rQsCKduzEoEPhBCDFGXvz2jW6bXFG6i0/MrV2s7hhXjjb2yAzcPuQlLwg== dependencies: - "@babel/compat-data" "^7.19.1" + "@babel/compat-data" "^7.19.3" "@babel/helper-validator-option" "^7.18.6" browserslist "^4.21.3" semver "^6.3.0" @@ -353,7 +353,7 @@ resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.18.10.tgz#181f22d28ebe1b3857fa575f5c290b1aaf659b56" integrity sha512-XtIfWmeNY3i4t7t4D2t02q50HvqHybPqW2ki1kosnvWCwuCMeo81Jf0gwr85jy/neUdg5XDdeFE/80DXiO+njw== -"@babel/helper-validator-identifier@^7.18.6": +"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1": version "7.19.1" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== @@ -391,10 +391,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.18.10", "@babel/parser@^7.19.1", "@babel/parser@^7.4.3", "@babel/parser@^7.7.0", "@babel/parser@^7.9.0": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.19.1.tgz#6f6d6c2e621aad19a92544cc217ed13f1aac5b4c" - integrity sha512-h7RCSorm1DdTVGJf3P2Mhj3kdnkmF/EiysUkzS2TdgAYqyjFdMQJbVuXOBej2SBJaXan/lIVtT6KkGbyyq753A== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.18.10", "@babel/parser@^7.19.3", "@babel/parser@^7.4.3", "@babel/parser@^7.7.0", "@babel/parser@^7.9.0": + version "7.19.3" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.19.3.tgz#8dd36d17c53ff347f9e55c328710321b49479a9a" + integrity sha512-pJ9xOlNWHiy9+FuFP09DEAFbAn4JskgRsVcc169w2xRBC3FRGuQEwjeIMMND9L2zc0iEhO/tGv4Zq+km+hxNpQ== "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6": version "7.18.6" @@ -1047,9 +1047,9 @@ "@babel/helper-plugin-utils" "^7.18.9" "@babel/plugin-transform-typescript@^7.9.0": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.19.1.tgz#adcf180a041dcbd29257ad31b0c65d4de531ce8d" - integrity sha512-+ILcOU+6mWLlvCwnL920m2Ow3wWx3Wo8n2t5aROQmV55GZt+hOiLvBaa3DNzRjSEHa1aauRs4/YLmkCfFkhhRQ== + version "7.19.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.19.3.tgz#4f1db1e0fe278b42ddbc19ec2f6cd2f8262e35d6" + integrity sha512-z6fnuK9ve9u/0X0rRvI9MY0xg+DOUaABDYOe+/SQTxtlptaBB/V9JIUxJn6xp3lMBeb9qe8xSFmHU35oZDXD+w== dependencies: "@babel/helper-create-class-features-plugin" "^7.19.0" "@babel/helper-plugin-utils" "^7.19.0" @@ -1137,12 +1137,12 @@ semver "^5.5.0" "@babel/preset-env@^7.4.5": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.19.1.tgz#9f04c916f9c0205a48ebe5cc1be7768eb1983f67" - integrity sha512-c8B2c6D16Lp+Nt6HcD+nHl0VbPKVnNPTpszahuxJJnurfMtKeZ80A+qUv48Y7wqvS+dTFuLuaM9oYxyNHbCLWA== + version "7.19.3" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.19.3.tgz#52cd19abaecb3f176a4ff9cc5e15b7bf06bec754" + integrity sha512-ziye1OTc9dGFOAXSWKUqQblYHNlBOaDl8wzqf2iKXJAltYiR3hKHUKmkt+S9PppW7RQpq4fFCrwwpIDj/f5P4w== dependencies: - "@babel/compat-data" "^7.19.1" - "@babel/helper-compilation-targets" "^7.19.1" + "@babel/compat-data" "^7.19.3" + "@babel/helper-compilation-targets" "^7.19.3" "@babel/helper-plugin-utils" "^7.19.0" "@babel/helper-validator-option" "^7.18.6" "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.18.6" @@ -1210,7 +1210,7 @@ "@babel/plugin-transform-unicode-escapes" "^7.18.10" "@babel/plugin-transform-unicode-regex" "^7.18.6" "@babel/preset-modules" "^0.1.5" - "@babel/types" "^7.19.0" + "@babel/types" "^7.19.3" babel-plugin-polyfill-corejs2 "^0.3.3" babel-plugin-polyfill-corejs3 "^0.6.0" babel-plugin-polyfill-regenerator "^0.4.1" @@ -1291,29 +1291,29 @@ "@babel/parser" "^7.18.10" "@babel/types" "^7.18.10" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.19.0", "@babel/traverse@^7.19.1", "@babel/traverse@^7.4.3", "@babel/traverse@^7.7.0", "@babel/traverse@^7.9.0": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.19.1.tgz#0fafe100a8c2a603b4718b1d9bf2568d1d193347" - integrity sha512-0j/ZfZMxKukDaag2PtOPDbwuELqIar6lLskVPPJDjXMXjfLb1Obo/1yjxIGqqAJrmfaTIY3z2wFLAQ7qSkLsuA== +"@babel/traverse@^7.1.0", "@babel/traverse@^7.19.0", "@babel/traverse@^7.19.1", "@babel/traverse@^7.19.3", "@babel/traverse@^7.4.3", "@babel/traverse@^7.7.0", "@babel/traverse@^7.9.0": + version "7.19.3" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.19.3.tgz#3a3c5348d4988ba60884e8494b0592b2f15a04b4" + integrity sha512-qh5yf6149zhq2sgIXmwjnsvmnNQC2iw70UFjp4olxucKrWd/dvlUsBI88VSLUsnMNF7/vnOiA+nk1+yLoCqROQ== dependencies: "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.19.0" + "@babel/generator" "^7.19.3" "@babel/helper-environment-visitor" "^7.18.9" "@babel/helper-function-name" "^7.19.0" "@babel/helper-hoist-variables" "^7.18.6" "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.19.1" - "@babel/types" "^7.19.0" + "@babel/parser" "^7.19.3" + "@babel/types" "^7.19.3" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.0", "@babel/types@^7.4.4", "@babel/types@^7.7.0", "@babel/types@^7.9.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.19.0.tgz#75f21d73d73dc0351f3368d28db73465f4814600" - integrity sha512-YuGopBq3ke25BVSiS6fgF49Ul9gH1x70Bcr6bqRLjWCkcX8Hre1/5+z+IiWOIerRMSSEfGZVB9z9kyq7wVs9YA== +"@babel/types@^7.0.0", "@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.19.3", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.0", "@babel/types@^7.4.4", "@babel/types@^7.7.0", "@babel/types@^7.9.0": + version "7.19.3" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.19.3.tgz#fc420e6bbe54880bce6779ffaf315f5e43ec9624" + integrity sha512-hGCaQzIY22DJlDh9CH7NOxgKkFjBk0Cw9xDO1Xmh2151ti7wiGfQ3LauXzL4HP1fmFlTX6XjpRETTpUcv7wQLw== dependencies: "@babel/helper-string-parser" "^7.18.10" - "@babel/helper-validator-identifier" "^7.18.6" + "@babel/helper-validator-identifier" "^7.19.1" to-fast-properties "^2.0.0" "@bcoe/v8-coverage@^0.2.3": @@ -1351,22 +1351,6 @@ resolved "https://registry.yarnpkg.com/@csstools/normalize.css/-/normalize.css-10.1.0.tgz#f0950bba18819512d42f7197e56c518aa491cf18" integrity sha512-ij4wRiunFfaJxjB0BdrYHIH8FxBJpOwNPhhAcunlmPdXudL1WQV1qoP9un6JsEBAgQH+7UXyyjh0g7jTxXK6tg== -"@dorgjelli-test/ipfs-http-client-lite@0.3.1": - version "0.3.1" - resolved "https://registry.yarnpkg.com/@dorgjelli-test/ipfs-http-client-lite/-/ipfs-http-client-lite-0.3.1.tgz#5514b4400e0c91ea64e0b5faf426ba808809ddfe" - integrity sha512-N96ilOlJnjnprOOIrwKjEA7lu67mbXyGmJO/vOBXQvY9AQw9XrPdIEn0x30bHwQ6pWSwN4RhIgJUy1/A7u/hEg== - dependencies: - abort-controller "^3.0.0" - async-iterator-to-pull-stream "^1.3.0" - buffer "^5.2.1" - cids "^0.7.1" - explain-error "^1.0.4" - form-data "^2.4.0" - iterable-ndjson "^1.1.0" - node-fetch "^2.6.0" - pull-stream-to-async-iterator "^1.0.2" - querystring "^0.2.0" - "@dorgjelli/graphql-schema-cycles@1.1.4": version "1.1.4" resolved "https://registry.yarnpkg.com/@dorgjelli/graphql-schema-cycles/-/graphql-schema-cycles-1.1.4.tgz#31f230c61f624f7c2ceca7e18fad8b2cb07d392f" @@ -1832,10 +1816,10 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/strings" "^5.7.0" -"@fetsorn/opentelemetry-console-exporter@0.0.1": - version "0.0.1" - resolved "https://registry.yarnpkg.com/@fetsorn/opentelemetry-console-exporter/-/opentelemetry-console-exporter-0.0.1.tgz#c842d5e15634c3b9014d9bef322b727b97d60a8e" - integrity sha512-TVqfRoIvszb6DjTEdlSiacpe+K8p36Stxh/poJ65l5SXWlKwlU0hO930WMyFaJWtWSKEKX91BqnKbU2kE1ONWQ== +"@fetsorn/opentelemetry-console-exporter@0.0.3": + version "0.0.3" + resolved "https://registry.yarnpkg.com/@fetsorn/opentelemetry-console-exporter/-/opentelemetry-console-exporter-0.0.3.tgz#c137629fecc610c7667e68b528926e498e152c0b" + integrity sha512-+UDrzHANOPcp0+47xK7dqeKIlYSh5a5WpFaswzM9S2MnjQfP0zOysAunWFRb6CFYSj1hTeFotYYXr8tYbyBpoA== "@formatjs/ecma402-abstract@1.6.2": version "1.6.2" @@ -3225,153 +3209,115 @@ dependencies: "@octokit/openapi-types" "^12.11.0" -"@opentelemetry/api@1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.1.0.tgz#563539048255bbe1a5f4f586a4a10a1bb737f44a" - integrity sha512-hf+3bwuBwtXsugA2ULBc95qxrOqP2pOekLz34BJhcAKawt94vfeNyUKpYc0lZQ/3sCP6LqRa7UAdHA7i5UODzQ== - -"@opentelemetry/context-async-hooks@1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/context-async-hooks/-/context-async-hooks-1.4.0.tgz#97c6d76e8b0d332ab06900d15436e40df15a864d" - integrity sha512-yXpe1qCK3CevzWN3VmLlEOcipNdSV6al204lWMDoBI4eCy3rWZZEAGlwRvIiEy3uPrHClh6BQ5Z0q1+LEB/y8g== - -"@opentelemetry/context-zone-peer-dep@1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/context-zone-peer-dep/-/context-zone-peer-dep-1.4.0.tgz#404b892cea2c6e3d7561604767f8ba145b299c0e" - integrity sha512-PuzyYH/aKdkq8utWrlWSWoFbxrZQg/xEsfoLNzhmFRhKMrHz8PEQt9DbOhjlfnVnYRi3eFgIJWJBwIS8m+RG9w== - -"@opentelemetry/context-zone@1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/context-zone/-/context-zone-1.4.0.tgz#00d374fa22b684114423a8ae30a5d4f0a69cfb9a" - integrity sha512-EFu8b1cMyAXj0o6S7Edh0iY8NzFsQq18b97Mr988o3W89OTFY2aSf6p4ilMhPLezXOXZUH3zW7ma8xj6rNP0dg== +"@opentelemetry/api-metrics@0.32.0": + version "0.32.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/api-metrics/-/api-metrics-0.32.0.tgz#0f09f78491a4b301ddf54a8b8a38ffa99981f645" + integrity sha512-g1WLhpG8B6iuDyZJFRGsR+JKyZ94m5LEmY2f+duEJ9Xb4XRlLHrZvh6G34OH6GJ8iDHxfHb/sWjJ1ZpkI9yGMQ== dependencies: - "@opentelemetry/context-zone-peer-dep" "1.4.0" - zone.js "^0.11.0" + "@opentelemetry/api" "^1.0.0" -"@opentelemetry/core@1.2.0": +"@opentelemetry/api@1.2.0", "@opentelemetry/api@^1.0.0": version "1.2.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-1.2.0.tgz#cc6dabb7bb2f317427135863ba6bebe22b0b475e" - integrity sha512-QiKp8fBbT9ZhRTP+ZVVMyqH62tD/ZQa4gWPi+GnpNetvK1SWPO/8DmRpaSXHwAhu5FWUDJrbFgpLsrDd1zGPOw== - dependencies: - "@opentelemetry/semantic-conventions" "1.2.0" - -"@opentelemetry/core@1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-1.4.0.tgz#26839ab9e36583a174273a1e1c5b33336c163725" - integrity sha512-faq50VFEdyC7ICAOlhSi+yYZ+peznnGjTJToha9R63i9fVopzpKrkZt7AIdXUmz2+L2OqXrcJs7EIdN/oDyr5w== - dependencies: - "@opentelemetry/semantic-conventions" "1.4.0" - -"@opentelemetry/exporter-trace-otlp-http@^0.28.0": - version "0.28.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/exporter-trace-otlp-http/-/exporter-trace-otlp-http-0.28.0.tgz#4d2589f6a3c476440973ce94e6d44ee1bbfea821" - integrity sha512-5GFN2NSXDikEMUphN5NT3tY+XQnPPkZhGVhhy+czf3rGjrcVRQqyYYqCm8/Q4kxxUr/hUx91UBt+DCxSqQLhpA== - dependencies: - "@opentelemetry/core" "1.2.0" - "@opentelemetry/otlp-exporter-base" "0.28.0" - "@opentelemetry/resources" "1.2.0" - "@opentelemetry/sdk-trace-base" "1.2.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.2.0.tgz#89ef99401cde6208cff98760b67663726ef26686" + integrity sha512-0nBr+VZNKm9tvNDZFstI3Pq1fCTEDK5OZTnVKNvBNAKgd0yIvmwsP4m61rEv7ZP+tOUjWJhROpxK5MsnlF911g== -"@opentelemetry/exporter-zipkin@1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/exporter-zipkin/-/exporter-zipkin-1.4.0.tgz#4dabd41c90a2f12d8047e50b04c090b1957ff41d" - integrity sha512-RafOtvHAYwe/wMz0Z4U5VFnLZcmaa5SGuB32mMNe+mUqMuqCirRQCTa3t8hlgSvZ+w2Gz5vjNYjoFZLfoRUGzg== +"@opentelemetry/core@1.6.0": + version "1.6.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-1.6.0.tgz#c55f8ab7496acef7dbd8c4eedef6a4d4a0143c95" + integrity sha512-MsEhsyCTfYme6frK8/AqEWwbS9SB3Ta5bjgz4jPQJjL7ijUM3JiLVvqh/kHo1UlUjbUbLmGG7jA5Nw4d7SMcLQ== dependencies: - "@opentelemetry/core" "1.4.0" - "@opentelemetry/resources" "1.4.0" - "@opentelemetry/sdk-trace-base" "1.4.0" - "@opentelemetry/semantic-conventions" "1.4.0" + "@opentelemetry/semantic-conventions" "1.6.0" -"@opentelemetry/otlp-exporter-base@0.28.0": - version "0.28.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.28.0.tgz#cdeb43de2fbc88c12a77dcf75a3694c5eef49727" - integrity sha512-RelJBa2rFO63jCPRTzWxs+DWPRBrO4Y5Fag1uXur8dwnjSmKlSBwRzfz7F+pVwLf3kqm5EDzCCoYzdL1/aH1tg== +"@opentelemetry/exporter-trace-otlp-http@0.32.0": + version "0.32.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/exporter-trace-otlp-http/-/exporter-trace-otlp-http-0.32.0.tgz#55773290a221855c4e8c422e8fb5e7ff4aa5f04e" + integrity sha512-8n44NDoEFoYG3mMToZxNyUKkHSGfzSShw6I2V5FApcH7rid20LmKiNuzc7lACneDIZBld+GGpLRuFhWniW8JhA== dependencies: - "@opentelemetry/core" "1.2.0" + "@opentelemetry/core" "1.6.0" + "@opentelemetry/otlp-exporter-base" "0.32.0" + "@opentelemetry/otlp-transformer" "0.32.0" + "@opentelemetry/resources" "1.6.0" + "@opentelemetry/sdk-trace-base" "1.6.0" -"@opentelemetry/propagator-b3@1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/propagator-b3/-/propagator-b3-1.4.0.tgz#69fe270c843e8a8ea8a938fe229e95adf2568ffb" - integrity sha512-KKFjvU2qrOEoK2S9FfSkE11u3AVxCniJOH7av6pmbFwkv1YD6uHNqvjvY4Xe6VwFOyKuTYS69VydO9OjJ5gvVA== +"@opentelemetry/otlp-exporter-base@0.32.0": + version "0.32.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.32.0.tgz#37dde162835a8fd23fa040f07e2938deb335fc4b" + integrity sha512-Dscxu4VNKrkD1SwGKdc7bAtLViGFJC8ah6Dr/vZn22NFHXSa53lSzDdTKeSTNNWH9sCGu/65LS45VMd4PsRvwQ== dependencies: - "@opentelemetry/core" "1.4.0" + "@opentelemetry/core" "1.6.0" -"@opentelemetry/propagator-jaeger@1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/propagator-jaeger/-/propagator-jaeger-1.4.0.tgz#34f0fdf8fef5fa8c1f46aae51c06898983c3fccc" - integrity sha512-LvSzgt9RIGYiMP9E45ifT5WtALsDyY74y/1Ol0DK4xmJt8Sku7YastjCZaxpsvLGA4CGAtth0ozic88AvJrmgw== +"@opentelemetry/otlp-transformer@0.32.0": + version "0.32.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/otlp-transformer/-/otlp-transformer-0.32.0.tgz#652c8f4c56c95f7d7ec39e20573b885d27ca13f1" + integrity sha512-PFAqfKgJpTOZryPe1UMm7R578PLxsK0wCAuKSt6m8v1bN/4DO8DX4HD7k3mYGZVU5jNg8tVZSwyIpY6ryrHDMQ== dependencies: - "@opentelemetry/core" "1.4.0" + "@opentelemetry/api-metrics" "0.32.0" + "@opentelemetry/core" "1.6.0" + "@opentelemetry/resources" "1.6.0" + "@opentelemetry/sdk-metrics" "0.32.0" + "@opentelemetry/sdk-trace-base" "1.6.0" -"@opentelemetry/resources@1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/resources/-/resources-1.2.0.tgz#5046d104d33839e58cca3184547c5dc26602f228" - integrity sha512-S5ZlZa2JF+1qhiF7eb3tTtDfKmTODO//pvam9vEyZvr+/At45rIQ7cyznRdMWCppZbholwXWXnrKml29IIG9vQ== +"@opentelemetry/resources@1.6.0": + version "1.6.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/resources/-/resources-1.6.0.tgz#9756894131b9b0dfbcc0cecb5d4bd040d9c1b09d" + integrity sha512-07GlHuq72r2rnJugYVdGumviQvfrl8kEPidkZSVoseLVfIjV7nzxxt5/vqs9pK7JItWOrvjRdr/jTBVayFBr/w== dependencies: - "@opentelemetry/core" "1.2.0" - "@opentelemetry/semantic-conventions" "1.2.0" + "@opentelemetry/core" "1.6.0" + "@opentelemetry/semantic-conventions" "1.6.0" -"@opentelemetry/resources@1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/resources/-/resources-1.4.0.tgz#5e23b0d7976158861059dec17e0ee36a35a5ab85" - integrity sha512-Q3pI5+pCM+Ur7YwK9GbG89UBipwJbfmuzSPAXTw964ZHFzSrz+JAgrETC9rqsUOYdUlj/V7LbRMG5bo72xE0Xw== +"@opentelemetry/sdk-metrics@0.32.0": + version "0.32.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-metrics/-/sdk-metrics-0.32.0.tgz#463cd3a2b267f044db9aaab85887a171710345a0" + integrity sha512-zC9RCOIsXRqOHWmWfcxArtDHbip2/jaIH1yu/OKau/shDZYFluAxY6zAEYIb4YEAzKKEF+fpaoRgpodDWNGVGA== dependencies: - "@opentelemetry/core" "1.4.0" - "@opentelemetry/semantic-conventions" "1.4.0" + "@opentelemetry/api-metrics" "0.32.0" + "@opentelemetry/core" "1.6.0" + "@opentelemetry/resources" "1.6.0" + lodash.merge "4.6.2" -"@opentelemetry/sdk-trace-base@1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.2.0.tgz#aac5b79dbaced92a886fb2e348e54f5b681205ed" - integrity sha512-eHrG9c9OhoDhUmMe63Qzgpcvlgxr2L7BFBbbj2DdZu3vGstayytTT6TDv6mz727lXBqR1HXMbqTGVafS07r3bg== +"@opentelemetry/sdk-trace-base@1.6.0": + version "1.6.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.6.0.tgz#8b1511c0b0f3e6015e345f5ed4a683adf03e3e3c" + integrity sha512-yx/uuzHdT0QNRSEbCgXHc0GONk90uvaFcPGaNowIFSl85rTp4or4uIIMkG7R8ckj8xWjDSjsaztH6yQxoZrl5g== dependencies: - "@opentelemetry/core" "1.2.0" - "@opentelemetry/resources" "1.2.0" - "@opentelemetry/semantic-conventions" "1.2.0" + "@opentelemetry/core" "1.6.0" + "@opentelemetry/resources" "1.6.0" + "@opentelemetry/semantic-conventions" "1.6.0" -"@opentelemetry/sdk-trace-base@1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.4.0.tgz#e54d09c1258cd53d3fe726053ed1cbda9d74f023" - integrity sha512-l7EEjcOgYlKWK0hfxz4Jtkkk2DuGiqBDWmRZf7g2Is9RVneF1IgcrbYZTKGaVfBKA7lPuVtUiQ2qTv3R+dKJrw== +"@opentelemetry/sdk-trace-web@1.6.0": + version "1.6.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-web/-/sdk-trace-web-1.6.0.tgz#ef243e3e1102b53bc0afa93c29c18fc7e2f66e52" + integrity sha512-iOgmygvooaZm4Vi6mh5FM7ubj/e+MqDn8cDPCNfk6V8Q2yWj0co8HKWPFo0RoxSLYyPaFnEEXOXWWuE4OTwLKw== dependencies: - "@opentelemetry/core" "1.4.0" - "@opentelemetry/resources" "1.4.0" - "@opentelemetry/semantic-conventions" "1.4.0" + "@opentelemetry/core" "1.6.0" + "@opentelemetry/sdk-trace-base" "1.6.0" + "@opentelemetry/semantic-conventions" "1.6.0" -"@opentelemetry/sdk-trace-node@1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-node/-/sdk-trace-node-1.4.0.tgz#01384987f02d24af0c0b8e2a630c0c79a18cf976" - integrity sha512-LET70LwaE8gK3W6jpeG6C7BNbl5m8fnEgNmO0LFXHyl4yofIzficDy06zjgVtPp1urygNuYPtK/4yiactzTvZg== - dependencies: - "@opentelemetry/context-async-hooks" "1.4.0" - "@opentelemetry/core" "1.4.0" - "@opentelemetry/propagator-b3" "1.4.0" - "@opentelemetry/propagator-jaeger" "1.4.0" - "@opentelemetry/sdk-trace-base" "1.4.0" - semver "^7.3.5" +"@opentelemetry/semantic-conventions@1.6.0": + version "1.6.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.6.0.tgz#ed410c9eb0070491cff9fe914246ce41f88d6f74" + integrity sha512-aPfcBeLErM/PPiAuAbNFLN5sNbZLc3KZlar27uohllN8Zs6jJbHyJU1y7cMA6W/zuq+thkaG8mujiS+3iD/FWQ== -"@opentelemetry/sdk-trace-web@1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-web/-/sdk-trace-web-1.4.0.tgz#3ca43baff768eb819214cfcce224d1f07a9fad44" - integrity sha512-3ZuSOY3jHK33Soat4qF4geIH5HwsnwPTzdxW+hERaySXK2+vVhK72C4wdIIjtiiL5sIXQUDvM7E0YGzmmrh0Og== +"@polywrap/ipfs-http-client-lite@0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@polywrap/ipfs-http-client-lite/-/ipfs-http-client-lite-0.3.0.tgz#b8caf4b4f39413e591aff4367023a04cb6df83a1" + integrity sha512-BriJXaflESPSml0lfsAtp4Prl6i8FC0RoEQpEoTx74E3LIAdiPhdPb8hKDTyOR77oX829WDp0EKsRpQmcvCArg== dependencies: - "@opentelemetry/core" "1.4.0" - "@opentelemetry/sdk-trace-base" "1.4.0" - "@opentelemetry/semantic-conventions" "1.4.0" - -"@opentelemetry/semantic-conventions@1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.2.0.tgz#1549c1d88dc45d720b8487e39077eacc69636c73" - integrity sha512-BNKB9fiYVghALJzCuWO3eNYfdTExPVK4ykrtmfNfy0A6UWYhOYjGMXifUmkunDJNL8ju9tBobo8jF0WR9zGy1Q== - -"@opentelemetry/semantic-conventions@1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.4.0.tgz#facf2c67d6063b9918d5a5e3fdf25f3a30d547b6" - integrity sha512-Hzl8soGpmyzja9w3kiFFcYJ7n5HNETpplY6cb67KR4QPlxp4FTTresO06qXHgHDhyIInmbLJXuwARjjpsKYGuQ== + abort-controller "^3.0.0" + async-iterator-to-pull-stream "^1.3.0" + buffer "^5.2.1" + cids "^0.7.1" + explain-error "^1.0.4" + form-data "^2.4.0" + iterable-ndjson "^1.1.0" + node-fetch "^2.6.0" + pull-stream-to-async-iterator "^1.0.2" + querystring "^0.2.0" "@sinclair/typebox@^0.24.1": - version "0.24.41" - resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.41.tgz#45470b8bae32a28f1e0501066d0bacbd8b772804" - integrity sha512-TJCgQurls4FipFvHeC+gfAzb+GGstL0TDwYJKQVtTeSvJIznWzP7g3bAd5gEBlr8+bIxqnWS9VGVWREDhmE8jA== + version "0.24.43" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.43.tgz#2e2bce0e5e493aaf639beed0cd6c88cfde7dd3d7" + integrity sha512-1orQTvtazZmsPeBroJjysvsOQCYV2yjWlebkSY38pl5vr2tdLjEJ+LoxITlGNZaH2RE19WlAwQMkH/7C14wLfw== "@sinonjs/commons@^1.7.0": version "1.8.3" @@ -3592,9 +3538,9 @@ "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.4", "@types/babel__traverse@^7.0.6": - version "7.18.1" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.18.1.tgz#ce5e2c8c272b99b7a9fd69fa39f0b4cd85028bd9" - integrity sha512-FSdLaZh2UxaMuLp9lixWaHq/golWTRWOnRsAXzDTDSDOQLuZb1nsdCt6pJSPWSEQt2eFZ2YVk3oYhn+1kLMeMA== + version "7.18.2" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.18.2.tgz#235bf339d17185bdec25e024ca19cce257cc7309" + integrity sha512-FcFaxOr2V5KZCviw1TnutEMVUVsGt4D2hP1TAfXZAMKuHYW3xQhe3jTxNPWutgCJ3/X1c5yX8ZoGVEItxKbwBg== dependencies: "@babel/types" "^7.3.0" @@ -3711,11 +3657,6 @@ jest-diff "^27.0.0" pretty-format "^27.0.0" -"@types/js-yaml@3.11.1": - version "3.11.1" - resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-3.11.1.tgz#ac5bab26be5f9c6f74b6b23420f2cfa5a7a6ba40" - integrity sha512-M5qhhfuTt4fwHGqqANNQilp3Htb5cHwBxlMHDUw/TYRVkEp3s3IIFSH3Fe9HIAeEtnO4p3SSowLmCVavdRYfpw== - "@types/json-schema@*", "@types/json-schema@^7.0.11", "@types/json-schema@^7.0.3", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.6": version "7.0.11" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" @@ -3757,9 +3698,9 @@ integrity sha512-wH6Tu9mbiOt0n5EvdoWy0VGQaJMHfLIxY/6wS0xLC7CV1taM6gESEzcYy0ZlWvxxiiljYvfDIvz4hHbUUDRlhw== "@types/node@*": - version "18.7.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.18.tgz#633184f55c322e4fb08612307c274ee6d5ed3154" - integrity sha512-m+6nTEOadJZuTPkKR/SYK3A2d7FZrgElol9UP1Kae90VVU4a6mxnPuLiIW1m4Cq4gZ/nWb9GrdVXJCoCazDAbg== + version "18.7.23" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.23.tgz#75c580983846181ebe5f4abc40fe9dfb2d65665f" + integrity sha512-DWNcCHolDq0ZKGizjx2DZjR/PqsYwAcYUJmfMWqtVU2MBMG5Mo+xFZrhGId5r/O5HOuMPyQEcM6KUBp5lBZZBg== "@types/node@12.12.26": version "12.12.26" @@ -3782,9 +3723,9 @@ integrity sha512-G/AdOadiZhnJp0jXCaBQU449W2h716OW/EoXeYkCytxKL06X1WCXB4DZpp8TpZ8eyIJVS1cw4lrlkkSYU21cDw== "@types/prettier@^2.0.0", "@types/prettier@^2.6.1": - version "2.7.0" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.0.tgz#ea03e9f0376a4446f44797ca19d9c46c36e352dc" - integrity sha512-RI1L7N4JnW5gQw2spvL7Sllfuf1SaHdrZpCHiBlCXjIlufi1SMNnbu2teze3/QE67Fg2tBlH7W+mi4hVNk4p0A== + version "2.7.1" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.1.tgz#dfd20e2dc35f027cdd6c1908e80a5ddc7499670e" + integrity sha512-ri0UmynRRvZiiUJdiz38MmIblKK+oH30MztdBVR95dv/Ubw6neWSb8u1XpRb72L4qsZOhz+L+z9JD40SJmfWow== "@types/prop-types@*": version "15.7.5" @@ -3848,13 +3789,6 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== -"@types/uuid@3.4.3": - version "3.4.3" - resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-3.4.3.tgz#121ace265f5569ce40f4f6d0ff78a338c732a754" - integrity sha512-5fRLCYhLtDb3hMWqQyH10qtF+Ud2JnNCXTCZ+9ktNdCcgslcuXkDTkFcJNk++MT29yDntDnlF1+jD+uVGumsbw== - dependencies: - "@types/node" "*" - "@types/uuid@8.3.0": version "8.3.0" resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.0.tgz#215c231dff736d5ba92410e6d602050cce7e273f" @@ -3879,6 +3813,13 @@ dependencies: "@types/yargs-parser" "*" +"@types/yauzl@^2.9.1": + version "2.10.0" + resolved "https://registry.yarnpkg.com/@types/yauzl/-/yauzl-2.10.0.tgz#b3248295276cf8c6f153ebe6a9aba0c988cb2599" + integrity sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw== + dependencies: + "@types/node" "*" + "@typescript-eslint/eslint-plugin@4.11.1": version "4.11.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.11.1.tgz#7579c6d17ad862154c10bc14b40e5427b729e209" @@ -4363,7 +4304,7 @@ alphanum-sort@^1.0.0: resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3" integrity sha512-0FcBfdcmaumGPQ0qPn7Q5qTgz/ooXgIyp1rf8ik5bGX8mpE2YHjC0P/eyQvxu1GURYQgq9ozf2mteQ5ZD9YiyQ== -ansi-colors@^3.0.0, ansi-colors@^3.2.1: +ansi-colors@^3.0.0: version "3.2.4" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.4.tgz#e3a3da4bfbae6c86a9c285625de124a234026fbf" integrity sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA== @@ -4463,18 +4404,6 @@ anymatch@^3.0.3, anymatch@~3.1.1, anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" -apisauce@^2.0.1: - version "2.1.6" - resolved "https://registry.yarnpkg.com/apisauce/-/apisauce-2.1.6.tgz#94887f335bf3d735305fc895c8a191c9c2608a7f" - integrity sha512-MdxR391op/FucS2YQRfB/NMRyCnHEPDd4h17LRIuVYi0BpGmMhpxc0shbOpfs5ahABuBEffNCGal5EcsydbBWg== - dependencies: - axios "^0.21.4" - -app-module-path@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/app-module-path/-/app-module-path-2.2.0.tgz#641aa55dfb7d6a6f0a8141c4b9c0aa50b6c24dd5" - integrity sha512-gkco+qxENJV+8vFcDiiFhuoSvRXb2a/QPqpSoWhVz829VNJfOTnELbBmPmNKFxf3xdNnw4DWCkzkDaavcX/1YQ== - aproba@^1.0.3, aproba@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" @@ -4813,7 +4742,7 @@ axios@0.21.2: dependencies: follow-redirects "^1.14.0" -axios@0.21.4, axios@^0.21.4: +axios@0.21.4: version "0.21.4" resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== @@ -5303,11 +5232,6 @@ browser-resolve@^1.11.3: dependencies: resolve "1.1.7" -browser-util-inspect@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/browser-util-inspect/-/browser-util-inspect-0.2.0.tgz#cdda8ce1a4a07a4386035168a228c8777bff459c" - integrity sha512-R7WvAj0p9FtwS2Jbtc1HUd1+YZdeb5EEqjBSbbOK3owJtW1viWyJDeTPy43QZ7bZ8POtb1yMv++h844486jMsQ== - browserify-aes@^1.0.0, browserify-aes@^1.0.4: version "1.2.0" resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" @@ -5379,7 +5303,7 @@ browserslist@4.10.0: node-releases "^1.1.52" pkg-up "^3.1.0" -browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.21.3, browserslist@^4.6.2, browserslist@^4.6.4, browserslist@^4.9.1: +browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.21.3, browserslist@^4.21.4, browserslist@^4.6.2, browserslist@^4.6.4, browserslist@^4.9.1: version "4.21.4" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.4.tgz#e7496bbc67b9e39dd0f98565feccdcb0d4ff6987" integrity sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw== @@ -5403,6 +5327,11 @@ bser@2.1.1: dependencies: node-int64 "^0.4.0" +buffer-crc32@~0.2.3: + version "0.2.13" + resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" + integrity sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ== + buffer-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/buffer-equal/-/buffer-equal-1.0.0.tgz#59616b498304d556abd466966b22eeda3eca5fbe" @@ -5647,9 +5576,9 @@ caniuse-api@^3.0.0: lodash.uniq "^4.5.0" caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30001035, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001400: - version "1.0.30001402" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001402.tgz#aa29e1f47f5055b0d0c07696a67b8b08023d14c8" - integrity sha512-Mx4MlhXO5NwuvXGgVb+hg65HZ+bhUYsz8QtDGDo2QmaJS2GBX47Xfi2koL86lc8K+l+htXeTEB/Aeqvezoo6Ew== + version "1.0.30001412" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001412.tgz#30f67d55a865da43e0aeec003f073ea8764d5d7c" + integrity sha512-+TeEIee1gS5bYOiuf+PS/kp2mrXic37Hl66VY6EAfxasIk5fELTktK2oOezYed12H8w7jt3s512PpulQidPjwA== capture-exit@^2.0.0: version "2.0.0" @@ -5881,21 +5810,6 @@ cli-cursor@^3.1.0: dependencies: restore-cursor "^3.1.0" -cli-spinners@^2.2.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.7.0.tgz#f815fd30b5f9eaac02db604c7a231ed7cb2f797a" - integrity sha512-qu3pN8Y3qHNgE2AFweciB1IfMnmZ/fsNTEE+NOFjmGB2F/7rLhnhzppvpCnN4FovtP26k8lHyy9ptEbNwWFLzw== - -cli-table3@~0.5.0: - version "0.5.1" - resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.5.1.tgz#0252372d94dfc40dbd8df06005f48f31f656f202" - integrity sha512-7Qg2Jrep1S/+Q3EceiZtQcDPWxhAvBw+ERf1162v4sikJrvojMHFqXt8QIVha8UlH9rgU0BeWPytZ9/TzYqlUw== - dependencies: - object-assign "^4.1.0" - string-width "^2.1.1" - optionalDependencies: - colors "^1.1.2" - cli-width@^2.0.0: version "2.2.1" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48" @@ -6056,11 +5970,6 @@ color@^3.0.0: color-convert "^1.9.3" color-string "^1.6.0" -colors@^1.1.2, colors@^1.3.3: - version "1.4.0" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" - integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== - columnify@^1.5.4: version "1.6.0" resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.6.0.tgz#6989531713c9008bb29735e61e37acf5bd553cf3" @@ -6367,16 +6276,16 @@ copyfiles@2.4.1: yargs "^16.1.0" core-js-compat@^3.25.1, core-js-compat@^3.6.2: - version "3.25.1" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.25.1.tgz#6f13a90de52f89bbe6267e5620a412c7f7ff7e42" - integrity sha512-pOHS7O0i8Qt4zlPW/eIFjwp+NrTPx+wTL0ctgI2fHn31sZOq89rDsmtc/A2vAX7r6shl+bmVI+678He46jgBlw== + version "3.25.3" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.25.3.tgz#d6a442a03f4eade4555d4e640e6a06151dd95d38" + integrity sha512-xVtYpJQ5grszDHEUU9O7XbjjcZ0ccX3LgQsyqSvTnjX97ZqEgn9F5srmrwwwMtbKzDllyFPL+O+2OFMl1lU4TQ== dependencies: - browserslist "^4.21.3" + browserslist "^4.21.4" core-js-pure@^3.25.1: - version "3.25.1" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.25.1.tgz#79546518ae87cc362c991d9c2d211f45107991ee" - integrity sha512-7Fr74bliUDdeJCBMxkkIuQ4xfxn/SwrVg+HkJUAoNEXVqYLv55l6Af0dJ5Lq2YBUW9yKqSkLXaS5SYPK6MGa/A== + version "3.25.3" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.25.3.tgz#66ac5bfa5754b47fdfd14f3841c5ed21c46db608" + integrity sha512-T/7qvgv70MEvRkZ8p6BasLZmOVYKzOaWNBEHAU8FmveCJkl4nko2quqPQOmy6AJIp5MBanhz9no3A94NoRb0XA== core-js@^2.4.0: version "2.6.12" @@ -6384,9 +6293,9 @@ core-js@^2.4.0: integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== core-js@^3.5.0: - version "3.25.1" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.25.1.tgz#5818e09de0db8956e16bf10e2a7141e931b7c69c" - integrity sha512-sr0FY4lnO1hkQ4gLDr24K0DGnweGO1QwSj5BpfQjpSJPdqWalja4cTps29Y/PJVG/P7FYlPDkH3hO+Tr0CvDgQ== + version "3.25.3" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.25.3.tgz#cbc2be50b5ddfa7981837bd8c41639f27b166593" + integrity sha512-y1hvKXmPHvm5B7w4ln1S4uc9eV/O5+iFExSRUimnvIph11uaizFR8LFMdONN8hG3P2pipUfX4Y/fR8rAEtcHcQ== core-util-is@1.0.2: version "1.0.2" @@ -6398,17 +6307,6 @@ core-util-is@~1.0.0: resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== -cosmiconfig@6.0.0, cosmiconfig@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-6.0.0.tgz#da4fee853c52f6b1e6935f41c1a2fc50bd4a9982" - integrity sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg== - dependencies: - "@types/parse-json" "^4.0.0" - import-fresh "^3.1.0" - parse-json "^5.0.0" - path-type "^4.0.0" - yaml "^1.7.2" - cosmiconfig@^5.0.0, cosmiconfig@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a" @@ -6419,6 +6317,17 @@ cosmiconfig@^5.0.0, cosmiconfig@^5.2.1: js-yaml "^3.13.1" parse-json "^4.0.0" +cosmiconfig@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-6.0.0.tgz#da4fee853c52f6b1e6935f41c1a2fc50bd4a9982" + integrity sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg== + dependencies: + "@types/parse-json" "^4.0.0" + import-fresh "^3.1.0" + parse-json "^5.0.0" + path-type "^4.0.0" + yaml "^1.7.2" + cosmiconfig@^7.0.0: version "7.0.1" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.1.tgz#714d756522cace867867ccb4474c5d01bbae5d6d" @@ -6851,9 +6760,9 @@ decamelize@^1.1.0, decamelize@^1.2.0: integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== decimal.js@^10.2.1: - version "10.4.0" - resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.0.tgz#97a7448873b01e92e5ff9117d89a7bca8e63e0fe" - integrity sha512-Nv6ENEzyPQ6AItkGwLE2PGKinZZ9g59vSh2BeH6NqPu0OTKZ5ruJsVqh/orbAnqXc9pBbgXAIrc2EyaCj8NpGg== + version "10.4.1" + resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.1.tgz#be75eeac4a2281aace80c1a8753587c27ef053e7" + integrity sha512-F29o+vci4DodHYT9UrR5IEbfBw9pE5eSapIJdTqXK5+6hq+t8VRxwQyKlW2i+KDKFkkJQRvFyI/QXD83h8LyQw== decode-uri-component@^0.2.0: version "0.2.0" @@ -7301,11 +7210,6 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== -ejs@^2.6.1: - version "2.7.4" - resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.7.4.tgz#48661287573dcc53e366c7a1ae52c3a120eec9ba" - integrity sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA== - electron-fetch@^1.7.2: version "1.7.4" resolved "https://registry.yarnpkg.com/electron-fetch/-/electron-fetch-1.7.4.tgz#af975ab92a14798bfaa025f88dcd2e54a7b0b769" @@ -7314,9 +7218,9 @@ electron-fetch@^1.7.2: encoding "^0.1.13" electron-to-chromium@^1.3.378, electron-to-chromium@^1.4.251: - version "1.4.253" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.253.tgz#3402fd2159530fc6d94237f1b9535fa7bebaf399" - integrity sha512-1pezJ2E1UyBTGbA7fUlHdPSXQw1k+82VhTFLG5G0AUqLGvsZqFzleOblceqegZzxYX4kC7hGEEdzIQI9RZ1Cuw== + version "1.4.265" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.265.tgz#45630ae190228f945ff79c060b99574b1347e5a7" + integrity sha512-38KaYBNs0oCzWCpr6j7fY/W9vF0vSp4tKFIshQTgdZMhUpkxgotkQgjJP6iGMdmlsgMs3i0/Hkko4UXLTrkYVQ== elliptic@6.5.4, elliptic@^6.5.3: version "6.5.4" @@ -7389,13 +7293,6 @@ enhanced-resolve@^4.0.0, enhanced-resolve@^4.1.0: memory-fs "^0.5.0" tapable "^1.0.0" -enquirer@2.3.4: - version "2.3.4" - resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.4.tgz#c608f2e1134c7f68c1c9ee056de13f9b31076de9" - integrity sha512-pkYrrDZumL2VS6VBGDhqbajCM2xpkUNLuKfGPjfKaSIBKYopQbqEFyrOkRMIb2HDR/rO1kGhEt/5twBwtzKBXw== - dependencies: - ansi-colors "^3.2.1" - enquirer@^2.3.5: version "2.3.6" resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" @@ -7443,21 +7340,21 @@ error-ex@^1.2.0, error-ex@^1.3.1: is-arrayish "^0.2.1" es-abstract@^1.17.2, es-abstract@^1.19.0, es-abstract@^1.19.1, es-abstract@^1.19.2, es-abstract@^1.19.5, es-abstract@^1.20.0, es-abstract@^1.20.1: - version "1.20.2" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.20.2.tgz#8495a07bc56d342a3b8ea3ab01bd986700c2ccb3" - integrity sha512-XxXQuVNrySBNlEkTYJoDNFe5+s2yIOpzq80sUHEdPdQr0S5nTLz4ZPPPswNIpKseDDUS5yghX1gfLIHQZ1iNuQ== + version "1.20.3" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.20.3.tgz#90b143ff7aedc8b3d189bcfac7f1e3e3f81e9da1" + integrity sha512-AyrnaKVpMzljIdwjzrj+LxGmj8ik2LckwXacHqrJJ/jxz6dDDBcZ7I7nlHM0FvEW8MfbWJwOd+yT2XzYW49Frw== dependencies: call-bind "^1.0.2" es-to-primitive "^1.2.1" function-bind "^1.1.1" function.prototype.name "^1.1.5" - get-intrinsic "^1.1.2" + get-intrinsic "^1.1.3" get-symbol-description "^1.0.0" has "^1.0.3" has-property-descriptors "^1.0.0" has-symbols "^1.0.3" internal-slot "^1.0.3" - is-callable "^1.2.4" + is-callable "^1.2.6" is-negative-zero "^2.0.2" is-regex "^1.1.4" is-shared-array-buffer "^1.0.2" @@ -7467,6 +7364,7 @@ es-abstract@^1.17.2, es-abstract@^1.19.0, es-abstract@^1.19.1, es-abstract@^1.19 object-keys "^1.1.1" object.assign "^4.1.4" regexp.prototype.flags "^1.4.3" + safe-regex-test "^1.0.0" string.prototype.trimend "^1.0.5" string.prototype.trimstart "^1.0.5" unbox-primitive "^1.0.2" @@ -8000,22 +7898,6 @@ execa@^1.0.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -execa@^3.0.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-3.4.0.tgz#c08ed4550ef65d858fac269ffc8572446f37eb89" - integrity sha512-r9vdGQk4bmCuK1yKQu1KTwcT2zwfWdbdaXfCtAh+5nU/4fSX+JAb7vZGvI5naJrQlvONrEB20jeruESI69530g== - dependencies: - cross-spawn "^7.0.0" - get-stream "^5.0.0" - human-signals "^1.1.1" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.0" - onetime "^5.1.0" - p-finally "^2.0.0" - signal-exit "^3.0.2" - strip-final-newline "^2.0.0" - execa@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/execa/-/execa-4.1.0.tgz#4e5491ad1572f2f17a77d388c6c857135b22847a" @@ -8180,6 +8062,17 @@ extglob@^2.0.4: snapdragon "^0.8.1" to-regex "^3.0.1" +extract-zip@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-2.0.1.tgz#663dca56fe46df890d5f131ef4a06d22bb8ba13a" + integrity sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg== + dependencies: + debug "^4.1.1" + get-stream "^5.1.0" + yauzl "^2.10.0" + optionalDependencies: + "@types/yauzl" "^2.9.1" + extsprintf@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" @@ -8265,12 +8158,19 @@ faye-websocket@~0.11.1: websocket-driver ">=0.5.1" fb-watchman@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.1.tgz#fc84fb39d2709cf3ff6d743706157bb5708a8a85" - integrity sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg== + version "2.0.2" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.2.tgz#e9524ee6b5c77e9e5001af0f85f3adbb8623255c" + integrity sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA== dependencies: bser "2.1.1" +fd-slicer@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" + integrity sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g== + dependencies: + pend "~1.2.0" + figgy-pudding@^3.5.1: version "3.5.2" resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.2.tgz#b4eee8148abb01dcf1d1ac34367d59e12fa61d6e" @@ -8608,14 +8508,6 @@ fs-extra@^9.0.1, fs-extra@^9.1.0: jsonfile "^6.0.1" universalify "^2.0.0" -fs-jetpack@^2.2.2: - version "2.4.0" - resolved "https://registry.yarnpkg.com/fs-jetpack/-/fs-jetpack-2.4.0.tgz#6080c4ab464a019d37a404baeb47f32af8835026" - integrity sha512-S/o9Dd7K9A7gicVU32eT8G0kHcmSu0rCVdP79P0MWInKFb8XpTc8Syhoo66k9no+HDshtlh4pUJTws8X+8fdFQ== - dependencies: - minimatch "^3.0.2" - rimraf "^2.6.3" - fs-minipass@^1.2.7: version "1.2.7" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" @@ -8717,7 +8609,7 @@ get-caller-file@^2.0.1, get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1, get-intrinsic@^1.1.2: +get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.3.tgz#063c84329ad93e83893c7f4f243ef63ffa351385" integrity sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A== @@ -8768,7 +8660,7 @@ get-stream@^4.0.0: dependencies: pump "^3.0.0" -get-stream@^5.0.0: +get-stream@^5.0.0, get-stream@^5.1.0: version "5.2.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== @@ -8959,43 +8851,6 @@ globby@^6.1.0: pify "^2.0.0" pinkie-promise "^2.0.0" -gluegun@4.6.1: - version "4.6.1" - resolved "https://registry.yarnpkg.com/gluegun/-/gluegun-4.6.1.tgz#f2a65d20378873de87a2143b8c3939ffc9a9e2b6" - integrity sha512-Jd5hV1Uku2rjBg59mYA/bnwLwynK7u9A1zmK/LIb/p5d3pzjDCKRjWFuxZXyPwl9rsvKGhJUQxkFo2HEy8crKQ== - dependencies: - apisauce "^2.0.1" - app-module-path "^2.2.0" - cli-table3 "~0.5.0" - colors "^1.3.3" - cosmiconfig "6.0.0" - cross-spawn "^7.0.0" - ejs "^2.6.1" - enquirer "2.3.4" - execa "^3.0.0" - fs-jetpack "^2.2.2" - lodash.camelcase "^4.3.0" - lodash.kebabcase "^4.1.1" - lodash.lowercase "^4.3.0" - lodash.lowerfirst "^4.3.1" - lodash.pad "^4.5.1" - lodash.padend "^4.6.1" - lodash.padstart "^4.6.1" - lodash.repeat "^4.1.0" - lodash.snakecase "^4.1.1" - lodash.startcase "^4.4.0" - lodash.trim "^4.5.1" - lodash.trimend "^4.5.1" - lodash.trimstart "^4.5.1" - lodash.uppercase "^4.3.0" - lodash.upperfirst "^4.3.1" - ora "^4.0.0" - pluralize "^8.0.0" - ramdasauce "^2.1.0" - semver "^7.0.0" - which "^2.0.0" - yargs-parser "^16.1.0" - graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.3, graceful-fs@^4.2.4: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" @@ -9011,11 +8866,6 @@ graphql-tag@2.10.4: resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.10.4.tgz#2f301a98219be8b178a6453bb7e33b79b66d8f83" integrity sha512-O7vG5BT3w6Sotc26ybcvLKNTdfr4GfsIVMD+LdYqXCeJIYPRyp8BIsDOUtxw7S1PYvRw5vH3278J2EDezR6mfA== -graphql-tag@2.11.0: - version "2.11.0" - resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.11.0.tgz#1deb53a01c46a7eb401d6cb59dec86fa1cccbffd" - integrity sha512-VmsD5pJqWJnQZMUeRwrDhfgoyqcfwEkvtpANqcoUG8/tOLkwNgU9mzub/Mc78OJMhHjx7gfAMTxzdG43VGg3bA== - graphql@15.5.0: version "15.5.0" resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.5.0.tgz#39d19494dbe69d1ea719915b578bf920344a69d5" @@ -9892,10 +9742,10 @@ is-buffer@^1.0.2, is-buffer@^1.1.5: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== -is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.4: - version "1.2.6" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.6.tgz#fd6170b0b8c7e2cc73de342ef8284a2202023c44" - integrity sha512-krO72EO2NptOGAX2KYyqbP9vYMlNAXdB53rq6f8LXY6RY7JdSR/3BD6wLUlPHSAesmY9vstNrjvqGaCiRK/91Q== +is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.6: + version "1.2.7" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" + integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== is-ci@^2.0.0: version "2.0.0" @@ -10042,11 +9892,6 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: dependencies: is-extglob "^2.1.1" -is-interactive@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" - integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== - is-ip@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/is-ip/-/is-ip-3.1.0.tgz#2ae5ddfafaf05cb8008a62093cf29734f657c5d8" @@ -11329,29 +11174,21 @@ js-tokens@^3.0.2: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" integrity sha512-RjTcuD4xjtthQkaWH7dFlH85L+QaVtSoOyGdZ3g6HFhS9dFNDfLyqgm2NFe2X6cQpeFmt0452FJjFG5UameExg== -js-yaml@3.14.0: - version "3.14.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.0.tgz#a7a34170f26a21bb162424d8adacb4113a69e482" - integrity sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A== +js-yaml@^3.13.1: + version "3.14.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" + integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== dependencies: argparse "^1.0.7" esprima "^4.0.0" -js-yaml@4.1.0, js-yaml@^4.1.0: +js-yaml@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== dependencies: argparse "^2.0.1" -js-yaml@^3.13.1: - version "3.14.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" @@ -11873,11 +11710,6 @@ lodash._reinterpolate@^3.0.0: resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" integrity sha512-xYHt68QRoYGjeeM/XOE1uJtvXQAgvszfBhjV4yvsQH0u2i9I6cI6c6/eG4Hh3UAOVn0y/xAXwmTzEay49Q//HA== -lodash.camelcase@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" - integrity sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA== - lodash.clonedeep@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" @@ -11893,66 +11725,26 @@ lodash.ismatch@^4.4.0: resolved "https://registry.yarnpkg.com/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz#756cb5150ca3ba6f11085a78849645f188f85f37" integrity sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g== -lodash.kebabcase@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz#8489b1cb0d29ff88195cceca448ff6d6cc295c36" - integrity sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g== - -lodash.lowercase@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/lodash.lowercase/-/lodash.lowercase-4.3.0.tgz#46515aced4acb0b7093133333af068e4c3b14e9d" - integrity sha512-UcvP1IZYyDKyEL64mmrwoA1AbFu5ahojhTtkOUr1K9dbuxzS9ev8i4TxMMGCqRC9TE8uDaSoufNAXxRPNTseVA== - -lodash.lowerfirst@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/lodash.lowerfirst/-/lodash.lowerfirst-4.3.1.tgz#de3c7b12e02c6524a0059c2f6cb7c5c52655a13d" - integrity sha512-UUKX7VhP1/JL54NXg2aq/E1Sfnjjes8fNYTNkPU8ZmsaVeBvPHKdbNaN79Re5XRL01u6wbq3j0cbYZj71Fcu5w== - lodash.memoize@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag== -lodash.pad@^4.5.1: - version "4.5.1" - resolved "https://registry.yarnpkg.com/lodash.pad/-/lodash.pad-4.5.1.tgz#4330949a833a7c8da22cc20f6a26c4d59debba70" - integrity sha512-mvUHifnLqM+03YNzeTBS1/Gr6JRFjd3rRx88FHWUvamVaT9k2O/kXha3yBSOwB9/DTQrSTLJNHvLBBt2FdX7Mg== - -lodash.padend@^4.6.1: - version "4.6.1" - resolved "https://registry.yarnpkg.com/lodash.padend/-/lodash.padend-4.6.1.tgz#53ccba047d06e158d311f45da625f4e49e6f166e" - integrity sha512-sOQs2aqGpbl27tmCS1QNZA09Uqp01ZzWfDUoD+xzTii0E7dSQfRKcRetFwa+uXaxaqL+TKm7CgD2JdKP7aZBSw== - -lodash.padstart@^4.6.1: - version "4.6.1" - resolved "https://registry.yarnpkg.com/lodash.padstart/-/lodash.padstart-4.6.1.tgz#d2e3eebff0d9d39ad50f5cbd1b52a7bce6bb611b" - integrity sha512-sW73O6S8+Tg66eY56DBk85aQzzUJDtpoXFBgELMd5P/SotAguo+1kYO6RuYgXxA4HJH3LFTFPASX6ET6bjfriw== - -lodash.repeat@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/lodash.repeat/-/lodash.repeat-4.1.0.tgz#fc7de8131d8c8ac07e4b49f74ffe829d1f2bec44" - integrity sha512-eWsgQW89IewS95ZOcr15HHCX6FVDxq3f2PNUIng3fyzsPev9imFQxIYdFZ6crl8L56UR6ZlGDLcEb3RZsCSSqw== +lodash.merge@4.6.2: + version "4.6.2" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" + integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== lodash.set@^4.3.2: version "4.3.2" resolved "https://registry.yarnpkg.com/lodash.set/-/lodash.set-4.3.2.tgz#d8757b1da807dde24816b0d6a84bea1a76230b23" integrity sha512-4hNPN5jlm/N/HLMCO43v8BXKq9Z7QdAGc/VGrRD61w8gN9g/6jF9A4L1pbUgBLCffi0w9VsXfTOij5x8iTyFvg== -lodash.snakecase@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz#39d714a35357147837aefd64b5dcbb16becd8f8d" - integrity sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw== - lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" integrity sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA== -lodash.startcase@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/lodash.startcase/-/lodash.startcase-4.4.0.tgz#9436e34ed26093ed7ffae1936144350915d9add8" - integrity sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg== - lodash.template@^4.4.0, lodash.template@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.5.0.tgz#f976195cf3f347d0d5f52483569fe8031ccce8ab" @@ -11968,21 +11760,6 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "^3.0.0" -lodash.trim@^4.5.1: - version "4.5.1" - resolved "https://registry.yarnpkg.com/lodash.trim/-/lodash.trim-4.5.1.tgz#36425e7ee90be4aa5e27bcebb85b7d11ea47aa57" - integrity sha512-nJAlRl/K+eiOehWKDzoBVrSMhK0K3A3YQsUNXHQa5yIrKBAhsZgSu3KoAFoFT+mEgiyBHddZ0pRk1ITpIp90Wg== - -lodash.trimend@^4.5.1: - version "4.5.1" - resolved "https://registry.yarnpkg.com/lodash.trimend/-/lodash.trimend-4.5.1.tgz#12804437286b98cad8996b79414e11300114082f" - integrity sha512-lsD+k73XztDsMBKPKvzHXRKFNMohTjoTKIIo4ADLn5dA65LZ1BqlAvSXhR2rPEC3BgAUQnzMnorqDtqn2z4IHA== - -lodash.trimstart@^4.5.1: - version "4.5.1" - resolved "https://registry.yarnpkg.com/lodash.trimstart/-/lodash.trimstart-4.5.1.tgz#8ff4dec532d82486af59573c39445914e944a7f1" - integrity sha512-b/+D6La8tU76L/61/aN0jULWHkT0EeJCmVstPBn/K9MtD2qBW83AsBNrr63dKuWYwVMO7ucv13QNO/Ek/2RKaQ== - lodash.truncate@^4.4.2: version "4.4.2" resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" @@ -11993,28 +11770,11 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ== -lodash.uppercase@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/lodash.uppercase/-/lodash.uppercase-4.3.0.tgz#c404abfd1469f93931f9bb24cf6cc7d57059bc73" - integrity sha512-+Nbnxkj7s8K5U8z6KnEYPGUOGp3woZbB7Ecs7v3LkkjLQSm2kP9SKIILitN1ktn2mB/tmM9oSlku06I+/lH7QA== - -lodash.upperfirst@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz#1365edf431480481ef0d1c68957a5ed99d49f7ce" - integrity sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg== - lodash@4.x, "lodash@>=3.5 <5", lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.5, lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -log-symbols@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-3.0.0.tgz#f3a08516a5dea893336a7dee14d18a1cfdab77c4" - integrity sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ== - dependencies: - chalk "^2.4.2" - loglevel@^1.6.6: version "1.8.0" resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.8.0.tgz#e7ec73a57e1e7b419cb6c6ac06bf050b67356114" @@ -12412,7 +12172,7 @@ minimatch@3.0.4: dependencies: brace-expansion "^1.1.7" -minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4, minimatch@^3.1.1: +minimatch@^3.0.3, minimatch@^3.0.4, minimatch@^3.1.1: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== @@ -12727,9 +12487,9 @@ multiformats@9.7.0: integrity sha512-uv/tcgwk0yN4DStopnBN4GTgvaAlYdy6KnZpuzEPFOYQd71DYFJjs0MN1ERElAflrZaYyGBWXyGxL5GgrxIx0Q== multiformats@^9.4.2: - version "9.8.1" - resolved "https://registry.yarnpkg.com/multiformats/-/multiformats-9.8.1.tgz#0e5f2910cf0c34f55adf0602f920775f9622552a" - integrity sha512-Cu7NfUYtCV+WN7w59WsRRF138S+um4tTo11ScYsWbNgWyCEGOu8wID1e5eMJs91gFZ0I7afodkkdxCF8NGkqZQ== + version "9.9.0" + resolved "https://registry.yarnpkg.com/multiformats/-/multiformats-9.9.0.tgz#c68354e7d21037a8f1f8833c8ccd68618e8f1d37" + integrity sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg== multihashes@^0.4.15, multihashes@~0.4.15, multihashes@~0.4.19: version "0.4.21" @@ -13437,33 +13197,6 @@ optionator@^0.9.1: type-check "^0.4.0" word-wrap "^1.2.3" -ora@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/ora/-/ora-4.0.0.tgz#374c4ee8c5fb91b5dbcd82de199f188d3e8fd5ec" - integrity sha512-2RaV0LWJgpWEjvpsW57H8pnzdVQJrtAr4VGk9cIqn58ePx5k1b0H3h9DS2Qj4cL1Cm012JSeg+7AcVNsis6AVQ== - dependencies: - chalk "^2.4.2" - cli-cursor "^3.1.0" - cli-spinners "^2.2.0" - is-interactive "^1.0.0" - log-symbols "^3.0.0" - strip-ansi "^5.2.0" - wcwidth "^1.0.1" - -ora@^4.0.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ora/-/ora-4.1.1.tgz#566cc0348a15c36f5f0e979612842e02ba9dddbc" - integrity sha512-sjYP8QyVWBpBZWD6Vr1M/KwknSw6kJOz41tvGMlwWeClHBtYKTbHMki1PsLZnxKpXMPbTKv9b3pjQu3REib96A== - dependencies: - chalk "^3.0.0" - cli-cursor "^3.1.0" - cli-spinners "^2.2.0" - is-interactive "^1.0.0" - log-symbols "^3.0.0" - mute-stream "0.0.8" - strip-ansi "^6.0.0" - wcwidth "^1.0.1" - os-browserify@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" @@ -13540,11 +13273,6 @@ p-finally@^1.0.0: resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" integrity sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow== -p-finally@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-2.0.1.tgz#bd6fcaa9c559a096b680806f4d657b3f0f240561" - integrity sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw== - p-is-promise@^2.0.0, p-is-promise@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" @@ -13898,6 +13626,11 @@ pbkdf2@^3.0.3: safe-buffer "^5.0.1" sha.js "^2.4.8" +pend@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" + integrity sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg== + performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" @@ -13983,11 +13716,6 @@ pkg-up@3.1.0, pkg-up@^3.1.0: dependencies: find-up "^3.0.0" -pluralize@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-8.0.0.tgz#1a6fa16a38d12a1901e0320fa017051c539ce3b1" - integrity sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA== - pn@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" @@ -15035,18 +14763,6 @@ railroad-diagrams@^1.0.0: resolved "https://registry.yarnpkg.com/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz#eb7e6267548ddedfb899c1b90e57374559cddb7e" integrity sha512-cz93DjNeLY0idrCNOH6PviZGRN9GJhsdm9hpn1YCS879fj4W+x5IFJhhkRZcwVgMmFF7R82UA/7Oh+R8lLZg6A== -ramda@^0.24.1: - version "0.24.1" - resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.24.1.tgz#c3b7755197f35b8dc3502228262c4c91ddb6b857" - integrity sha512-HEm619G8PaZMfkqCa23qiOe7r3R0brPu7ZgOsgKUsnvLhd0qhc/vTjkUovomgPWa5ECBa08fJZixth9LaoBo5w== - -ramdasauce@^2.1.0: - version "2.1.3" - resolved "https://registry.yarnpkg.com/ramdasauce/-/ramdasauce-2.1.3.tgz#acb45ecc7e4fc4d6f39e19989b4a16dff383e9c2" - integrity sha512-Ml3CPim4SKwmg5g9UI77lnRSeKr/kQw7YhQ6rfdMcBYy6DMlwmkEwQqjygJ3OhxPR+NfFfpjKl3Tf8GXckaqqg== - dependencies: - ramda "^0.24.1" - randexp@0.4.6: version "0.4.6" resolved "https://registry.yarnpkg.com/randexp/-/randexp-0.4.6.tgz#e986ad5e5e31dae13ddd6f7b3019aa7c87f60ca3" @@ -15867,6 +15583,15 @@ safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== +safe-regex-test@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.0.tgz#793b874d524eb3640d1873aad03596db2d4f2295" + integrity sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.3" + is-regex "^1.1.4" + safe-regex@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" @@ -15989,7 +15714,7 @@ semver@7.3.5: dependencies: lru-cache "^6.0.0" -semver@7.x, semver@^7.0.0, semver@^7.1.1, semver@^7.1.3, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5: +semver@7.x, semver@^7.1.1, semver@^7.1.3, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5: version "7.3.7" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f" integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== @@ -17143,6 +16868,11 @@ toidentifier@1.0.1: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== +toml@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/toml/-/toml-3.0.0.tgz#342160f1af1904ec9d204d03a5d61222d762c5ee" + integrity sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w== + tough-cookie@^2.3.3, tough-cookie@^2.3.4, tough-cookie@^2.5.0, tough-cookie@~2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" @@ -17281,7 +17011,7 @@ tslib@^1.8.1, tslib@^1.9.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.0: +tslib@^2.0.3, tslib@^2.1.0: version "2.4.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== @@ -17390,14 +17120,14 @@ typescript@4.0.7: integrity sha512-yi7M4y74SWvYbnazbn8/bmJmX4Zlej39ZOqwG/8dut/MYoSQ119GY9ZFbbGsD4PFZYWxqik/XsP3vk3+W5H3og== typescript@^4.0: - version "4.8.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.3.tgz#d59344522c4bc464a65a730ac695007fdb66dd88" - integrity sha512-goMHfm00nWPa8UvR/CPSvykqf6dVV8x/dp0c5mFTMTIu0u0FlGWRioyy7Nn0PGAdHxpJZnuO/ut+PpQ8UiHAig== + version "4.8.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6" + integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ== uglify-js@^3.1.4: - version "3.17.0" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.0.tgz#55bd6e9d19ce5eef0d5ad17cd1f587d85b180a85" - integrity sha512-aTeNPVmgIMPpm1cxXr2Q/nEbvkmV8yq66F3om7X3P/cvOXQ0TMQ64Wk63iyT1gPlmdmGzjGpyLh1f3y8MZWXGg== + version "3.17.2" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.2.tgz#f55f668b9a64b213977ae688703b6bbb7ca861c6" + integrity sha512-bbxglRjsGQMchfvXZNusUcYgiB9Hx2K4AHYXQy2DITZ9Rd+JzhX7+hoocE5Winr7z2oHvPsekkBwXtigvxevXg== uid-number@0.0.6: version "0.0.6" @@ -17688,16 +17418,16 @@ utils-merge@1.0.1: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== -uuid@8.3.2, uuid@^8.3.0: - version "8.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" - integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== - uuid@^3.0.1, uuid@^3.3.2: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== +uuid@^8.3.0: + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== + v8-compile-cache-lib@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" @@ -17801,9 +17531,9 @@ vscode-nls@^5.0.0: integrity sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng== vscode-uri@^3.0.3: - version "3.0.5" - resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.5.tgz#3dd5a9e154e7c9a40de5eaa450a0ce59b435e584" - integrity sha512-bBp2pi1o6ynwlnGL8Tt6UBL1w3VsVZtHCU/Sl73bRfqjno3jMcVSCybdY+hj+31A8FQOELZJWwY+shLVLtcNew== + version "3.0.6" + resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.6.tgz#5e6e2e1a4170543af30151b561a41f71db1d6f91" + integrity sha512-fmL7V1eiDBFRRnu+gfRWTzyPpNIHJTc4mWnFkwBUmO9U3KPgJAmTx7oxi2bl/Rh6HLdU7+4C9wlj0k2E4AdKFQ== w3c-hr-time@^1.0.1, w3c-hr-time@^1.0.2: version "1.0.2" @@ -17860,7 +17590,7 @@ wbuf@^1.1.0, wbuf@^1.7.3: dependencies: minimalistic-assert "^1.0.0" -wcwidth@^1.0.0, wcwidth@^1.0.1: +wcwidth@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" integrity sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg== @@ -18102,7 +17832,7 @@ which@^1.2.9, which@^1.3.0, which@^1.3.1: dependencies: isexe "^2.0.0" -which@^2.0.0, which@^2.0.1, which@^2.0.2: +which@^2.0.1, which@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== @@ -18388,11 +18118,6 @@ ws@7.2.3: resolved "https://registry.yarnpkg.com/ws/-/ws-7.2.3.tgz#a5411e1fb04d5ed0efee76d26d5c46d830c39b46" integrity sha512-HTDl9G9hbkNDk98naoR/cHDws7+EyYMOdL1BmjsZXRUjf7d+MficC4B7HLUPlSiho0vg+CWKrGIt/VJBd1xunQ== -ws@7.3.1: - version "7.3.1" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.3.1.tgz#d0547bf67f7ce4f12a72dfe31262c68d7dc551c8" - integrity sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA== - ws@7.4.6: version "7.4.6" resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" @@ -18459,6 +18184,11 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== +yaml@2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.1.3.tgz#9b3a4c8aff9821b696275c79a8bee8399d945207" + integrity sha512-AacA8nRULjKMX2DvWvOAdBZMOfQlypSFkjcOcu9FalllIDJ1kvlREzcdIZmidQUqqeMv7jorHjq2HlLv/+c2lg== + yaml@^1.10.0, yaml@^1.10.2, yaml@^1.7.2: version "1.10.2" resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" @@ -18490,14 +18220,6 @@ yargs-parser@^13.1.2: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^16.1.0: - version "16.1.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-16.1.0.tgz#73747d53ae187e7b8dbe333f95714c76ea00ecf1" - integrity sha512-H/V41UNZQPkUMIT5h5hiwg4QKIY1RPvoBV4XcjUbRM8Bk2oKqqyZ0DIEbTFZB0XjbtSPG8SAa/0DxCQmiRgzKg== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - yargs-parser@^18.1.2: version "18.1.3" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" @@ -18570,14 +18292,20 @@ yargs@^16.1.0, yargs@^16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" +yauzl@^2.10.0: + version "2.10.0" + resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" + integrity sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g== + dependencies: + buffer-crc32 "~0.2.3" + fd-slicer "~1.1.0" + +yesno@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/yesno/-/yesno-0.4.0.tgz#5d674f14d339f0bd4b0edc47f899612c74fcd895" + integrity sha512-tdBxmHvbXPBKYIg81bMCB7bVeDmHkRzk5rVJyYYXurwKkHq/MCd8rz4HSJUP7hW0H2NlXiq8IFiWvYKEHhlotA== + yn@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== - -zone.js@^0.11.0: - version "0.11.8" - resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.11.8.tgz#40dea9adc1ad007b5effb2bfed17f350f1f46a21" - integrity sha512-82bctBg2hKcEJ21humWIkXRlLBBmrc3nN7DFh5LGGhcyycO2S7FN8NmdvlcKaGFDNVL4/9kFLmwmInTavdJERA== - dependencies: - tslib "^2.3.0"