Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/esm-only.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nextjs-basic-auth-middleware": minor
---

Publish as ESM-only. The CommonJS build (`dist/index.cjs`) is removed; the package now ships `dist/index.js` + `dist/index.d.ts` with `exports` conditions `types` and `default`. CommonJS consumers on Node.js >= 22.12 can still `require()` the package.
5 changes: 5 additions & 0 deletions .changeset/node-22.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nextjs-basic-auth-middleware": minor
---

Require Node.js >= 22 (`engines.node` is now `>=22`). Node.js 20 and older are end-of-life and no longer supported.
12 changes: 9 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,19 @@ jobs:
run: pnpm tsc

test:
name: Test
name: Test on Node ${{ matrix.node }}
runs-on: ubuntu-latest
strategy:
matrix:
node: ["22.x", "24.x", "26.x"]
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Set up Node.js
uses: labd/gh-actions-typescript/pnpm-install@ada4548df9a365c62c8b396b583953c6d4bc113f # v1.1.0
with:
node-version: ${{ matrix.node }}

- name: Test
run: pnpm test
Expand Down Expand Up @@ -69,7 +74,7 @@ jobs:
release:
name: Release
needs: [build]
if: github.ref == 'refs/heads/main'
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment: release
permissions:
Expand All @@ -86,7 +91,7 @@ jobs:
uses: labd/gh-actions-typescript/pnpm-install@ada4548df9a365c62c8b396b583953c6d4bc113f # v1.1.0
with:
node-version: 24.x
cache: false
cache: "false"

- name: Build
run: pnpm build
Expand All @@ -100,6 +105,7 @@ jobs:
pr-title: "Release new version"
commit-message: "update version"
publish-script: pnpm publish:ci
version-script: pnpm publish:version
# v2 pushes the release commit and tags through the GitHub API; the
# git CLI path keeps the previous behaviour.
push-with-git-cli: true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# nextjs-basic-auth-middleware


[![npm](https://img.shields.io/npm/v/nextjs-basic-auth-middleware)](https://www.npmjs.com/package/nextjs-basic-auth-middleware)

Adds basic auth support to Next.js projects using the official middleware approach (with a `middleware` file).
Options can be set on the basic auth middleware and overridden using environment variables.
Expand Down
6 changes: 3 additions & 3 deletions examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"start": "next start"
},
"dependencies": {
"next": "16.4.0",
"next": "16.4.2",
"nextjs-basic-auth-middleware": "latest",
"react": "19.3.0",
"react-dom": "19.3.0"
"react": "19.3.1",
"react-dom": "19.3.1"
},
"devDependencies": {
"@types/react": "19.3.0",
Expand Down
132 changes: 66 additions & 66 deletions examples/basic/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading