Page MenuHomePhabricator

LinkedWiki relies on npm for javascript dependencies
Closed, DeclinedPublic

Description

MediaWiki core structure tests fail for the LinkedWiki extension:

1) Warning
The data provider specified for ResourcesTest::testFileExistence is invalid.
ResourceLoaderFileModule::readStyleFile: style file not found: "extensions/LinkedWiki/node_modules/bootstrap/dist/css/bootstrap.min.css"

That is because bootstrap is supposed to be installed via npm install, a process we do not quite support:

{
	"dependencies": {
		"bootstrap": "^4.0.0-beta.3",
		"font-awesome": "^4.7.0",
		"popper.js": "^1.12.9",
		"sgvizler2": "^1.0.9"
	}
}

Other repositories having dependencies in their package.json are Athena, Kartographer, ImageTweaks. They have the node_modules committed in.

Event Timeline

hashar renamed this task from LinkedWiki: style file not found: extensions/LinkedWiki/node_modules/bootstrap/dist/css/bootstrap.min.css to LinkedWiki relies on npm for javascript dependencies.Jul 11 2018, 4:39 PM
hashar updated the task description. (Show Details)

Definitely related. LinkedWiki is currently forced to check in the asset after npm install, which as I argue in T199004 is a little unreasonable to expect when the build can be replicated easily by a bot.

Change 454300 had a related patch set uploaded (by Hashar; owner: Hashar):
[integration/config@master] LinkedWiki extension is broken

https://gerrit.wikimedia.org/r/454300

Change 454300 merged by jenkins-bot:
[integration/config@master] LinkedWiki extension is broken

https://gerrit.wikimedia.org/r/454300

I have filed that one cause we don't use npm install to install JavaScript dependencies. For a MediaWiki extension or skin, they should be committed to the repository. For CI, we just don't run jobs.

T199004 is the RFC to add a build step that would lets one define javascript dependencies and have them installed when deploying an extension or skin.