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

Conversation

NovemLinguae
Copy link
Member

@NovemLinguae NovemLinguae commented Dec 9, 2024

Move twinkle.js, morebits.js, CSS files, etc. out of the root. The root directory should be config files and readmes only.

Wikimedia also does this. JS files are always all placed in a directory called /modules/ (or sometimes a subdirectory with a different name, the other name escpaes me at the moment). But never in the root.

Fixes #2078

To test:

  • npm start
  • perl deploy.pl - test by deploying to testwiki

Maybe:

  • put the old modules in a subdirectory? modules/menuItems/*.js or something?

Move twinkle.js, morebits.js, CSS files, etc. out of the root. The root directory should be config files and readmes only.

Wikimedia also does this. JS files are always all placed in a directory called /modules/ (or sometimes a subdirectory with a different name, the other name escpaes me at the moment). But never in the root.

Fixes wikimedia-gadgets#2078

To test:
- npm start
- perl deploy.pl

Maybe:
- put the old modules in a subdirectory? modules/menuItems/*.js or something?
@NovemLinguae
Copy link
Member Author

After thinking about this a bit more, I think I do want to have a subfolder for the Twinkle modules, but I also want to avoid an ugly modules/modules. Perhaps src/modules would be a good way to do it?

src/
   |--morebits.css
   |--morebits.js
   |--twinkle.css
   |--twinkle.js
   |--twinkle-pagestyles.css
   |--modules/
      |--twinklearv.js
      |--twinklebatchdelete.js
      |--twinklebatchprotect.js
      |--etc.

@siddharthvp, can I get a second opinion on that?

@siddharthvp
Copy link
Member

Putting everything under src/ looks good to me and is consistent with modern JS projects. In fact, I had a branch locally that made the same change but didn't get around to pushing it.

@NovemLinguae NovemLinguae marked this pull request as draft December 10, 2024 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

move all client-side javascript into modules folder, and adjust eslint config accordingly
2 participants