Coder Social home page Coder Social logo

dringsim / new-lexeme-special-page Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wmde/new-lexeme-special-page

0.0 0.0 0.0 2.04 MB

Form the upcoming revival of the NewLexeme special page on Wikidata

Home Page: https://phabricator.wikimedia.org/project/board/5674/

License: GNU General Public License v2.0

Shell 0.04% JavaScript 4.83% TypeScript 76.89% HTML 2.40% Vue 15.85%

new-lexeme-special-page's Introduction

New Lexeme Special Page form

This repository holds the form for the NewLexeme special page on Wikidata.

Please report bugs on phabricator.

Local Development

Prerequisites: This repository requires node v16 and up

Initial setup

  1. Clone this repository
  2. Install dependecies with npm i

This will also install some Git pre-commit hooks that check any modified files against the configured linters. (Use git commit -n to skip these hooks, e.g. to create some work-in-progress commits that will be cleaned up later.)

Regular development

TL;DR: All checks are run with:

npm t

Dev Entry point

To run the development entry point also known as the dev server:

npm run dev

You can visit the dev entry point at http://localhost:3000/. Changes to the source files will be applied automatically, so you can start this once and then leave it running in the background.

For instructions to see the form in the context of the special page, see the WikibaseLexeme readme.

The dev entry point can also read some parameters from the URL, as a single JSON-serialized initParams object in the same format as the special page passes to the app. Here are some useful links:

Linting

The linters, except for TypeScript type checking, can be run with:

npm run lint

Many linter errors can be fixed automatically:

npm run fix

Static type checking is executed with

npm run check-types

Testing

Several npm scripts are available to only run a subset of tests, such as:

npm run test-only # only tests without linters
npm run test:unit
npm run test:integration

Unit tests (in tests/unit/) focus on excercising a self-contained piece of code, while integration tests in (tests/integration/) are designed to test the interaction between several components and the store.

You can run individual unit or integration tests using npx jest, for example:

npx jest tests/unit/store/actions.test.ts
npx jest tests/integration/App.test.ts

Finally, browser tests in cypress/integration/ are designed to test this application end-to-end with actual browser interaction. They are also the main place for the automated accessiblity tests.

Cypress tests are run against the dev entry point (see above) and thus use /index.html to provide the scaffolding. After you've started the dev server, you can open the interactive browser tests environment with:

npm run cypress:open

Chore: Dependency Updates

You can see which dependencies have new releases by first making sure your local dependencies are up-to-date by executing npm ci and then running npm outdated. The following dependencies should be ignored:

  • Wikit (i.e. @wmde/wikit-tokens and @wmde/wikit-vue-components): we’re using a newer pre-release version and don’t want to downgrade to the latest full release.
  • Vue and Vuex: in production, we use the versions shipped by MediaWiki core, so we should use the same versions for testing. The current versions shipped by MediaWiki core are listed in foreign-resources.yaml.
  • Typescript: Vue up until version 3.2.38 (which we currently use) doesn't support typescript 4.8+.
  • Prettier: Jest 29.65.2 is not compatible with Prettier 3. This might be resolved with the next release (Jest#14566), so be sure to check whether a newer Jest version is available that includes Prettier 3 compatibility.
  • ESLint and some related packages: Known issues (T341552) that are beyond the scope of chores.
  • Vue Test Utils (@vue/test-utils): Seems to require a newer Vue.js version (see #492), though it’s worth checking whether that’s still the case in newer VTU versions.

All other dependencies should generally be updated to the latest version. If you discover that a dependency should not be updated for some reason, please add it to the above list. If a dependency can only be updated with substantial manual work, you can create a new task for it and skip it in the context of the current chore.

The recommended way to update dependencies is to collect related dependency updates into grouped commits; this keeps the number of commits to review manageable (compared to having one commit for every update), while keeping the scope of each commit limited and increasing reviewability and debuggability (compared to combining all updates in a single commit). For example, this can be one commit for each of:

  • all ESLint-related dependency updates
  • all Jest-related dependency updates
  • all Vue-related dependency updates
  • all PostCSS/Stylelint-related dependency updates
  • npm update for all other dependency updates

Make sure that all checks still pass for every commit.

Once all dependency updates are merged, update the submodule version in WikibaseLexeme (see below).

Updating the submodule version in WikibaseLexeme

This repository is a git submodule in WikibaseLexeme. That submodule needs to be updated there for changes here to be deployed to production.

To update the submodule version in WikibaseLexeme run npm run bump-special-new-lexeme there. See New Lexeme Special Page in the WikibaseLexeme dev README for more details.

new-lexeme-special-page's People

Contributors

lucaswerkmeister avatar dependabot[bot] avatar micgro42 avatar guergana avatar chukarave avatar mariushoch avatar itamargiv avatar quetzlthethird avatar bgo-eiu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.