express-version-route 1.2.13 → 1.2.15

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.
@@ -11,7 +11,7 @@ jobs:
11
11
  strategy:
12
12
  matrix:
13
13
  platform: [ubuntu-latest]
14
- node: ['12', '10']
14
+ node: ['24.x']
15
15
  name: Node ${{ matrix.node }} (${{ matrix.platform }})
16
16
  runs-on: ${{ matrix.platform }}
17
17
  steps:
@@ -21,16 +21,17 @@ jobs:
21
21
  node-version: ${{ matrix.node }}
22
22
  - name: install dependencies
23
23
  run: yarn install --ignore-engines
24
- - name: install codecov
25
- run: npm install -g codecov
26
24
  - name: run tests
27
25
  run: yarn run test:coverage
28
- - name: get code coverage report
29
- run: yarn run report-coverage
30
- - name: send coverage
31
- run: codecov
26
+ - name: coverage
27
+ uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
28
+ if: github.actor != 'dependabot[bot]'
29
+ with:
30
+ fail_ci_if_error: true
31
+ verbose: false
32
+ token: ${{ secrets.CODECOV_TOKEN }}
32
33
  env:
33
- CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
34
+ CI: true
34
35
 
35
36
  release:
36
37
  name: do semantic release
@@ -46,7 +47,7 @@ jobs:
46
47
  - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
47
48
  - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
48
49
  with:
49
- node-version: '24'
50
+ node-version: '24.x'
50
51
  - name: install dependencies
51
52
  run: yarn install --ignore-engines
52
53
  - name: release
package/AGENTS.md ADDED
@@ -0,0 +1,35 @@
1
+ # AGENTS.md
2
+
3
+ Guidance for AI coding agents working in this repository.
4
+
5
+ ## Start Here
6
+
7
+ Before making changes, read:
8
+
9
+ - `CONTRIBUTING.md` for contribution, PR, testing, commit, and agent-specific expectations.
10
+ - `RELEASE.md` for release workflow details.
11
+ - `README.md` for user-facing behavior, install/use examples, and package or app overview.
12
+ - `docs/README.md` for the project documentation index.
13
+ - `docs/development.md` for local setup and development workflows.
14
+ - `docs/testing.md` for test strategy, commands, and verification expectations.
15
+ - `docs/architecture.md` for project structure, boundaries, and important invariants.
16
+ - `docs/conventions.md` for project-specific coding, documentation, and maintenance conventions.
17
+
18
+ Treat those files as the source of truth. Do not duplicate or reinterpret their rules here.
19
+
20
+ ## Documentation
21
+
22
+ - Keep documentation in sync when changing behavior, public interfaces, workflows, architecture, configuration, or operational assumptions.
23
+ - Put project-specific development details in `docs/`; keep root files focused on their standard audiences.
24
+ - Prefer linking to the source of truth over duplicating long instructions across files.
25
+ - When adding new docs, link them from `docs/README.md` and update this file only when they become important entry points for future agents.
26
+
27
+ ## PRs and Issues
28
+
29
+ - Follow PR, issue, and agent-labeling rules in `CONTRIBUTING.md`.
30
+ - Use the issue-linking format specified in `CONTRIBUTING.md`.
31
+
32
+ ## Releases
33
+
34
+ - Follow `RELEASE.md` for release workflow and changeset creation steps.
35
+ - If this project uses changesets, treat `RELEASE.md` and any changeset guidance in `CONTRIBUTING.md` as authoritative.
package/README.md CHANGED
@@ -163,6 +163,10 @@ Several npm projects exist which provide similar API versioning capabilities to
163
163
  * https://github.com/elliotttf/express-versioned-routes
164
164
  * https://github.com/biowink/express-route-versioning
165
165
 
166
+ ## Documentation
167
+
168
+ - [Project documentation](./docs/README.md) - development, testing, architecture, and conventions.
169
+
166
170
  ## Contributing
167
171
 
168
172
  Please consult [CONTRIBUTING](./CONTRIBUTING.md) for guidelines on contributing to this project.
