Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .github/actions/back-merge/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ runs:
git fetch --unshallow
git checkout development
git pull
git merge --no-ff origin/${{ inputs.main_branch }} -m "🔀 Back-merge ${{ inputs.main_branch }} into development"
git merge --no-ff origin/${{ inputs.main_branch }} -m "ci: 🔀 back-merge ${{ inputs.main_branch }} into development"
git push
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

strategy:
matrix:
node-version: [18, 20]
node-version: [20, 22]

steps:
- name: Checkout
Expand All @@ -42,7 +42,7 @@ jobs:

strategy:
matrix:
node-version: [18, 20]
node-version: [20, 22]

steps:
- name: Checkout
Expand All @@ -64,7 +64,7 @@ jobs:

strategy:
matrix:
node-version: [18, 20]
node-version: [20, 22]

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

strategy:
matrix:
node-version: [20]
node-version: [22]

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
.env.sample
.eslintignore
.eslintrc.js
.releaserc.yaml
.releaserc.json
codecov.yml
jest.config.js
prettier.config.js
Expand Down
77 changes: 77 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"branches": [
{
"name": "1.x",
"range": "1.x",
"channel": "1.x"
},
{
"name": "2.x",
"range": "2.x",
"channel": "2.x"
},
{
"name": "main"
},
{
"name": "development",
"prerelease": "alpha",
"channel": "alpha"
}
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"parserOpts": {
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"]
},
"preset": "angular",
"releaseRules": [
{ "type": "build", "release": "patch" },
{ "type": "refactor", "release": "patch" },
{ "type": "style", "release": "patch" }
]
}
],
[
"@semantic-release/release-notes-generator",
{
"parserOpts": {
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"]
},
"preset": "conventionalcommits",
"presetConfig": {
"types": [
{ "type": "build", "section": "Build System", "hidden": false },
{
"type": "ci",
"section": "Continuous Integration",
"hidden": false
},
{ "type": "docs", "section": "Documentation", "hidden": false },
{ "type": "feat", "section": "Features", "hidden": false },
{ "type": "fix", "section": "Bug Fixes", "hidden": false },
{
"type": "perf",
"section": "Performance Improvements",
"hidden": false
},
{
"type": "refactor",
"section": "Code Refactoring",
"hidden": false
},
{ "type": "style", "section": "Styles", "hidden": false },
{ "type": "test", "section": "Tests", "hidden": false }
]
},
"writerOpts": {
"commitsSort": ["subject", "scope"]
}
}
],
"@semantic-release/npm",
"@semantic-release/github"
]
}
35 changes: 0 additions & 35 deletions .releaserc.yaml

This file was deleted.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

🌟 **Highlights:**
- **Isomorphic Design:** Works seamlessly on both server and browser, and even in middleware.
- **Next.js 13 & 14 Ready:** Fully compatible with the latest Next.js features.
- **Next.js 13, 14, and 15 Ready:** Fully compatible with the latest Next.js features.
- **`.env` Friendly:** Use `.env` files during development, just like standard Next.js.

### 🤔 Why `next-runtime-env`?
Expand All @@ -19,6 +19,7 @@ In the modern software development landscape, the "[Build once, deploy many][bui

### 🤝 Compatibility Notes

- **Next.js 15:** Use `[email protected]` for new connection API.
- **Next.js 14:** Use `[email protected]` for optimal caching support.
- **Next.js 13:** Opt for [`[email protected]`][app-router-branch-link], tailored for the App Router.
- **Next.js 12/13 Page Router:** Stick with [`[email protected]`][pages-router-branch-link].
Expand All @@ -28,6 +29,7 @@ In the modern software development landscape, the "[Build once, deploy many][bui
- **1.x:** Next.js 12/13 Page Router
- **2.x:** Next.js 13 App Router
- **3.x:** Next.js 14 with advanced caching
- **3.x:** Next.js 15 with new connection API

### 🚀 Getting Started

Expand Down
12 changes: 6 additions & 6 deletions docs/EXPOSING_CUSTOM_ENV.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ You might not only want to expose environment variables that are prefixed with `
```tsx
// app/layout.tsx
// This is as of Next.js 14, but you could also use other dynamic functions
import { unstable_noStore as noStore } from 'next/cache';
import { connection } from 'next/server'
import { EnvScript } from 'next-runtime-env';

export default function RootLayout({
export default async function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
noStore(); // Opt into dynamic rendering
await connection(); // Opt into dynamic rendering

// This value will be evaluated at runtime
return (
Expand Down Expand Up @@ -55,15 +55,15 @@ You might not only want to expose environment variables that are prefixed with `
```tsx
// app/layout.tsx
// This is as of Next.js 14, but you could also use other dynamic functions
import { unstable_noStore as noStore } from 'next/cache';
import { connection } from 'next/server'
import { EnvProvider } from 'next-runtime-env';

export default function RootLayout({
export default async function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
noStore(); // Opt into dynamic rendering
await connection(); // Opt into dynamic rendering

// This value will be evaluated at runtime
return (
Expand Down
7 changes: 1 addition & 6 deletions examples/with-app-router-context/next.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
serverComponentsExternalPackages: ['next-runtime-env'],
// This is optional incase you want to make some private env vars publicly
// available.
instrumentationHook: true,
},
serverExternalPackages: ['next-runtime-env'],
};

module.exports = nextConfig;
18 changes: 9 additions & 9 deletions examples/with-app-router-context/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"lint": "next lint"
},
"dependencies": {
"@types/node": "20.12.12",
"@types/react": "18.3.2",
"@types/react-dom": "18.3.0",
"eslint": "8.57.0",
"eslint-config-next": "14.2.3",
"next": "14.2.3",
"@types/node": "22.10.6",
"@types/react": "19.0.7",
"@types/react-dom": "19.0.3",
"eslint": "9.18.0",
"eslint-config-next": "15.1.4",
"next": "15.1.4",
"next-runtime-env": "link:../..",
"react": "18.3.1",
"react-dom": "18.3.1",
"typescript": "5.4.5"
"react": "19.0.0",
"react-dom": "19.0.0",
"typescript": "5.7.3"
}
}
Loading
Loading