diff --git a/.circleci/config.yml b/.circleci/config.yml index 0f1b52640..4d342f90b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -99,7 +99,7 @@ jobs: - run: working_directory: create-leo-app/template-node command: | - yarn start + yarn dev template-node-ts: executor: rust-node @@ -108,7 +108,7 @@ jobs: - run: working_directory: create-leo-app/template-node-ts command: | - yarn start + yarn dev template-extension: executor: rust-node diff --git a/create-leo-app/template-node-ts/package.json b/create-leo-app/template-node-ts/package.json index be36c97a3..6c3e3df2f 100644 --- a/create-leo-app/template-node-ts/package.json +++ b/create-leo-app/template-node-ts/package.json @@ -5,7 +5,7 @@ "type": "module", "scripts": { "build": "rimraf dist/js && rollup --config", - "start": "npm run build && node dist/index.js" + "dev": "npm run build && node dist/index.js" }, "dependencies": { "@provablehq/sdk": "^0.7.0" diff --git a/create-leo-app/template-node/package.json b/create-leo-app/template-node/package.json index 0334fe2ba..a37b987a9 100644 --- a/create-leo-app/template-node/package.json +++ b/create-leo-app/template-node/package.json @@ -4,7 +4,7 @@ "version": "0.0.0", "type": "module", "scripts": { - "start": "node index.js" + "dev": "node index.js" }, "dependencies": { "@provablehq/sdk": "^0.7.0" diff --git a/create-leo-app/template-offline-public-transaction-ts/package.json b/create-leo-app/template-offline-public-transaction-ts/package.json index 7d836216e..663095c84 100644 --- a/create-leo-app/template-offline-public-transaction-ts/package.json +++ b/create-leo-app/template-offline-public-transaction-ts/package.json @@ -5,7 +5,7 @@ "type": "module", "scripts": { "build": "rimraf dist/js && rollup --config", - "start": "npm run build && node dist/index.js" + "dev": "npm run build && node dist/index.js" }, "dependencies": { "@provablehq/sdk": "^0.7.0" diff --git a/sdk/package.json b/sdk/package.json index bebc2b24a..52f55fd1a 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -50,7 +50,8 @@ "@provablehq/wasm": "^0.7.0", "comlink": "^4.4.1", "mime": "^3.0.0", - "sync-request": "^6.1.0" + "sync-request": "^6.1.0", + "core-js": "^3.38.1" }, "devDependencies": { "@rollup/plugin-replace": "^5.0.5", @@ -63,7 +64,6 @@ "better-docs": "^2.7.2", "chai": "^5.1.1", "clean-jsdoc-theme": "^4.1.8", - "core-js": "^3.38.1", "cpr": "^3.0.1", "eslint": "^8.26.0", "eslint-config-prettier": "^8.5.0", diff --git a/sdk/src/polyfill/worker.ts b/sdk/src/polyfill/worker.ts index 8f979db29..7e05d61a9 100644 --- a/sdk/src/polyfill/worker.ts +++ b/sdk/src/polyfill/worker.ts @@ -32,10 +32,11 @@ globalThis.Worker = class Worker extends EventTarget { } const code = ` - const { workerData } = require("node:worker_threads"); - - import(workerData.polyfill) - .then(() => import(workerData.url)) + import("node:worker_threads") + .then(({ workerData }) => { + return import(workerData.polyfill) + .then(() => import(workerData.url)) + }) .catch((e) => { // TODO maybe it should send a message to the parent? console.error(e.stack);