Jump to content

Readers/Web/Team/Releasing libraries

From mediawiki.org

On github

[edit]

Register on npm with 2FA

[edit]

Wikimedia members are listed on https://www.npmjs.com/settings/wikimedia/members and 2FA is required for publishing. See wikitech:Npm registry for info on getting access.

Prepare the versioning and make a changelog

[edit]

Create a new pull request which modifies the package.json version file number (see https://semver.org/) and run:

npm version patch --git-tag-version=false

… for trivial changes, or for bigger releases:

npm version minor --git-tag-version=false

… or if it contains breaking changes then:

npm version major --git-tag-version=false

Commit the modifications to package.json and package-lock.json

Generate change log if CHANGELOG.md exists

[edit]

A changelog (example) can be maintained by modifying CHANGELOG.md with the result of

git log `git describe --tags --abbrev=0` ..HEAD --oneline

Running tests

[edit]

Always check tests are passing before releasing. If using Github pull requests with CI this should have been done automatically.

Create pull request

[edit]

Create a pull request get someone to approve it, and merge.

Releasing the code

[edit]

Once the code is merged

git fetch
git checkout origin/master
npm publish

you should be prompted for a 2FA token