From d9424d2806af953e504aca395dccec5c9de38240 Mon Sep 17 00:00:00 2001 From: Koby Date: Wed, 27 Sep 2023 16:41:18 +0200 Subject: [PATCH 1/3] chore: improve workspace clean --- acvm-repo/acvm_js/package.json | 3 ++- compiler/wasm/package.json | 4 ++-- flake.nix | 1 + package.json | 5 +++-- tooling/noir_js/package.json | 10 ++++++---- tooling/noirc_abi_wasm/package.json | 4 ++-- 6 files changed, 16 insertions(+), 11 deletions(-) diff --git a/acvm-repo/acvm_js/package.json b/acvm-repo/acvm_js/package.json index d1a2c2f7bfa..72e3f9a6471 100644 --- a/acvm-repo/acvm_js/package.json +++ b/acvm-repo/acvm_js/package.json @@ -27,7 +27,8 @@ "build": "bash ./build.sh", "test": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha", "test:browser": "web-test-runner", - "lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0" + "lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0", + "clean": "chmod u+w web nodejs && rm -rf web nodejs" }, "devDependencies": { "@esm-bundle/chai": "^4.3.4-fix.0", diff --git a/compiler/wasm/package.json b/compiler/wasm/package.json index 01ad9680f43..84f8d90f67b 100644 --- a/compiler/wasm/package.json +++ b/compiler/wasm/package.json @@ -23,7 +23,7 @@ "test": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha", "test:node": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha", "test:browser": "web-test-runner", - "clean": "rm -rf ./nodejs ./web ./target ./result", + "clean": "chmod u+w web nodejs && rm -rf ./nodejs ./web ./target ./result", "lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0" }, "peerDependencies": { @@ -37,4 +37,4 @@ "@web/test-runner-webdriver": "^0.7.0", "mocha": "^10.2.0" } -} \ No newline at end of file +} diff --git a/flake.nix b/flake.nix index 996b760fee9..42ba602c45e 100644 --- a/flake.nix +++ b/flake.nix @@ -235,6 +235,7 @@ # Nix flakes cannot build more than one derivation in one command (see https://github.com/NixOS/nix/issues/5591) # so we use `symlinkJoin` to build everything as the "all" package. all = pkgs.symlinkJoin { name = "all"; paths = [ nargo noir_wasm noirc_abi_wasm acvm_js ]; }; + all_wasm = pkgs.symlinkJoin { name = "all_wasm"; paths = [ noir_wasm noirc_abi_wasm acvm_js ]; }; # We also export individual packages to enable `nix build .#nargo -L`, etc. inherit nargo; diff --git a/package.json b/package.json index 36d5a674520..8e3a29c2fc7 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ "build:with:nix": "nix build -L .#wasm", "install:from:nix:noirc_abi_wasm": "cp -r ./result/noirc_abi_wasm/nodejs ./tooling/noirc_abi_wasm && cp -r ./result/noirc_abi_wasm/web ./tooling/noirc_abi_wasm", "install:from:nix:noir_wasm": "cp -r ./result/noir_wasm/nodejs ./compiler/wasm && cp -r ./result/noir_wasm/web ./compiler/wasm", - "install:from:nix": "yarn build:with:nix && yarn install:from:nix:noirc_abi_wasm && yarn install:from:nix:noir_wasm" + "install:from:nix:acvm_js": "cp -rf ./result/acvm_js/nodejs ./acvm-repo/acvm_js && cp -rf ./result/acvm_js/web ./acvm-repo/acvm_js", + "install:from:nix": "yarn build:with:nix && yarn install:from:nix:noirc_abi_wasm && yarn install:from:nix:noir_wasm && yarn install:from:nix:acvm_js" }, "devDependencies": { "@typescript-eslint/eslint-plugin": "^5.59.5", @@ -39,4 +40,4 @@ "dependencies": { "tslog": "^4.9.2" } -} \ No newline at end of file +} diff --git a/tooling/noir_js/package.json b/tooling/noir_js/package.json index a16aa6c301b..d90e7a709f6 100644 --- a/tooling/noir_js/package.json +++ b/tooling/noir_js/package.json @@ -18,11 +18,11 @@ ], "source": "src/index.ts", "main": "lib/index.cjs", - "module": "lib/index.js", + "module": "lib/index.mjs", "exports": { "require": "./lib/index.cjs", - "default": "./lib/index.js", - "types": "./lib/index.d.ts" + "default": "./lib/index.mjs", + "types": "./lib/inde.ts" }, "types": "lib/index.d.ts", "scripts": { @@ -33,7 +33,9 @@ "test:node:cjs": "mocha --timeout 25000 --exit --config ./.mocharc.cjs.json", "prettier": "prettier 'src/**/*.ts'", "prettier:fix": "prettier --write 'src/**/*.ts' 'test/**/*.ts'", - "lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0" + "lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0", + "clean": "rm -rf ./lib" + }, "devDependencies": { "@aztec/bb.js": "0.7.2", diff --git a/tooling/noirc_abi_wasm/package.json b/tooling/noirc_abi_wasm/package.json index 23def0e1197..418bdbfeade 100644 --- a/tooling/noirc_abi_wasm/package.json +++ b/tooling/noirc_abi_wasm/package.json @@ -25,7 +25,7 @@ "build": "bash ./build.sh", "test": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha", "test:browser": "web-test-runner", - "clean": "rm -rf ./nodejs ./web ./target ./result", + "clean": "chmod u+w web nodejs && rm -rf ./nodejs ./web ./target ./result", "lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0" }, "devDependencies": { @@ -37,4 +37,4 @@ "eslint": "^8.40.0", "mocha": "^10.2.0" } -} \ No newline at end of file +} From 2545ca83179715f06e06fe3eccc404e1862fef77 Mon Sep 17 00:00:00 2001 From: Koby Date: Wed, 27 Sep 2023 16:58:41 +0200 Subject: [PATCH 2/3] chore: fix target --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8e3a29c2fc7..84d44a38383 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "clean:root": "rm -rf ./result ./target", "clean": "yarn clean:workspaces && yarn clean:root", "lint": "yarn workspaces foreach run lint", - "build:with:nix": "nix build -L .#wasm", + "build:with:nix": "nix build -L .#all_wasm", "install:from:nix:noirc_abi_wasm": "cp -r ./result/noirc_abi_wasm/nodejs ./tooling/noirc_abi_wasm && cp -r ./result/noirc_abi_wasm/web ./tooling/noirc_abi_wasm", "install:from:nix:noir_wasm": "cp -r ./result/noir_wasm/nodejs ./compiler/wasm && cp -r ./result/noir_wasm/web ./compiler/wasm", "install:from:nix:acvm_js": "cp -rf ./result/acvm_js/nodejs ./acvm-repo/acvm_js && cp -rf ./result/acvm_js/web ./acvm-repo/acvm_js", From 4adf539ae86f0c41690cf4585b2345f49f5769d5 Mon Sep 17 00:00:00 2001 From: Tom French <15848336+TomAFrench@users.noreply.github.com> Date: Thu, 28 Sep 2023 12:34:50 +0100 Subject: [PATCH 3/3] Update tooling/noir_js/package.json --- tooling/noir_js/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooling/noir_js/package.json b/tooling/noir_js/package.json index d90e7a709f6..4be9f9fc8bb 100644 --- a/tooling/noir_js/package.json +++ b/tooling/noir_js/package.json @@ -22,7 +22,7 @@ "exports": { "require": "./lib/index.cjs", "default": "./lib/index.mjs", - "types": "./lib/inde.ts" + "types": "./lib/index.d.ts" }, "types": "lib/index.d.ts", "scripts": {