Skip to content

Commit

Permalink
feat: modernize, require node >= 14, bump deps
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Jul 4, 2022
1 parent db9f56a commit 9597a07
Show file tree
Hide file tree
Showing 17 changed files with 86 additions and 7,164 deletions.
3 changes: 3 additions & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional']
};
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.*.js
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* text=auto
* text=auto eol=lf
4 changes: 0 additions & 4 deletions .github/FUNDING.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI
on:
- push
- pull_request
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
node_version:
- 14
- 16
- 18
name: Node ${{ matrix.node_version }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
- name: Install dependencies
run: npm install
- name: Run tests
run: npm run test
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
node_modules
coverage
.nyc_output

locales/
package-lock.json
yarn.lock

Thumbs.db
tmp/
temp/
*.lcov
.env
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commitlint --edit $1
npx --no-install commitlint --edit $1
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
npx --no-install lint-staged && npm test
5 changes: 5 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
'*.md': (filenames) => filenames.map((filename) => `remark ${filename} -qfo`),
'package.json': 'fixpack',
'*.js': 'xo --fix'
};
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
5 changes: 5 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
singleQuote: true,
bracketSpacing: true,
trailingComma: 'none'
};
3 changes: 3 additions & 0 deletions .remarkrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
plugins: ['preset-github']
};
6 changes: 0 additions & 6 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .xo-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
prettier: true,
space: true,
extends: ['xo-lass']
};
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# [**@ladjs/i18n**](https://github.com/ladjs/i18n)

[![build status](https://img.shields.io/travis/ladjs/i18n.svg)](https://travis-ci.org/ladjs/i18n)
[![code coverage](https://img.shields.io/codecov/c/github/ladjs/i18n.svg)](https://codecov.io/gh/ladjs/i18n)
[![code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![made with lass](https://img.shields.io/badge/made_with-lass-95CC28.svg)](https://lass.js.org)
Expand Down Expand Up @@ -33,12 +32,6 @@
npm install @ladjs/i18n
```

[yarn][]:

```sh
yarn add @ladjs/i18n
```


## Usage

Expand Down Expand Up @@ -198,8 +191,6 @@ We came across this missing feature and added it after our discovery through [Fo

[npm]: https://www.npmjs.com/

[yarn]: https://yarnpkg.com/

[i18n]: https://github.com/mashpie/i18n-node

[i18n-locales]: https://github.com/ladjs/i18n-locales
Expand Down
110 changes: 30 additions & 80 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,123 +3,73 @@
"description": "i18n wrapper and Koa middleware for Lad",
"version": "7.2.6",
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)",
"ava": {
"failFast": true,
"verbose": true,
"serial": true
},
"bugs": {
"url": "https://github.com/ladjs/i18n/issues",
"email": "niftylettuce@gmail.com"
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"contributors": [
"Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)",
"shadowgate15 (https://github.com/shadowgate15)"
],
"dependencies": {
"@hapi/boom": "^9.1.4",
"@ladjs/country-language": "^0.2.1",
"@hapi/boom": "^10.0.0",
"@ladjs/country-language": "^1.0.1",
"boolean": "3.2.0",
"debug": "^4.3.3",
"i18n": "^0.14.1",
"i18n": "^0.15.0",
"i18n-locales": "^0.0.5",
"lodash": "^4.17.21",
"multimatch": "5",
"punycode": "^2.1.1",
"qs": "^6.10.3",
"qs": "^6.11.0",
"titleize": "2",
"tlds": "^1.230.0"
"tlds": "^1.231.0"
},
"devDependencies": {
"@commitlint/cli": "^16.2.1",
"@commitlint/config-conventional": "^16.2.1",
"ava": "^4.0.1",
"codecov": "^3.8.2",
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"ava": "^4.3.0",
"cross-env": "^7.0.3",
"eslint": "^8.9.0",
"eslint-config-xo-lass": "^1.0.6",
"eslint": "^8.19.0",
"eslint-config-xo-lass": "^2.0.1",
"fixpack": "^4.0.0",
"husky": "^7.0.4",
"husky": "^8.0.1",
"koa": "^2.13.4",
"koa-generic-session": "^2.3.0",
"lint-staged": "^12.3.4",
"lint-staged": "^13.0.3",
"nyc": "^15.1.0",
"remark-cli": "^10.0.1",
"remark-preset-github": "^4.0.1",
"sinon": "^13.0.1",
"supertest": "^6.2.2",
"xo": "^0.48.0"
"remark-cli": "^11.0.0",
"remark-preset-github": "^4.0.4",
"sinon": "^14.0.0",
"supertest": "^6.2.4",
"xo": "^0.50.0"
},
"engines": {
"node": ">=8.3.0"
"node": ">=14"
},
"files": [
"index.js",
"locales"
"index.js"
],
"homepage": "https://github.com/ladjs/i18n",
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"keywords": [
"@ladjs/i18n",
"lass"
"i18n",
"lad",
"lass",
"locale",
"locales",
"localization",
"translate"
],
"license": "MIT",
"lint-staged": {
"*.js": [
"xo --fix",
"git add"
],
"*.md": [
"remark . -qfo",
"git add"
],
"package.json": [
"fixpack",
"git add"
]
},
"main": "index.js",
"prettier": {
"singleQuote": true,
"bracketSpacing": true,
"trailingComma": "none"
},
"remarkConfig": {
"plugins": [
"preset-github"
]
},
"repository": {
"type": "git",
"url": "https://github.com/ladjs/i18n"
},
"scripts": {
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
"lint": "xo && remark . -qfo",
"precommit": "lint-staged && npm test",
"test": "npm run lint && npm run test-coverage",
"test-coverage": "cross-env NODE_ENV=test nyc ava"
},
"xo": {
"prettier": true,
"space": true,
"extends": [
"xo-lass"
],
"rules": {
"unicorn/prevent-abbreviations": "off",
"unicorn/prefer-module": "off",
"unicorn/numeric-separators-style": "off"
}
"lint": "xo --fix && remark . -qfo && fixpack",
"prepare": "husky install",
"pretest": "npm run lint",
"test": "cross-env NODE_ENV=test nyc ava"
}
}
Loading

0 comments on commit 9597a07

Please sign in to comment.