Skip to content

Commit

Permalink
ESM only (#5)
Browse files Browse the repository at this point in the history
* ESM only

* Cleanup release

* Update Yarn

* Fix format workflow

* Set module type

* Fix Jest
  • Loading branch information
Mark Skelton authored Mar 4, 2022
1 parent 1a5a170 commit 1dfae97
Show file tree
Hide file tree
Showing 14 changed files with 809 additions and 1,167 deletions.
5 changes: 5 additions & 0 deletions .changeset/nervous-ears-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'i18next-async-backend': major
---

This package is now ESM only.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x]
node-version: [14.x, 16.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -27,13 +27,13 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: 14.x
node-version: 16.x
cache: yarn
- run: yarn install --immutable
- name: Create release pull request or publish to npm
uses: changesets/action@master
with:
publish: yarn release
publish: yarn tsc && yarn changeset publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ name: Format
on:
pull_request:
branches: [main]
if: github.repository == 'Widen/i18next-async-backend'
jobs:
test:
runs-on: ubuntu-latest
if: github.repository == 'Widen/i18next-async-backend'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 16.x
- run: yarn install --immutable
- run: yarn prettier --write .
- name: Commit changes
Expand Down
363 changes: 0 additions & 363 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

This file was deleted.

6 changes: 3 additions & 3 deletions .yarn/plugins/@yarnpkg/plugin-outdated.cjs

Large diffs are not rendered by default.

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

This file was deleted.

785 changes: 785 additions & 0 deletions .yarn/releases/yarn-3.2.0.cjs

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-outdated.cjs
spec: "https://mskelton.dev/yarn-outdated/v2"
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"

yarnPath: .yarn/releases/yarn-3.1.0.cjs
yarnPath: .yarn/releases/yarn-3.2.0.cjs
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
[![npm](https://img.shields.io/npm/v/i18next-async-backend)](https://www.npmjs.com/package/i18next-async-backend)
[![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](https://www.i18next.com) backend which loads resources via promises.
Useful when loading resources via dynamic imports.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
preset: 'ts-jest',
testEnvironment: 'node',
}
11 changes: 3 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "i18next backend which loads resources via promises. Useful when loading resources via dynamic imports.",
"author": "Widen",
"license": "ISC",
"packageManager": "yarn@3.1.0",
"packageManager": "yarn@3.2.0",
"repository": "github:Widen/i18next-async-backend",
"homepage": "https://github.com/Widen/i18next-async-backend#readme",
"bugs": {
Expand All @@ -16,6 +16,7 @@
"i18next-plugin",
"dynamic-import"
],
"type": "module",
"exports": "./lib/index.js",
"types": "lib/index.d.ts",
"files": [
Expand All @@ -24,13 +25,7 @@
],
"scripts": {
"lint": "eslint .",
"test": "jest",
"release": "./scripts/release.sh"
},
"release": {
"branches": [
"main"
]
"test": "jest"
},
"peerDependencies": {
"i18next": ">=20"
Expand Down
10 changes: 0 additions & 10 deletions scripts/release.sh

This file was deleted.

2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"module": "CommonJS",
"module": "ESNext",
"target": "ES6",
"removeComments": true,
"moduleResolution": "node",
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Manual changes might be lost - proceed with caution!

__metadata:
version: 5
version: 6
cacheKey: 8

"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.12.13":
Expand Down Expand Up @@ -6045,11 +6045,11 @@ __metadata:

"typescript@patch:typescript@^4.4.4#~builtin<compat/typescript>":
version: 4.4.4
resolution: "typescript@patch:typescript@npm%3A4.4.4#~builtin<compat/typescript>::version=4.4.4&hash=ddd1e8"
resolution: "typescript@patch:typescript@npm%3A4.4.4#~builtin<compat/typescript>::version=4.4.4&hash=bda367"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: bd629ad0da4a15d79aaad56baf3ee7d96f6a181760d430ae77f8c5325df7bffd9edee57544a3970e3651e8b796fe03a5838a7eb39c6d46cc3866c0b23d36a0dd
checksum: 3d1b04449662193544b81d055479d03b4c5dca95f1a82f8922596f089d894c9fefbe16639d1d9dfe26a7054419645530cef44001bc17aed1fe1eb3c237e9b3c7
languageName: node
linkType: hard

Expand Down

0 comments on commit 1dfae97

Please sign in to comment.