diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index fd0cb30..d876c2e 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -12,6 +12,6 @@ jobs: uses: node-modules/github-actions/.github/workflows/node-test.yml@master with: os: 'ubuntu-latest' - version: '16, 18.19.0, 18, 20, 22' + version: '18.19.0, 18, 20, 22' secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/README.md b/README.md index 08230af..8443b9d 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,12 @@ [![NPM version](https://img.shields.io/npm/v/@eggjs/router.svg?style=flat-square)](https://npmjs.org/package/@eggjs/router) [![NPM download](https://img.shields.io/npm/dm/@eggjs/router.svg?style=flat-square)](https://npmjs.org/package/@eggjs/router) -[![Node.js CI](https://github.com/eggjs/egg-router/actions/workflows/nodejs.yml/badge.svg?branch=master)](https://github.com/eggjs/egg-router/actions/workflows/nodejs.yml) -[![Test coverage](https://img.shields.io/codecov/c/github/eggjs/egg-router.svg?style=flat-square)](https://codecov.io/gh/eggjs/egg-router) +[![Node.js CI](https://github.com/eggjs/router/actions/workflows/nodejs.yml/badge.svg?branch=master)](https://github.com/eggjs/router/actions/workflows/nodejs.yml) +[![Test coverage](https://img.shields.io/codecov/c/github/eggjs/router.svg?style=flat-square)](https://codecov.io/gh/eggjs/router) [![Known Vulnerabilities](https://snyk.io/test/npm/@eggjs/router/badge.svg?style=flat-square)](https://snyk.io/test/npm/@eggjs/router) +[![Node.js Version](https://img.shields.io/node/v/@eggjs/router.svg?style=flat)](https://nodejs.org/en/download/) +[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://makeapullrequest.com) +![CodeRabbit Pull Request Reviews](https://img.shields.io/coderabbit/prs/github/eggjs/router) Router core component for [Egg.js](https://github.com/eggjs). @@ -459,6 +462,6 @@ Run tests using `npm test`. ## Contributors -[![Contributors](https://contrib.rocks/image?repo=eggjs/egg-router)](https://github.com/eggjs/egg-router/graphs/contributors) +[![Contributors](https://contrib.rocks/image?repo=eggjs/router)](https://github.com/eggjs/router/graphs/contributors) Made with [contributors-img](https://contrib.rocks). diff --git a/package.json b/package.json index b0e570a..729e2c1 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "description": "Router middleware for egg/koa. Provides RESTful resource routing.", "repository": { "type": "git", - "url": "https://github.com/eggjs/egg-router.git" + "url": "https://github.com/eggjs/router.git" }, "bugs": { "url": "https://github.com/eggjs/egg/issues" @@ -28,19 +28,20 @@ "is-type-of": "^2.1.0", "koa-compose": "^4.1.0", "methods": "^1.1.2", - "path-to-regexp": "^1.1.1", + "path-to-regexp": "^1.9.0", "urijs": "^1.19.11", "utility": "^2.1.0" }, "devDependencies": { "@eggjs/koa": "^2.18.1", "@eggjs/tsconfig": "^1.3.3", + "@types/http-errors": "^2.0.4", "@types/koa-compose": "^3.2.8", "@types/methods": "^1.1.4", "@types/mocha": "^10.0.6", "@types/supertest": "^6.0.2", "@types/urijs": "^1.19.25", - "egg-bin": "6", + "@eggjs/bin": "7", "eslint": "8", "eslint-config-egg": "13", "supertest": "^1.0.1", @@ -55,6 +56,8 @@ "test-local": "egg-bin test", "preci": "npm run lint && npm run prepublishOnly", "ci": "egg-bin cov", + "postci": "npm run clean", + "clean": "tsc -b --clean", "prepublishOnly": "tshy && tshy-after", "bench": "cd bench && make" }, diff --git a/test/Router.test.ts b/test/Router.test.ts index 5b05356..9e23f63 100644 --- a/test/Router.test.ts +++ b/test/Router.test.ts @@ -889,9 +889,14 @@ describe('test/lib/router.test.js', () => { .expect(200); assert.equal(res.body.id, '815'); assert.equal(res.body['0'], undefined); + + const res2 = await request(app.callback()) + .get('/foo/1,2,3,4,5') + .expect(200); + assert.equal(res2.body.id, '1,2,3,4,5'); }); - it('does not add an erroneous (.*) to unprefiexed nested routers - gh-369 gh-410', async () => { + it('does not add an erroneous (.*) to unprefixed nested routers - gh-369 gh-410', async () => { const app = new Koa(); const router = new Router(); const nested = new Router();