fix(api): run npm install with --ignore-scripts - #793
Conversation
kanadgupta
left a comment
There was a problem hiding this comment.
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.
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.
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.
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