You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying out using plugin-exec in my work project, for more complex non-npm dependencies. To be precise: Git repositories containing schema files which we later generate TypeScript bindings for.
It's working perfectly for cloning the repository, creating a "fake" package.json, and only re-exec'ing the script when the file changes. It's providing a lot of benefit with caching and only running "postinstall" when the dependencies change, etc.
Problem
I have to create a separate script for each git repository I would like to clone rather than being able to re-use a shared script for each exec:-schema dependency.
If I could provide arguments / environment variables to the script, then I could re-use the same script and just initialise it differently for each dependency.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Background
I've been trying out using
plugin-exec
in my work project, for more complex non-npm dependencies. To be precise: Git repositories containing schema files which we later generate TypeScript bindings for.It's working perfectly for cloning the repository, creating a "fake"
package.json
, and only re-exec'ing the script when the file changes. It's providing a lot of benefit with caching and only running"postinstall"
when the dependencies change, etc.Problem
I have to create a separate script for each git repository I would like to clone rather than being able to re-use a shared script for each
exec:
-schema dependency.If I could provide arguments / environment variables to the script, then I could re-use the same script and just initialise it differently for each dependency.
Examples
Current:
Currently, I have something that looks akin to
Where each file is identical aside from some initial variable setup at the top of the file, e.g:
Desired
Syntax is entirely open to ideation.
Notes
I can't use the
Git
/GitHub
protocols as no manifest exists in the repositoryBeta Was this translation helpful? Give feedback.
All reactions