init-version.sh: npm install extensions and skins that need node_modules - #2
Open
claude[bot] wants to merge 1 commit into
Open
claude[bot] wants to merge 1 commit into
claude[bot] wants to merge 1 commit into
Conversation
Some extensions and skins register ResourceLoader modules whose localBasePath points into node_modules. The Femiwiki skin is the current example: it serves styles out of node_modules/xeicon and node_modules/@femiwiki/ooui-femiwiki-theme/dist/resources, both listed as runtime dependencies in its package.json. This script runs composer install for every extension and skin but never npm install, so those files never exist in a freshly built version tree and load.php throws "RuntimeException: style file not found or not a file". Pages on the affected wikis render unstyled. Install production npm dependencies in the same loop for any directory that ships a package.json and whose extension.json / skin.json actually references node_modules, so unrelated build-tooling package.json files are skipped. This only affects version trees built from now on; existing 1.45 and 1.46 trees still need a one-off npm install under skins/Femiwiki. Sentry: MEDIAWIKI-2KE, MEDIAWIKI-2HR Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AiEBkhzV1z9bEykvEU9U8j
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Requested by Thomas · Slack thread
Before: Wikis using the Femiwiki skin render as unstyled HTML. Every page load fires a
/w/load.phprequest that dies withRuntimeException: style file not found or not a file, because the skin's stylesheets live inside npm packages that were never installed into the version tree. Sentry issuesMEDIAWIKI-2KE(50 events) andMEDIAWIKI-2HR(15 events) cover this across 7 wikis, all on/w/load.php.After: A version tree built by
init-version.shfrom now on has those npm packages present, soload.phpfinds the style files and Femiwiki pages render with their styles. Nothing changes for extensions and skins that do not load files out ofnode_modules— they are skipped entirely, so build times for the rest of the farm are unaffected.How: The Femiwiki skin registers ResourceLoader modules whose
localBasePathpoints intonode_modules/xeiconandnode_modules/@femiwiki/ooui-femiwiki-theme/dist/resources, both listed as runtime dependencies in itspackage.json.scripts/init-version.shrunscomposer installfor every extension and skin but nevernpm install, so those paths never exist. This adds a second condition to the same loop: for any directory that ships apackage.jsonand whoseextension.json/skin.jsonactually mentionsnode_modules, runnpm install --omit=devaswww-data, matching how the composer step already runs. Theextension.json/skin.jsoncheck keeps this from installing dependencies for the many extensions that ship apackage.jsonpurely for lint and test tooling.Scope — please read: this fixes future version builds only. It does not touch the trees already on disk, so the existing 1.45 and 1.46 installs still need a one-off
npm installunderskins/Femiwikibefore the Sentry issues above stop firing. Merging this PR alone does not resolveMEDIAWIKI-2KEorMEDIAWIKI-2HR; it stops them coming back on the next version.Verified with
bash -n scripts/init-version.sh— no syntax errors.shellcheckis not installed in this environment, so it was not run.🤖 Generated with Claude Code
https://claude.ai/code/session_01AiEBkhzV1z9bEykvEU9U8j
Generated by Claude Code