prism
prism copied to clipboard
Provide a single bundled JS file for the CLI
Context / Current Behaivour
We've ran into issues on two separate occasions due to a regression in new minor releases of one of the transitive deps of the Prism CLI. This means that we can't even downgrade to an earlier CLI version as npx will still use the broken transitive dep.
https://github.com/stoplightio/prism/issues/2566
Possible Solution(s)
If instead of using npx to run the Prism CLI, we could download a JS file (e.g. from github releases) and run it ourselves, we wouldn't ever run into issues due to new transitive dependency releases.
Another alternative would be to update the existing CLI package (or publish a separate one) that would just be the bundled JS file with no dependencies.
To add to Robert's comment, we use that type of bundles for multiple of our internal tooling, we had a great experience using esbuild to generate bundles containing all files and dependencies without much time investment.