Skip to content

Commit 680e862

Browse files
authored
Update dev dependencies (#217)
codecov add @vitest/coverage-v8 format vite.config.mjs fix tests build
1 parent c8dd715 commit 680e862

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+7249
-22867
lines changed

.eslintignore

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

.eslintrc.js

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

.github/workflows/ci.yml

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,32 @@ jobs:
55
runs-on: ubuntu-latest
66
strategy:
77
matrix:
8-
node-version: [14.x, 16.x]
8+
node-version: [18.x, 20.x, 22.x]
99
steps:
10-
- name: Checkout
11-
uses: actions/checkout@v2
12-
- name: Use Node.js ${{ matrix.node-version }}
13-
uses: actions/setup-node@v2
14-
with:
15-
node-version: ${{ matrix.node-version }}
16-
- name: Install dependencies
17-
run: npm ci --force
18-
- name: Lint
19-
run: npm run lint
20-
- name: Test
21-
run: npm run test -- --coverage --verbose --ci
22-
- name: Build
23-
run: npm run build
24-
- name: Upload coverage to Codecov
25-
uses: codecov/codecov-action@v1
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
- name: Use Node.js ${{ matrix.node-version }}
13+
uses: actions/setup-node@v4
14+
with:
15+
node-version: ${{ matrix.node-version }}
16+
- name: Install dependencies
17+
run: npm ci
18+
- name: Run Tests
19+
run: npm run coverage -- --reporter=junit --outputFile=test-report.junit.xml
20+
- name: Lint code
21+
run: npm run lint
22+
- name: Check types
23+
run: npm run typecheck
24+
- name: Check code formatting
25+
run: npm run formatcheck
26+
- name: Build
27+
run: npm run build
28+
- name: Upload coverage to Codecov
29+
uses: codecov/codecov-action@v4
30+
with:
31+
token: ${{ secrets.CODECOV_TOKEN }}
32+
- name: Upload test results to Codecov
33+
if: ${{ !cancelled() }}
34+
uses: codecov/test-results-action@v1
35+
with:
36+
token: ${{ secrets.CODECOV_TOKEN }}

.gitignore

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,16 @@
22

33
# Dependencies
44
node_modules/
5-
yarn.lock
5+
src/path-to-regexp.ts
66

77
# Compiled output
8-
/dist/*
9-
!/dist/universal-router*
8+
/dist/
109

1110
# Test coverage
1211
/coverage/
1312

1413
# Logs
1514
npm-debug.log*
16-
yarn-debug.log*
17-
yarn-error.log*
1815

1916
# Editors and IDEs
2017
.idea/

.prettierrc.js

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

.vscode/launch.json

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,17 @@
44
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
55
"version": "0.2.0",
66
"configurations": [
7-
// https://github.com/microsoft/vscode-recipes/tree/master/debugging-jest-tests#debugging-all-tests
7+
// https://vitest.dev/guide/debugging
88
{
99
"type": "node",
1010
"request": "launch",
11-
"name": "Jest All",
12-
"program": "${workspaceFolder}/node_modules/.bin/jest",
13-
"args": ["--runInBand"],
14-
"console": "integratedTerminal",
15-
"internalConsoleOptions": "neverOpen",
16-
"disableOptimisticBPs": true,
17-
"windows": {
18-
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
19-
}
20-
},
21-
// https://github.com/microsoft/vscode-recipes/tree/master/debugging-jest-tests#debugging-the-current-test
22-
{
23-
"type": "node",
24-
"request": "launch",
25-
"name": "Jest Current File",
26-
"program": "${workspaceFolder}/node_modules/.bin/jest",
27-
"args": ["${fileBasenameNoExtension}", "--config", "jest.config.js"],
28-
"console": "integratedTerminal",
29-
"internalConsoleOptions": "neverOpen",
30-
"disableOptimisticBPs": true,
31-
"windows": {
32-
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
33-
}
11+
"name": "Debug Current Test File",
12+
"autoAttachChildProcesses": true,
13+
"skipFiles": ["<node_internals>/**", "**/node_modules/**"],
14+
"program": "${workspaceRoot}/node_modules/vitest/vitest.mjs",
15+
"args": ["run", "${relativeFile}"],
16+
"smartStep": true,
17+
"console": "integratedTerminal"
3418
}
3519
]
3620
}

.vscode/settings.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
"[typescript]": { "editor.formatOnSave": false },
66
"tslint.enable": false,
77
"editor.codeActionsOnSave": {
8-
"source.fixAll.eslint": true
8+
"source.fixAll.eslint": "explicit"
99
},
10-
"cSpell.words": [
11-
"Kriasoft"
12-
]
10+
"cSpell.words": ["Kriasoft"]
1311
}

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
147147
```js
148148
const router = new UniversalRouter({
149149
path: ['/one/:parameter', '/two/:parameter'],
150-
action: context => context.params,
150+
action: (context) => context.params,
151151
})
152152

153153
router.resolve('/one/a') // => { parameter: 'a' }

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![NPM version](https://img.shields.io/npm/v/universal-router.svg)](https://www.npmjs.com/package/universal-router)
44
[![NPM downloads](https://img.shields.io/npm/dw/universal-router.svg)](https://www.npmjs.com/package/universal-router)
55
[![Library Size](https://img.shields.io/bundlephobia/minzip/universal-router.svg)](https://bundlephobia.com/result?p=universal-router)
6-
[![Online Chat](https://badges.gitter.im/kriasoft/universal-router.svg)](https://gitter.im/kriasoft/universal-router)
6+
[![Online Chat](https://img.shields.io/discord/643523529131950086?label=Chat)](https://discord.gg/2nKEnKq)
77

88
<a href="https://www.kriasoft.com/universal-router/" target="_blank">
99
<img width="64" height="64" align="right" alt="Visit Universal Router Website"
@@ -70,27 +70,27 @@ import UniversalRouter from 'universal-router'
7070
const routes = [
7171
{
7272
path: '', // optional
73-
action: () => `<h1>Home</h1>`
73+
action: () => `<h1>Home</h1>`,
7474
},
7575
{
7676
path: '/posts',
7777
action: () => console.log('checking child routes for /posts'),
7878
children: [
7979
{
8080
path: '', // optional, matches both "/posts" and "/posts/"
81-
action: () => `<h1>Posts</h1>`
81+
action: () => `<h1>Posts</h1>`,
8282
},
8383
{
8484
path: '/:id',
85-
action: (context) => `<h1>Post #${context.params.id}</h1>`
86-
}
87-
]
88-
}
85+
action: (context) => `<h1>Post #${context.params.id}</h1>`,
86+
},
87+
],
88+
},
8989
]
9090

9191
const router = new UniversalRouter(routes)
9292

93-
router.resolve('/posts').then(html => {
93+
router.resolve('/posts').then((html) => {
9494
document.body.innerHTML = html // renders: <h1>Posts</h1>
9595
})
9696
```

dist/universal-router-generate-urls.js

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

dist/universal-router-generate-urls.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/universal-router-generate-urls.min.js

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

dist/universal-router-generate-urls.min.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/universal-router-sync.js

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

dist/universal-router-sync.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/universal-router-sync.min.js

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

dist/universal-router-sync.min.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/universal-router.js

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

dist/universal-router.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/universal-router.min.js

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

dist/universal-router.min.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)