Skip to content

Expose bundler scripts (build-id, package-build) for reuse in other bundles#3874

Merged
markus-moser merged 2 commits into
2025.4from
feat/expose-bundler-scripts-for-reuse
Jul 10, 2026
Merged

Expose bundler scripts (build-id, package-build) for reuse in other bundles#3874
markus-moser merged 2 commits into
2025.4from
feat/expose-bundler-scripts-for-reuse

Conversation

@markus-moser

@markus-moser markus-moser commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Makes assets/bundler/build-id.ts and assets/bundler/package-build.cjs reusable via @pimcore/studio-ui-bundle, so consumers (e.g. collab-bundle) no longer copy-paste them into their own assets/{bundle}/bundler/.

Changes

  • build-id.ts: getBuildGroupId() accepts an optional sourceDir. Default preserved for in-repo callers; consumers installed via npm pass their own assets root.
  • package-build.cjs: reads --build-dir and --out-dir from argv, defaults unchanged. npm run package-build still works with no args.
  • package.json: ships both files via files:, adds ./bundler/build-id subpath export and studio-package-build bin, moves adm-zip to dependencies.

Additive — no behaviour change for studio-ui-bundle itself.

markus-moser and others added 2 commits July 10, 2026 13:15
…euse

Consumers (e.g. collab-bundle) have been copy-pasting these scripts into
their own assets/{bundle}/bundler/ directory, so any fix has to be applied
twice and the copies drift over time. This makes both scripts reusable
via the shared @pimcore/studio-ui-bundle npm package that consumers
already depend on.

- build-id.ts: getBuildGroupId() now takes an optional sourceDir. Callers
  installed via npm pass their own assets root; the in-repo default
  (path.resolve(__dirname, ..)) is preserved so studio-ui-bundle callers
  keep working unchanged.
- package-build.cjs: reads --build-dir and --out-dir from argv, with the
  current __dirname-relative paths as defaults. The internal npm script
  (npm run package-build) still works without arguments.
- package.json: ships bundler/build-id.ts and bundler/package-build.cjs
  in the published tarball, exposes them via a subpath export and a bin
  entry (studio-package-build). Moves adm-zip from devDependencies to
  dependencies so the bin has its runtime dependency after install.

No behaviour change for studio-ui-bundle itself - internal callers use
the same paths as before. The refactor is additive: it exposes an API,
does not change the existing one.
@sonarqubecloud

Copy link
Copy Markdown

@markus-moser markus-moser added this to the 2025.4.9 milestone Jul 10, 2026
@markus-moser
markus-moser marked this pull request as ready for review July 10, 2026 11:24
@markus-moser
markus-moser merged commit 22fbbf1 into 2025.4 Jul 10, 2026
7 checks passed
@markus-moser
markus-moser deleted the feat/expose-bundler-scripts-for-reuse branch July 10, 2026 11:24
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant