Skip to content

init-version.sh: npm install extensions and skins that need node_modules - #2

Open
claude[bot] wants to merge 1 commit into
mainfrom
sentry/femiwiki-npm-install
Open

claude[bot] wants to merge 1 commit into
mainfrom
sentry/femiwiki-npm-install

Conversation

@claude

@claude claude Bot commented Sep 10, 2026

Copy link
Copy Markdown

Requested by Thomas · Slack thread

Before: Wikis using the Femiwiki skin render as unstyled HTML. Every page load fires a /w/load.php request that dies with RuntimeException: 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 issues MEDIAWIKI-2KE (50 events) and MEDIAWIKI-2HR (15 events) cover this across 7 wikis, all on /w/load.php.

After: A version tree built by init-version.sh from now on has those npm packages present, so load.php finds the style files and Femiwiki pages render with their styles. Nothing changes for extensions and skins that do not load files out of node_modules — they are skipped entirely, so build times for the rest of the farm are unaffected.

How: The Femiwiki skin registers ResourceLoader modules whose localBasePath points into node_modules/xeicon and node_modules/@femiwiki/ooui-femiwiki-theme/dist/resources, both listed as runtime dependencies in its package.json. scripts/init-version.sh runs composer install for every extension and skin but never npm install, so those paths never exist. This adds a second condition to the same loop: for any directory that ships a package.json and whose extension.json / skin.json actually mentions node_modules, run npm install --omit=dev as www-data, matching how the composer step already runs. The extension.json / skin.json check keeps this from installing dependencies for the many extensions that ship a package.json purely 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 install under skins/Femiwiki before the Sentry issues above stop firing. Merging this PR alone does not resolve MEDIAWIKI-2KE or MEDIAWIKI-2HR; it stops them coming back on the next version.

Verified with bash -n scripts/init-version.sh — no syntax errors. shellcheck is not installed in this environment, so it was not run.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AiEBkhzV1z9bEykvEU9U8j


Generated by Claude Code

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
@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 23a55cf5-bf50-4cdf-a6fc-1d94c89d5682

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant