VulcanJS / vulcan-npm

The full-stack JavaScript App Framework
https://vulcan-docs.vercel.app
MIT License
31 stars 8 forks source link

Add a test/protection to check that NPM packages are not empty #57

Open eric-burel opened 3 years ago

eric-burel commented 3 years ago

Is your feature request related to a problem? Please describe. Unit test may let pass the case where we forget to correctly export files in the NPM package.

We absolutely need to run yarn run build locally before publishing packages, so we need a way to secure this process.

Describe the solution you'd like We could have multiple strategies, like running npm pack --dry-run.

We can also add a publish + prepublish script that forces the build, but that can be annoying when you have already built the app and want to skip this step. I'd rather check if the build has been done, than systematically building.

To reproduce Run yarn clean then npm pack --dry-run in a package => you will have an empty result because /dist folders are empty. We could also simply check that all packages contain a "dist" folder or something similar.

eric-burel commented 3 years ago

A solution could be to host a very minimal app directly within vulcan-npm, so it can test whether the packages are correctly imported (in Lerna, you don't really test this because of hoisting)

eric-burel commented 2 years ago

Added a first test that checks that the build did not erroneously load other packages (related to https://github.com/VulcanJS/vulcan-npm/issues/80 multi entry support in packages)