diff --git a/barretenberg/acir_tests/browser-test-app/package.json b/barretenberg/acir_tests/browser-test-app/package.json index 886c60cac06..767e301f494 100644 --- a/barretenberg/acir_tests/browser-test-app/package.json +++ b/barretenberg/acir_tests/browser-test-app/package.json @@ -6,18 +6,16 @@ "type": "module", "scripts": { "build": "rm -rf dest && webpack", - "serve:dest:st": "serve -n -L -p ${PORT:-8080} -c ../serve.st.json dest", - "serve:dest:mt": "serve -n -L -p ${PORT:-8080} -c ../serve.mt.json dest" + "serve:dest:st": "serve -n -L -p ${PORT:-8080} -c ../serve.json dest", + "serve:dest:mt": "serve -n -L -p ${PORT:-8080} -c ../serve.json dest" }, "devDependencies": { "@aztec/bb.js": "../../ts", "@types/debug": "^4.1.12", "@types/pako": "^2.0.3", - "copy-webpack-plugin": "^12.0.2", "debug": "^4.3.4", "html-webpack-plugin": "^5.6.0", "pako": "^2.1.0", - "resolve-typescript-plugin": "^2.0.1", "serve": "^14.2.1", "ts-loader": "^9.5.1", "typescript": "^5.4.2", diff --git a/barretenberg/acir_tests/browser-test-app/serve.mt.json b/barretenberg/acir_tests/browser-test-app/serve.json similarity index 57% rename from barretenberg/acir_tests/browser-test-app/serve.mt.json rename to barretenberg/acir_tests/browser-test-app/serve.json index 1a9bb81d15b..9046720908b 100644 --- a/barretenberg/acir_tests/browser-test-app/serve.mt.json +++ b/barretenberg/acir_tests/browser-test-app/serve.json @@ -12,17 +12,6 @@ "value": "same-origin" } ] - }, - { - "source" : "**/*.gz", - "headers" : [{ - "key" : "Content-Encoding", - "value" : "gzip" - }, - { - "key" : "Content-Type", - "value" : "application/wasm" - }] } ] } diff --git a/barretenberg/acir_tests/browser-test-app/serve.st.json b/barretenberg/acir_tests/browser-test-app/serve.st.json deleted file mode 100644 index 984cb769ccf..00000000000 --- a/barretenberg/acir_tests/browser-test-app/serve.st.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "headers": [ - { - "source" : "**/*.gz", - "headers" : [{ - "key" : "Content-Encoding", - "value" : "gzip" - }, - { - "key" : "Content-Type", - "value" : "application/wasm" - }] - } - ] -} diff --git a/barretenberg/acir_tests/browser-test-app/webpack.config.js b/barretenberg/acir_tests/browser-test-app/webpack.config.js index aee3f8f4806..af2ec76d2f7 100644 --- a/barretenberg/acir_tests/browser-test-app/webpack.config.js +++ b/barretenberg/acir_tests/browser-test-app/webpack.config.js @@ -1,7 +1,5 @@ import { resolve, dirname } from "path"; import { fileURLToPath } from "url"; -import ResolveTypeScriptPlugin from "resolve-typescript-plugin"; -import CopyWebpackPlugin from "copy-webpack-plugin"; import HtmlWebpackPlugin from "html-webpack-plugin"; import webpack from "webpack"; @@ -13,10 +11,6 @@ export default { }, module: { rules: [ - { - test: /\.gz$/, - type: 'asset/resource', - }, { test: /\.tsx?$/, use: [{ loader: "ts-loader" }], @@ -25,8 +19,8 @@ export default { }, output: { path: resolve(dirname(fileURLToPath(import.meta.url)), "./dest"), + publicPath: "/", filename: "[name].js", - chunkFilename: "[name].chunk.js", // This naming pattern is used for chunks produced from code-splitting. library: { type: 'module', }, @@ -36,19 +30,11 @@ export default { outputModule: true, }, plugins: [ - new CopyWebpackPlugin({ - patterns: [ - { - context: '../../ts/dest/browser', - from: '*.gz', - }, - ], - }), new HtmlWebpackPlugin({ inject: false, template: "./src/index.html" }), new webpack.DefinePlugin({ "process.env.NODE_DEBUG": false }), ], resolve: { - plugins: [new ResolveTypeScriptPlugin()], + extensions: ['.tsx', '.ts', '.js'], }, devServer: { hot: false, diff --git a/barretenberg/ts/package.json b/barretenberg/ts/package.json index 3ccd338750c..a82c56a8950 100644 --- a/barretenberg/ts/package.json +++ b/barretenberg/ts/package.json @@ -84,7 +84,6 @@ "@typescript-eslint/eslint-plugin": "^5.54.1", "@typescript-eslint/parser": "^5.54.1", "buffer": "^6.0.3", - "copy-webpack-plugin": "^11.0.0", "eslint": "^8.35.0", "eslint-config-prettier": "^8.8.0", "html-webpack-plugin": "^5.5.1", @@ -93,6 +92,7 @@ "prettier": "^2.8.4", "resolve-typescript-plugin": "^2.0.1", "source-map-support": "^0.5.21", + "terser-webpack-plugin": "^5.3.11", "ts-jest": "^29.1.0", "ts-loader": "^9.4.2", "ts-node": "^10.9.1", diff --git a/barretenberg/ts/src/barretenberg_wasm/fetch_code/browser/barretenberg-threads.ts b/barretenberg/ts/src/barretenberg_wasm/fetch_code/browser/barretenberg-threads.ts new file mode 100644 index 00000000000..23aa9ed841f --- /dev/null +++ b/barretenberg/ts/src/barretenberg_wasm/fetch_code/browser/barretenberg-threads.ts @@ -0,0 +1,3 @@ +import barretenbergThreadsModule from '../../barretenberg-threads.wasm.gz'; + +export default barretenbergThreadsModule; diff --git a/barretenberg/ts/src/barretenberg_wasm/fetch_code/browser/barretenberg.ts b/barretenberg/ts/src/barretenberg_wasm/fetch_code/browser/barretenberg.ts new file mode 100644 index 00000000000..c75591e5c6e --- /dev/null +++ b/barretenberg/ts/src/barretenberg_wasm/fetch_code/browser/barretenberg.ts @@ -0,0 +1,3 @@ +import barretenbergModule from '../../barretenberg.wasm.gz'; + +export default barretenbergModule; diff --git a/barretenberg/ts/src/barretenberg_wasm/fetch_code/browser/index.ts b/barretenberg/ts/src/barretenberg_wasm/fetch_code/browser/index.ts index 62ce155642f..38b3701f6d6 100644 --- a/barretenberg/ts/src/barretenberg_wasm/fetch_code/browser/index.ts +++ b/barretenberg/ts/src/barretenberg_wasm/fetch_code/browser/index.ts @@ -1,12 +1,12 @@ -import barretenbergModule from '../../barretenberg.wasm.gz'; -import barretenbergThreadsModule from '../../barretenberg-threads.wasm.gz'; import pako from 'pako'; // Annoyingly the wasm declares if it's memory is shared or not. So now we need two wasms if we want to be // able to fallback on "non shared memory" situations. export async function fetchCode(multithreaded: boolean, wasmPath?: string) { - let url = multithreaded ? barretenbergThreadsModule : barretenbergModule; - url = wasmPath ? `${wasmPath}/${/[^/]+(?=\/$|$)/.exec(url)?.[0]}` : url; + const suffix = multithreaded ? '-threads' : ''; + const url = wasmPath + ? `${wasmPath}/barretenberg${suffix}.wasm.gz` + : (await import(/* webpackIgnore: true */ `./barretenberg${suffix}.js`)).default; const res = await fetch(url); const maybeCompressedData = await res.arrayBuffer(); const buffer = new Uint8Array(maybeCompressedData); diff --git a/barretenberg/ts/src/barretenberg_wasm/fetch_code/browser/wasm-module.d.ts b/barretenberg/ts/src/barretenberg_wasm/fetch_code/wasm-module.d.ts similarity index 100% rename from barretenberg/ts/src/barretenberg_wasm/fetch_code/browser/wasm-module.d.ts rename to barretenberg/ts/src/barretenberg_wasm/fetch_code/wasm-module.d.ts diff --git a/barretenberg/ts/webpack.config.js b/barretenberg/ts/webpack.config.js index 1f9c743da7a..04421e8a26c 100644 --- a/barretenberg/ts/webpack.config.js +++ b/barretenberg/ts/webpack.config.js @@ -2,6 +2,7 @@ import { resolve, dirname } from 'path'; import { fileURLToPath } from 'url'; import ResolveTypeScriptPlugin from 'resolve-typescript-plugin'; import webpack from 'webpack'; +import TerserPlugin from 'terser-webpack-plugin'; /** * @type {import('webpack').Configuration} @@ -12,24 +13,17 @@ export default { // Useful for debugging. // mode: 'development', // devtool: 'source-map', - entry: './src/index.ts', + entry: { + index: './src/index.ts', + // Force inclusion of inlined wasm files withouth mangling await import statements. + barretenberg: './src/barretenberg_wasm/fetch_code/browser/barretenberg.ts', + "barretenberg-threads": './src/barretenberg_wasm/fetch_code/browser/barretenberg-threads.ts' + }, module: { rules: [ { test: /\.wasm\.gz$/, - type: 'asset/resource', - generator: { - // The wasm filenames are actually the same, but we symlink them to the correct one - // (threads or not) on the .ts folder. Unfortunately webpack uses the original name, - // so we have to manually correct it here. - filename: (path) => { - if(path.filename.includes('wasm-threads')) { - return 'barretenberg-threads.wasm.gz'; - } - return '[base]'; - }, - publicPath: '/' - } + type: 'asset/inline', }, { test: /\.worker\.ts$/, @@ -49,7 +43,8 @@ export default { }, output: { path: resolve(dirname(fileURLToPath(import.meta.url)), './dest/browser'), - filename: 'index.js', + filename: '[name].js', + chunkFilename: '[name].[chunkhash].js', module: true, globalObject: 'globalThis', library: { @@ -57,7 +52,20 @@ export default { }, }, optimization: { - minimize: false, + minimizer: [ + new TerserPlugin({ + terserOptions: { + compress: false, + mangle: false, + format: { + beautify: true + } + }, + }), + ], + splitChunks: { + chunks: 'async', + } }, experiments: { outputModule: true, diff --git a/barretenberg/ts/yarn.lock b/barretenberg/ts/yarn.lock index 1573426e9e8..b1b5e9d9691 100644 --- a/barretenberg/ts/yarn.lock +++ b/barretenberg/ts/yarn.lock @@ -41,7 +41,6 @@ __metadata: buffer: "npm:^6.0.3" comlink: "npm:^4.4.1" commander: "npm:^12.1.0" - copy-webpack-plugin: "npm:^11.0.0" debug: "npm:^4.3.4" eslint: "npm:^8.35.0" eslint-config-prettier: "npm:^8.8.0" @@ -53,6 +52,7 @@ __metadata: prettier: "npm:^2.8.4" resolve-typescript-plugin: "npm:^2.0.1" source-map-support: "npm:^0.5.21" + terser-webpack-plugin: "npm:^5.3.11" ts-jest: "npm:^29.1.0" ts-loader: "npm:^9.4.2" ts-node: "npm:^10.9.1" @@ -878,6 +878,16 @@ __metadata: languageName: node linkType: hard +"@jridgewell/trace-mapping@npm:^0.3.25": + version: 0.3.25 + resolution: "@jridgewell/trace-mapping@npm:0.3.25" + dependencies: + "@jridgewell/resolve-uri": "npm:^3.1.0" + "@jridgewell/sourcemap-codec": "npm:^1.4.14" + checksum: 10/dced32160a44b49d531b80a4a2159dceab6b3ddf0c8e95a0deae4b0e894b172defa63d5ac52a19c2068e1fe7d31ea4ba931fbeec103233ecb4208953967120fc + languageName: node + linkType: hard + "@leichtgewicht/ip-codec@npm:^2.0.1": version: 2.0.4 resolution: "@leichtgewicht/ip-codec@npm:2.0.4" @@ -2687,22 +2697,6 @@ __metadata: languageName: node linkType: hard -"copy-webpack-plugin@npm:^11.0.0": - version: 11.0.0 - resolution: "copy-webpack-plugin@npm:11.0.0" - dependencies: - fast-glob: "npm:^3.2.11" - glob-parent: "npm:^6.0.1" - globby: "npm:^13.1.1" - normalize-path: "npm:^3.0.0" - schema-utils: "npm:^4.0.0" - serialize-javascript: "npm:^6.0.0" - peerDependencies: - webpack: ^5.1.0 - checksum: 10/dc103be79ef72a4bb0bc8ce498b2cca964e3771326b009a1f3cb2d17960fca17538a725b09427161eccf485e2badbbd5490ddf2570f7976938e4e7338f1fd7e9 - languageName: node - linkType: hard - "core-util-is@npm:~1.0.0": version: 1.0.3 resolution: "core-util-is@npm:1.0.3" @@ -3392,7 +3386,7 @@ __metadata: languageName: node linkType: hard -"fast-glob@npm:^3.2.11, fast-glob@npm:^3.2.9, fast-glob@npm:^3.3.0": +"fast-glob@npm:^3.2.9": version: 3.3.2 resolution: "fast-glob@npm:3.3.2" dependencies: @@ -3681,7 +3675,7 @@ __metadata: languageName: node linkType: hard -"glob-parent@npm:^6.0.1, glob-parent@npm:^6.0.2": +"glob-parent@npm:^6.0.2": version: 6.0.2 resolution: "glob-parent@npm:6.0.2" dependencies: @@ -3756,19 +3750,6 @@ __metadata: languageName: node linkType: hard -"globby@npm:^13.1.1": - version: 13.2.2 - resolution: "globby@npm:13.2.2" - dependencies: - dir-glob: "npm:^3.0.1" - fast-glob: "npm:^3.3.0" - ignore: "npm:^5.2.4" - merge2: "npm:^1.4.1" - slash: "npm:^4.0.0" - checksum: 10/4494a9d2162a7e4d327988b26be66d8eab87d7f59a83219e74b065e2c3ced23698f68fb10482bf9337133819281803fb886d6ae06afbb2affa743623eb0b1949 - languageName: node - linkType: hard - "gopd@npm:^1.0.1": version: 1.0.1 resolution: "gopd@npm:1.0.1" @@ -4058,7 +4039,7 @@ __metadata: languageName: node linkType: hard -"ignore@npm:^5.2.0, ignore@npm:^5.2.4": +"ignore@npm:^5.2.0": version: 5.3.0 resolution: "ignore@npm:5.3.0" checksum: 10/51594355cea4c6ad6b28b3b85eb81afa7b988a1871feefd7062baf136c95aa06760ee934fa9590e43d967bd377ce84a4cf6135fbeb6063e063f1182a0e9a3bcd @@ -6115,6 +6096,18 @@ __metadata: languageName: node linkType: hard +"schema-utils@npm:^4.3.0": + version: 4.3.0 + resolution: "schema-utils@npm:4.3.0" + dependencies: + "@types/json-schema": "npm:^7.0.9" + ajv: "npm:^8.9.0" + ajv-formats: "npm:^2.1.1" + ajv-keywords: "npm:^5.1.0" + checksum: 10/86c5a7c72a275c56f140bc3cdd832d56efb11428c88ad588127db12cb9b2c83ccaa9540e115d7baa9c6175b5e360094457e29c44e6fb76787c9498c2eb6df5d6 + languageName: node + linkType: hard + "select-hose@npm:^2.0.0": version: 2.0.0 resolution: "select-hose@npm:2.0.0" @@ -6173,7 +6166,7 @@ __metadata: languageName: node linkType: hard -"serialize-javascript@npm:^6.0.0, serialize-javascript@npm:^6.0.1": +"serialize-javascript@npm:^6.0.1": version: 6.0.1 resolution: "serialize-javascript@npm:6.0.1" dependencies: @@ -6182,6 +6175,15 @@ __metadata: languageName: node linkType: hard +"serialize-javascript@npm:^6.0.2": + version: 6.0.2 + resolution: "serialize-javascript@npm:6.0.2" + dependencies: + randombytes: "npm:^2.1.0" + checksum: 10/445a420a6fa2eaee4b70cbd884d538e259ab278200a2ededd73253ada17d5d48e91fb1f4cd224a236ab62ea7ba0a70c6af29fc93b4f3d3078bf7da1c031fde58 + languageName: node + linkType: hard + "serve-index@npm:^1.9.1": version: 1.9.1 resolution: "serve-index@npm:1.9.1" @@ -6306,13 +6308,6 @@ __metadata: languageName: node linkType: hard -"slash@npm:^4.0.0": - version: 4.0.0 - resolution: "slash@npm:4.0.0" - checksum: 10/da8e4af73712253acd21b7853b7e0dbba776b786e82b010a5bfc8b5051a1db38ed8aba8e1e8f400dd2c9f373be91eb1c42b66e91abb407ff42b10feece5e1d2d - languageName: node - linkType: hard - "smart-buffer@npm:^4.2.0": version: 4.2.0 resolution: "smart-buffer@npm:4.2.0" @@ -6596,6 +6591,28 @@ __metadata: languageName: node linkType: hard +"terser-webpack-plugin@npm:^5.3.11": + version: 5.3.11 + resolution: "terser-webpack-plugin@npm:5.3.11" + dependencies: + "@jridgewell/trace-mapping": "npm:^0.3.25" + jest-worker: "npm:^27.4.5" + schema-utils: "npm:^4.3.0" + serialize-javascript: "npm:^6.0.2" + terser: "npm:^5.31.1" + peerDependencies: + webpack: ^5.1.0 + peerDependenciesMeta: + "@swc/core": + optional: true + esbuild: + optional: true + uglify-js: + optional: true + checksum: 10/a8f7c92c75aa42628adfa4d171d4695c366c1852ecb4a24e72dd6fec86e383e12ac24b627e798fedff4e213c21fe851cebc61be3ab5a2537e6e42bea46690aa3 + languageName: node + linkType: hard + "terser-webpack-plugin@npm:^5.3.7": version: 5.3.9 resolution: "terser-webpack-plugin@npm:5.3.9" @@ -6632,6 +6649,20 @@ __metadata: languageName: node linkType: hard +"terser@npm:^5.31.1": + version: 5.38.0 + resolution: "terser@npm:5.38.0" + dependencies: + "@jridgewell/source-map": "npm:^0.3.3" + acorn: "npm:^8.8.2" + commander: "npm:^2.20.0" + source-map-support: "npm:~0.5.20" + bin: + terser: bin/terser + checksum: 10/91d20ab35836861e1500a298b3f401b93f0a564cd4a52cd0da79f1a0a8fdbce4967cfc9b77f037603273a31af698eee2b27bbfab4dc5812d334035c9be18256b + languageName: node + linkType: hard + "test-exclude@npm:^6.0.0": version: 6.0.0 resolution: "test-exclude@npm:6.0.0" diff --git a/boxes/boxes/react/package.json b/boxes/boxes/react/package.json index 373d58aefd8..7d1e50746c2 100644 --- a/boxes/boxes/react/package.json +++ b/boxes/boxes/react/package.json @@ -55,7 +55,6 @@ "@typescript-eslint/parser": "^6.0.0", "assert": "^2.1.0", "autoprefixer": "^10.4.15", - "copy-webpack-plugin": "^12.0.2", "css-loader": "^6.8.1", "eslint": "^8.21.0", "eslint-config-prettier": "^9.0.0", diff --git a/boxes/boxes/react/webpack.config.js b/boxes/boxes/react/webpack.config.js index ed649c35962..9b778589fa0 100644 --- a/boxes/boxes/react/webpack.config.js +++ b/boxes/boxes/react/webpack.config.js @@ -1,8 +1,6 @@ -import CopyPlugin from 'copy-webpack-plugin'; import { createRequire } from 'module'; import webpack from 'webpack'; import HtmlWebpackPlugin from 'html-webpack-plugin'; -import { resolve } from 'path'; const require = createRequire(import.meta.url); @@ -15,10 +13,6 @@ export default (_, argv) => ({ }, module: { rules: [ - { - test: /\.gz$/, - type: 'asset/resource', - }, { test: /\.tsx?$/, use: 'ts-loader', @@ -29,15 +23,10 @@ export default (_, argv) => ({ }, ], }, + output: { + publicPath: "/" + }, plugins: [ - new CopyPlugin({ - patterns: [ - { - context: resolve(require.resolve('@aztec/aztec.js'), '../'), - from: '*.gz', - }, - ], - }), new HtmlWebpackPlugin({ template: './index.html', scriptLoading: 'module', diff --git a/boxes/boxes/vanilla/package.json b/boxes/boxes/vanilla/package.json index 6f1182198bb..516d34a8682 100644 --- a/boxes/boxes/vanilla/package.json +++ b/boxes/boxes/vanilla/package.json @@ -24,7 +24,6 @@ "@playwright/test": "1.49.0", "@types/node": "^20.11.17", "assert": "^2.1.0", - "copy-webpack-plugin": "^12.0.2", "html-webpack-plugin": "^5.6.0", "stream-browserify": "^3.0.0", "ts-loader": "^9.5.1", diff --git a/boxes/boxes/vanilla/webpack.config.js b/boxes/boxes/vanilla/webpack.config.js index 916f9ded909..dd96c6bbb44 100644 --- a/boxes/boxes/vanilla/webpack.config.js +++ b/boxes/boxes/vanilla/webpack.config.js @@ -1,8 +1,6 @@ -import CopyPlugin from 'copy-webpack-plugin'; import { createRequire } from 'module'; import webpack from 'webpack'; import HtmlWebpackPlugin from 'html-webpack-plugin'; -import { resolve } from 'path'; const require = createRequire(import.meta.url); @@ -15,10 +13,6 @@ export default (_, argv) => ({ }, module: { rules: [ - { - test: /\.gz$/, - type: 'asset/resource', - }, { test: /\.ts?$/, use: 'ts-loader', @@ -26,14 +20,6 @@ export default (_, argv) => ({ ], }, plugins: [ - new CopyPlugin({ - patterns: [ - { - context: resolve(require.resolve('@aztec/aztec.js'), '../'), - from: '*.gz', - }, - ], - }), new HtmlWebpackPlugin({ template: './src/index.html', scriptLoading: 'module', diff --git a/boxes/boxes/vite/package.json b/boxes/boxes/vite/package.json index 0697700e6e0..bc90a948c7e 100644 --- a/boxes/boxes/vite/package.json +++ b/boxes/boxes/vite/package.json @@ -40,7 +40,6 @@ "typescript": "~5.6.2", "typescript-eslint": "^8.11.0", "vite": "^6.0.3", - "vite-plugin-node-polyfills": "^0.23.0", - "vite-plugin-static-copy": "^2.2.0" + "vite-plugin-node-polyfills": "^0.23.0" } } diff --git a/boxes/boxes/vite/vite.config.ts b/boxes/boxes/vite/vite.config.ts index e82b2135fd0..e5b3b4be5bc 100644 --- a/boxes/boxes/vite/vite.config.ts +++ b/boxes/boxes/vite/vite.config.ts @@ -1,7 +1,6 @@ import { defineConfig, searchForWorkspaceRoot } from "vite"; import react from "@vitejs/plugin-react-swc"; import { PolyfillOptions, nodePolyfills } from "vite-plugin-node-polyfills"; -import { viteStaticCopy } from "vite-plugin-static-copy"; const nodeModulesPath = `${searchForWorkspaceRoot(process.cwd())}/node_modules`; @@ -47,13 +46,5 @@ export default defineConfig({ plugins: [ react(), nodePolyfillsFix({ include: ["buffer", "process", "path"] }), - viteStaticCopy({ - targets: [ - { - src: `${nodeModulesPath}/@aztec/aztec.js/dest/*.wasm.gz`, - dest: "./", - }, - ], - }), ], }); diff --git a/boxes/yarn.lock b/boxes/yarn.lock index a56741755c4..cb1578e0195 100644 --- a/boxes/yarn.lock +++ b/boxes/yarn.lock @@ -73,7 +73,6 @@ __metadata: assert: "npm:^2.1.0" autoprefixer: "npm:^10.4.15" classnames: "npm:^2.3.2" - copy-webpack-plugin: "npm:^12.0.2" css-loader: "npm:^6.8.1" eslint: "npm:^8.21.0" eslint-config-prettier: "npm:^9.0.0" @@ -122,7 +121,6 @@ __metadata: "@playwright/test": "npm:1.49.0" "@types/node": "npm:^20.11.17" assert: "npm:^2.1.0" - copy-webpack-plugin: "npm:^12.0.2" html-webpack-plugin: "npm:^5.6.0" stream-browserify: "npm:^3.0.0" ts-loader: "npm:^9.5.1" @@ -161,7 +159,6 @@ __metadata: typescript-eslint: "npm:^8.11.0" vite: "npm:^6.0.3" vite-plugin-node-polyfills: "npm:^0.23.0" - vite-plugin-static-copy: "npm:^2.2.0" languageName: unknown linkType: soft @@ -1955,13 +1952,6 @@ __metadata: languageName: node linkType: hard -"@sindresorhus/merge-streams@npm:^2.1.0": - version: 2.3.0 - resolution: "@sindresorhus/merge-streams@npm:2.3.0" - checksum: 10c0/69ee906f3125fb2c6bb6ec5cdd84e8827d93b49b3892bce8b62267116cc7e197b5cccf20c160a1d32c26014ecd14470a72a5e3ee37a58f1d6dadc0db1ccf3894 - languageName: node - linkType: hard - "@sinonjs/commons@npm:^3.0.0": version: 3.0.1 resolution: "@sinonjs/commons@npm:3.0.1" @@ -4624,22 +4614,6 @@ __metadata: languageName: node linkType: hard -"copy-webpack-plugin@npm:^12.0.2": - version: 12.0.2 - resolution: "copy-webpack-plugin@npm:12.0.2" - dependencies: - fast-glob: "npm:^3.3.2" - glob-parent: "npm:^6.0.1" - globby: "npm:^14.0.0" - normalize-path: "npm:^3.0.0" - schema-utils: "npm:^4.2.0" - serialize-javascript: "npm:^6.0.2" - peerDependencies: - webpack: ^5.1.0 - checksum: 10c0/1a2715a1280a37b81b7040b89ed962db4aa75475b164f84f266fa4e81f209269b13f8bff10b104dff7558854bafedcdd4f30c40fd23ecd8fa28af45516b459cd - languageName: node - linkType: hard - "core-util-is@npm:~1.0.0": version: 1.0.3 resolution: "core-util-is@npm:1.0.3" @@ -6229,7 +6203,7 @@ __metadata: languageName: node linkType: hard -"fast-glob@npm:^3.2.11, fast-glob@npm:^3.2.9, fast-glob@npm:^3.3.2": +"fast-glob@npm:^3.2.9, fast-glob@npm:^3.3.2": version: 3.3.2 resolution: "fast-glob@npm:3.3.2" dependencies: @@ -6533,17 +6507,6 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:^11.1.0": - version: 11.3.0 - resolution: "fs-extra@npm:11.3.0" - dependencies: - graceful-fs: "npm:^4.2.0" - jsonfile: "npm:^6.0.1" - universalify: "npm:^2.0.0" - checksum: 10c0/5f95e996186ff45463059feb115a22fb048bdaf7e487ecee8a8646c78ed8fdca63630e3077d4c16ce677051f5e60d3355a06f3cd61f3ca43f48cc58822a44d0a - languageName: node - linkType: hard - "fs-minipass@npm:^2.0.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" @@ -6738,7 +6701,7 @@ __metadata: languageName: node linkType: hard -"glob-parent@npm:^6.0.1, glob-parent@npm:^6.0.2": +"glob-parent@npm:^6.0.2": version: 6.0.2 resolution: "glob-parent@npm:6.0.2" dependencies: @@ -6845,20 +6808,6 @@ __metadata: languageName: node linkType: hard -"globby@npm:^14.0.0": - version: 14.0.2 - resolution: "globby@npm:14.0.2" - dependencies: - "@sindresorhus/merge-streams": "npm:^2.1.0" - fast-glob: "npm:^3.3.2" - ignore: "npm:^5.2.4" - path-type: "npm:^5.0.0" - slash: "npm:^5.1.0" - unicorn-magic: "npm:^0.1.0" - checksum: 10c0/3f771cd683b8794db1e7ebc8b6b888d43496d93a82aad4e9d974620f578581210b6c5a6e75ea29573ed16a1345222fab6e9b877a8d1ed56eeb147e09f69c6f78 - languageName: node - linkType: hard - "globrex@npm:^0.1.2": version: 0.1.2 resolution: "globrex@npm:0.1.2" @@ -9684,13 +9633,6 @@ __metadata: languageName: node linkType: hard -"path-type@npm:^5.0.0": - version: 5.0.0 - resolution: "path-type@npm:5.0.0" - checksum: 10c0/e8f4b15111bf483900c75609e5e74e3fcb79f2ddb73e41470028fcd3e4b5162ec65da9907be077ee5012c18801ff7fffb35f9f37a077f3f81d85a0b7d6578efd - languageName: node - linkType: hard - "pathe@npm:^1.1.2": version: 1.1.2 resolution: "pathe@npm:1.1.2" @@ -10859,7 +10801,7 @@ __metadata: languageName: node linkType: hard -"serialize-javascript@npm:^6.0.1, serialize-javascript@npm:^6.0.2": +"serialize-javascript@npm:^6.0.1": version: 6.0.2 resolution: "serialize-javascript@npm:6.0.2" dependencies: @@ -11082,13 +11024,6 @@ __metadata: languageName: node linkType: hard -"slash@npm:^5.1.0": - version: 5.1.0 - resolution: "slash@npm:5.1.0" - checksum: 10c0/eb48b815caf0bdc390d0519d41b9e0556a14380f6799c72ba35caf03544d501d18befdeeef074bc9c052acf69654bc9e0d79d7f1de0866284137a40805299eb3 - languageName: node - linkType: hard - "smart-buffer@npm:^4.2.0": version: 4.2.0 resolution: "smart-buffer@npm:4.2.0" @@ -12023,13 +11958,6 @@ __metadata: languageName: node linkType: hard -"unicorn-magic@npm:^0.1.0": - version: 0.1.0 - resolution: "unicorn-magic@npm:0.1.0" - checksum: 10c0/e4ed0de05b0a05e735c7d8a2930881e5efcfc3ec897204d5d33e7e6247f4c31eac92e383a15d9a6bccb7319b4271ee4bea946e211bf14951fec6ff2cbbb66a92 - languageName: node - linkType: hard - "unique-filename@npm:^3.0.0": version: 3.0.0 resolution: "unique-filename@npm:3.0.0" @@ -12214,20 +12142,6 @@ __metadata: languageName: node linkType: hard -"vite-plugin-static-copy@npm:^2.2.0": - version: 2.2.0 - resolution: "vite-plugin-static-copy@npm:2.2.0" - dependencies: - chokidar: "npm:^3.5.3" - fast-glob: "npm:^3.2.11" - fs-extra: "npm:^11.1.0" - picocolors: "npm:^1.0.0" - peerDependencies: - vite: ^5.0.0 || ^6.0.0 - checksum: 10c0/c5174926d66776697bfe8aa3013bfea62a48868c683784973b9b329c43b57a915685031047d397a9c0ae8dd1fd734bde37438af3939d395f9b82ada341b4fff7 - languageName: node - linkType: hard - "vite@npm:^5.0.0": version: 5.4.11 resolution: "vite@npm:5.4.11" diff --git a/playground/package.json b/playground/package.json index 08cbfe557ce..a72d4dadadc 100644 --- a/playground/package.json +++ b/playground/package.json @@ -45,7 +45,6 @@ "typescript": "~5.7.3", "typescript-eslint": "^8.11.0", "vite": "^6.0.11", - "vite-plugin-node-polyfills": "^0.23.0", - "vite-plugin-static-copy": "^2.2.0" + "vite-plugin-node-polyfills": "^0.23.0" } } diff --git a/playground/src/aztecEnv.ts b/playground/src/aztecEnv.ts index b6f225965de..a7bbf56faf5 100644 --- a/playground/src/aztecEnv.ts +++ b/playground/src/aztecEnv.ts @@ -1,13 +1,14 @@ import { createLogger, createAztecNodeClient, - type PXE, AztecNode, - AccountWalletWithSecretKey, - AztecAddress, - Contract, Logger, -} from "@aztec/aztec.js"; +} from "@aztec/aztec.js/utils"; + +import { AztecAddress } from "@aztec/aztec.js/addresses"; +import { AccountWalletWithSecretKey } from "@aztec/aztec.js/wallet"; +import { Contract } from "@aztec/aztec.js/contracts"; +import { type PXE } from "@aztec/aztec.js/interfaces/pxe"; import { PXEService } from "@aztec/pxe/service"; import { PXEServiceConfig, getPXEServiceConfig } from "@aztec/pxe/config"; import { KVPxeDatabase } from "@aztec/pxe/database"; diff --git a/playground/vite.config.ts b/playground/vite.config.ts index 96934fb3f17..6815daf2654 100644 --- a/playground/vite.config.ts +++ b/playground/vite.config.ts @@ -1,7 +1,6 @@ import { defineConfig, searchForWorkspaceRoot } from "vite"; import react from "@vitejs/plugin-react-swc"; import { PolyfillOptions, nodePolyfills } from "vite-plugin-node-polyfills"; -import { viteStaticCopy } from "vite-plugin-static-copy"; // Unfortunate, but needed due to https://github.com/davidmyersdev/vite-plugin-node-polyfills/issues/81 // Suspected to be because of the yarn workspace setup, but not sure @@ -37,19 +36,12 @@ export default defineConfig({ "../yarn-project/noir-protocol-circuits-types/artifacts", "../noir/packages/noirc_abi/web", "../noir/packages/acvm_js/web", + "../barretenberg/ts/dest/browser", ], }, }, plugins: [ react({ jsxImportSource: "@emotion/react" }), nodePolyfillsFix({ include: ["buffer", "process", "path"] }), - viteStaticCopy({ - targets: [ - { - src: "../barretenberg/ts/dest/browser/*.wasm.gz", - dest: "./", - }, - ], - }), ], }); diff --git a/playground/yarn.lock b/playground/yarn.lock index 545d938e9e2..c7fce48e13a 100644 --- a/playground/yarn.lock +++ b/playground/yarn.lock @@ -1484,16 +1484,6 @@ __metadata: languageName: node linkType: hard -"anymatch@npm:~3.1.2": - version: 3.1.3 - resolution: "anymatch@npm:3.1.3" - dependencies: - normalize-path: "npm:^3.0.0" - picomatch: "npm:^2.0.4" - checksum: 10c0/57b06ae984bc32a0d22592c87384cd88fe4511b1dd7581497831c56d41939c8a001b28e7b853e1450f2bf61992dfcaa8ae2d0d161a0a90c4fb631ef07098fbac - languageName: node - linkType: hard - "argparse@npm:^2.0.1": version: 2.0.1 resolution: "argparse@npm:2.0.1" @@ -1566,13 +1556,6 @@ __metadata: languageName: node linkType: hard -"binary-extensions@npm:^2.0.0": - version: 2.3.0 - resolution: "binary-extensions@npm:2.3.0" - checksum: 10c0/75a59cafc10fb12a11d510e77110c6c7ae3f4ca22463d52487709ca7f18f69d886aa387557cc9864fbdb10153d0bdb4caacabf11541f55e89ed6e18d12ece2b5 - languageName: node - linkType: hard - "bn.js@npm:^4.0.0, bn.js@npm:^4.1.0, bn.js@npm:^4.11.9": version: 4.12.1 resolution: "bn.js@npm:4.12.1" @@ -1606,7 +1589,7 @@ __metadata: languageName: node linkType: hard -"braces@npm:^3.0.3, braces@npm:~3.0.2": +"braces@npm:^3.0.3": version: 3.0.3 resolution: "braces@npm:3.0.3" dependencies: @@ -1799,25 +1782,6 @@ __metadata: languageName: node linkType: hard -"chokidar@npm:^3.5.3": - version: 3.6.0 - resolution: "chokidar@npm:3.6.0" - dependencies: - anymatch: "npm:~3.1.2" - braces: "npm:~3.0.2" - fsevents: "npm:~2.3.2" - glob-parent: "npm:~5.1.2" - is-binary-path: "npm:~2.1.0" - is-glob: "npm:~4.0.1" - normalize-path: "npm:~3.0.0" - readdirp: "npm:~3.6.0" - dependenciesMeta: - fsevents: - optional: true - checksum: 10c0/8361dcd013f2ddbe260eacb1f3cb2f2c6f2b0ad118708a343a5ed8158941a39cb8fb1d272e0f389712e74ee90ce8ba864eece9e0e62b9705cb468a2f6d917462 - languageName: node - linkType: hard - "chownr@npm:^3.0.0": version: 3.0.0 resolution: "chownr@npm:3.0.0" @@ -2445,7 +2409,7 @@ __metadata: languageName: node linkType: hard -"fast-glob@npm:^3.2.11, fast-glob@npm:^3.3.2": +"fast-glob@npm:^3.3.2": version: 3.3.3 resolution: "fast-glob@npm:3.3.3" dependencies: @@ -2561,17 +2525,6 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:^11.1.0": - version: 11.3.0 - resolution: "fs-extra@npm:11.3.0" - dependencies: - graceful-fs: "npm:^4.2.0" - jsonfile: "npm:^6.0.1" - universalify: "npm:^2.0.0" - checksum: 10c0/5f95e996186ff45463059feb115a22fb048bdaf7e487ecee8a8646c78ed8fdca63630e3077d4c16ce677051f5e60d3355a06f3cd61f3ca43f48cc58822a44d0a - languageName: node - linkType: hard - "fs-minipass@npm:^3.0.0": version: 3.0.3 resolution: "fs-minipass@npm:3.0.3" @@ -2635,7 +2588,7 @@ __metadata: languageName: node linkType: hard -"glob-parent@npm:^5.1.2, glob-parent@npm:~5.1.2": +"glob-parent@npm:^5.1.2": version: 5.1.2 resolution: "glob-parent@npm:5.1.2" dependencies: @@ -2697,7 +2650,7 @@ __metadata: languageName: node linkType: hard -"graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.6": +"graceful-fs@npm:^4.2.6": version: 4.2.11 resolution: "graceful-fs@npm:4.2.11" checksum: 10c0/386d011a553e02bc594ac2ca0bd6d9e4c22d7fa8cfbfc448a6d148c59ea881b092db9dbe3547ae4b88e55f1b01f7c4a2ecc53b310c042793e63aa44cf6c257f2 @@ -2918,15 +2871,6 @@ __metadata: languageName: node linkType: hard -"is-binary-path@npm:~2.1.0": - version: 2.1.0 - resolution: "is-binary-path@npm:2.1.0" - dependencies: - binary-extensions: "npm:^2.0.0" - checksum: 10c0/a16eaee59ae2b315ba36fad5c5dcaf8e49c3e27318f8ab8fa3cdb8772bf559c8d1ba750a589c2ccb096113bb64497084361a25960899cb6172a6925ab6123d38 - languageName: node - linkType: hard - "is-callable@npm:^1.2.7": version: 1.2.7 resolution: "is-callable@npm:1.2.7" @@ -2969,7 +2913,7 @@ __metadata: languageName: node linkType: hard -"is-glob@npm:^4.0.0, is-glob@npm:^4.0.1, is-glob@npm:^4.0.3, is-glob@npm:~4.0.1": +"is-glob@npm:^4.0.0, is-glob@npm:^4.0.1, is-glob@npm:^4.0.3": version: 4.0.3 resolution: "is-glob@npm:4.0.3" dependencies: @@ -3126,19 +3070,6 @@ __metadata: languageName: node linkType: hard -"jsonfile@npm:^6.0.1": - version: 6.1.0 - resolution: "jsonfile@npm:6.1.0" - dependencies: - graceful-fs: "npm:^4.1.6" - universalify: "npm:^2.0.0" - dependenciesMeta: - graceful-fs: - optional: true - checksum: 10c0/4f95b5e8a5622b1e9e8f33c96b7ef3158122f595998114d1e7f03985649ea99cb3cd99ce1ed1831ae94c8c8543ab45ebd044207612f31a56fd08462140e46865 - languageName: node - linkType: hard - "jss-plugin-camel-case@npm:^10.10.0": version: 10.10.0 resolution: "jss-plugin-camel-case@npm:10.10.0" @@ -3574,13 +3505,6 @@ __metadata: languageName: node linkType: hard -"normalize-path@npm:^3.0.0, normalize-path@npm:~3.0.0": - version: 3.0.0 - resolution: "normalize-path@npm:3.0.0" - checksum: 10c0/e008c8142bcc335b5e38cf0d63cfd39d6cf2d97480af9abdbe9a439221fd4d749763bab492a8ee708ce7a194bb00c9da6d0a115018672310850489137b3da046 - languageName: node - linkType: hard - "nosleep.js@npm:^0.12.0": version: 0.12.0 resolution: "nosleep.js@npm:0.12.0" @@ -3793,7 +3717,7 @@ __metadata: languageName: node linkType: hard -"picomatch@npm:^2.0.4, picomatch@npm:^2.2.1, picomatch@npm:^2.3.1": +"picomatch@npm:^2.3.1": version: 2.3.1 resolution: "picomatch@npm:2.3.1" checksum: 10c0/26c02b8d06f03206fc2ab8d16f19960f2ff9e81a658f831ecb656d8f17d9edc799e8364b1f4a7873e89d9702dff96204be0fa26fe4181f6843f040f819dac4be @@ -3852,7 +3776,6 @@ __metadata: typescript-eslint: "npm:^8.11.0" vite: "npm:^6.0.11" vite-plugin-node-polyfills: "npm:^0.23.0" - vite-plugin-static-copy: "npm:^2.2.0" languageName: unknown linkType: soft @@ -4082,15 +4005,6 @@ __metadata: languageName: node linkType: hard -"readdirp@npm:~3.6.0": - version: 3.6.0 - resolution: "readdirp@npm:3.6.0" - dependencies: - picomatch: "npm:^2.2.1" - checksum: 10c0/6fa848cf63d1b82ab4e985f4cf72bd55b7dcfd8e0a376905804e48c3634b7e749170940ba77b32804d5fe93b3cc521aa95a8d7e7d725f830da6d93f3669ce66b - languageName: node - linkType: hard - "regenerator-runtime@npm:^0.14.0": version: 0.14.1 resolution: "regenerator-runtime@npm:0.14.1" @@ -4699,13 +4613,6 @@ __metadata: languageName: node linkType: hard -"universalify@npm:^2.0.0": - version: 2.0.1 - resolution: "universalify@npm:2.0.1" - checksum: 10c0/73e8ee3809041ca8b818efb141801a1004e3fc0002727f1531f4de613ea281b494a40909596dae4a042a4fb6cd385af5d4db2e137b1362e0e91384b828effd3a - languageName: node - linkType: hard - "uri-js@npm:^4.2.2": version: 4.4.1 resolution: "uri-js@npm:4.4.1" @@ -4757,20 +4664,6 @@ __metadata: languageName: node linkType: hard -"vite-plugin-static-copy@npm:^2.2.0": - version: 2.2.0 - resolution: "vite-plugin-static-copy@npm:2.2.0" - dependencies: - chokidar: "npm:^3.5.3" - fast-glob: "npm:^3.2.11" - fs-extra: "npm:^11.1.0" - picocolors: "npm:^1.0.0" - peerDependencies: - vite: ^5.0.0 || ^6.0.0 - checksum: 10c0/c5174926d66776697bfe8aa3013bfea62a48868c683784973b9b329c43b57a915685031047d397a9c0ae8dd1fd734bde37438af3939d395f9b82ada341b4fff7 - languageName: node - linkType: hard - "vite@npm:^6.0.11": version: 6.0.11 resolution: "vite@npm:6.0.11" diff --git a/yarn-project/.gitignore b/yarn-project/.gitignore index 40d4d571bbb..16913cbef7e 100644 --- a/yarn-project/.gitignore +++ b/yarn-project/.gitignore @@ -24,8 +24,8 @@ end-to-end/flame_graph end-to-end/log end-to-end/data end-to-end/src/web/*.gz -end-to-end/src/web/*main.js -end-to-end/src/web/main.js.LICENSE.txt +end-to-end/src/web/*.mjs +end-to-end/src/web/*.mjs.LICENSE.txt l1-artifacts/generated l1-contracts/generated builder/target/ diff --git a/yarn-project/accounts/tsconfig.dest.json b/yarn-project/accounts/tsconfig.dest.json deleted file mode 100644 index 5997e69d530..00000000000 --- a/yarn-project/accounts/tsconfig.dest.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": ".", - "references": [ - { - "path": "../aztec.js/tsconfig.dest.json" - }, - { - "path": "../circuits.js/tsconfig.dest.json" - }, - { - "path": "../foundation/tsconfig.dest.json" - }, - { - "path": "../circuit-types/tsconfig.dest.json" - } - ], - "exclude": ["src/**/*.test.ts"] -} diff --git a/yarn-project/aztec.js/package.json b/yarn-project/aztec.js/package.json index a34ebb907cc..2cb92d1382c 100644 --- a/yarn-project/aztec.js/package.json +++ b/yarn-project/aztec.js/package.json @@ -9,14 +9,14 @@ "./abi": "./dest/api/abi.js", "./account": "./dest/api/account.js", "./addresses": "./dest/api/addresses.js", + "./cheatcodes": "./dest/api/cheatcodes.js", "./contracts": "./dest/contract/index.js", "./deployment": "./dest/api/deployment.js", "./entrypoint": "./dest/api/entrypoint.js", "./eth_address": "./dest/api/eth_address.js", - "./ethereum": "./dest/api/ethereum.js", + "./ethereum": "./dest/api/ethereum/index.js", "./fee": "./dest/api/fee.js", "./fields": "./dest/api/fields.js", - "./init": "./dest/api/init.js", "./log_id": "./dest/api/log_id.js", "./rpc": "./dest/rpc_clients/index.js", "./tx_hash": "./dest/api/tx_hash.js", @@ -31,8 +31,7 @@ "tsconfig": "./tsconfig.json" }, "scripts": { - "build": "yarn clean && tsc -b && webpack", - "build:web": "webpack", + "build": "yarn clean && tsc -b", "build:dev": "tsc -b --watch", "build:ts": "tsc -b", "clean": "rm -rf ./dest .tsbuildinfo ./src/account_contract/artifacts", diff --git a/yarn-project/aztec.js/package.local.json b/yarn-project/aztec.js/package.local.json index e070cdff602..22a9de3407f 100644 --- a/yarn-project/aztec.js/package.local.json +++ b/yarn-project/aztec.js/package.local.json @@ -1,9 +1,5 @@ { "scripts": { - "build": "yarn clean && tsc -b && webpack", - "build:web": "webpack", - "build:dev": "tsc -b --watch", - "build:ts": "tsc -b", "clean": "rm -rf ./dest .tsbuildinfo ./src/account_contract/artifacts" } } diff --git a/yarn-project/aztec.js/src/api/cheat_codes.ts b/yarn-project/aztec.js/src/api/cheat_codes.ts new file mode 100644 index 00000000000..19e7dfd7bf9 --- /dev/null +++ b/yarn-project/aztec.js/src/api/cheat_codes.ts @@ -0,0 +1,35 @@ +import { type PXE } from '@aztec/circuit-types'; +import { EthCheatCodes } from '@aztec/ethereum/eth-cheatcodes'; +import { type L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses'; + +import { RollupCheatCodes } from '../index.js'; +import { AztecCheatCodes } from '../utils/aztec_cheatcodes.js'; + +/** + * A class that provides utility functions for interacting with the chain. + */ +export class CheatCodes { + constructor( + /** Cheat codes for L1.*/ + public eth: EthCheatCodes, + /** Cheat codes for Aztec L2. */ + public aztec: AztecCheatCodes, + /** Cheat codes for the Aztec Rollup contract on L1. */ + public rollup: RollupCheatCodes, + ) {} + + static async create(rpcUrl: string, pxe: PXE): Promise { + const ethCheatCodes = new EthCheatCodes(rpcUrl); + const aztecCheatCodes = new AztecCheatCodes(pxe); + const rollupCheatCodes = new RollupCheatCodes( + ethCheatCodes, + await pxe.getNodeInfo().then(n => n.l1ContractAddresses), + ); + return new CheatCodes(ethCheatCodes, aztecCheatCodes, rollupCheatCodes); + } + + static createRollup(rpcUrl: string, addresses: Pick): RollupCheatCodes { + const ethCheatCodes = new EthCheatCodes(rpcUrl); + return new RollupCheatCodes(ethCheatCodes, addresses); + } +} diff --git a/yarn-project/aztec.js/src/api/ethereum.ts b/yarn-project/aztec.js/src/api/ethereum.ts deleted file mode 100644 index 52a244255d9..00000000000 --- a/yarn-project/aztec.js/src/api/ethereum.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { deployL1Contract, deployL1Contracts, DeployL1Contracts } from '@aztec/ethereum/deploy-l1-contracts'; -export { EthCheatCodes } from '@aztec/ethereum/eth-cheatcodes'; diff --git a/yarn-project/aztec.js/src/utils/anvil_test_watcher.ts b/yarn-project/aztec.js/src/api/ethereum/anvil_test_watcher.ts similarity index 97% rename from yarn-project/aztec.js/src/utils/anvil_test_watcher.ts rename to yarn-project/aztec.js/src/api/ethereum/anvil_test_watcher.ts index 52340b99e02..ca830f26b4d 100644 --- a/yarn-project/aztec.js/src/utils/anvil_test_watcher.ts +++ b/yarn-project/aztec.js/src/api/ethereum/anvil_test_watcher.ts @@ -1,5 +1,6 @@ -import { type EthCheatCodes, type Logger, createLogger } from '@aztec/aztec.js'; import { type EthAddress } from '@aztec/circuits.js'; +import { type EthCheatCodes } from '@aztec/ethereum/eth-cheatcodes'; +import { type Logger, createLogger } from '@aztec/foundation/log'; import { RunningPromise } from '@aztec/foundation/running-promise'; import { type TestDateProvider } from '@aztec/foundation/timer'; import { RollupAbi } from '@aztec/l1-artifacts'; diff --git a/yarn-project/aztec.js/src/utils/chain_monitor.ts b/yarn-project/aztec.js/src/api/ethereum/chain_monitor.ts similarity index 100% rename from yarn-project/aztec.js/src/utils/chain_monitor.ts rename to yarn-project/aztec.js/src/api/ethereum/chain_monitor.ts diff --git a/yarn-project/aztec.js/src/utils/cheat_codes.ts b/yarn-project/aztec.js/src/api/ethereum/cheat_codes.ts similarity index 62% rename from yarn-project/aztec.js/src/utils/cheat_codes.ts rename to yarn-project/aztec.js/src/api/ethereum/cheat_codes.ts index 413650e893d..849a3597709 100644 --- a/yarn-project/aztec.js/src/utils/cheat_codes.ts +++ b/yarn-project/aztec.js/src/api/ethereum/cheat_codes.ts @@ -1,6 +1,5 @@ -import { type EpochProofClaim, type Note, type PXE } from '@aztec/circuit-types'; -import { type AztecAddress, EthAddress, Fr } from '@aztec/circuits.js'; -import { deriveStorageSlotInMap } from '@aztec/circuits.js/hash'; +import { type EpochProofClaim } from '@aztec/circuit-types'; +import { EthAddress } from '@aztec/circuits.js'; import { EthCheatCodes } from '@aztec/ethereum/eth-cheatcodes'; import { type L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses'; import { createLogger } from '@aztec/foundation/log'; @@ -18,34 +17,7 @@ import { } from 'viem'; import { foundry } from 'viem/chains'; -/** - * A class that provides utility functions for interacting with the chain. - */ -export class CheatCodes { - constructor( - /** Cheat codes for L1.*/ - public eth: EthCheatCodes, - /** Cheat codes for Aztec L2. */ - public aztec: AztecCheatCodes, - /** Cheat codes for the Aztec Rollup contract on L1. */ - public rollup: RollupCheatCodes, - ) {} - - static async create(rpcUrl: string, pxe: PXE): Promise { - const ethCheatCodes = new EthCheatCodes(rpcUrl); - const aztecCheatCodes = new AztecCheatCodes(pxe, ethCheatCodes); - const rollupCheatCodes = new RollupCheatCodes( - ethCheatCodes, - await pxe.getNodeInfo().then(n => n.l1ContractAddresses), - ); - return new CheatCodes(ethCheatCodes, aztecCheatCodes, rollupCheatCodes); - } - - static createRollup(rpcUrl: string, addresses: Pick): RollupCheatCodes { - const ethCheatCodes = new EthCheatCodes(rpcUrl); - return new RollupCheatCodes(ethCheatCodes, addresses); - } -} +export { EthCheatCodes }; /** Cheat codes for the L1 rollup contract. */ export class RollupCheatCodes { @@ -198,78 +170,3 @@ export class RollupCheatCodes { }); } } - -/** - * A class that provides utility functions for interacting with the aztec chain. - */ -export class AztecCheatCodes { - constructor( - /** - * The PXE Service to use for interacting with the chain - */ - public pxe: PXE, - /** - * The eth cheat codes. - */ - public eth: EthCheatCodes, - /** - * The logger to use for the aztec cheatcodes - */ - public logger = createLogger('aztecjs:cheat_codes'), - ) {} - - /** - * Computes the slot value for a given map and key. - * @param mapSlot - The slot of the map (specified in Aztec.nr contract) - * @param key - The key to lookup in the map - * @returns The storage slot of the value in the map - */ - public computeSlotInMap(mapSlot: Fr | bigint, key: Fr | bigint | AztecAddress): Promise { - const keyFr = typeof key === 'bigint' ? new Fr(key) : key.toField(); - return deriveStorageSlotInMap(mapSlot, keyFr); - } - - /** - * Get the current blocknumber - * @returns The current block number - */ - public async blockNumber(): Promise { - return await this.pxe.getBlockNumber(); - } - - /** - * Get the current timestamp - * @returns The current timestamp - */ - public async timestamp(): Promise { - const res = await this.pxe.getBlock(await this.blockNumber()); - return res?.header.globalVariables.timestamp.toNumber() ?? 0; - } - - /** - * Loads the value stored at the given slot in the public storage of the given contract. - * @param who - The address of the contract - * @param slot - The storage slot to lookup - * @returns The value stored at the given slot - */ - public async loadPublic(who: AztecAddress, slot: Fr | bigint): Promise { - const storageValue = await this.pxe.getPublicStorageAt(who, new Fr(slot)); - return storageValue; - } - - /** - * Loads the value stored at the given slot in the private storage of the given contract. - * @param contract - The address of the contract - * @param owner - The owner for whom the notes are encrypted - * @param slot - The storage slot to lookup - * @returns The notes stored at the given slot - */ - public async loadPrivate(owner: AztecAddress, contract: AztecAddress, slot: Fr | bigint): Promise { - const extendedNotes = await this.pxe.getNotes({ - owner, - contractAddress: contract, - storageSlot: new Fr(slot), - }); - return extendedNotes.map(extendedNote => extendedNote.note); - } -} diff --git a/yarn-project/aztec.js/src/api/ethereum/index.ts b/yarn-project/aztec.js/src/api/ethereum/index.ts new file mode 100644 index 00000000000..87324787922 --- /dev/null +++ b/yarn-project/aztec.js/src/api/ethereum/index.ts @@ -0,0 +1,15 @@ +export { + L1FeeJuicePortalManager, + L1ToL2TokenPortalManager, + L1TokenManager, + L1TokenPortalManager, + type L2AmountClaim, + type L2AmountClaimWithRecipient, + type L2Claim, + generateClaimSecret, +} from './portal_manager.js'; +export { getL1ContractAddresses } from './l1_contracts.js'; +export { RollupCheatCodes, EthCheatCodes } from './cheat_codes.js'; +export { ChainMonitor } from './chain_monitor.js'; +export { AnvilTestWatcher } from './anvil_test_watcher.js'; +export { deployL1Contract, deployL1Contracts, DeployL1Contracts } from '@aztec/ethereum/deploy-l1-contracts'; diff --git a/yarn-project/aztec.js/src/utils/l1_contracts.ts b/yarn-project/aztec.js/src/api/ethereum/l1_contracts.ts similarity index 89% rename from yarn-project/aztec.js/src/utils/l1_contracts.ts rename to yarn-project/aztec.js/src/api/ethereum/l1_contracts.ts index ee4cf2211f6..21f57a32d2a 100644 --- a/yarn-project/aztec.js/src/utils/l1_contracts.ts +++ b/yarn-project/aztec.js/src/api/ethereum/l1_contracts.ts @@ -1,7 +1,7 @@ import { type L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses'; import { retryUntil } from '@aztec/foundation/retry'; -import { createPXEClient } from '../rpc_clients/index.js'; +import { createPXEClient } from '../../rpc_clients/index.js'; export const getL1ContractAddresses = async (url: string): Promise => { const pxeClient = createPXEClient(url); diff --git a/yarn-project/aztec.js/src/utils/portal_manager.ts b/yarn-project/aztec.js/src/api/ethereum/portal_manager.ts similarity index 98% rename from yarn-project/aztec.js/src/utils/portal_manager.ts rename to yarn-project/aztec.js/src/api/ethereum/portal_manager.ts index cad7c1f5a9f..cb98af57afc 100644 --- a/yarn-project/aztec.js/src/utils/portal_manager.ts +++ b/yarn-project/aztec.js/src/api/ethereum/portal_manager.ts @@ -1,14 +1,9 @@ -import { - type AztecAddress, - EthAddress, - Fr, - type Logger, - type PXE, - type SiblingPath, - computeSecretHash, -} from '@aztec/aztec.js'; +import { type PXE, type SiblingPath } from '@aztec/circuit-types'; +import { type AztecAddress, EthAddress, Fr } from '@aztec/circuits.js'; +import { computeSecretHash } from '@aztec/circuits.js/hash'; import { extractEvent } from '@aztec/ethereum/utils'; import { sha256ToField } from '@aztec/foundation/crypto'; +import { type Logger } from '@aztec/foundation/log'; import { FeeJuicePortalAbi, OutboxAbi, TestERC20Abi, TokenPortalAbi } from '@aztec/l1-artifacts'; import { diff --git a/yarn-project/aztec.js/src/api/log.ts b/yarn-project/aztec.js/src/api/log.ts new file mode 100644 index 00000000000..d69397ece41 --- /dev/null +++ b/yarn-project/aztec.js/src/api/log.ts @@ -0,0 +1 @@ +export { createLogger, type Logger } from '@aztec/foundation/log'; diff --git a/yarn-project/aztec.js/src/entrypoint/default_multi_call_entrypoint.ts b/yarn-project/aztec.js/src/entrypoint/default_multi_call_entrypoint.ts index 8f234e37acb..c5d8152be2c 100644 --- a/yarn-project/aztec.js/src/entrypoint/default_multi_call_entrypoint.ts +++ b/yarn-project/aztec.js/src/entrypoint/default_multi_call_entrypoint.ts @@ -1,9 +1,10 @@ -import { type EntrypointInterface, EntrypointPayload, type ExecutionRequestInit } from '@aztec/aztec.js/entrypoint'; import { HashedValues, TxExecutionRequest } from '@aztec/circuit-types'; import { type AztecAddress, TxContext } from '@aztec/circuits.js'; import { type FunctionAbi, FunctionSelector, encodeArguments } from '@aztec/foundation/abi'; import { ProtocolContractAddress } from '@aztec/protocol-contracts'; +import { type EntrypointInterface, EntrypointPayload, type ExecutionRequestInit } from './entrypoint.js'; + /** * Implementation for an entrypoint interface that can execute multiple function calls in a single transaction */ diff --git a/yarn-project/aztec.js/src/fee/fee_juice_payment_method_with_claim.ts b/yarn-project/aztec.js/src/fee/fee_juice_payment_method_with_claim.ts index 2ede963265a..40f6f26f229 100644 --- a/yarn-project/aztec.js/src/fee/fee_juice_payment_method_with_claim.ts +++ b/yarn-project/aztec.js/src/fee/fee_juice_payment_method_with_claim.ts @@ -4,7 +4,7 @@ import { FunctionType, U128 } from '@aztec/foundation/abi'; import { ProtocolContractAddress } from '@aztec/protocol-contracts'; import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice'; -import { type L2AmountClaim } from '../utils/portal_manager.js'; +import { type L2AmountClaim } from '../api/ethereum/portal_manager.js'; import { FeeJuicePaymentMethod } from './fee_juice_payment_method.js'; /** diff --git a/yarn-project/aztec.js/src/index.ts b/yarn-project/aztec.js/src/index.ts index 1e96ed31f00..fde9a37f04c 100644 --- a/yarn-project/aztec.js/src/index.ts +++ b/yarn-project/aztec.js/src/index.ts @@ -22,34 +22,6 @@ export { ContractDeployer } from './deployment/index.js'; -export { - AnvilTestWatcher, - CheatCodes, - L1FeeJuicePortalManager, - L1ToL2TokenPortalManager, - L1TokenManager, - L1TokenPortalManager, - computeAuthWitMessageHash, - computeInnerAuthWitHash, - computeInnerAuthWitHashFromAction, - generateClaimSecret, - generatePublicKey, - readFieldCompressedString, - waitForPXE, - waitForNode, - type AztecAddressLike, - type EthAddressLike, - type EventSelectorLike, - type FieldLike, - type FunctionSelectorLike, - type L2AmountClaim, - type L2AmountClaimWithRecipient, - type L2Claim, - type U128Like, - type WrappedFieldLike, - type IntentAction, -} from './utils/index.js'; - export { NoteSelector } from '@aztec/foundation/abi'; export { createCompatibleClient, createPXEClient } from './rpc_clients/index.js'; @@ -120,12 +92,10 @@ export { TxStatus, UnencryptedL2Log, UniqueNote, - createAztecNodeClient, getTimestampRangeForEpoch, merkleTreeIds, mockEpochProofQuote, mockTx, - type AztecNode, type LogFilter, type PXE, type PartialAddress, @@ -139,7 +109,6 @@ export { decodeFromAbi, encodeArguments, type AbiType } from '@aztec/foundation/ export { toBigIntBE } from '@aztec/foundation/bigint-buffer'; export { sha256 } from '@aztec/foundation/crypto'; export { makeFetch } from '@aztec/foundation/json-rpc/client'; -export { createLogger, type Logger } from '@aztec/foundation/log'; export { retry, retryUntil } from '@aztec/foundation/retry'; export { to2Fields, toBigInt } from '@aztec/foundation/serialize'; export { sleep } from '@aztec/foundation/sleep'; @@ -151,8 +120,11 @@ export { fileURLToPath } from '@aztec/foundation/url'; // Here you *can* do `export *` as the granular api defacto exports things explicitly. // This entire index file will be deprecated at some point after we're satisfied. export * from './api/abi.js'; +export * from './api/cheat_codes.js'; export * from './api/fee.js'; export * from './api/addresses.js'; -export * from './api/ethereum.js'; +export * from './api/ethereum/index.js'; +export * from './api/log.js'; // Granular export, even if not in the api folder export * from './contract/index.js'; +export * from './utils/index.js'; diff --git a/yarn-project/aztec.js/src/utils/aztec_cheatcodes.ts b/yarn-project/aztec.js/src/utils/aztec_cheatcodes.ts new file mode 100644 index 00000000000..002a77a5cfd --- /dev/null +++ b/yarn-project/aztec.js/src/utils/aztec_cheatcodes.ts @@ -0,0 +1,75 @@ +import { type Note, type PXE } from '@aztec/circuit-types'; +import { type AztecAddress, Fr } from '@aztec/circuits.js'; +import { deriveStorageSlotInMap } from '@aztec/circuits.js/hash'; +import { createLogger } from '@aztec/foundation/log'; + +/** + * A class that provides utility functions for interacting with the aztec chain. + */ +export class AztecCheatCodes { + constructor( + /** + * The PXE Service to use for interacting with the chain + */ + public pxe: PXE, + /** + * The logger to use for the aztec cheatcodes + */ + public logger = createLogger('aztecjs:cheat_codes'), + ) {} + + /** + * Computes the slot value for a given map and key. + * @param mapSlot - The slot of the map (specified in Aztec.nr contract) + * @param key - The key to lookup in the map + * @returns The storage slot of the value in the map + */ + public computeSlotInMap(mapSlot: Fr | bigint, key: Fr | bigint | AztecAddress): Promise { + const keyFr = typeof key === 'bigint' ? new Fr(key) : key.toField(); + return deriveStorageSlotInMap(mapSlot, keyFr); + } + + /** + * Get the current blocknumber + * @returns The current block number + */ + public async blockNumber(): Promise { + return await this.pxe.getBlockNumber(); + } + + /** + * Get the current timestamp + * @returns The current timestamp + */ + public async timestamp(): Promise { + const res = await this.pxe.getBlock(await this.blockNumber()); + return res?.header.globalVariables.timestamp.toNumber() ?? 0; + } + + /** + * Loads the value stored at the given slot in the public storage of the given contract. + * @param who - The address of the contract + * @param slot - The storage slot to lookup + * @returns The value stored at the given slot + */ + public async loadPublic(who: AztecAddress, slot: Fr | bigint): Promise { + const storageValue = await this.pxe.getPublicStorageAt(who, new Fr(slot)); + return storageValue; + } + + /** + * Loads the value stored at the given slot in the private storage of the given contract. + * @param contract - The address of the contract + * @param owner - The owner for whom the notes are encrypted + * @param slot - The storage slot to lookup + * @returns The notes stored at the given slot + */ + public async loadPrivate(owner: AztecAddress, contract: AztecAddress, slot: Fr | bigint): Promise { + const extendedNotes = await this.pxe.getNotes({ + owner, + contractAddress: contract, + storageSlot: new Fr(slot), + }); + return extendedNotes.map(extendedNote => extendedNote.note); + } +} diff --git a/yarn-project/aztec.js/src/utils/index.ts b/yarn-project/aztec.js/src/utils/index.ts index a2ed02d5d9e..65779e8e168 100644 --- a/yarn-project/aztec.js/src/utils/index.ts +++ b/yarn-project/aztec.js/src/utils/index.ts @@ -1,11 +1,19 @@ -export * from './pub_key.js'; -export * from './l1_contracts.js'; -export * from './abi_types.js'; -export * from './cheat_codes.js'; -export * from './authwit.js'; -export * from './pxe.js'; -export * from './node.js'; -export * from './anvil_test_watcher.js'; -export * from './field_compressed_string.js'; -export * from './portal_manager.js'; -export * from './chain_monitor.js'; +export { generatePublicKey } from './pub_key.js'; +export { + type AztecAddressLike, + type EthAddressLike, + type EventSelectorLike, + type FieldLike, + type FunctionSelectorLike, + type U128Like, + type WrappedFieldLike, +} from './abi_types.js'; +export { + computeAuthWitMessageHash, + computeInnerAuthWitHash, + computeInnerAuthWitHashFromAction, + type IntentAction, +} from './authwit.js'; +export { waitForPXE } from './pxe.js'; +export { waitForNode, createAztecNodeClient, AztecNode } from './node.js'; +export { readFieldCompressedString } from './field_compressed_string.js'; diff --git a/yarn-project/aztec.js/src/utils/node.ts b/yarn-project/aztec.js/src/utils/node.ts index 8f8310d6c65..db5dc47ad21 100644 --- a/yarn-project/aztec.js/src/utils/node.ts +++ b/yarn-project/aztec.js/src/utils/node.ts @@ -15,3 +15,5 @@ export const waitForNode = async (node: AztecNode, logger?: Logger) => { return undefined; }, 'RPC Get Node Info'); }; + +export { createAztecNodeClient, AztecNode } from '@aztec/circuit-types'; diff --git a/yarn-project/aztec.js/src/wallet/index.ts b/yarn-project/aztec.js/src/wallet/index.ts index 6479e8c50bb..443d8312025 100644 --- a/yarn-project/aztec.js/src/wallet/index.ts +++ b/yarn-project/aztec.js/src/wallet/index.ts @@ -1,4 +1,4 @@ -import { type PXE } from '@aztec/circuit-types'; +import { type PXE } from '@aztec/circuit-types/interfaces'; import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { type AccountContract } from '../account/contract.js'; diff --git a/yarn-project/aztec.js/tsconfig.dest.json b/yarn-project/aztec.js/tsconfig.dest.json deleted file mode 100644 index cc347e5c4c7..00000000000 --- a/yarn-project/aztec.js/tsconfig.dest.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": ".", - "references": [ - { - "path": "../circuits.js/tsconfig.dest.json" - }, - { - "path": "../foundation/tsconfig.dest.json" - }, - { - "path": "../circuit-types/tsconfig.dest.json" - } - ], - "exclude": ["src/**/*.test.ts"] -} diff --git a/yarn-project/aztec.js/webpack.config.js b/yarn-project/aztec.js/webpack.config.js deleted file mode 100644 index 16268c44495..00000000000 --- a/yarn-project/aztec.js/webpack.config.js +++ /dev/null @@ -1,88 +0,0 @@ -import CopyPlugin from 'copy-webpack-plugin'; -import { createRequire } from 'module'; -import { dirname, resolve } from 'path'; -import ResolveTypeScriptPlugin from 'resolve-typescript-plugin'; -import { fileURLToPath } from 'url'; -import webpack from 'webpack'; - -const require = createRequire(import.meta.url); - -export default { - target: 'web', - mode: 'production', - devtool: false, - entry: { - main: './src/index.ts', - }, - module: { - rules: [ - { - test: /\.wasm\.gz$/, - type: 'asset/resource', - generator: { - filename: '[base]', - publicPath: '/', - }, - }, - { - test: /\.tsx?$/, - use: [ - { - loader: 'ts-loader', - options: { - configFile: 'tsconfig.dest.json', - }, - }, - ], - }, - ], - }, - output: { - path: resolve(dirname(fileURLToPath(import.meta.url)), './dest'), - filename: 'main.js', - library: { - type: 'module', - }, - chunkFormat: 'module', - }, - experiments: { - outputModule: true, - }, - plugins: [ - new CopyPlugin({ - patterns: [ - { - // createRequire resolves the cjs version, so we need to go up one level - context: resolve(require.resolve('@aztec/bb.js'), '../../browser'), - from: '*.gz', - }, - ], - }), - new webpack.DefinePlugin({ - 'process.env': { - NODE_ENV: JSON.stringify('production'), - }, - }), - new webpack.ProvidePlugin({ Buffer: ['buffer', 'Buffer'] }), - ], - resolve: { - plugins: [new ResolveTypeScriptPlugin()], - alias: { - // All node specific code, wherever it's located, should be imported as below. - // Provides a clean and simple way to always strip out the node code for the web build. - './node/index.js': false, - }, - fallback: { - crypto: false, - os: false, - fs: false, - path: false, - url: false, - tty: false, - worker_threads: false, - buffer: require.resolve('buffer/'), - util: require.resolve('util/'), - stream: require.resolve('stream-browserify'), - }, - }, -}; diff --git a/yarn-project/bootstrap.sh b/yarn-project/bootstrap.sh index 3bfde823b00..f0098329a57 100755 --- a/yarn-project/bootstrap.sh +++ b/yarn-project/bootstrap.sh @@ -38,7 +38,6 @@ function build { fi esac - denoise 'cd aztec.js && yarn build:web' denoise 'cd end-to-end && yarn build:web' # Upload common patterns for artifacts: dest, fixtures, build, artifacts, generated diff --git a/yarn-project/circuit-types/tsconfig.dest.json b/yarn-project/circuit-types/tsconfig.dest.json deleted file mode 100644 index 849be7da93e..00000000000 --- a/yarn-project/circuit-types/tsconfig.dest.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": ".", - "references": [ - { - "path": "../circuits.js/tsconfig.dest.json" - }, - { - "path": "../foundation/tsconfig.dest.json" - } - ], - "exclude": ["src/**/*.test.ts"] -} diff --git a/yarn-project/circuits.js/tsconfig.dest.json b/yarn-project/circuits.js/tsconfig.dest.json deleted file mode 100644 index 5ce7408ee2d..00000000000 --- a/yarn-project/circuits.js/tsconfig.dest.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": ".", - "references": [ - { - "path": "../foundation/tsconfig.dest.json" - } - ], - "exclude": ["src/**/*.test.ts", "src/**/*.in.ts"] -} diff --git a/yarn-project/cli/src/cmds/l1/update_l1_validators.ts b/yarn-project/cli/src/cmds/l1/update_l1_validators.ts index c19d7496783..e9c554dc9b0 100644 --- a/yarn-project/cli/src/cmds/l1/update_l1_validators.ts +++ b/yarn-project/cli/src/cmds/l1/update_l1_validators.ts @@ -1,6 +1,6 @@ -import { EthCheatCodes } from '@aztec/aztec.js'; import { type EthAddress } from '@aztec/circuits.js'; import { + EthCheatCodes, createEthereumChain, getExpectedAddress, getL1ContractsConfigEnvVars, diff --git a/yarn-project/end-to-end/package.json b/yarn-project/end-to-end/package.json index ca19f703e8b..e40f75080c4 100644 --- a/yarn-project/end-to-end/package.json +++ b/yarn-project/end-to-end/package.json @@ -88,7 +88,6 @@ "memdown": "^6.1.1", "process": "^0.11.10", "puppeteer-core": "^22.2", - "resolve-typescript-plugin": "^2.0.1", "stream-browserify": "^3.0.0", "string-argv": "^0.3.2", "ts-loader": "^9.4.4", @@ -97,7 +96,7 @@ "typescript": "^5.0.4", "util": "^0.12.5", "viem": "2.22.8", - "webpack": "^5.88.2", + "webpack": "^5.90.0", "webpack-cli": "^5.1.4", "zod": "^3.23.8" }, @@ -108,7 +107,6 @@ "@types/js-yaml": "^4.0.9", "@types/lodash.chunk": "^4.2.9", "concurrently": "^7.6.0", - "copy-webpack-plugin": "^12.0.2", "jest": "^29.5.0", "jest-extended": "^4.0.2", "js-yaml": "^4.1.0", diff --git a/yarn-project/end-to-end/src/e2e_epochs.test.ts b/yarn-project/end-to-end/src/e2e_epochs.test.ts index 6371bc02981..6de0128183c 100644 --- a/yarn-project/end-to-end/src/e2e_epochs.test.ts +++ b/yarn-project/end-to-end/src/e2e_epochs.test.ts @@ -1,5 +1,5 @@ import { type Logger, getTimestampRangeForEpoch, retryUntil, sleep } from '@aztec/aztec.js'; -import { ChainMonitor } from '@aztec/aztec.js/utils'; +import { ChainMonitor } from '@aztec/aztec.js/ethereum'; // eslint-disable-next-line no-restricted-imports import { type L1RollupConstants } from '@aztec/circuit-types'; import { Proof } from '@aztec/circuits.js'; diff --git a/yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts b/yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts index e5c34a7b74d..c1bf1f211b1 100644 --- a/yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts +++ b/yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts @@ -1,7 +1,7 @@ import { getSchnorrAccount } from '@aztec/accounts/schnorr'; import { type AztecNodeConfig, type AztecNodeService } from '@aztec/aztec-node'; import { type AccountWalletWithSecretKey } from '@aztec/aztec.js'; -import { ChainMonitor } from '@aztec/aztec.js/utils'; +import { ChainMonitor } from '@aztec/aztec.js/ethereum'; import { L1TxUtilsWithBlobs, RollupContract, getExpectedAddress, getL1ContractsConfigEnvVars } from '@aztec/ethereum'; import { EthCheatCodesWithState } from '@aztec/ethereum/test'; import { type Logger, createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/end-to-end/src/e2e_pruned_blocks.test.ts b/yarn-project/end-to-end/src/e2e_pruned_blocks.test.ts index 403a3b78aa1..66f67cfb19c 100644 --- a/yarn-project/end-to-end/src/e2e_pruned_blocks.test.ts +++ b/yarn-project/end-to-end/src/e2e_pruned_blocks.test.ts @@ -2,12 +2,12 @@ import { type AccountWallet, type AztecAddress, type AztecNode, + type CheatCodes, type Logger, MerkleTreeId, type Wallet, retryUntil, } from '@aztec/aztec.js'; -import { type CheatCodes } from '@aztec/aztec.js/utils'; import { TokenContract } from '@aztec/noir-contracts.js/Token'; import { setup } from './fixtures/utils.js'; diff --git a/yarn-project/end-to-end/src/spartan/4epochs.test.ts b/yarn-project/end-to-end/src/spartan/4epochs.test.ts index f63b56a6f61..92de2f5cf39 100644 --- a/yarn-project/end-to-end/src/spartan/4epochs.test.ts +++ b/yarn-project/end-to-end/src/spartan/4epochs.test.ts @@ -1,4 +1,5 @@ import { readFieldCompressedString } from '@aztec/aztec.js'; +import { RollupCheatCodes } from '@aztec/aztec.js/ethereum'; import { getL1ContractsConfigEnvVars } from '@aztec/ethereum'; import { EthCheatCodesWithState } from '@aztec/ethereum/test'; import { createLogger } from '@aztec/foundation/log'; @@ -6,7 +7,6 @@ import { TokenContract } from '@aztec/noir-contracts.js/Token'; import { jest } from '@jest/globals'; -import { RollupCheatCodes } from '../../../aztec.js/src/utils/cheat_codes.js'; import { type TestWallets, setupTestWalletsWithTokens } from './setup_test_wallets.js'; import { isK8sConfig, setupEnvironment, startPortForward } from './utils.js'; diff --git a/yarn-project/end-to-end/src/spartan/gating-passive.test.ts b/yarn-project/end-to-end/src/spartan/gating-passive.test.ts index 06007d05b7f..70555ac82ea 100644 --- a/yarn-project/end-to-end/src/spartan/gating-passive.test.ts +++ b/yarn-project/end-to-end/src/spartan/gating-passive.test.ts @@ -1,10 +1,10 @@ import { createCompatibleClient, sleep } from '@aztec/aztec.js'; +import { RollupCheatCodes } from '@aztec/aztec.js/ethereum'; import { EthCheatCodesWithState } from '@aztec/ethereum/test'; import { createLogger } from '@aztec/foundation/log'; import { expect, jest } from '@jest/globals'; -import { RollupCheatCodes } from '../../../aztec.js/src/utils/cheat_codes.js'; import { type AlertConfig } from '../quality_of_service/alert_checker.js'; import { applyBootNodeFailure, diff --git a/yarn-project/end-to-end/src/spartan/reorg.test.ts b/yarn-project/end-to-end/src/spartan/reorg.test.ts index a69b90d98d8..3603379be63 100644 --- a/yarn-project/end-to-end/src/spartan/reorg.test.ts +++ b/yarn-project/end-to-end/src/spartan/reorg.test.ts @@ -1,10 +1,10 @@ import { sleep } from '@aztec/aztec.js'; +import { RollupCheatCodes } from '@aztec/aztec.js/ethereum'; import { EthCheatCodesWithState } from '@aztec/ethereum/test'; import { createLogger } from '@aztec/foundation/log'; import { expect, jest } from '@jest/globals'; -import { RollupCheatCodes } from '../../../aztec.js/src/utils/cheat_codes.js'; import { type TestWallets, performTransfers, setupTestWalletsWithTokens } from './setup_test_wallets.js'; import { applyProverFailure, diff --git a/yarn-project/end-to-end/src/spartan/utils.ts b/yarn-project/end-to-end/src/spartan/utils.ts index facd41b7202..758e52e2696 100644 --- a/yarn-project/end-to-end/src/spartan/utils.ts +++ b/yarn-project/end-to-end/src/spartan/utils.ts @@ -1,4 +1,5 @@ import { createAztecNodeClient, createLogger, sleep } from '@aztec/aztec.js'; +import { type RollupCheatCodes } from '@aztec/aztec.js/ethereum'; import type { Logger } from '@aztec/foundation/log'; import type { SequencerConfig } from '@aztec/sequencer-client'; @@ -7,7 +8,6 @@ import path from 'path'; import { promisify } from 'util'; import { z } from 'zod'; -import type { RollupCheatCodes } from '../../../aztec.js/src/utils/cheat_codes.js'; import { AlertChecker, type AlertConfig } from '../quality_of_service/alert_checker.js'; const execAsync = promisify(exec); diff --git a/yarn-project/end-to-end/src/web/index.html b/yarn-project/end-to-end/src/web/index.html index 97e7d022731..6ae3bec01d6 100644 --- a/yarn-project/end-to-end/src/web/index.html +++ b/yarn-project/end-to-end/src/web/index.html @@ -2,7 +2,7 @@ diff --git a/yarn-project/end-to-end/webpack.config.js b/yarn-project/end-to-end/webpack.config.js index 5a9d09623df..6804e111bd0 100644 --- a/yarn-project/end-to-end/webpack.config.js +++ b/yarn-project/end-to-end/webpack.config.js @@ -1,7 +1,5 @@ -import CopyPlugin from 'copy-webpack-plugin'; import { createRequire } from 'module'; import { dirname, resolve } from 'path'; -import ResolveTypeScriptPlugin from 'resolve-typescript-plugin'; import { fileURLToPath } from 'url'; import webpack from 'webpack'; @@ -16,10 +14,6 @@ export default { }, module: { rules: [ - { - test: /\.gz$/, - type: 'asset/resource', - }, { test: /\.tsx?$/, use: [ @@ -35,7 +29,7 @@ export default { }, output: { path: resolve(dirname(fileURLToPath(import.meta.url)), './src/web'), - filename: 'main.js', + publicPath: '/', library: { type: 'module', }, @@ -45,14 +39,6 @@ export default { outputModule: true, }, plugins: [ - new CopyPlugin({ - patterns: [ - { - context: '../../barretenberg/ts/dest/browser', - from: '*.gz', - }, - ], - }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify('production'), @@ -61,12 +47,7 @@ export default { new webpack.ProvidePlugin({ Buffer: ['buffer', 'Buffer'] }), ], resolve: { - plugins: [new ResolveTypeScriptPlugin()], - alias: { - // All node specific code, wherever it's located, should be imported as below. - // Provides a clean and simple way to always strip out the node code for the web build. - './node/index.js': false, - }, + extensions: ['.tsx', '.ts', '.js'], fallback: { crypto: false, os: false, diff --git a/yarn-project/entrypoints/tsconfig.dest.json b/yarn-project/entrypoints/tsconfig.dest.json deleted file mode 100644 index 5997e69d530..00000000000 --- a/yarn-project/entrypoints/tsconfig.dest.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": ".", - "references": [ - { - "path": "../aztec.js/tsconfig.dest.json" - }, - { - "path": "../circuits.js/tsconfig.dest.json" - }, - { - "path": "../foundation/tsconfig.dest.json" - }, - { - "path": "../circuit-types/tsconfig.dest.json" - } - ], - "exclude": ["src/**/*.test.ts"] -} diff --git a/yarn-project/yarn.lock b/yarn-project/yarn.lock index a615d671028..9dd5197d7f5 100644 --- a/yarn-project/yarn.lock +++ b/yarn-project/yarn.lock @@ -634,7 +634,6 @@ __metadata: "@viem/anvil": "npm:^0.0.9" buffer: "npm:^6.0.3" concurrently: "npm:^7.6.0" - copy-webpack-plugin: "npm:^12.0.2" crypto-browserify: "npm:^3.12.0" fs-extra: "npm:^11.2.0" get-port: "npm:^7.1.0" @@ -652,7 +651,6 @@ __metadata: memdown: "npm:^6.1.1" process: "npm:^0.11.10" puppeteer-core: "npm:^22.2" - resolve-typescript-plugin: "npm:^2.0.1" stream-browserify: "npm:^3.0.0" string-argv: "npm:^0.3.2" ts-loader: "npm:^9.4.4" @@ -661,7 +659,7 @@ __metadata: typescript: "npm:^5.0.4" util: "npm:^0.12.5" viem: "npm:2.22.8" - webpack: "npm:^5.88.2" + webpack: "npm:^5.90.0" webpack-cli: "npm:^5.1.4" zod: "npm:^3.23.8" languageName: unknown @@ -6568,6 +6566,16 @@ __metadata: languageName: node linkType: hard +"@webassemblyjs/ast@npm:1.14.1, @webassemblyjs/ast@npm:^1.14.1": + version: 1.14.1 + resolution: "@webassemblyjs/ast@npm:1.14.1" + dependencies: + "@webassemblyjs/helper-numbers": "npm:1.13.2" + "@webassemblyjs/helper-wasm-bytecode": "npm:1.13.2" + checksum: 10/f83e6abe38057f5d87c1fb356513a371a8b43c9b87657f2790741a66b1ef8ecf958d1391bc42f27c5fb33f58ab8286a38ea849fdd21f433cd4df1307424bab45 + languageName: node + linkType: hard + "@webassemblyjs/floating-point-hex-parser@npm:1.11.6": version: 1.11.6 resolution: "@webassemblyjs/floating-point-hex-parser@npm:1.11.6" @@ -6575,6 +6583,13 @@ __metadata: languageName: node linkType: hard +"@webassemblyjs/floating-point-hex-parser@npm:1.13.2": + version: 1.13.2 + resolution: "@webassemblyjs/floating-point-hex-parser@npm:1.13.2" + checksum: 10/e866ec8433f4a70baa511df5e8f2ebcd6c24f4e2cc6274c7c5aabe2bcce3459ea4680e0f35d450e1f3602acf3913b6b8e4f15069c8cfd34ae8609fb9a7d01795 + languageName: node + linkType: hard + "@webassemblyjs/helper-api-error@npm:1.11.6": version: 1.11.6 resolution: "@webassemblyjs/helper-api-error@npm:1.11.6" @@ -6582,6 +6597,13 @@ __metadata: languageName: node linkType: hard +"@webassemblyjs/helper-api-error@npm:1.13.2": + version: 1.13.2 + resolution: "@webassemblyjs/helper-api-error@npm:1.13.2" + checksum: 10/48b5df7fd3095bb252f59a139fe2cbd999a62ac9b488123e9a0da3906ad8a2f2da7b2eb21d328c01a90da987380928706395c2897d1f3ed9e2125b6d75a920d0 + languageName: node + linkType: hard + "@webassemblyjs/helper-buffer@npm:1.12.1": version: 1.12.1 resolution: "@webassemblyjs/helper-buffer@npm:1.12.1" @@ -6589,6 +6611,13 @@ __metadata: languageName: node linkType: hard +"@webassemblyjs/helper-buffer@npm:1.14.1": + version: 1.14.1 + resolution: "@webassemblyjs/helper-buffer@npm:1.14.1" + checksum: 10/9690afeafa5e765a34620aa6216e9d40f9126d4e37e9726a2594bf60cab6b211ef20ab6670fd3c4449dd4a3497e69e49b2b725c8da0fb213208c7f45f15f5d5b + languageName: node + linkType: hard + "@webassemblyjs/helper-numbers@npm:1.11.6": version: 1.11.6 resolution: "@webassemblyjs/helper-numbers@npm:1.11.6" @@ -6600,6 +6629,17 @@ __metadata: languageName: node linkType: hard +"@webassemblyjs/helper-numbers@npm:1.13.2": + version: 1.13.2 + resolution: "@webassemblyjs/helper-numbers@npm:1.13.2" + dependencies: + "@webassemblyjs/floating-point-hex-parser": "npm:1.13.2" + "@webassemblyjs/helper-api-error": "npm:1.13.2" + "@xtuc/long": "npm:4.2.2" + checksum: 10/e4c7d0b09811e1cda8eec644a022b560b28f4e974f50195375ccd007df5ee48a922a6dcff5ac40b6a8ec850d56d0ea6419318eee49fec7819ede14e90417a6a4 + languageName: node + linkType: hard + "@webassemblyjs/helper-wasm-bytecode@npm:1.11.6": version: 1.11.6 resolution: "@webassemblyjs/helper-wasm-bytecode@npm:1.11.6" @@ -6607,6 +6647,13 @@ __metadata: languageName: node linkType: hard +"@webassemblyjs/helper-wasm-bytecode@npm:1.13.2": + version: 1.13.2 + resolution: "@webassemblyjs/helper-wasm-bytecode@npm:1.13.2" + checksum: 10/3edd191fff7296df1ef3b023bdbe6cb5ea668f6386fd197ccfce46015c6f2a8cc9763cfb86503a0b94973ad27996645afff2252ee39a236513833259a47af6ed + languageName: node + linkType: hard + "@webassemblyjs/helper-wasm-section@npm:1.12.1": version: 1.12.1 resolution: "@webassemblyjs/helper-wasm-section@npm:1.12.1" @@ -6619,6 +6666,18 @@ __metadata: languageName: node linkType: hard +"@webassemblyjs/helper-wasm-section@npm:1.14.1": + version: 1.14.1 + resolution: "@webassemblyjs/helper-wasm-section@npm:1.14.1" + dependencies: + "@webassemblyjs/ast": "npm:1.14.1" + "@webassemblyjs/helper-buffer": "npm:1.14.1" + "@webassemblyjs/helper-wasm-bytecode": "npm:1.13.2" + "@webassemblyjs/wasm-gen": "npm:1.14.1" + checksum: 10/6b73874f906532512371181d7088460f767966f26309e836060c5a8e4e4bfe6d523fb5f4c034b34aa22ebb1192815f95f0e264298769485c1f0980fdd63ae0ce + languageName: node + linkType: hard + "@webassemblyjs/ieee754@npm:1.11.6": version: 1.11.6 resolution: "@webassemblyjs/ieee754@npm:1.11.6" @@ -6628,6 +6687,15 @@ __metadata: languageName: node linkType: hard +"@webassemblyjs/ieee754@npm:1.13.2": + version: 1.13.2 + resolution: "@webassemblyjs/ieee754@npm:1.13.2" + dependencies: + "@xtuc/ieee754": "npm:^1.2.0" + checksum: 10/d7e3520baa37a7309fa7db4d73d69fb869878853b1ebd4b168821bd03fcc4c0e1669c06231315b0039035d9a7a462e53de3ad982da4a426a4b0743b5888e8673 + languageName: node + linkType: hard + "@webassemblyjs/leb128@npm:1.11.6": version: 1.11.6 resolution: "@webassemblyjs/leb128@npm:1.11.6" @@ -6637,6 +6705,15 @@ __metadata: languageName: node linkType: hard +"@webassemblyjs/leb128@npm:1.13.2": + version: 1.13.2 + resolution: "@webassemblyjs/leb128@npm:1.13.2" + dependencies: + "@xtuc/long": "npm:4.2.2" + checksum: 10/3a10542c86807061ec3230bac8ee732289c852b6bceb4b88ebd521a12fbcecec7c432848284b298154f28619e2746efbed19d6904aef06c49ef20a0b85f650cf + languageName: node + linkType: hard + "@webassemblyjs/utf8@npm:1.11.6": version: 1.11.6 resolution: "@webassemblyjs/utf8@npm:1.11.6" @@ -6644,6 +6721,13 @@ __metadata: languageName: node linkType: hard +"@webassemblyjs/utf8@npm:1.13.2": + version: 1.13.2 + resolution: "@webassemblyjs/utf8@npm:1.13.2" + checksum: 10/27885e5d19f339501feb210867d69613f281eda695ac508f04d69fa3398133d05b6870969c0242b054dc05420ed1cc49a64dea4fe0588c18d211cddb0117cc54 + languageName: node + linkType: hard + "@webassemblyjs/wasm-edit@npm:^1.12.1": version: 1.12.1 resolution: "@webassemblyjs/wasm-edit@npm:1.12.1" @@ -6660,6 +6744,22 @@ __metadata: languageName: node linkType: hard +"@webassemblyjs/wasm-edit@npm:^1.14.1": + version: 1.14.1 + resolution: "@webassemblyjs/wasm-edit@npm:1.14.1" + dependencies: + "@webassemblyjs/ast": "npm:1.14.1" + "@webassemblyjs/helper-buffer": "npm:1.14.1" + "@webassemblyjs/helper-wasm-bytecode": "npm:1.13.2" + "@webassemblyjs/helper-wasm-section": "npm:1.14.1" + "@webassemblyjs/wasm-gen": "npm:1.14.1" + "@webassemblyjs/wasm-opt": "npm:1.14.1" + "@webassemblyjs/wasm-parser": "npm:1.14.1" + "@webassemblyjs/wast-printer": "npm:1.14.1" + checksum: 10/c62c50eadcf80876713f8c9f24106b18cf208160ab842fcb92060fd78c37bf37e7fcf0b7cbf1afc05d230277c2ce0f3f728432082c472dd1293e184a95f9dbdd + languageName: node + linkType: hard + "@webassemblyjs/wasm-gen@npm:1.12.1": version: 1.12.1 resolution: "@webassemblyjs/wasm-gen@npm:1.12.1" @@ -6673,6 +6773,19 @@ __metadata: languageName: node linkType: hard +"@webassemblyjs/wasm-gen@npm:1.14.1": + version: 1.14.1 + resolution: "@webassemblyjs/wasm-gen@npm:1.14.1" + dependencies: + "@webassemblyjs/ast": "npm:1.14.1" + "@webassemblyjs/helper-wasm-bytecode": "npm:1.13.2" + "@webassemblyjs/ieee754": "npm:1.13.2" + "@webassemblyjs/leb128": "npm:1.13.2" + "@webassemblyjs/utf8": "npm:1.13.2" + checksum: 10/6085166b0987d3031355fe17a4f9ef0f412e08098d95454059aced2bd72a4c3df2bc099fa4d32d640551fc3eca1ac1a997b44432e46dc9d84642688e42c17ed4 + languageName: node + linkType: hard + "@webassemblyjs/wasm-opt@npm:1.12.1": version: 1.12.1 resolution: "@webassemblyjs/wasm-opt@npm:1.12.1" @@ -6685,6 +6798,18 @@ __metadata: languageName: node linkType: hard +"@webassemblyjs/wasm-opt@npm:1.14.1": + version: 1.14.1 + resolution: "@webassemblyjs/wasm-opt@npm:1.14.1" + dependencies: + "@webassemblyjs/ast": "npm:1.14.1" + "@webassemblyjs/helper-buffer": "npm:1.14.1" + "@webassemblyjs/wasm-gen": "npm:1.14.1" + "@webassemblyjs/wasm-parser": "npm:1.14.1" + checksum: 10/fa5d1ef8d2156e7390927f938f513b7fb4440dd6804b3d6c8622b7b1cf25a3abf1a5809f615896d4918e04b27b52bc3cbcf18faf2d563cb563ae0a9204a492db + languageName: node + linkType: hard + "@webassemblyjs/wasm-parser@npm:1.12.1, @webassemblyjs/wasm-parser@npm:^1.12.1": version: 1.12.1 resolution: "@webassemblyjs/wasm-parser@npm:1.12.1" @@ -6699,6 +6824,20 @@ __metadata: languageName: node linkType: hard +"@webassemblyjs/wasm-parser@npm:1.14.1, @webassemblyjs/wasm-parser@npm:^1.14.1": + version: 1.14.1 + resolution: "@webassemblyjs/wasm-parser@npm:1.14.1" + dependencies: + "@webassemblyjs/ast": "npm:1.14.1" + "@webassemblyjs/helper-api-error": "npm:1.13.2" + "@webassemblyjs/helper-wasm-bytecode": "npm:1.13.2" + "@webassemblyjs/ieee754": "npm:1.13.2" + "@webassemblyjs/leb128": "npm:1.13.2" + "@webassemblyjs/utf8": "npm:1.13.2" + checksum: 10/07d9805fda88a893c984ed93d5a772d20d671e9731358ab61c6c1af8e0e58d1c42fc230c18974dfddebc9d2dd7775d514ba4d445e70080b16478b4b16c39c7d9 + languageName: node + linkType: hard + "@webassemblyjs/wast-printer@npm:1.12.1": version: 1.12.1 resolution: "@webassemblyjs/wast-printer@npm:1.12.1" @@ -6709,6 +6848,16 @@ __metadata: languageName: node linkType: hard +"@webassemblyjs/wast-printer@npm:1.14.1": + version: 1.14.1 + resolution: "@webassemblyjs/wast-printer@npm:1.14.1" + dependencies: + "@webassemblyjs/ast": "npm:1.14.1" + "@xtuc/long": "npm:4.2.2" + checksum: 10/cef09aad2fcd291bfcf9efdae2ea1e961a1ba0f925d1d9dcdd8c746d32fbaf431b6d26a0241699c0e39f82139018aa720b4ceb84ac6f4c78f13072747480db69 + languageName: node + linkType: hard + "@webpack-cli/configtest@npm:^2.1.1": version: 2.1.1 resolution: "@webpack-cli/configtest@npm:2.1.1" @@ -21345,6 +21494,42 @@ __metadata: languageName: node linkType: hard +"webpack@npm:^5.90.0": + version: 5.97.1 + resolution: "webpack@npm:5.97.1" + dependencies: + "@types/eslint-scope": "npm:^3.7.7" + "@types/estree": "npm:^1.0.6" + "@webassemblyjs/ast": "npm:^1.14.1" + "@webassemblyjs/wasm-edit": "npm:^1.14.1" + "@webassemblyjs/wasm-parser": "npm:^1.14.1" + acorn: "npm:^8.14.0" + browserslist: "npm:^4.24.0" + chrome-trace-event: "npm:^1.0.2" + enhanced-resolve: "npm:^5.17.1" + es-module-lexer: "npm:^1.2.1" + eslint-scope: "npm:5.1.1" + events: "npm:^3.2.0" + glob-to-regexp: "npm:^0.4.1" + graceful-fs: "npm:^4.2.11" + json-parse-even-better-errors: "npm:^2.3.1" + loader-runner: "npm:^4.2.0" + mime-types: "npm:^2.1.27" + neo-async: "npm:^2.6.2" + schema-utils: "npm:^3.2.0" + tapable: "npm:^2.1.1" + terser-webpack-plugin: "npm:^5.3.10" + watchpack: "npm:^2.4.1" + webpack-sources: "npm:^3.2.3" + peerDependenciesMeta: + webpack-cli: + optional: true + bin: + webpack: bin/webpack.js + checksum: 10/665bd3b8c84b20f0b1f250159865e4d3e9b76c682030313d49124d5f8e96357ccdcc799dd9fe0ebf010fdb33dbc59d9863d79676a308e868e360ac98f7c09987 + languageName: node + linkType: hard + "webpack@npm:^5.90.3": version: 5.96.1 resolution: "webpack@npm:5.96.1"