Skip to content

Commit 3f65d17

Browse files
feat(gatsby-plugin-nprogress): Replace nprogress with accessible-nprogress (#34038)
Co-authored-by: LekoArts <[email protected]>
1 parent 7d354be commit 3f65d17

File tree

5 files changed

+15
-16
lines changed

5 files changed

+15
-16
lines changed

packages/gatsby-plugin-nprogress/README.md

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# gatsby-plugin-nprogress
22

3-
Automatically shows the [nprogress](http://ricostacruz.com/nprogress/) indicator
3+
Automatically shows the [accessible-nprogress](https://github.com/nmackey/accessible-nprogress) indicator
44
when a page is delayed in loading (which Gatsby considers as one second after
55
clicking on a link).
66

77
## Install
88

9-
`npm install gatsby-plugin-nprogress`
9+
```shell
10+
npm install gatsby-plugin-nprogress
11+
```
1012

1113
## How to use
1214

@@ -25,8 +27,4 @@ plugins: [
2527
]
2628
```
2729

28-
In addition to `color` – a configuration option specific to
29-
`gatsby-plugin-nprogress` that saves some time
30-
[customizing the nprogress CSS](https://github.com/rstacruz/nprogress#customization)
31-
to match your site colors – you may pass all available
32-
[nprogress configuration options](https://github.com/rstacruz/nprogress#configuration).
30+
You can pass in the custom configuration option `color` to [customize the accessible-nprogress CSS](https://github.com/nmackey/accessible-nprogress#customization). You may also pass all available [accessible-nprogress configuration options](https://github.com/nmackey/accessible-nprogress#configuration) into the plugin, too.

packages/gatsby-plugin-nprogress/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"dependencies": {
1010
"@babel/runtime": "^7.15.4",
11-
"nprogress": "^0.2.0"
11+
"accessible-nprogress": "^2.1.2"
1212
},
1313
"devDependencies": {
1414
"@babel/cli": "^7.15.4",

packages/gatsby-plugin-nprogress/src/__tests__/gatsby-browser.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
jest.mock(`nprogress`)
1+
jest.mock(`accessible-nprogress`)
22

3-
import NProgress from "nprogress"
3+
import NProgress from "accessible-nprogress"
44
import {
55
onClientEntry,
66
onRouteUpdateDelayed,

packages/gatsby-plugin-nprogress/src/gatsby-browser.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import NProgress from "nprogress"
1+
import NProgress from "accessible-nprogress"
22

33
const defaultOptions = { color: `#29d` }
44

5-
export const onClientEntry = (a, pluginOptions = {}) => {
5+
export const onClientEntry = (_gatsbyApi, pluginOptions = {}) => {
66
// Merge default options with user defined options in `gatsby-config.js`
77
const options = { ...defaultOptions, ...pluginOptions }
88

yarn.lock

+5-4
Original file line numberDiff line numberDiff line change
@@ -5279,6 +5279,11 @@ accepts@^1.3.7, accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7:
52795279
mime-types "~2.1.24"
52805280
negotiator "0.6.2"
52815281

5282+
accessible-nprogress@^2.1.2:
5283+
version "2.1.2"
5284+
resolved "https://registry.yarnpkg.com/accessible-nprogress/-/accessible-nprogress-2.1.2.tgz#8e65ebf4936db1752638e1cd2e8730f9bef311e9"
5285+
integrity sha512-reIwMbbt+ZGOmQLWPXGcPf5X1F4fzsZAekY9alCxpekxizRhQMAd/QInaA8k7WtwTcGMzD9hnYswGLcaJDRY/A==
5286+
52825287
acorn-dynamic-import@^4.0.0:
52835288
version "4.0.0"
52845289
resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz#482210140582a36b83c3e342e1cfebcaa9240948"
@@ -18436,10 +18441,6 @@ npm-run-path@^4.0.0, npm-run-path@^4.0.1:
1843618441
gauge "~2.7.3"
1843718442
set-blocking "~2.0.0"
1843818443

18439-
nprogress@^0.2.0:
18440-
version "0.2.0"
18441-
resolved "https://registry.yarnpkg.com/nprogress/-/nprogress-0.2.0.tgz#cb8f34c53213d895723fcbab907e9422adbcafb1"
18442-
1844318444
nspell@^2.0.0:
1844418445
version "2.1.2"
1844518446
resolved "https://registry.yarnpkg.com/nspell/-/nspell-2.1.2.tgz#429a1bcd4288e93bd0989e8fa5d4ab2c3950e00a"

0 commit comments

Comments
 (0)