Allow .cjs and .mjs files to be shadowed - #8418
Open
kunalKumar-13 wants to merge 1 commit into
Open
Conversation
(cherry picked from commit 799e67d)
There was a problem hiding this comment.
🟢 Approval recommended
The change is small, targeted, and includes a fixture-backed test assertion that verifies .cjs shadows are discovered and aliased correctly without altering the alias key stripping behavior.
Pull request overview
This PR backports the fix from #8413 to the 18.x.x branch so that Volto customizations can shadow core modules implemented as CommonJS/ESM modules with .cjs/.mjs extensions (previously ignored by the customization file glob).
Changes:
- Extend the addon-registry customization file glob to include
cjsandmjs. - Add a
.cjsshadow pair to the registry test fixture to exercise the behavior. - Update the addon-registry test to assert that
.cjsshadow aliases are generated with the extension preserved.
File summaries
| File | Description |
|---|---|
| packages/registry/src/addon-registry/addon-registry.ts | Adds `cjs |
| packages/registry/news/8366.bugfix | Adds a news fragment documenting the bugfix/backport. |
| packages/registry/tests/fixtures/test-volto-project/src/customizations/constants/Languages.cjs | Adds a .cjs customization fixture. |
| packages/registry/tests/fixtures/test-volto-project/node_modules/@plone/volto/src/constants/Languages.cjs | Adds a .cjs “core” fixture module to be shadowed. |
| packages/registry/tests/addon-registry.test.js | Asserts the .cjs alias key is present and retains its extension. |
Review details
- Files reviewed: 4/5 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Documentation build overview
102 files changed ·
|
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.
Backport of #8413 to
18.x.x, as requested.Cherry-picked from
799e67d81with-x; it applied without conflicts, and theglob line it changes is identical on this branch.
packages/registryis green here: 4 test files, 83 tests. I also checked thebackported test is doing its job on
18.x.xrather than passing regardless —reverting just the glob change fails
addon-registry.test.json the.cjsalias assertion.