mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-11-23 22:03:28 +00:00
ca02360228
See https://w.wiki/9Twh for example usage with ResourceLoader. Webpack is retired in favor of Rollup, which allows us to convert the ECMAScript Modules into CommonJS modules for use by ResourceLoader. We now have a file in dist/ for each RL module that we want to offer, including the 'lib' module which includes the CM library itself. Because Rollup has no knowledge of the ResourceLoader module registry, the generated output requires other modules via relative path, when it needs to be the RL module name. To get around this, we do a crude find/replace after the files are generated. Hacky, but necessary to make CodeMirror usable by gadgets and scripts that don't also want WikiEditor. Add new RL modules 'ext.CodeMirror.v6.lib' (vendor code) and 'ext.CodeMirror.v6' (the main CodeMirror class, sans WikiEditor). Clean up extension.json, listing the v6 modules beneath the old ones. Bug: T214989 Change-Id: Ide716247e545cf2bdd977bea645729564ebbe6e2
50 lines
1.9 KiB
JSON
50 lines
1.9 KiB
JSON
{
|
|
"name": "codemirror",
|
|
"private": true,
|
|
"scripts": {
|
|
"start": "rollup -c --watch",
|
|
"build": "rollup -c",
|
|
"test": "npm run test:lint && npm run test:unit && npm run check-built-assets",
|
|
"test:lint": "npm run test:lint:styles && npm run test:lint:js && npm run test:lint:i18n",
|
|
"test:lint:js": "eslint --cache .",
|
|
"test:lint:styles": "stylelint \"resources/**/*.less\"",
|
|
"test:lint:i18n": "banana-checker i18n/",
|
|
"test:unit": "jest",
|
|
"check-built-assets": "{ git status src/ | grep \"nothing to commit, working tree clean\"; } && { echo 'CHECKING BUILD SOURCES ARE COMMITTED' && npm run build && git status resources/dist/ | grep \"nothing to commit, working tree clean\" || { npm run node-debug; false; }; }",
|
|
"node-debug": "node -v && npm -v && echo 'ERROR: Please ensure that production assets have been built with `npm run build` and commited, and that you are using the correct version of Node/NPM.'",
|
|
"selenium-test": "wdio tests/selenium/wdio.conf.js"
|
|
},
|
|
"engines": {
|
|
"node": "18.17.0"
|
|
},
|
|
"devDependencies": {
|
|
"@babel/plugin-transform-private-methods": "7.23.3",
|
|
"@babel/preset-env": "7.24.0",
|
|
"@codemirror/commands": "6.2.5",
|
|
"@codemirror/language": "6.9.3",
|
|
"@codemirror/search": "6.5.4",
|
|
"@codemirror/state": "6.2.1",
|
|
"@codemirror/view": "6.22.2",
|
|
"@lezer/highlight": "1.2.0",
|
|
"@rollup/plugin-babel": "6.0.4",
|
|
"@rollup/plugin-node-resolve": "15.2.3",
|
|
"@rollup/plugin-terser": "0.4.4",
|
|
"@wdio/cli": "7.30.1",
|
|
"@wdio/junit-reporter": "7.29.1",
|
|
"@wdio/local-runner": "7.30.1",
|
|
"@wdio/mocha-framework": "7.26.0",
|
|
"@wdio/spec-reporter": "7.29.1",
|
|
"@wikimedia/mw-node-qunit": "7.2.0",
|
|
"dotenv": "8.2.0",
|
|
"eslint-config-wikimedia": "0.26.0",
|
|
"grunt-banana-checker": "0.11.1",
|
|
"jest": "29.7.0",
|
|
"jest-environment-jsdom": "29.7.0",
|
|
"jquery": "3.7.1",
|
|
"rollup": "4.13.0",
|
|
"rollup-plugin-copy": "3.5.0",
|
|
"stylelint-config-wikimedia": "0.16.1",
|
|
"wdio-mediawiki": "2.3.0"
|
|
}
|
|
}
|