package/RELEASE.md ADDED
@@ -0,0 +1,22 @@
1
+ # Release
2
+
3
+ This project uses [Changesets](https://github.com/changesets/changesets) for versioning and release notes.
4
+
5
+ ## Release Flow
6
+
7
+ 1. Ensure all intended changes are merged and CI is green.
8
+ 2. Run `yarn version` to apply Changesets version and changelog updates.
9
+ 3. Review the generated package and changelog changes.
10
+ 4. Run the release command, if configured for the repository.
11
+
12
+ No root `release` script is currently defined. Use the repository's publishing workflow or add one before publishing.
13
+
14
+ ## Changesets
15
+
16
+ Add a changeset for user-facing package behavior changes:
17
+
18
+ ```sh
19
+ yarn changeset
20
+ ```
21
+
22
+ Documentation-only, test-only, and internal refactor PRs usually do not need a changeset unless they describe or accompany a release-worthy behavior change.
package/index.js CHANGED
@@ -6,8 +6,8 @@ const { RouteVersionUnmatchedError } = require('./errors')
6
6
  class versionRouter {
7
7
  static route (versionsMap = new Map(), options = new Map()) {
8
8
  return (req, res, next) => {
9
- var versionArray = []
10
- for (let [versionKey, versionRouter] of versionsMap) {
9
+ const versionArray = []
10
+ for (const [versionKey, versionRouter] of versionsMap) {
11
11
  versionArray.push(versionKey)
12
12
  if (this.checkVersionMatch(req.version, versionKey)) {
13
13
  if (Array.isArray(versionRouter)) {
@@ -22,7 +22,7 @@ class versionRouter {
22
22
  if (options.useMaxVersion) {
23
23
  const maxVersion = semver.maxSatisfying(versionArray, req.version)
24
24
  if (maxVersion) {
25
- for (let [versionKey, versionRouter] of versionsMap) {
25
+ for (const [versionKey, versionRouter] of versionsMap) {
26
26
  if (this.checkVersionMatch(maxVersion, versionKey)) {
27
27
  return versionRouter(req, res, next)
28
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "express-version-route",
3
- "version": "1.2.13",
3
+ "version": "1.2.15",
4
4
  "description": "provides middleware to load controllers based on api versions",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -32,16 +32,16 @@
32
32
  "cz-conventional-changelog": "^2.1.0",
33
33
  "docco": "^0.7.0",
34
34
  "doxdox": "^2.0.1",
35
- "eslint": "^6.0.0",
36
- "eslint-plugin-ava": "^5.1.0",
37
- "eslint-plugin-import": "^2.2.0",
38
- "eslint-plugin-node": "^5.2.1",
39
- "eslint-plugin-security": "^1.3.0",
35
+ "eslint": "^8.57.1",
36
+ "eslint-plugin-ava": "^15.0.1",
37
+ "eslint-plugin-import": "^2.31.0",
38
+ "eslint-plugin-n": "^17.15.0",
39
+ "eslint-plugin-security": "^3.0.1",
40
40
  "husky": "^3.0.0",
41
- "nyc": "^13.2.0",
41
+ "nyc": "^17.1.0",
42
42
  "opn-cli": "^4.0.0",
43
43
  "semantic-release": "^25.0.3",
44
- "standard": "^12.0.0"
44
+ "standard": "^17.1.2"
45
45
  },
46
46
  "nyc": {
47
47
  "statements": 85,
@@ -81,17 +81,15 @@
81
81
  "es6": true
82
82
  },
83
83
  "plugins": [
84
- "node",
84
+ "n",
85
85
  "security",
86
86
  "ava"
87
87
  ],
88
88
  "extends": [
89
89
  "plugin:ava/recommended",
90
- "plugin:node/recommended"
90
+ "plugin:n/recommended"
91
91
  ],
92
92
  "rules": {
93
- "node/no-unsupported-features": "off",
94
- "node/no-unpublished-require": "off",
95
93
  "security/detect-non-literal-fs-filename": "error",
96
94
  "security/detect-unsafe-regex": "error",
97
95
  "security/detect-buffer-noassert": "error",
@@ -103,7 +101,8 @@
103
101
  "security/detect-non-literal-require": "error",
104
102
  "security/detect-object-injection": "error",
105
103
  "security/detect-possible-timing-attacks": "error",
106
- "security/detect-pseudoRandomBytes": "error"
104
+ "security/detect-pseudoRandomBytes": "error",
105
+ "n/no-unpublished-require": "off"
107
106
  },
108
107
  "parserOptions": {
109
108
  "ecmaFeatures": {
@@ -137,5 +136,9 @@
137
136
  },
138
137
  "dependencies": {
139
138
  "semver": "^6.3.0"
139
+ },
140
+ "engines": {
141
+ "node": ">=24.0.0",
142
+ "npm": ">=11.10.0"
140
143
  }
141
144
  }
@@ -88,7 +88,7 @@ test('given a versioned router, dont match the requestVersion and error out if n
88
88
  version: requestedVersion
89
89
  }
90
90
 
91
- let resIn = null
91
+ const resIn = null
92
92
  const result = middleware(req, resIn, nextHandler)
93
93
  t.falsy(resIn)
94
94
  t.truthy(result instanceof Error)