Skip to content

Commit 658d356

Browse files
authored
Merge pull request #22 from expatfile/development
chore: 🔖 release stable version
2 parents 3dba89b + 4ec4e8b commit 658d356

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+6508
-34
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/build
22
/node_modules
33
/coverage
4+
/examples
45
!.eslintrc.js

.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ tsconfig.json
1717
# source
1818
/src
1919

20+
# expamples
21+
/examples
22+
2023
# misc
2124
.DS_Store
2225
.env

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ build time. This means you must rebuild your app for each target environment,
2424
which violates the principle. But what if you want, or need, to follow the build
2525
once, deploy many principle?
2626

27-
### This package 🤓
27+
### This package 📦
2828

2929
`next-runtime-env` solves this problem by generating a JavaScript file that
3030
contains the environment variables at runtime, so you no longer have to declare
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "next/core-web-vitals"
3+
}

examples/with-app-router/.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
/public/__ENV.js
18+
19+
# misc
20+
.DS_Store
21+
*.pem
22+
23+
# debug
24+
npm-debug.log*
25+
yarn-debug.log*
26+
yarn-error.log*
27+
28+
# local env files
29+
.env*.local
30+
31+
# vercel
32+
.vercel
33+
34+
# typescript
35+
*.tsbuildinfo
36+
next-env.d.ts
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

examples/with-app-router/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
## Getting Started
2+
3+
First, run the development server:
4+
5+
```bash
6+
NEXT_PUBLIC_FOO=foo-value BAR=bar-value npm run dev
7+
# or
8+
NEXT_PUBLIC_FOO=foo-value BAR=bar-value yarn dev
9+
# or
10+
NEXT_PUBLIC_FOO=foo-value BAR=bar-value pnpm dev
11+
```
12+
13+
Open [http://localhost:3000/client-side](http://localhost:3000/client-side) or
14+
[http://localhost:3000/server-side](http://localhost:3000/server-side) with your
15+
browser to see the development result.
16+
17+
Next, build the app without the environment variables:
18+
19+
```bash
20+
npm run build
21+
# or
22+
yarn build
23+
# or
24+
pnpm build
25+
```
26+
27+
Finally, run the production server with the environment variables:
28+
29+
```bash
30+
NEXT_PUBLIC_FOO=foo-value BAR=bar-value npm run start
31+
# or
32+
NEXT_PUBLIC_FOO=foo-value BAR=bar-value yarn start
33+
# or
34+
NEXT_PUBLIC_FOO=foo-value BAR=bar-value pnpm start
35+
```
36+
37+
Open [http://localhost:3000/client-side](http://localhost:3000/client-side) or
38+
[http://localhost:3000/server-side](http://localhost:3000/server-side) with your
39+
browser to see the production result.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const { configureRuntimeEnv } = require('next-runtime-env/build/configure');
2+
3+
configureRuntimeEnv();
4+
5+
/** @type {import('next').NextConfig} */
6+
const nextConfig = {};
7+
8+
module.exports = nextConfig;

examples/with-app-router/package.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "with-app-router",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "next dev",
7+
"build": "next build",
8+
"start": "next start",
9+
"lint": "next lint"
10+
},
11+
"dependencies": {
12+
"@types/node": "20.1.4",
13+
"@types/react": "18.2.6",
14+
"@types/react-dom": "18.2.4",
15+
"eslint": "8.40.0",
16+
"eslint-config-next": "13.4.2",
17+
"next": "13.4.2",
18+
"next-runtime-env": "link:../..",
19+
"react": "18.2.0",
20+
"react-dom": "18.2.0",
21+
"typescript": "5.0.4"
22+
}
23+
}

0 commit comments

Comments
 (0)