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 include rules for packages/gitlab-ui/.gitlab-ci.yml have is-publishing-pipeline: when: never as the first rule, which excludes the entire UI CI config from the publishing pipeline
  • This means ui:build_package (which runs yarn build and produces dist/) never executes during publishing
  • The fix uses the prepack npm lifecycle script so that yarn build is run automatically whenever npm pack (or changeset publish) is called
  • @gitlab/svgs is unaffected because its dist/ is generated by the prepare lifecycle hook during yarn install
Edited by Mark Florian

Merge request reports

Loading