Closed dgp1130 closed 1 year ago
After the migration to @aspect_rules_js
, the new way packages are linked and published works directly through Bazel and doesn't require hacks like this. I already have //examples/external/...
as a test case for external workspaces.
The
pkg_npm()
rule generated at//:pkg
holds the package which is published to NPM. This contains pre-built artifacts and distinct build files from the normal repository, however it is completed untested bybazel test //...
(aside from a simplebuild_test()
). Whether or not it works required manual verification via theref/external
branch.I want something which still works with
bazel test
in the main repository. I can imagine a process which looks something like:WORKSPACE
file).//:pkg
, then serves it (and all dependencies in the reponode_modules/
) out of the custom NPM server.npm install
with the custom registry to install all deps in the inner workspace.bazel test //...
to build and execute all tests in the inner workspace.We could then author a couple small but complete examples which prerender a few web pages and assert that they work as expected.
This would be a pretty heavyweight test and would require a custom NPM server, but I think it is worth the investment as without it there is no way to easily verify that the published NPM package actually works as expected without a lot of manual effort.