diff --git a/packages/core/interfaces/package.json b/packages/core/interfaces/package.json index 7fc887a0..8e702e3f 100644 --- a/packages/core/interfaces/package.json +++ b/packages/core/interfaces/package.json @@ -50,7 +50,7 @@ "dependencies": {}, "devDependencies": { "@multiformats/multiaddr": "11.3.0", - "@fluencelabs/avm": "0.48.0", + "@fluencelabs/avm": "0.52.0", "hotscript": "1.0.13" } } diff --git a/packages/core/js-client/package.json b/packages/core/js-client/package.json index b6ef1850..dbcdf21b 100644 --- a/packages/core/js-client/package.json +++ b/packages/core/js-client/package.json @@ -34,7 +34,7 @@ "dependencies": { "@chainsafe/libp2p-noise": "13.0.0", "@chainsafe/libp2p-yamux": "5.0.0", - "@fluencelabs/avm": "0.48.0", + "@fluencelabs/avm": "0.52.0", "@fluencelabs/interfaces": "workspace:*", "@fluencelabs/marine-worker": "0.3.3", "@libp2p/crypto": "2.0.3", diff --git a/packages/core/js-client/src/fetchers/index.ts b/packages/core/js-client/src/fetchers/index.ts deleted file mode 100644 index 152bc792..00000000 --- a/packages/core/js-client/src/fetchers/index.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright 2023 Fluence Labs Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import process from "process"; - -import { fetchResource as fetchResourceIsomorphic } from "#fetcher"; - -const isNode = - // process.release is undefined in browser env - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - typeof process !== "undefined" && process.release?.name === "node"; - -export async function fetchResource(pkg: string, path: string) { - switch (true) { - case isNode: - return fetchResourceIsomorphic(pkg, path); - default: - return fetchResourceIsomorphic(pkg, path); - } -} diff --git a/packages/core/js-client/src/index.ts b/packages/core/js-client/src/index.ts index a3470e09..5cc8e282 100644 --- a/packages/core/js-client/src/index.ts +++ b/packages/core/js-client/src/index.ts @@ -29,10 +29,11 @@ import { BlobWorker, Worker } from "threads/master"; import { ClientPeer, makeClientPeerConfig } from "./clientPeer/ClientPeer.js"; import { callAquaFunction } from "./compilerSupport/callFunction.js"; import { registerService } from "./compilerSupport/registerService.js"; -import { fetchResource } from "./fetchers/index.js"; import { MarineBackgroundRunner } from "./marine/worker/index.js"; import { doRegisterNodeUtils } from "./services/NodeUtils.js"; +import { fetchResource } from "#fetcher"; + const isNode = // process.release is undefined in browser env // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 29d3ffa0..c6fbe3f3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -188,8 +188,8 @@ importers: packages/core/interfaces: devDependencies: '@fluencelabs/avm': - specifier: 0.48.0 - version: 0.48.0 + specifier: 0.52.0 + version: 0.52.0 '@multiformats/multiaddr': specifier: 11.3.0 version: 11.3.0 @@ -206,8 +206,8 @@ importers: specifier: 5.0.0 version: 5.0.0 '@fluencelabs/avm': - specifier: 0.48.0 - version: 0.48.0 + specifier: 0.52.0 + version: 0.52.0 '@fluencelabs/interfaces': specifier: workspace:* version: link:../interfaces @@ -3859,8 +3859,8 @@ packages: resolution: {integrity: sha512-+JVbWmHeGB+X/BSqmk6/B0gwWJ4bEAxkepVTN8l0mVrJ5zRRmYaCKVplWy6Z3W012m3VVK3A1o3rm/fgfVrQkw==} dev: true - /@fluencelabs/avm@0.48.0: - resolution: {integrity: sha512-9sXyKx2jp8JvmGUIddb7iILq9KN6d1PoCNSvrzIej4yP+pCxpiY9elgeaSoGY5yHcPClNnvHBKcenL23mdUckg==} + /@fluencelabs/avm@0.52.0: + resolution: {integrity: sha512-T+/Hv/ZPfwWZAC4tH6wEDIRmtN6cTBebqbCaHfaq2PDLSMG0BgssdFF2BAaEXrvOvJbI5Bu/9bQhHv4ga7bYlA==} /@fluencelabs/cli@0.7.2(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(@nomicfoundation/hardhat-chai-matchers@1.0.6)(@nomicfoundation/hardhat-network-helpers@1.0.8)(@nomiclabs/hardhat-ethers@2.2.3)(@nomiclabs/hardhat-etherscan@3.1.7)(@typechain/ethers-v5@10.2.1)(@typechain/hardhat@6.1.6)(@types/chai@4.3.5)(@types/mocha@9.1.1)(@types/node@20.7.0)(chai@4.3.10)(hardhat-gas-reporter@1.0.9)(hardhat@2.15.0)(solidity-coverage@0.7.22)(ts-node@10.9.1)(typechain@8.2.0)(typescript@5.1.6): resolution: {integrity: sha512-cXhlXBxNh1i66Twb3Nhpm1mXHpa+8zzoQ5wKJ6zJjOtrw6GWB6WrfIAb+aaLGWJMBnWHcZEkXs5vx9vwvVplcQ==} @@ -4452,6 +4452,8 @@ packages: protons-runtime: 5.0.2(uint8arraylist@2.4.3) uint8arraylist: 2.4.3 uint8arrays: 4.0.6 + transitivePeerDependencies: + - supports-color /@libp2p/interface-connection@4.0.0: resolution: {integrity: sha512-6xx/NmEc84HX7QmsjSC3hHredQYjHv4Dkf4G27adAPf+qN+vnPxmQ7gaTnk243a0++DOFTbZ2gKX/15G2B6SRg==} @@ -4621,6 +4623,8 @@ packages: protons-runtime: 5.0.2(uint8arraylist@2.4.3) uint8arraylist: 2.4.3 uint8arrays: 4.0.6 + transitivePeerDependencies: + - supports-color /@libp2p/peer-id@2.0.1: resolution: {integrity: sha512-uGIR4rS+j+IzzIu0kih4MonZEfRmjGNfXaSPMIFOeMxZItZT6TIpxoVNYxHl4YtneSFKzlLnf9yx9EhRcyfy8Q==}