Repository navigation
feat: support for custom module name - #525
Merged
Merged
Conversation
baptistegrimaud
force-pushed
the
ability-to-use-custom-name
branch
from
October 8, 2025 09:38
2e625cb to
64cdaaf
Compare
baptistegrimaud
force-pushed
the
ability-to-use-custom-name
branch
from
October 8, 2025 09:40
64cdaaf to
5016f7a
Compare
baptistegrimaud
marked this pull request as ready for review
October 8, 2025 10:06
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces support for custom module names in JavaScript modules by allowing developers to specify a name field in the jahia section of package.json, which will be used as the Bundle-Name instead of the restrictive npm package name.
Key changes:
- Modified Java code to prioritize
jahia.nameover packagenamefor Bundle-Name generation - Updated templates to include placeholder
$MODULEin jahia.name field - Added test module example with custom name "JS Modules Engine Test Module"
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| JavascriptProtocolConnection.java | Updated bundle name generation logic to use jahia.name when available |
| moduleTransformationTest.cy.ts | Updated test expectations to reflect new custom module name format |
| package.json templates | Added jahia.name field with $MODULE placeholder in all templates |
| jahia-test-module/package.json | Added example custom name for testing purposes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
GauBen
approved these changes
Oct 8, 2025
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Instead of using the
namefield of thepackage.jsonas the module name (Bundle-Name), support for a customnameunder thejahiasection.The
namefield is restricted, see https://docs.npmjs.com/creating-a-package-json-file:When there is no such limitation on the custom Jahia one:
{ "name": "my-module", ... "jahia": { "name": "Any name I want", ... } }NB: the symbolic name (
Bundle-SymbolicName) remains based on thenamefield (for consistency with the Maven modules that use<artifactId>).Tip
Documentation to guide the reviews: How to do a code review