Skip to content

Commit

Permalink
DD-272 Updating dependencies
Browse files Browse the repository at this point in the history
Drop Node 14, 16 and 18 and allowing only 20.x || 22.x and updating the following dependencies:
async ^3.2.5 -> ^3.2.6
deep-clone-merge ^1.5.4 -> ^1.5.5
replacing deprecated findup with find-up ^5.0.0
glob ^10.4.5 -> ^11.0.0
eslint ^8.57.0 -> ^9.12.0
Adding eslint-define-config and replacing .eslintrc with eslint.config.js
Adding Husky ^9.1.6 then adding ./husky/pre-push
replacing reqres with hmpo-reqres ^2.0.0
sinon ^18.0.0 -> ^19.0.2
sinon-test ^3.1.6
globals ^15.11.0
proxyquire ^2.1.3
  • Loading branch information
KLV96 committed Oct 10, 2024
1 parent fe4f4fc commit 15ef73c
Show file tree
Hide file tree
Showing 29 changed files with 2,084 additions and 2,087 deletions.
14 changes: 0 additions & 14 deletions .eslintrc

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 20.x]
node-version: [20.x, 22.x]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ build/Release
# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
.idea/
1 change: 1 addition & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm test
53 changes: 53 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
const js = require('@eslint/js');
const globals = require('globals');


const styleRules = {
quotes: ['error', 'single', { avoidEscape: true }],
'no-trailing-spaces': 'error',
indent: 'error',
'linebreak-style': ['error', 'unix'],
semi: ['error', 'always'],
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
'keyword-spacing': 'error',
'space-before-blocks': 'error',
'space-before-function-paren': [
'error',
{ anonymous: 'always', named: 'never' },
],
'no-mixed-spaces-and-tabs': 'error',
'comma-spacing': ['error', { before: false, after: true }],
'key-spacing': ['error', { beforeColon: false, afterColon: true }],
};


module.exports = [
js.configs.recommended,
{
languageOptions: {
ecmaVersion: 2022,
globals: {
...globals.node,
}
},
rules: {
'no-unused-vars': [
'error',
{ argsIgnorePattern: '^(err|req|res|next)$' },
],
'one-var': ['error', { initialized: 'never' }],
'no-var': 'error',
...styleRules,
},
},
// Unit tests
{
files: ['test/**'],
languageOptions: {
globals: {
...globals.mocha,
sinon: 'readonly',
},
},
},
];
1 change: 1 addition & 0 deletions examples/express-template/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
package-lock.json
8 changes: 5 additions & 3 deletions examples/express-template/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
var app = require('express')();
let app = require('express')();

var i18n = require('i18n-future').middleware();
let i18n = require('hmpo-i18n');

app.use(i18n);
i18n.middleware(app, {
detect: true
});

app.set('view engine', 'html');
app.engine('html', require('mustache-express')());
Expand Down
2 changes: 1 addition & 1 deletion examples/express-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"private": true,
"dependencies": {
"express": "^4.16.4",
"hmpo-i18n": "*",
"hmpo-i18n": "../..",
"mustache-express": "^1.2.8"
}
}
1 change: 1 addition & 0 deletions examples/express/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
package-lock.json
8 changes: 5 additions & 3 deletions examples/express/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
var app = require('express')();
let app = require('express')();

var i18n = require('i18n-future').middleware();
let i18n = require('hmpo-i18n');

app.use(i18n);
i18n.middleware(app, {
detect: true
});

app.get('/', function (req, res) {
// a translate method is now available on the request
Expand Down
2 changes: 1 addition & 1 deletion examples/express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"private": true,
"dependencies": {
"express": "^4.16.4",
"hmpo-i18n": "*"
"hmpo-i18n": "../.."
}
}
1 change: 1 addition & 0 deletions examples/standalone/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
package-lock.json
8 changes: 4 additions & 4 deletions examples/standalone/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
var i18n = require('i18n-future')();
let i18n = require('hmpo-i18n')();

i18n.on('ready', function () {
var en = i18n.translate('greeting', 'en');
let en = i18n.translate('greeting', 'en');
console.log('English:', en);
var fr = i18n.translate('greeting', 'fr');
let fr = i18n.translate('greeting', 'fr');
console.log('French:', fr);
var def = i18n.translate('greeting');
let def = i18n.translate('greeting');
console.log('Default fallback:', def);
});
2 changes: 1 addition & 1 deletion examples/standalone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"hmpo-i18n": "*"
"hmpo-i18n": "../.."
}
}
Loading

0 comments on commit 15ef73c

Please sign in to comment.