@localnerve/hmac-symmetric 2.0.1 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nvmrc +1 -0
- package/eslint.config.js +33 -3
- package/package.json +16 -16
- package/babel.config.json +0 -11
- package/jest.config.js +0 -10
- package/posttranspile.js +0 -13
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
22.17.0
|
package/eslint.config.js
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import js from '@eslint/js';
|
|
2
2
|
import globals from 'globals';
|
|
3
|
-
import
|
|
3
|
+
import nodePlugin from 'eslint-plugin-n';
|
|
4
|
+
|
|
5
|
+
const nodeRules = {
|
|
6
|
+
...nodePlugin.configs['flat/recommended'].rules,
|
|
7
|
+
...{
|
|
8
|
+
"n/no-unsupported-features/node-builtins": [
|
|
9
|
+
"error",
|
|
10
|
+
{
|
|
11
|
+
allowExperimental: true,
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
}
|
|
15
|
+
};
|
|
4
16
|
|
|
5
17
|
export default [{
|
|
6
18
|
ignores: [
|
|
@@ -10,17 +22,22 @@ export default [{
|
|
|
10
22
|
'**/tmp/**'
|
|
11
23
|
]
|
|
12
24
|
}, {
|
|
25
|
+
plugins: { n: nodePlugin },
|
|
13
26
|
files: [
|
|
14
27
|
'lib/**',
|
|
15
28
|
'__test_package__/*.mjs'
|
|
16
29
|
],
|
|
17
|
-
...js.configs.recommended,
|
|
18
30
|
languageOptions: {
|
|
19
31
|
globals: {
|
|
20
32
|
...globals.node
|
|
21
33
|
}
|
|
34
|
+
},
|
|
35
|
+
rules: {
|
|
36
|
+
...js.configs.recommended.rules,
|
|
37
|
+
...nodeRules
|
|
22
38
|
}
|
|
23
39
|
}, {
|
|
40
|
+
plugins: { n: nodePlugin },
|
|
24
41
|
files: [
|
|
25
42
|
'__test_package__/*.{js,cjs}'
|
|
26
43
|
],
|
|
@@ -30,10 +47,23 @@ export default [{
|
|
|
30
47
|
globals: {
|
|
31
48
|
...globals.node
|
|
32
49
|
}
|
|
50
|
+
},
|
|
51
|
+
rules: {
|
|
52
|
+
...js.configs.recommended.rules,
|
|
53
|
+
...nodeRules
|
|
33
54
|
}
|
|
34
55
|
}, {
|
|
56
|
+
plugins: { n: nodePlugin },
|
|
35
57
|
files: [
|
|
36
58
|
'__tests__/**'
|
|
37
59
|
],
|
|
38
|
-
|
|
60
|
+
languageOptions: {
|
|
61
|
+
globals: {
|
|
62
|
+
...globals.node
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
rules: {
|
|
66
|
+
...js.configs.recommended.rules,
|
|
67
|
+
...nodeRules
|
|
68
|
+
}
|
|
39
69
|
}]
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@localnerve/hmac-symmetric",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "A library to generate hmac and symmetrically encrypted payloads",
|
|
5
|
-
"main": "index.js",
|
|
6
5
|
"type": "module",
|
|
7
6
|
"exports": {
|
|
8
7
|
"require": "./cjs/index.cjs",
|
|
@@ -14,11 +13,14 @@
|
|
|
14
13
|
},
|
|
15
14
|
"scripts": {
|
|
16
15
|
"lint": "eslint .",
|
|
17
|
-
"pretranspile": "
|
|
16
|
+
"pretranspile": "node -e 'require(\"fs\").rmSync(\"./cjs\", {recursive:true,force:true})'",
|
|
18
17
|
"transpile": "babel lib -d cjs --out-file-extension .cjs",
|
|
19
18
|
"posttranspile": "node posttranspile.js",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
19
|
+
"prepublishOnly": "npm run transpile",
|
|
20
|
+
"pretest:node": "node -e 'require(\"fs\"); fs.rmSync(\"./coverage\", {recursive:true,force:true}); fs.mkdirSync(\"./coverage\", {recursive:true});'",
|
|
21
|
+
"test:node": "node --test --experimental-test-coverage --test-coverage-lines=95 --test-coverage-exclude='__tests__/**' --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=coverage/lcov.info ./__tests__/*.js",
|
|
22
|
+
"test": "cross-env HS_HMAC_SECRET=deadbeef HS_ENCRYPTION_KEY=56c6a9c6fb56a39e05fb993918ab01dda24439e2658dd7b06aa0f8fcc7fe0627 npm run test:node && npm run test:package",
|
|
23
|
+
"test:package": "node ./__test_package__/index.js"
|
|
22
24
|
},
|
|
23
25
|
"repository": {
|
|
24
26
|
"type": "git",
|
|
@@ -43,20 +45,18 @@
|
|
|
43
45
|
"url": "https://github.com/localnerve/hmac-symmetric/issues"
|
|
44
46
|
},
|
|
45
47
|
"homepage": "https://github.com/localnerve/hmac-symmetric#readme",
|
|
48
|
+
"dependencies": {},
|
|
46
49
|
"devDependencies": {
|
|
47
|
-
"@babel/cli": "^7.
|
|
48
|
-
"@babel/preset-env": "^7.
|
|
49
|
-
"@eslint/js": "^
|
|
50
|
+
"@babel/cli": "^7.29.7",
|
|
51
|
+
"@babel/preset-env": "^7.29.7",
|
|
52
|
+
"@eslint/js": "^10.0.1",
|
|
50
53
|
"cross-env": "^10.1.0",
|
|
51
|
-
"eslint": "^
|
|
52
|
-
"eslint-plugin-
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"jest": "^30.2.0",
|
|
56
|
-
"rimraf": "^6.1.2",
|
|
57
|
-
"tar": "^7.5.2"
|
|
54
|
+
"eslint": "^10.4.1",
|
|
55
|
+
"eslint-plugin-n": "^18.1.0",
|
|
56
|
+
"globals": "^17.6.0",
|
|
57
|
+
"tar": "^7.5.16"
|
|
58
58
|
},
|
|
59
59
|
"engines": {
|
|
60
|
-
"node": ">=
|
|
60
|
+
"node": ">=22.17"
|
|
61
61
|
}
|
|
62
62
|
}
|
package/babel.config.json
DELETED
package/jest.config.js
DELETED
package/posttranspile.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs/promises';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
|
|
4
|
-
const dir = './cjs';
|
|
5
|
-
const files = await fs.readdir(dir);
|
|
6
|
-
for (const file of files) {
|
|
7
|
-
const filename = `${dir}${path.sep}${file}`;
|
|
8
|
-
const data = await fs.readFile(filename, 'utf8');
|
|
9
|
-
const newData = data.replace(/(require\("[a-z./]+)(\.js")(.+)$/mg, (m, req, repl, rest) => {
|
|
10
|
-
return `${req}.cjs"${rest}`;
|
|
11
|
-
});
|
|
12
|
-
await fs.writeFile(filename, newData);
|
|
13
|
-
}
|