Ensure @gitlab/ui package has dist directory
Summary
Fixes #3426 (closed)
Starting at @gitlab/ui v131.3.1, the dist/ folder is no longer included in the published npm package because the scheduled publishing pipeline excludes the UI CI config (and thus ui:build_package) via is-publishing-pipeline: when: never include rules.
This MR adds a prepack npm lifecycle script to packages/gitlab-ui/package.json that runs yarn build before the package is packed (and published). This ensures dist/ is always produced regardless of which pipeline publishes the package, and also allows simplifying the ui:build_package CI job script by removing the explicit yarn build step.
Details
- !5838 (merged) moved package publishing to a dedicated scheduled pipeline
- The
includerules forpackages/gitlab-ui/.gitlab-ci.ymlhaveis-publishing-pipeline: when: neveras the first rule, which excludes the entire UI CI config from the publishing pipeline - This means
ui:build_package(which runsyarn buildand producesdist/) never executes during publishing - The fix uses the
prepacknpm lifecycle script so thatyarn buildis run automatically whenevernpm pack(orchangeset publish) is called @gitlab/svgsis unaffected because itsdist/is generated by thepreparelifecycle hook duringyarn install
Edited by Mark Florian