Skip to content

Commit 8ac90ae

Browse files
committed
wip bump deps + adapt eslint file + uuid fixup
1 parent 2086ecf commit 8ac90ae

File tree

7 files changed

+2711
-3704
lines changed

7 files changed

+2711
-3704
lines changed

.eslintrc

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
- name: Install node
6060
uses: actions/setup-node@v4
6161
with:
62-
node-version: '16'
62+
node-version: '22'
6363
cache: 'yarn'
6464
- run: sudo apt-get update -q
6565
# Ubuntu 24.04 doesn't have libssl1.1 which is needed by mongo-memory-server

CountItems/CountWorkerObj.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const uuid = require('node-uuid');
1+
const { v4: uuid } = require('uuid');
22
const { once } = require('arsenal').jsutil;
33
const { deserializeBigInts, serializeBigInts } = require('./utils/utils');
44

@@ -95,7 +95,7 @@ class CountWorkerObj {
9595
}
9696

9797
setup(callback) {
98-
const id = uuid.v4();
98+
const id = uuid();
9999
this._addCallback(id, 'setup', callback);
100100
this._worker.send({
101101
id,
@@ -108,7 +108,7 @@ class CountWorkerObj {
108108
if (!this.clientConnected || !this._worker.isConnected()) {
109109
return callback();
110110
}
111-
const id = uuid.v4();
111+
const id = uuid();
112112
this._addCallback(id, 'teardown', callback);
113113
return this._worker.send({
114114
id,
@@ -118,7 +118,7 @@ class CountWorkerObj {
118118
}
119119

120120
count(bucketInfo, callback) {
121-
const id = uuid.v4();
121+
const id = uuid();
122122
this._addCallback(id, 'count', (err, results) => {
123123
if (err) {
124124
return callback(err);

eslint.config.mjs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import path from "node:path";
2+
import { fileURLToPath } from "node:url";
3+
import js from "@eslint/js";
4+
import { FlatCompat } from "@eslint/eslintrc";
5+
6+
7+
const __filename = fileURLToPath(import.meta.url);
8+
const __dirname = path.dirname(__filename);
9+
const compat = new FlatCompat({
10+
baseDirectory: __dirname,
11+
recommendedConfig: js.configs.recommended,
12+
allConfig: js.configs.all
13+
});
14+
15+
export default [...compat.extends("scality"),
16+
{
17+
languageOptions: {
18+
ecmaVersion: 2020,
19+
sourceType: "script",
20+
globals: {
21+
BigInt: "readonly",
22+
},
23+
},
24+
rules: {
25+
"no-plusplus": 0,
26+
"no-underscore-dangle": 0,
27+
"no-restricted-syntax": 0,
28+
"max-len": 0,
29+
"import/no-extraneous-dependencies": 0,
30+
"no-continue": 0,
31+
"global-require": 0,
32+
"no-prototype-builtins": 0,
33+
"class-methods-use-this": 0,
34+
"no-unused-vars": 0,
35+
"no-lonely-if": 0,
36+
"max-classes-per-file": 0,
37+
"prefer-spread": 0,
38+
"no-constructor-return": 0,
39+
"new-cap": 0
40+
}
41+
}
42+
];

package.json

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "s3utils",
33
"version": "1.15.7",
44
"engines": {
5-
"node": ">= 16"
5+
"node": ">= 22"
66
},
77
"description": "Awesome scripts to use when working with S3 at scale",
88
"scripts": {
@@ -26,22 +26,22 @@
2626
},
2727
"homepage": "https://github.com/scality/s3utils#readme",
2828
"dependencies": {
29-
"@senx/warp10": "^1.1.2",
29+
"@senx/warp10": "^2.0.3",
3030
"JSONStream": "^1.3.5",
31-
"arsenal": "git+https://github.com/scality/arsenal#8.1.146",
32-
"async": "^2.6.4",
33-
"aws-sdk": "^2.1005.0",
34-
"bucketclient": "git+https://github.com/scality/bucketclient#8.1.5",
35-
"express": "^4.18.2",
31+
"arsenal": "git+https://github.com/scality/arsenal#8.2.1",
32+
"async": "^3.2.6",
33+
"aws-sdk": "^2.1691.0",
34+
"bucketclient": "scality/bucketclient#8.2.0",
35+
"express": "^5.1.0",
3636
"heapdump": "^0.3.15",
37-
"httpagent": "git+https://github.com/scality/httpagent#1.0.6",
38-
"level": "^7",
39-
"needle": "^3.2.0",
40-
"node-rdkafka": "2.12.0",
41-
"node-schedule": "^1.3.2",
42-
"node-uuid": "^1.4.8",
43-
"vaultclient": "scality/vaultclient#8.2.6",
44-
"werelogs": "scality/werelogs#8.1.2",
37+
"httpagent": "git+https://github.com/scality/httpagent#1.1.0",
38+
"level": "^9.0.0",
39+
"needle": "^3.3.1",
40+
"node-rdkafka": "^2.12.0",
41+
"node-schedule": "^2.1.1",
42+
"uuid": "^11.0.3",
43+
"vaultclient": "scality/vaultclient#8.5.1",
44+
"werelogs": "scality/werelogs#8.2.1",
4545
"xml2js": "^0.6.2",
4646
"zenkoclient": "scality/zenkoclient#1.2.1"
4747
},
@@ -50,15 +50,15 @@
5050
"jsprim": "1.4.2"
5151
},
5252
"devDependencies": {
53-
"@sinonjs/fake-timers": "^9.1.2",
54-
"eslint": "^8.8.0",
55-
"eslint-config-airbnb": "^19.0.0",
56-
"eslint-config-scality": "github:scality/Guidelines#8.2.0",
57-
"eslint-plugin-import": "^2.20.1",
58-
"eslint-plugin-jest": "^23.6.0",
53+
"@sinonjs/fake-timers": "^14.0.0",
54+
"eslint": "^9.14.0",
55+
"eslint-config-scality": "github:scality/Guidelines#8.3.0",
56+
"eslint-plugin-import": "^2.31.0",
57+
"eslint-plugin-jest": "^28.11.0",
5958
"jest": "^29.7.0",
60-
"mongodb-memory-server": "^8.10.2",
59+
"mongodb-memory-server": "10.1.2",
6160
"randomatic": "^3.1.1",
62-
"sinon": "^17.0.1"
61+
"sinon": "^19.0.2",
62+
"typescript": "^4.9.5"
6363
}
6464
}

tests/unit/CountItems/CountWorkerObj.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
jest.mock('node-uuid', () => require('../../mocks/uuid'));
1+
jest.mock('uuid', () => require('../../mocks/uuid'));
22

3-
const uuid = require('node-uuid');
3+
const { v4: uuid } = require('uuid');
44
const Subprocess = require('../../mocks/subprocess');
55

66
const CountWorkerObj = require('../../../CountItems/CountWorkerObj');
@@ -14,7 +14,7 @@ const createWorker = () => {
1414
describe('CountItems::CountWorkerObj', () => {
1515
beforeEach(() => {
1616
jest.resetModules();
17-
uuid.v4.mockReset();
17+
uuid.mockReset();
1818
});
1919

2020
test('should add callback object to list', () => {
@@ -146,7 +146,7 @@ describe('CountItems::CountWorkerObj', () => {
146146
const { p, w } = createWorker();
147147
w.clientConnected = testCase.connected;
148148
const pSendFn = jest.spyOn(p, 'send');
149-
uuid.v4.mockImplementationOnce(() => testCase.id);
149+
uuid.mockImplementationOnce(() => testCase.id);
150150
w[testCase.type](...testCase.args, err => {
151151
if (testCase.error) {
152152
expect(err).toEqual(new Error(testCase.error));
@@ -183,7 +183,7 @@ describe('CountItems::CountWorkerObj', () => {
183183
w.clientConnected = true;
184184
const testCallbackFn = jest.fn();
185185
let id = 0;
186-
uuid.v4.mockImplementation(() => id++);
186+
uuid.mockImplementation(() => id++);
187187
w.init(testCallbackFn);
188188
w.setup(testCallbackFn);
189189
w.teardown(testCallbackFn);

0 commit comments

Comments
 (0)