Skip to content

Commit

Permalink
Changesets
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Skelton committed Nov 8, 2021
1 parent f40deef commit 32da424
Show file tree
Hide file tree
Showing 18 changed files with 3,548 additions and 5,874 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
10 changes: 10 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/dirty-terms-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'i18next-async-backend': patch
---

Update docs to reflect migration to changesets.
13 changes: 9 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,22 @@ jobs:
- run: yarn prettier --check .
- run: yarn tsc --noEmit
release:
needs: test
runs-on: ubuntu-latest
needs: test
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: 14.x
cache: yarn
- run: yarn install --immutable
- run: yarn tsc
- run: yarn semantic-release
- name: Create release pull request or publish to npm
uses: changesets/action@master
with:
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Yarn auto-generated files
.yarn/
.yarnrc.yml

# Changelogs are managed by changesets
CHANGELOG.md
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"semi": false,
"singleQuote": true
"singleQuote": true,
"proseWrap": "always"
}
356 changes: 321 additions & 35 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

22 changes: 13 additions & 9 deletions .yarn/plugins/@yarnpkg/plugin-outdated.cjs

Large diffs are not rendered by default.

55 changes: 0 additions & 55 deletions .yarn/releases/yarn-2.4.1.cjs

This file was deleted.

768 changes: 768 additions & 0 deletions .yarn/releases/yarn-3.1.0.cjs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-outdated.cjs
spec: "https://github.com/mskelton/yarn-plugin-outdated/raw/main/bundles/@yarnpkg/plugin-outdated.js"
spec: "https://mskelton.dev/yarn-outdated/v2"
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"

yarnPath: .yarn/releases/yarn-2.4.1.cjs
yarnPath: .yarn/releases/yarn-3.1.0.cjs
3 changes: 0 additions & 3 deletions CHANGELOG.md

This file was deleted.

31 changes: 16 additions & 15 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
size, disability, ethnicity, sex characteristics, gender identity and
expression, level of experience, education, socio-economic status, nationality,
personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Expand Down Expand Up @@ -37,11 +37,11 @@ Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
Project maintainers have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, or to ban temporarily or permanently any
contributor for other behaviors that they deem inappropriate, threatening,
offensive, or harmful.

## Scope

Expand All @@ -55,20 +55,21 @@ further defined and clarified by project maintainers.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at . All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
reported by contacting the project team at . All complaints will be reviewed and
investigated and will result in a response that is deemed necessary and
appropriate to the circumstances. The project team is obligated to maintain
confidentiality with regard to the reporter of an incident. Further details of
specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.4, available at
https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

Expand Down
40 changes: 34 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# How to Contribute
# Contributing

We'd love to accept your patches and contributions to this project. There are
just a few small guidelines you need to follow.
Expand All @@ -10,10 +10,38 @@ use GitHub pull requests for this purpose. Consult
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
information on using pull requests.

## Tips
### Tips

- Smaller changes are easier to review
- Give the PR a meaningful title and description with context surrounding
the changes
- To close an issue automatically after a PR is merged, use keywords
"fix", "close", or "resolve" in the PR description, e.g. fix #1337.
- Give the PR a meaningful title and description with context surrounding the
changes
- To close an issue automatically after a PR is merged, use keywords "fix",
"close", or "resolve" in the PR description, e.g. fix #1337.

## Changesets

This project uses [changesets](https://github.com/atlassian/changesets) for
versioning and publishing packages. Changesets allows contributors to specify
how changes should be released without having to manually edit changelogs or
package.json files.

When making a change that requires a release, run the `yarn changeset` command
and follow the prompts to specify the semver bump and the change notes.

```sh
yarn changeset
```

After running this command, a new markdown file will be created in the
`.changeset` folder. These files should be pushed to your branch and if you make
a mistake, you can amend them at any time.

### Snapshot releases

When commits are pushed to a branch, snapshot releases will be published.
Snapshot releases are not meant for production use, but can be installed in your
application for testing purposes.

```sh
yarn add [email protected]
```
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

[![Build](https://github.com/Widen/i18next-async-backend/actions/workflows/build.yml/badge.svg)](https://github.com/Widen/i18next-async-backend/actions/workflows/build.yml)
[![npm](https://img.shields.io/npm/v/i18next-async-backend)](https://www.npmjs.com/package/i18next-async-backend)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![changesets](https://img.shields.io/badge/maintained%20with-changesets-blue)](https://github.com/atlassian/changesets)

i18next backend which loads resources via promises. Useful when loading resources via dynamic imports.
i18next backend which loads resources via promises. Useful when loading
resources via dynamic imports.

## Installation

Expand Down Expand Up @@ -60,7 +61,3 @@ const resources = {
},
}
```

## Releasing

This extension uses [semantic-release](https://github.com/semantic-release/semantic-release) to automatically increment the release based on the commit message. Checkout [their docs](https://github.com/semantic-release/semantic-release#how-does-it-work) for more details.
25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "i18next-async-backend",
"version": "0.0.0-semantically-released",
"version": "1.0.1",
"description": "i18next backend which loads resources via promises. Useful when loading resources via dynamic imports.",
"author": "Widen",
"license": "ISC",
"packageManager": "[email protected]",
"repository": "github:Widen/i18next-async-backend",
"homepage": "https://github.com/Widen/i18next-async-backend#readme",
"bugs": {
Expand All @@ -24,7 +25,7 @@
"scripts": {
"lint": "eslint .",
"test": "jest",
"release": "semantic-release"
"release": "./scripts/release.sh"
},
"release": {
"branches": [
Expand All @@ -35,15 +36,15 @@
"i18next": ">=20"
},
"devDependencies": {
"@types/jest": "^26.0.22",
"@typescript-eslint/eslint-plugin": "^4.19.0",
"@typescript-eslint/parser": "^4.19.0",
"eslint": "^7.22.0",
"i18next": "^20.1.0",
"jest": "^26.6.3",
"prettier": "^2.2.1",
"semantic-release": "^17.4.2",
"ts-jest": "^26.5.4",
"typescript": "^4.2.3"
"@changesets/cli": "^2.18.0",
"@types/jest": "^27.0.2",
"@typescript-eslint/eslint-plugin": "^5.3.0",
"@typescript-eslint/parser": "^5.3.0",
"eslint": "^8.2.0",
"i18next": "^21.4.1",
"jest": "^27.3.1",
"prettier": "^2.4.1",
"ts-jest": "^27.0.7",
"typescript": "^4.4.4"
}
}
10 changes: 10 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -eo pipefail

if [[ -z "${CI}" ]]; then
echo "Releasing is only allowed from CI."
exit 1
fi

yarn tsc
yarn changeset publish
Loading

0 comments on commit 32da424

Please sign in to comment.