-
Notifications
You must be signed in to change notification settings - Fork 28
fix(api): run npm install with --ignore-scripts
#793
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
Conversation
kanadgupta
left a comment
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.
so i added a little prompt after this line to confirm that the dist/ directory wasn't being built before the compilation step, but it looks like it's being built:
i did a little digging and was able to fix this by making this change on this line:
- return execa('npm', [...npmInstall, installDir].filter(Boolean))
+ return execa('npm', [...npmInstall].filter(Boolean), { cwd: installDir })|
Is the api in that case added to the root package.json file? I think thats just going to run npm i install the api and not add it as a dependency |
ah shit you're right 😬 my hunch is that the |
|
another idea:
|
| .then(res => handleExecSuccess(res, opts)) | ||
| .catch(err => handleExecFailure(err, opts)); |
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.
might be nice to write a small wrapper for execa() that handles these success and failure states instead of having to copy-paste this code everywhere but i don't really have the energy at the moment to try to figure out how to clone all of execa's parameter typing into a wrapper
kanadgupta
left a comment
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.
i was able to confirm it works as expected with the fix below!
| const REF_PLACEHOLDER = '::convert::'; | ||
| const REF_PLACEHOLDER_REGEX = /"::convert::([a-zA-Z_$\\d]*)"/g; | ||
|
|
||
| function handleExecSuccess(res: ExecaReturnValue<string>, opts: InstallerOptions = {}) { |
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.
great refactor here 🫶🏽
Co-authored-by: Kanad Gupta <8854718+kanadgupta@users.noreply.github.com>

🧰 Changes
The
preparescript that was added to codegen'dpackage.jsonfiles in #761 is being executed when we install that SDK resulting us in running the compilation step twice. Because I'd like to keep the dependency installation and SDK dist compilation processes separate we should runnpm installwith the--ignore-scriptsoption.fixes RM-8243