Skip to content
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

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

Open
eric-burel opened this issue Jun 22, 2021 · 2 comments
Open

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

eric-burel opened this issue Jun 22, 2021 · 2 comments
Labels
enhancement New feature or request hacktoberfest

Comments

@eric-burel
Copy link
Collaborator

eric-burel commented Jun 22, 2021

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 eric-burel added the enhancement New feature or request label Jun 22, 2021
@eric-burel eric-burel changed the title Add a unit test to check built packages import Add a test/protection to check built packages import Jun 22, 2021
@eric-burel eric-burel changed the title Add a test/protection to check built packages import Add a test/protection to check that NPM packages are not empty Jun 22, 2021
@eric-burel
Copy link
Collaborator Author

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
Copy link
Collaborator Author

Added a first test that checks that the build did not erroneously load other packages (related to #80 multi entry support in packages)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest
Projects
None yet
Development

No branches or pull requests

1 participant