diff options
author | Roan Kattouw <roan.kattouw@gmail.com> | 2024-05-01 20:27:22 -0700 |
---|---|---|
committer | Roan Kattouw <roan.kattouw@gmail.com> | 2024-08-22 17:20:24 -0700 |
commit | 8a39d83175cbe47a0a66ef95d765bcf8952e5f77 (patch) | |
tree | d1ac3e11d1c4fa51af11e416771f8a935c66c1aa /.eslintignore | |
parent | 38066e53178bbf7df24742c116b1c5b2f92852fa (diff) | |
download | mediawikicore-8a39d83175cbe47a0a66ef95d765bcf8952e5f77.tar.gz mediawikicore-8a39d83175cbe47a0a66ef95d765bcf8952e5f77.zip |
Codex: Allow a local development version to be used
Developers can use this to test their local version of Codex with
MediaWiki by pointing $wgCodexDevelopmentDir to their local clone of the
Codex repo, e.g. $wgCodexDevelopmentDir = '/home/yourname/git/codex';
Setting $wgCodexDevelopmentDir affects where the following things come
from:
- Codex JS/CSS files for the full library
- Codex JS/CSS files for code-split chunks, and the manifest.json file
that points to them
- Icons retrieved by CodexModule::getIcons()
- CSS-only icons imported in Less
- Design tokens imported in Less
Other changes in this patch:
- Add CodexModule::makeFilePath() to centralize the repeated path
concatenation. This makes it easier to switch out the regular path for
the dev mode path.
- Replace all uses of $IP (which is deprecated) and MW_INSTALL_PATH in
CodexModule with the BaseDirectory config setting.
- Make CodexModule::getIcons() reset its static cache if the path to the
icons file changes. Without this, it's impossible to make the unit
tests pass.
- Move the i18n messages code from the CodexModule constructor to
getMessages(). It can't be in the constructor because makeFilePath()
doesn't work there (it fails because the Config object hasn't been set
up yet).
- Add a 'mediawiki.skin.codex' import path so that we can stop
hard-coding the path to the Codex mixins file. Without this, we can't
make the Codex mixins come from the right place in development mode.
- Consider $wgCodexDevelopmentDir in setting the cache key for compiled
Less code, since changing this setting can change the output of Less
compilation (by changing design tokens, icons or mixins).
- Add unit tests for (the non-dev mode behavior of)
CodexModule::getIcons() and the i18n message key handling.
Bug: T314507
Change-Id: I11c6a81a1ba34fe10f4b1c98bf76f0db40c1ce98
Diffstat (limited to '.eslintignore')
-rw-r--r-- | .eslintignore | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/.eslintignore b/.eslintignore index 27d2852baa25..300e20a28287 100644 --- a/.eslintignore +++ b/.eslintignore @@ -13,7 +13,8 @@ /vendor/ /tests/coverage/ /tests/phpunit/data/registration/duplicate_keys.json -/tests/phpunit/data/resourceloader/codex/modules/ +/tests/phpunit/data/resourceloader/codex/ +/tests/phpunit/data/resourceloader/codex-devmode/ /tests/phpunit/unit/includes/Settings/Source/fixtures/bad.json /maintenance/benchmarks/data/ |