-
Notifications
You must be signed in to change notification settings - Fork 81
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
Shared Local Bundler E2E Setup #314
Conversation
@@ -0,0 +1,68 @@ | |||
#!/usr/bin/env node |
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.
Ported from the original run.sh
script to JS so that it can be exported as a bin
.
d9828e8
to
ca79025
Compare
Pull Request Test Coverage Report for Build 8194488336Details
💛 - Coveralls |
@@ -10,7 +10,8 @@ | |||
], | |||
"scripts": { | |||
"fmt:global": "prettier --write .", | |||
"fmt:global-check": "prettier --check ." | |||
"fmt:global-check": "prettier --check .", | |||
"postinstall": "npm rebuild --skip-scripts @safe-global/safe-4337-local-bundler" |
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.
This looks weird, bit it is a work around to re-link the bin
from the workspace package. The issue is that the JS file that is referenced in the bin
field from the package.json
is in the dist/
folder and generated by the build step, and NPM can't figure out how to link it correctly.
The work-around is to manually re-build the package, this forces NPM to regenerate bin
links. Note that, by the time the postinstall
step happens, the package is guarateed to have compiled the JS to the dist/
directory, as it is a dependency of other packages in the workspace, and this happens in the prepackage
step for the workspace package.
87f28bc
to
2507654
Compare
4fd20e4
to
c2b7f01
Compare
This PR adds a new workspace
packages/4337-local-bundler
which exposes abin
executable called4337-local-bundler-test
which runs a local bundler using Docker, and then executeshardhat
tests using the@4337
tag.This allows us to have a homogeneous setup between both the 4337 and passkey repositories (as well as any future modules that we want to be 4337-compliant).
Along the way, I was also able to share 4337 and Safe deployment scripts across the projects when bootstrapping the local development node.