Skip to content

Commit ec920cc

Browse files
committed
Require Node.js 20, React 19, React Router 7, and move to ESM
1 parent de549b2 commit ec920cc

File tree

17 files changed

+501
-450
lines changed

17 files changed

+501
-450
lines changed

.github/funding.yml

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

.github/workflows/main.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
node-version:
13-
- 14
14-
- 12
15-
- 10
16-
- 8
13+
- 24
14+
- 20
1715
steps:
18-
- uses: actions/checkout@v2
19-
- uses: actions/setup-node@v1
16+
- uses: actions/checkout@v5
17+
- uses: actions/setup-node@v5
2018
with:
2119
node-version: ${{ matrix.node-version }}
2220
- run: npm install

index.js

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

license

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
3+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66

package.json

Lines changed: 41 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,24 @@
44
"description": "Useful components and utilities for working with React Router",
55
"license": "MIT",
66
"repository": "sindresorhus/react-router-util",
7+
"funding": "https://github.com/sponsors/sindresorhus",
78
"author": {
89
"name": "Sindre Sorhus",
910
"email": "sindresorhus@gmail.com",
10-
"url": "sindresorhus.com"
11+
"url": "https://sindresorhus.com"
1112
},
12-
"main": "./dist/index.js",
13+
"type": "module",
14+
"exports": {
15+
"types": "./dist/index.d.ts",
16+
"default": "./dist/index.js"
17+
},
18+
"sideEffects": false,
1319
"engines": {
14-
"node": ">=8"
20+
"node": ">=20"
1521
},
1622
"scripts": {
17-
"build": "babel index.js --out-dir=dist",
18-
"test": "xo && ava",
23+
"build": "tsc",
24+
"test": "npm run build && xo && tsx --test --tsconfig tsconfig.test.json test/*.test.tsx",
1925
"prepare": "npm run build"
2026
},
2127
"files": [
@@ -40,69 +46,49 @@
4046
"helpers"
4147
],
4248
"dependencies": {
43-
"prop-types": "^15.6.0"
49+
"history": "^5.3.0"
4450
},
4551
"devDependencies": {
46-
"@babel/cli": "^7.5.0",
47-
"@babel/plugin-transform-modules-commonjs": "^7.5.0",
48-
"@babel/preset-env": "^7.5.4",
49-
"@babel/preset-react": "^7.0.0",
50-
"@babel/register": "^7.4.4",
51-
"ava": "^2.2.0",
52-
"babel-eslint": "^10.0.1",
53-
"babel-preset-env": "^1.6.1",
54-
"babel-preset-react": "^6.24.1",
55-
"enzyme": "^3.9.0",
56-
"enzyme-adapter-react-16": "^1.11.2",
57-
"eslint-config-xo-react": "^0.20.0",
58-
"eslint-plugin-react": "^7.14.2",
59-
"eslint-plugin-react-hooks": "^1.6.1",
60-
"jsdom": "^15.1.1",
61-
"react": "^16.8.6",
62-
"react-dom": "^16.8.6",
63-
"react-router-dom": "^5.0.1",
64-
"xo": "^0.24.0"
52+
"@sindresorhus/tsconfig": "^8.0.1",
53+
"@testing-library/react": "^16.3.0",
54+
"@testing-library/user-event": "^14.6.1",
55+
"@types/node": "^24.3.1",
56+
"@types/react": "^19.1.12",
57+
"@types/react-dom": "^19.1.9",
58+
"eslint-config-xo-react": "^0.27.0",
59+
"eslint-config-xo-typescript": "^3.0.0",
60+
"eslint-plugin-react": "^7.37.5",
61+
"eslint-plugin-react-hooks": "^5.2.0",
62+
"global-jsdom": "^26.0.0",
63+
"jsdom": "^26.1.0",
64+
"react": "^19.1.1",
65+
"react-dom": "^19.1.1",
66+
"react-router-dom": "^7.8.2",
67+
"tsx": "^4.20.5",
68+
"typescript": "^5.9.2",
69+
"xo": "^0.59.3"
6570
},
6671
"peerDependencies": {
67-
"react": ">=16.8",
68-
"react-router-dom": ">=5"
72+
"react": ">=19",
73+
"react-router-dom": ">=7"
6974
},
7075
"xo": {
7176
"envs": [
7277
"node",
7378
"browser"
7479
],
75-
"parser": "babel-eslint",
7680
"extends": [
77-
"xo-react"
81+
"xo-react",
82+
"xo-typescript"
83+
],
84+
"extensions": [
85+
"ts",
86+
"tsx"
7887
],
7988
"rules": {
80-
"import/no-unresolved": "off",
81-
"import/no-extraneous-dependencies": "off",
82-
"ava/no-ignored-test-files": "off",
83-
"unicorn/import-index": "off",
84-
"react/prop-types": "off",
85-
"react/require-default-props": "off"
89+
"@typescript-eslint/indent": "off",
90+
"unicorn/expiring-todo-comments": "off",
91+
"n/no-unsupported-features/node-builtins": "off"
8692
}
87-
},
88-
"ava": {
89-
"files": [
90-
"!test/fixtures/**/*",
91-
"!test/helpers/**/*"
92-
],
93-
"require": [
94-
"@babel/register",
95-
"./test/helpers/setup-browser-env.js",
96-
"./test/helpers/setup-enzyme.js"
97-
]
98-
},
99-
"babel": {
100-
"plugins": [
101-
"@babel/plugin-transform-modules-commonjs"
102-
],
103-
"presets": [
104-
"@babel/preset-env",
105-
"@babel/preset-react"
106-
]
10793
}
10894
}

readme.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22

33
> Useful components and utilities for working with [React Router](https://github.com/ReactTraining/react-router)
44
5-
65
## Install
76

7+
```sh
8+
npm install react-router-util
89
```
9-
$ npm install react-router-util
10-
```
11-
1210

1311
## Usage
1412

@@ -41,7 +39,6 @@ const App = () => (
4139
);
4240
```
4341

44-
4542
## API
4643

4744
### `history`
@@ -168,7 +165,6 @@ Like [`<Link>`](https://github.com/ReactTraining/react-router/blob/master/packag
168165

169166
Like [`<Link>`](https://github.com/ReactTraining/react-router/blob/master/packages/react-router-dom/docs/api/Link.md), but navigates to the next route in the history. Accepts any props `<Link>` supports except for `to`.
170167

171-
172168
## Related
173169

174170
- [react-extras](https://github.com/sindresorhus/react-extras) - Useful components and utilities for working with React

0 commit comments

Comments
 (0)