Expose bundler scripts (build-id, package-build) for reuse in other bundles#3874
Merged
Merged
Conversation
…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.
|
markus-moser
marked this pull request as ready for review
July 10, 2026 11:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Makes
assets/bundler/build-id.tsandassets/bundler/package-build.cjsreusable via@pimcore/studio-ui-bundle, so consumers (e.g.collab-bundle) no longer copy-paste them into their ownassets/{bundle}/bundler/.Changes
build-id.ts:getBuildGroupId()accepts an optionalsourceDir. Default preserved for in-repo callers; consumers installed via npm pass their own assets root.package-build.cjs: reads--build-dirand--out-dirfromargv, defaults unchanged.npm run package-buildstill works with no args.package.json: ships both files viafiles:, adds./bundler/build-idsubpath export andstudio-package-buildbin, movesadm-ziptodependencies.Additive — no behaviour change for studio-ui-bundle itself.