diff --git a/packages/core/js-client-isomorphic/package.json b/packages/core/js-client-isomorphic/package.json index 175178edc..5aecf653e 100644 --- a/packages/core/js-client-isomorphic/package.json +++ b/packages/core/js-client-isomorphic/package.json @@ -25,7 +25,7 @@ "@fluencelabs/avm": "0.52.0", "@fluencelabs/marine-js": "0.7.2", "@fluencelabs/marine-worker": "workspace:*", - "threads": "fluencelabs/threads.js#b00a5342380b0278d3ae56dcfb170effb3cad7cd" + "@fluencelabs/threads": "^2.0.0" }, "keywords": [], "author": "Fluence Labs", diff --git a/packages/core/js-client-isomorphic/src/types.ts b/packages/core/js-client-isomorphic/src/types.ts index 389bed28e..0fdf6f853 100644 --- a/packages/core/js-client-isomorphic/src/types.ts +++ b/packages/core/js-client-isomorphic/src/types.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Worker } from "threads/master"; +import { Worker } from "@fluencelabs/threads/master"; export type VersionedPackage = { name: string; version: string }; export type GetWorker = ( diff --git a/packages/core/js-client-isomorphic/src/worker-resolvers/browser.ts b/packages/core/js-client-isomorphic/src/worker-resolvers/browser.ts index c197c821f..7c8047031 100644 --- a/packages/core/js-client-isomorphic/src/worker-resolvers/browser.ts +++ b/packages/core/js-client-isomorphic/src/worker-resolvers/browser.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { BlobWorker } from "threads/master"; +import { BlobWorker } from "@fluencelabs/threads/master"; import { fetchResource } from "../fetchers/browser.js"; import type { GetWorker, VersionedPackage } from "../types.js"; diff --git a/packages/core/js-client-isomorphic/src/worker-resolvers/node.ts b/packages/core/js-client-isomorphic/src/worker-resolvers/node.ts index 6e23bf8ea..753e5e28b 100644 --- a/packages/core/js-client-isomorphic/src/worker-resolvers/node.ts +++ b/packages/core/js-client-isomorphic/src/worker-resolvers/node.ts @@ -18,7 +18,7 @@ import { createRequire } from "module"; import { dirname, relative } from "path"; import { fileURLToPath } from "url"; -import { Worker } from "threads/master"; +import { Worker } from "@fluencelabs/threads/master"; import type { GetWorker, VersionedPackage } from "../types.js"; diff --git a/packages/core/js-client/package.json b/packages/core/js-client/package.json index fcd0a5653..8fb534892 100644 --- a/packages/core/js-client/package.json +++ b/packages/core/js-client/package.json @@ -55,7 +55,7 @@ "libp2p": "0.46.6", "multiformats": "11.0.1", "rxjs": "7.5.5", - "threads": "fluencelabs/threads.js#b00a5342380b0278d3ae56dcfb170effb3cad7cd", + "@fluencelabs/threads": "^2.0.0", "ts-pattern": "3.3.3", "uint8arrays": "4.0.3", "uuid": "8.3.2", diff --git a/packages/core/js-client/src/marine/deps-loader/node.ts b/packages/core/js-client/src/marine/deps-loader/node.ts index 93b0877d3..2ee3ded79 100644 --- a/packages/core/js-client/src/marine/deps-loader/node.ts +++ b/packages/core/js-client/src/marine/deps-loader/node.ts @@ -19,7 +19,10 @@ import fs from "fs"; import { createRequire } from "module"; import path from "path"; -import { Worker, type Worker as WorkerImplementation } from "threads/master"; +import { + Worker, + type Worker as WorkerImplementation, +} from "@fluencelabs/threads/master"; import { LazyLoader } from "../interfaces.js"; diff --git a/packages/core/js-client/src/marine/interfaces.ts b/packages/core/js-client/src/marine/interfaces.ts index a1a2f0462..933ed6076 100644 --- a/packages/core/js-client/src/marine/interfaces.ts +++ b/packages/core/js-client/src/marine/interfaces.ts @@ -20,7 +20,7 @@ import { RunParameters, } from "@fluencelabs/avm"; import { JSONObject, JSONValue, JSONArray } from "@fluencelabs/interfaces"; -import type { Worker as WorkerImplementation } from "threads/master"; +import type { Worker as WorkerImplementation } from "@fluencelabs/threads/master"; import { IStartable, CallParameters } from "../util/commonTypes.js"; diff --git a/packages/core/js-client/src/marine/worker-script/workerLoader.ts b/packages/core/js-client/src/marine/worker-script/workerLoader.ts index 66b656a7d..d4fc8bd9f 100644 --- a/packages/core/js-client/src/marine/worker-script/workerLoader.ts +++ b/packages/core/js-client/src/marine/worker-script/workerLoader.ts @@ -14,7 +14,10 @@ * limitations under the License. */ -import { Worker, type Worker as WorkerImplementation } from "threads/master"; +import { + Worker, + type Worker as WorkerImplementation, +} from "@fluencelabs/threads/master"; import { LazyLoader } from "../interfaces.js"; diff --git a/packages/core/js-client/src/marine/worker/index.ts b/packages/core/js-client/src/marine/worker/index.ts index 21086b8ba..2716c8618 100644 --- a/packages/core/js-client/src/marine/worker/index.ts +++ b/packages/core/js-client/src/marine/worker/index.ts @@ -22,7 +22,7 @@ import type { } from "@fluencelabs/marine-js/dist/types"; import { LogFunction, logLevelToEnv } from "@fluencelabs/marine-js/dist/types"; import type { MarineBackgroundInterface } from "@fluencelabs/marine-worker"; -import { ModuleThread, Thread, spawn } from "threads/master"; +import { ModuleThread, Thread, spawn } from "@fluencelabs/threads/master"; import { MarineLogger, marineLogger } from "../../util/logger.js"; import { IMarineHost, IWasmLoader, IWorkerLoader } from "../interfaces.js"; diff --git a/packages/core/marine-worker/package.json b/packages/core/marine-worker/package.json index 57ef5a6ff..f47e6c503 100644 --- a/packages/core/marine-worker/package.json +++ b/packages/core/marine-worker/package.json @@ -26,6 +26,6 @@ "dependencies": { "@fluencelabs/marine-js": "0.7.2", "observable-fns": "0.6.1", - "threads": "fluencelabs/threads.js#b00a5342380b0278d3ae56dcfb170effb3cad7cd" + "@fluencelabs/threads": "^2.0.0" } } diff --git a/packages/core/marine-worker/src/index.ts b/packages/core/marine-worker/src/index.ts index 2faaad41a..cef426a2b 100644 --- a/packages/core/marine-worker/src/index.ts +++ b/packages/core/marine-worker/src/index.ts @@ -27,8 +27,8 @@ import type { LogMessage, } from "@fluencelabs/marine-js/dist/types"; import { JSONValue } from "@fluencelabs/marine-js/dist/types"; +import { expose } from "@fluencelabs/threads/worker"; import { Observable, Subject } from "observable-fns"; -import { expose } from "threads/worker"; const createSimpleModuleDescriptor = ( name: string, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9c9477f96..ba39e3a4b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -214,6 +214,9 @@ importers: '@fluencelabs/marine-worker': specifier: 0.4.0 version: link:../marine-worker + '@fluencelabs/threads': + specifier: ^2.0.0 + version: 2.0.0 '@libp2p/crypto': specifier: 2.0.3 version: 2.0.3 @@ -268,9 +271,6 @@ importers: rxjs: specifier: 7.5.5 version: 7.5.5 - threads: - specifier: fluencelabs/threads.js#b00a5342380b0278d3ae56dcfb170effb3cad7cd - version: github.com/fluencelabs/threads.js/b00a5342380b0278d3ae56dcfb170effb3cad7cd ts-pattern: specifier: 3.3.3 version: 3.3.3 @@ -329,21 +329,21 @@ importers: '@fluencelabs/marine-worker': specifier: workspace:* version: link:../marine-worker - threads: - specifier: fluencelabs/threads.js#b00a5342380b0278d3ae56dcfb170effb3cad7cd - version: github.com/fluencelabs/threads.js/b00a5342380b0278d3ae56dcfb170effb3cad7cd + '@fluencelabs/threads': + specifier: ^2.0.0 + version: 2.0.0 packages/core/marine-worker: dependencies: '@fluencelabs/marine-js': specifier: 0.7.2 version: 0.7.2 + '@fluencelabs/threads': + specifier: ^2.0.0 + version: 2.0.0 observable-fns: specifier: 0.6.1 version: 0.6.1 - threads: - specifier: fluencelabs/threads.js#b00a5342380b0278d3ae56dcfb170effb3cad7cd - version: github.com/fluencelabs/threads.js/b00a5342380b0278d3ae56dcfb170effb3cad7cd devDependencies: '@rollup/plugin-inject': specifier: 5.0.3 @@ -4043,6 +4043,19 @@ packages: resolution: {integrity: sha512-QFbknWwALLUWMzpWkFt34McuwTz9xwQuiPP1zXqhPqVZ1J6g8F3gwHHtzgHFW5Z7WrRmwsL+IQtFJy8YZubhDw==} dev: true + /@fluencelabs/threads@2.0.0: + resolution: {integrity: sha512-dgYpZg55OcEmop1U3G2bFKEJXg2avjXWYfWsdPlkSbHOHguaRifvr5bgwIYTg1wxoPGcn0jegcjKKwrY0qrV+g==} + dependencies: + callsites: 3.1.0 + debug: 4.3.4(supports-color@8.1.1) + is-observable: 2.1.0 + observable-fns: 0.6.1 + optionalDependencies: + tiny-worker: 2.3.0 + transitivePeerDependencies: + - supports-color + dev: false + /@fluencelabs/trust-graph@0.4.1: resolution: {integrity: sha512-V/6ts4q/Y0uKMS6orVpPyxfdd99YFMkm9wN9U2IFtlBUWNsQZG369FK9qEizwsSRCqTchMHYs8Vh4wgZ2uRfuQ==} dependencies: @@ -21018,19 +21031,3 @@ packages: /zod@3.22.4: resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} dev: false - - github.com/fluencelabs/threads.js/b00a5342380b0278d3ae56dcfb170effb3cad7cd: - resolution: {tarball: https://codeload.github.com/fluencelabs/threads.js/tar.gz/b00a5342380b0278d3ae56dcfb170effb3cad7cd} - name: threads - version: 1.7.0 - requiresBuild: true - dependencies: - callsites: 3.1.0 - debug: 4.3.4(supports-color@8.1.1) - is-observable: 2.1.0 - observable-fns: 0.6.1 - optionalDependencies: - tiny-worker: 2.3.0 - transitivePeerDependencies: - - supports-color - dev: false