Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move .js and .css files out of the root #2124

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"Module: twinkle":
- twinkle.js
- twinkle.css
- twinkle-pagestyles.css
- modules/twinkle.js
- modules/twinkle.css
- modules/twinkle-pagestyles.css
"Module: morebits":
- morebits.js
- morebits.css
- modules/morebits.js
- modules/morebits.css
"Module: arv":
- modules/twinklearv.js
"Module: batch":
Expand Down
14 changes: 7 additions & 7 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ After the files are synced, ensure that [MediaWiki:Gadgets-definition][] contain

Each Twinkle module and dependency lives on the wiki as a separate file. The list of modules and what pages they should be on are as follows:

- `twinkle.js` → [MediaWiki:Gadget-Twinkle.js][]
- `twinkle.css` → [MediaWiki:Gadget-Twinkle.css][]
- `twinkle-pagestyles.css` → [MediaWiki:Gadget-Twinkle-pagestyles.css][]
- `morebits.js` → [MediaWiki:Gadget-morebits.js][]
- `morebits.css` → [MediaWiki:Gadget-morebits.css][]
- `select2.min.js` → [MediaWiki:Gadget-select2.min.js][]
- `select2.min.css` → [MediaWiki:Gadget-select2.min.css][]
- `modules/twinkle.js` → [MediaWiki:Gadget-Twinkle.js][]
- `modules/twinkle.css` → [MediaWiki:Gadget-Twinkle.css][]
- `modules/twinkle-pagestyles.css` → [MediaWiki:Gadget-Twinkle-pagestyles.css][]
- `modules/morebits.js` → [MediaWiki:Gadget-morebits.js][]
- `modules/morebits.css` → [MediaWiki:Gadget-morebits.css][]
- `lib/select2.min.js` → [MediaWiki:Gadget-select2.min.js][]
- `lib/select2.min.css` → [MediaWiki:Gadget-select2.min.css][]
- `modules/twinklearv.js` → [MediaWiki:Gadget-twinklearv.js][]
- `modules/twinklebatchdelete.js` → [MediaWiki:Gadget-twinklebatchdelete.js][]
- `modules/twinklebatchprotect.js` → [MediaWiki:Gadget-twinklebatchprotect.js][]
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ If you'd like to start contributing, awesome! Check out [CONTRIBUTING.md](CONTR

## Layout of this repository

* `morebits.js`: The central library used by Twinkle and many other scripts. Contains code to interact with the MediaWiki API, display forms and dialogs, generate status logs, and do various other useful things. The vast majority of code in here is not Twinkle-specific; see docs ([1](https://wikimedia-gadgets.github.io/twinkle/Morebits.html) and [2](https://github.com/wikimedia-gadgets/twinkle/wiki/morebits))
* `twinkle.js`: General Twinkle-specific code, mostly related to preferences and exposing Twinkle in the UI. Significantly, it contains the default set of preferences of Twinkle.
* `modules`: Contains the individual Twinkle modules. Descriptions for these can be found in header comments or in the [Twinkle documentation][]. The module `twinkleconfig.js` powers the [Twinkle preferences panel][WP:TWPREFS].
* `modules/morebits.js`: The central library used by Twinkle and many other scripts. Contains code to interact with the MediaWiki API, display forms and dialogs, generate status logs, and do various other useful things. The vast majority of code in here is not Twinkle-specific; see docs ([1](https://wikimedia-gadgets.github.io/twinkle/Morebits.html) and [2](https://github.com/wikimedia-gadgets/twinkle/wiki/morebits))
* `modules/twinkle.js`: General Twinkle-specific code, mostly related to preferences and exposing Twinkle in the UI. Significantly, it contains the default set of preferences of Twinkle.
* `modules/*.js`: Contains the individual Twinkle modules. Descriptions for these can be found in header comments or in the [Twinkle documentation][]. The module `twinkleconfig.js` powers the [Twinkle preferences panel][WP:TWPREFS].

[select2][] is added under the [MIT license][select2license].

Expand Down
2 changes: 0 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ module.exports = {
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['mock-mediawiki', '<rootDir>/tests/jest.setup.js'],
collectCoverageFrom: [
'morebits.js',
'twinkle.js',
'modules/**/*.{js,jsx,ts,tsx}'
]
};
File renamed without changes.
1 change: 0 additions & 1 deletion morebits.js → modules/morebits.js
Original file line number Diff line number Diff line change
Expand Up @@ -6106,7 +6106,6 @@ Morebits.wikitext.Page = Morebits.wikitext.page;
*/

if (typeof arguments === 'undefined') { // typeof is here for a reason...
/* global Morebits */
window.SimpleWindow = Morebits.simpleWindow;
window.QuickForm = Morebits.quickForm;
window.Wikipedia = Morebits.wiki;
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions twinkle.js → modules/twinkle.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
*/
// <nowiki>

/* global Morebits */

(function() {

// Check if account is experienced enough to use Twinkle
Expand Down
10 changes: 5 additions & 5 deletions scripts/deploy.pl
Original file line number Diff line number Diff line change
Expand Up @@ -452,11 +452,11 @@ sub usage {
## compiler. Rather, they are used by the --all option to simplify bulk
## updating all files.
__DATA__
twinkle.js
twinkle.css
twinkle-pagestyles.css
morebits.js
morebits.css
modules/twinkle.js
modules/twinkle.css
modules/twinkle-pagestyles.css
modules/morebits.js
modules/morebits.css
lib/select2.min.js
lib/select2.min.css
modules/twinklearv.js
Expand Down
4 changes: 2 additions & 2 deletions scripts/dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ async function readFiles(filePaths) {
}
const server = http.createServer(async (request, response) => {
const moduleFiles = (await fs.readdir('./modules')).filter(f => f.endsWith('.js'));
const jsFiles = ['morebits.js', 'twinkle.js'].concat(moduleFiles.map(f => 'modules/' + f));
const cssFiles = ['morebits.css', 'twinkle.css'];
const jsFiles = moduleFiles.map(f => 'modules/' + f);
const cssFiles = ['modules/morebits.css', 'modules/twinkle.css'];

let jsCode = `mw.loader.using(['jquery.ui', 'ext.gadget.select2']).then(function () {\n`;

Expand Down
4 changes: 2 additions & 2 deletions tests/jest.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ mw.config.set({
wgUserGroups: ['interface-admin', 'sysop', '*', 'user', 'autoconfirmed'],
});

require('../morebits.js');
require('../twinkle.js');
require('../modules/morebits.js');
require('../modules/twinkle.js');
require('../modules/twinklewarn.js');
require('../modules/twinklexfd.js');
global.Morebits = window.Morebits;
Expand Down
Loading