@localnerve/hmac-symmetric 2.0.0 → 3.0.0

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 ADDED
@@ -0,0 +1 @@
1
+ 22.17.0
package/eslint.config.js CHANGED
@@ -1,6 +1,8 @@
1
1
  import js from '@eslint/js';
2
2
  import globals from 'globals';
3
- import jest from 'eslint-plugin-jest';
3
+ import nodePlugin from 'eslint-plugin-n';
4
+
5
+ const nodeRules = nodePlugin.configs['flat/recommended'].rules;
4
6
 
5
7
  export default [{
6
8
  ignores: [
@@ -10,17 +12,22 @@ export default [{
10
12
  '**/tmp/**'
11
13
  ]
12
14
  }, {
15
+ plugins: { n: nodePlugin },
13
16
  files: [
14
17
  'lib/**',
15
18
  '__test_package__/*.mjs'
16
19
  ],
17
- ...js.configs.recommended,
18
20
  languageOptions: {
19
21
  globals: {
20
22
  ...globals.node
21
23
  }
24
+ },
25
+ rules: {
26
+ ...js.configs.recommended.rules,
27
+ ...nodeRules
22
28
  }
23
29
  }, {
30
+ plugins: { n: nodePlugin },
24
31
  files: [
25
32
  '__test_package__/*.{js,cjs}'
26
33
  ],
@@ -30,10 +37,23 @@ export default [{
30
37
  globals: {
31
38
  ...globals.node
32
39
  }
40
+ },
41
+ rules: {
42
+ ...js.configs.recommended.rules,
43
+ ...nodeRules
33
44
  }
34
45
  }, {
46
+ plugins: { n: nodePlugin },
35
47
  files: [
36
48
  '__tests__/**'
37
49
  ],
38
- ...jest.configs['flat/recommended']
50
+ languageOptions: {
51
+ globals: {
52
+ ...globals.node
53
+ }
54
+ },
55
+ rules: {
56
+ ...js.configs.recommended.rules,
57
+ ...nodeRules
58
+ }
39
59
  }]
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "@localnerve/hmac-symmetric",
3
- "version": "2.0.0",
3
+ "version": "3.0.0",
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": "rimraf ./cjs",
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
- "test": "cross-env HS_HMAC_SECRET=deadbeef HS_ENCRYPTION_KEY=56c6a9c6fb56a39e05fb993918ab01dda24439e2658dd7b06aa0f8fcc7fe0627 jest && npm run test-package",
21
- "test-package": "node ./__test_package__/index.js"
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.28.3",
48
- "@babel/preset-env": "^7.28.5",
49
- "@eslint/js": "^9.39.1",
50
+ "@babel/cli": "^7.28.6",
51
+ "@babel/preset-env": "^7.29.2",
52
+ "@eslint/js": "^10.0.1",
50
53
  "cross-env": "^10.1.0",
51
- "eslint": "^9.39.1",
52
- "eslint-plugin-jest": "^29.1.0",
53
- "glob": "^12.0.0",
54
- "globals": "^16.5.0",
55
- "jest": "^30.2.0",
56
- "rimraf": "^6.1.0",
57
- "tar": "^7.5.2"
54
+ "eslint": "^10.2.1",
55
+ "eslint-plugin-n": "^17.24.0",
56
+ "globals": "^17.5.0",
57
+ "tar": "^7.5.13"
58
58
  },
59
59
  "engines": {
60
- "node": ">=20"
60
+ "node": ">=22.17"
61
61
  }
62
62
  }
package/babel.config.json DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "presets": [
3
- [
4
- "@babel/preset-env", {
5
- "targets": {
6
- "node": "18"
7
- }
8
- }
9
- ]
10
- ]
11
- }
package/jest.config.js DELETED
@@ -1,10 +0,0 @@
1
- export default {
2
- collectCoverage: true,
3
- coverageDirectory: 'coverage',
4
- verbose: true,
5
- testEnvironment: 'node',
6
- testPathIgnorePatterns: [
7
- '/node_modules/',
8
- '/tmp/'
9
- ]
10
- };
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
- }