-
Notifications
You must be signed in to change notification settings - Fork 381
chore: add init method to Noir class for web #2920
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
Merged
Merged
Changes from 34 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
5ca20f7
Copy from Kobys Branch
kevaundray e120e24
revert to previous definition
kevaundray 15ebc21
remove unused ignore file
kevaundray 29d7f94
revert: group tooling workspace packages
kevaundray 190f011
format
kevaundray c053aac
update yarn.lock
kevaundray 9dcbbca
Import types into noir_js
kevaundray bbcf611
replace anonymous object with CompiledCircuit type
kevaundray 7959844
export Noir
kevaundray ebaa551
lint fix
kevaundray 894162d
update lockfile
kevaundray ef6ad1c
remove prettier
kevaundray 01aee47
lint fix
kevaundray 17b8956
copy barretenberg backend from ts
kevaundray e84e060
remove prettier
kevaundray 1372c0d
remove compiled_examples from gitignore
kevaundray f4f0a79
remove lib folder
kevaundray 0368617
add redundant methods
kevaundray 9312121
extend mv syntax so that we convert all files to cjs in cjs folder
kevaundray 8468b07
import backend
kevaundray 8672a11
delete backend file
kevaundray 7c72e68
add bb backend to workspace
kevaundray ab0c694
update index.ts in bb backend interface file
kevaundray 331f157
update yarn.lock
kevaundray 4f9a363
Merge remote-tracking branch 'origin/master' into kw/add-bb-backend-i…
kevaundray a0e327c
lint --fix
kevaundray 5be1151
build bb.js wrapper
kevaundray 26eeabf
Update tooling/noir_js_backend_barretenberg/src/serialize.ts
kevaundray 3710d73
silence error if lib does not exist
kevaundray d8ddde0
chore: add gitignore
TomAFrench 69b47e2
Merge remote-tracking branch 'origin/master' into kw/add-bb-backend-i…
kevaundray c2d850b
add init method to noir class
kevaundray 619029e
chore: compile types package (#2921)
kevaundray 59751cb
Update tooling/noir_js/src/program.ts
TomAFrench c662120
Update tooling/noir_js_backend_barretenberg/src/serialize.ts
TomAFrench 55aadff
Merge branch 'master' into kw/add-init-to-noir
TomAFrench 3b62219
fix merge resolution: extra build step
kevaundray File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| node_modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| module.exports = { | ||
| extends: ["../../.eslintrc.js"], | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| crs | ||
| lib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| { | ||
| "name": "@noir-lang/backend_barretenberg", | ||
| "collaborators": [ | ||
| "The Noir Team <team@noir-lang.org>" | ||
| ], | ||
| "version": "0.7.10", | ||
| "packageManager": "yarn@3.5.1", | ||
| "license": "(MIT OR Apache-2.0)", | ||
| "type": "module", | ||
| "source": "src/index.ts", | ||
| "main": "lib/cjs/index.cjs", | ||
| "module": "lib/esm/index.js", | ||
| "exports": { | ||
| "require": "./lib/cjs/index.cjs", | ||
| "default": "./lib/esm/index.js", | ||
| "types": "./lib/esm/index.d.ts" | ||
| }, | ||
| "types": "lib/esm/index.d.ts", | ||
| "scripts": { | ||
| "dev": "tsc --watch", | ||
| "build": "yarn clean && tsc && tsc -p ./tsconfig.cjs.json && mv ./lib/cjs/index.js ./lib/cjs/index.cjs && mv ./lib/cjs/serialize.js ./lib/cjs/serialize.cjs && mv ./lib/cjs/base64_decode.js ./lib/cjs/base64_decode.cjs", | ||
| "clean": "rm -rf ./lib", | ||
| "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" | ||
| }, | ||
| "dependencies": { | ||
| "@aztec/bb.js": "0.7.10", | ||
| "@noir-lang/types": "workspace:*", | ||
| "fflate": "^0.8.0" | ||
| }, | ||
| "peerDependencies": { | ||
| "@noir-lang/backend_barretenberg": "workspace:*" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/node": "^20.6.2", | ||
| "@types/prettier": "^3", | ||
| "eslint": "^8.40.0", | ||
| "eslint-plugin-prettier": "^5.0.0", | ||
| "prettier": "3.0.3", | ||
| "typescript": "5.1.5" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| // Since this is a simple function, we can use feature detection to | ||
| // see if we are in the nodeJs environment or the browser environment. | ||
| export function base64Decode(input: string): Uint8Array { | ||
| if (typeof Buffer !== 'undefined') { | ||
| // Node.js environment | ||
| return Buffer.from(input, 'base64'); | ||
| } else if (typeof atob === 'function') { | ||
| // Browser environment | ||
| return Uint8Array.from(atob(input), (c) => c.charCodeAt(0)); | ||
| } else { | ||
| throw new Error('No implementation found for base64 decoding.'); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import { decompressSync as gunzip } from 'fflate'; | ||
| import { base64Decode } from './base64_decode.js'; | ||
|
|
||
| // Converts bytecode from a base64 string to a Uint8Array | ||
| export function acirToUint8Array(base64EncodedBytecode): Uint8Array { | ||
TomAFrench marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| const compressedByteCode = base64Decode(base64EncodedBytecode); | ||
| return gunzip(compressedByteCode); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "extends": "./tsconfig.json", | ||
| "compilerOptions": { | ||
| "module": "CommonJS", | ||
| "outDir": "./lib/cjs" | ||
| }, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "target": "esnext", | ||
| "declaration": true, | ||
| "emitDeclarationOnly": false, | ||
| "module": "ESNext", | ||
| "moduleResolution": "NodeNext", | ||
| "outDir": "./lib/esm", | ||
| "esModuleInterop": true, | ||
| "resolveJsonModule": true, | ||
| "strict": true, | ||
| "noImplicitAny": false, | ||
| }, | ||
| "include": ["src/**/*.ts"], | ||
| "exclude": ["node_modules"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| lib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "declaration": true, | ||
| "module": "ESNext", | ||
| "moduleResolution": "node", | ||
| "outDir": "lib/esm", | ||
| "target": "ES2020", | ||
| "rootDir": "./src" | ||
| }, | ||
| "include": ["src/**/*.ts"], | ||
| "exclude": ["node_modules"] | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.