-
Notifications
You must be signed in to change notification settings - Fork 17
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
refactor(wasm): modify turborepo config #780
Conversation
@turbocrime can you check why |
patterns: [ | ||
{ from: 'public', to: '.' }, | ||
{ | ||
from: 'bin', | ||
to: 'bin', | ||
context: path.resolve(__dirname, '../../packages/wasm'), | ||
noErrorOnMissing: true, | ||
}, | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iirc there is a more 'conventional' way to bundle assets from a dependency in webpack. i don't have an example on hand but i will see what i can find later
packages/wasm/package.json
Outdated
@@ -5,6 +5,7 @@ | |||
"license": "MIT", | |||
"type": "module", | |||
"scripts": { | |||
"precompile": "tsx ../../apps/extension/src/utils/download-proving-keys.ts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
excellent, i like how this leverages the pre/post auto-execute feature of npm. it might be more technically correct as a 'postcompile' or 'postbuild' script - or even 'pretest' 'prelint' or 'postinstall'
we might look at using more of these pre/post scripts for dependency management outside of turbo, which should be aware of them and manage cache appropriately - playwright-install
before certain tests is another good candidate for this
@turbocrime is this in a mergeable state? feel free to make any changes |
probably the wasm package should contain the key download script, and expose it to other packages via the 'bin' field |
closing in favor of #872 |
references #676
The responsibility of downloading proving keys is moved to the
wasm
package. I further simplified the turborepo configuration defined inturbo.json
, while still adhering to the existing dependency chain, by utilizing theprecompile
script hook provided by npm. This hook is automatically executed before the compile / dev / build scripts, ensuring the proving keys are available before proceeding with the compilation of the WASM package. The top-level scripts in package.json will call this precompile step before continuing with their respective execution. As such, we remove the unnecessary explicitdownload-key
call in favor of thisprecompile
step.Additionally, per #434 (comment), we maintain a
bin
directory in the wasm package, and copy the bin directory inside the temporarydist
directory in the extension package.