Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Integrate noir.js into workspace and CI release workflow #2705

Merged
merged 20 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions .github/workflows/noir-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,39 @@ jobs:
- name: Install dependencies
run: yarn install --immutable

- name: Install jq
run: sudo apt-get install jq

- name: Install cargo and wasm-bindgen
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
cargo install -f wasm-bindgen-cli --version 0.2.86

- name: Install toml2json
run: |
source $HOME/.cargo/env
cargo install toml2json

- name: Install wasm-opt (from binaryen)
kevaundray marked this conversation as resolved.
Show resolved Hide resolved
run: |
npm i wasm-opt -g

- name: Install wasm32-unknown-unknwown target
run: |
rustup target add wasm32-unknown-unknown

- name: Build noirc_abi
kevaundray marked this conversation as resolved.
Show resolved Hide resolved
run: yarn workspace @noir-lang/noirc_abi build

- name: Build noir_js
run: yarn workspace @noir-lang/noir_js build

- name: Authenticate with npm
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- name: Publish to NPM
working-directory: ./tooling/noir_js
run: npm publish
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ compiler/source-resolver/node_modules
compiler/source-resolver/lib
compiler/source-resolver/lib-node

# Noir.js
tooling/noir_js/lib


kevaundray marked this conversation as resolved.
Show resolved Hide resolved
# Nix stuff
**/outputs
result
Expand Down
12 changes: 12 additions & 0 deletions tooling/noir_js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,17 @@
"dependencies": {
"@noir-lang/acvm_js": "0.26.1",
"@noir-lang/noirc_abi": "workspace:*"
},
"files": [
"lib",
"package.json"
],
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"build": "tsc"
},
"devDependencies": {
"typescript": "^5.2.2"
}
}
File renamed without changes.
14 changes: 14 additions & 0 deletions tooling/noir_js/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"compilerOptions": {
kevaundray marked this conversation as resolved.
Show resolved Hide resolved
"target": "esnext",
"declaration": true,
"emitDeclarationOnly": false,
"module": "ESNext",
"moduleResolution": "node",
"outDir": "./lib",
"esModuleInterop": true,
"strict": true
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules"]
}
2 changes: 1 addition & 1 deletion tooling/noirc_abi_wasm/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ rm -rf $self_path/result >/dev/null 2>&1
if [ -v out ]; then
echo "Will install package to $out (defined outside installPhase.sh script)"
else
out="$self_path/outputs/out"
export out="$self_path/outputs/out"
kevaundray marked this conversation as resolved.
Show resolved Hide resolved
echo "Will install package to $out"
fi

Expand Down
3 changes: 3 additions & 0 deletions tooling/noirc_abi_wasm/installPhase.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env bash

set -x

kevaundray marked this conversation as resolved.
Show resolved Hide resolved
export self_path=$(dirname "$(readlink -f "$0")")

mkdir -p $out
Expand Down
5 changes: 3 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ __metadata:
dependencies:
"@noir-lang/acvm_js": 0.26.1
"@noir-lang/noirc_abi": "workspace:*"
typescript: ^5.2.2
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -7085,7 +7086,7 @@ __metadata:
languageName: node
linkType: hard

"typescript@npm:^5.0.4":
"typescript@npm:^5.0.4, typescript@npm:^5.2.2":
version: 5.2.2
resolution: "typescript@npm:5.2.2"
bin:
Expand All @@ -7105,7 +7106,7 @@ __metadata:
languageName: node
linkType: hard

"typescript@patch:typescript@^5.0.4#~builtin<compat/typescript>":
"typescript@patch:typescript@^5.0.4#~builtin<compat/typescript>, typescript@patch:typescript@^5.2.2#~builtin<compat/typescript>":
version: 5.2.2
resolution: "typescript@patch:typescript@npm%3A5.2.2#~builtin<compat/typescript>::version=5.2.2&hash=f3b441"
bin:
Expand Down
Loading