Skip to content

Commit e610233

Browse files
committed
update docs and cd
1 parent 6196484 commit e610233

File tree

7 files changed

+65
-68
lines changed

7 files changed

+65
-68
lines changed

.github/workflows/jsr-deploy.yml renamed to .github/workflows/build-deploy.yml

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,19 @@
1-
name: Publish
1+
name: Publish nextjs-toploader to npmjs & jsr.io
22
on:
3-
pull_request:
4-
branches:
5-
- jsr
6-
3+
release:
4+
types: [published]
75
jobs:
8-
publish:
9-
name: Build & Deploy for JSR.io
6+
build:
107
runs-on: ubuntu-latest
118

129
permissions:
13-
contents: read
10+
contents: write
1411
id-token: write
1512

1613
steps:
1714
- name: Checkout Repository
1815
uses: actions/checkout@v4
1916

20-
- name: Delete Current README.md
21-
run: rm README.md
22-
23-
- name: Modify README for JSR.io
24-
run: mv JSR.md README.md
25-
2617
- name: Find yarn cache location
2718
id: yarn-cache
2819
run: echo "::set-output name=dir::$(yarn cache dir)"
@@ -38,14 +29,33 @@ jobs:
3829
- name: Install Dependencies
3930
run: yarn install
4031

41-
- name: Generate Types Manually using TSUP
32+
- name: Compile the Library
4233
run: yarn build-lib
34+
# Setup .npmrc file to publish to npm
35+
- name: Setup the node
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version: '20.11.1'
39+
registry-url: 'https://registry.npmjs.org'
40+
- name: Publish nextjs-toploader on npm
41+
run: npm publish --access public --provenance
42+
env:
43+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
44+
45+
- name: Checkout Repository
46+
uses: actions/checkout@v4
47+
48+
- name: Delete Current README.md
49+
run: rm README.md
50+
51+
- name: Modify README for JSR.io
52+
run: mv JSR.md README.md
4353

4454
- name: Move index.d.ts in src directory for JSR
4555
run: cp dist/index.d.ts src/
4656

4757
- name: Add Use Client line
48-
run: sed -i '16s/^/\"use client\";/' src/index.tsx
58+
run: sed -i '1s/^/\"use client\";/' src/index.tsx
4959

5060
- name: Install Deno
5161
run: curl -fsSL https://deno.land/install.sh | sh

.github/workflows/npm-publish.yml

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

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,10 @@
126126
### Fixed
127127

128128
- Fix npm-publish.yml for gh actions to publish with provenance
129+
130+
## v1.6.11
131+
132+
### Fixed
133+
134+
- Fix to add use client in jsr usage with nextjs
135+
- Update README about support for React

JSR.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
[![NPM](https://img.shields.io/badge/NPM-%23CB3837.svg?style=for-the-badge&logo=npm&logoColor=white)](https://www.npmjs.com/package/nextjs-toploader)
66
[![NPM Downloads](https://img.shields.io/npm/dm/nextjs-toploader?&style=flat-square)](https://www.npmjs.com/package/nextjs-toploader)
7+
[![JSR](https://jsr.io/badges/@thesgj/nextjs-toploader)](https://jsr.io/badges/@thesgj/nextjs-toploader)
78

89
For using npm package manager instead see: (https://www.npmjs.com/package/nextjs-toploader)
910

@@ -73,19 +74,18 @@ export default function MyApp({ Component, pageProps }) {
7374

7475
### Usage with React, Vite React or any other React based component
7576

76-
For rendering add `<NextTopLoader />` to your `return()` inside the <Router><Router/> component in `App()`:
77+
For rendering add `<NextTopLoader />` to your `return()` inside the <Router><Router/> component in `App()` in your App.js:
78+
7779

7880
```js
79-
import NextTopLoader from 'nextjs-toploader';
81+
import NextTopLoader from '@thesgj/nextjs-toploader';
8082
const App = () => {
8183
return (
8284
<div>
8385
<Router>
84-
<NextTopLoader color='red' showSpinner={false} />
86+
<NextTopLoader />
8587
<Routes>
86-
<Route path="/" element={<Home />} />
87-
<Route path="/about" element={<About />} />
88-
<Route path="*" element={<NotFound/>} />
88+
{/* Your Routes Here */}
8989
</Routes>
9090
</Router>
9191
</div>

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Next Js TopLoader
22

3-
- A Next.js Top Loading Bar component made using nprogress, works with Next.js 14.
3+
- A Next.js Top Loading Bar component made using nprogress, works with Next.js 14 and React.
44

55
[![NPM](https://img.shields.io/badge/NPM-%23CB3837.svg?style=for-the-badge&logo=npm&logoColor=white)](https://www.npmjs.com/package/nextjs-toploader)
66
[![NPM Downloads](https://img.shields.io/npm/dm/nextjs-toploader?&style=flat-square)](https://www.npmjs.com/package/nextjs-toploader)
@@ -63,6 +63,28 @@ export default function MyApp({ Component, pageProps }) {
6363
}
6464
```
6565

66+
### Usage with React, Vite React or any other React based component
67+
68+
For rendering add `<NextTopLoader />` to your `return()` inside the <Router><Router/> component in `App()` in your App.js:
69+
70+
```js
71+
import NextTopLoader from 'nextjs-toploader';
72+
const App = () => {
73+
return (
74+
<div>
75+
<Router>
76+
<NextTopLoader />
77+
<Routes>
78+
{/* Your Routes Here */}
79+
</Routes>
80+
</Router>
81+
</div>
82+
)
83+
}
84+
85+
export default App;
86+
```
87+
6688
### Default Configuration
6789

6890
If no props are passed to `<NextTopLoader />`, below is the default configuration applied.

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@thesgj/nextjs-toploader",
3-
"version": "1.6.10",
3+
"version": "1.6.11",
44
"exports": "./src/index.tsx",
55
"compilerOptions": {
66
"jsx": "react-jsx",

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "nextjs-toploader",
3-
"version": "1.6.10",
4-
"description": "A Next.js Top Loading Bar component made using nprogress, works with Next.js 14.",
3+
"version": "1.6.11",
4+
"description": "A Next.js Top Loading Bar component made using nprogress, works with Next.js 14 and React.",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
77
"scripts": {

0 commit comments

Comments
 (0)