Skip to content

Commit

Permalink
Merge pull request #7 from xairoo/dev-next-v14
Browse files Browse the repository at this point in the history
Updated to next v14, moved the configuration to environment variables
  • Loading branch information
xairoo authored Dec 28, 2023
2 parents 26df4b3 + 871e7d6 commit d9851be
Show file tree
Hide file tree
Showing 18 changed files with 3,887 additions and 9,188 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEXT_TELEMETRY_DISABLED=1
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ yarn-error.log*
.env.production.local

# turbo
.turbo
.turbo

!/examples/*/.env.local
4 changes: 4 additions & 0 deletions examples/web-ts/.env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
NEXT_PUBLIC_I18N_LANGUAGES=["en", "de"]
NEXT_PUBLIC_I18N_DEFAULT_LANGUAGE=en
NEXT_PUBLIC_I18N_NAMESPACES=["common", "meta", "error"]
NEXT_PUBLIC_I18N_DEFAULT_NAMESPACE=common
8 changes: 0 additions & 8 deletions examples/web-ts/next-i18next-static-site-config.js

This file was deleted.

10 changes: 7 additions & 3 deletions examples/web-ts/next.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
const { i18n } = require("./next-i18next-static-site-config");
const packageJSON = require("./package.json");

const withTM = require("next-transpile-modules")(["next-i18next-static-site"]);

module.exports = withTM({
reactStrictMode: true,
publicRuntimeConfig: {
i18n,
env: {
// Just for the example
NEXT_PUBLIC_EXAMPLE_NAME: packageJSON.name,
NEXT_PUBLIC_EXAMPLE_VERSION: packageJSON.version,
NEXT_PUBLIC_NEXT_VERSION: packageJSON.dependencies.next,
},
output: "export",
});
26 changes: 13 additions & 13 deletions examples/web-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
{
"name": "web-ts",
"version": "0.0.0",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "next dev -p 3001",
"build": "next build",
"start": "next start",
"export": "next build && next export",
"serve": "serve out",
"export": "npm run build --prefix ../../packages/next-i18next-static-site/ && next build && next export",
"serve": "serve out -p 3001",
"lint": "next lint"
},
"dependencies": {
"cookie-cutter": "^0.2.0",
"next": "13.0.0",
"next": "^14.0.4",
"next-i18next-static-site": "*",
"react": "18.2.0",
"react-dom": "18.2.0"
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@types/node": "^17.0.12",
"@types/react": "18.0.17",
"eslint": "7.32.0",
"@babel/core": "^7.22.9",
"@types/node": "^20.4.8",
"@types/react": "^18.2.18",
"eslint": "^8.46.0",
"eslint-config-custom": "*",
"next-transpile-modules": "9.0.0",
"serve": "^14.0.1",
"next-transpile-modules": "^10.0.1",
"serve": "^14.2.0",
"tsconfig": "*",
"typescript": "^4.5.3"
"typescript": "^5.1.6"
}
}
8 changes: 8 additions & 0 deletions examples/web-ts/pages/[lang]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ export default function Home() {
{t("Message count -")}
</button>
</p>
<pre>
Example name: {process.env.NEXT_PUBLIC_EXAMPLE_NAME}
{"\n"}
Example version: {process.env.NEXT_PUBLIC_EXAMPLE_VERSION}
{"\n"}
Next.js version: {process.env.NEXT_PUBLIC_NEXT_VERSION}
{"\n"}
</pre>
</div>
);
}
Expand Down
4 changes: 4 additions & 0 deletions examples/web/.env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
NEXT_PUBLIC_I18N_LANGUAGES=["en", "de"]
NEXT_PUBLIC_I18N_DEFAULT_LANGUAGE=en
NEXT_PUBLIC_I18N_NAMESPACES=["common", "meta", "error"]
NEXT_PUBLIC_I18N_DEFAULT_NAMESPACE=common
8 changes: 0 additions & 8 deletions examples/web/next-i18next-static-site-config.js

This file was deleted.

10 changes: 7 additions & 3 deletions examples/web/next.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
const { i18n } = require("./next-i18next-static-site-config");
const packageJSON = require("./package.json");

const withTM = require("next-transpile-modules")(["next-i18next-static-site"]);

module.exports = withTM({
reactStrictMode: true,
publicRuntimeConfig: {
i18n,
env: {
// Just for the example
NEXT_PUBLIC_EXAMPLE_NAME: packageJSON.name,
NEXT_PUBLIC_EXAMPLE_VERSION: packageJSON.version,
NEXT_PUBLIC_NEXT_VERSION: packageJSON.dependencies.next,
},
output: "export",
});
26 changes: 13 additions & 13 deletions examples/web/package.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
{
"name": "web",
"version": "0.0.0",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "next dev -p 3000",
"build": "next build",
"start": "next start",
"export": "next build && next export",
"serve": "serve out",
"export": "npm run build --prefix ../../packages/next-i18next-static-site/ && next build && next export",
"serve": "serve out -p 3000",
"lint": "next lint"
},
"dependencies": {
"cookie-cutter": "^0.2.0",
"next": "13.0.0",
"next": "^14.0.4",
"next-i18next-static-site": "*",
"react": "18.2.0",
"react-dom": "18.2.0"
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@types/node": "^17.0.12",
"@types/react": "18.0.17",
"eslint": "7.32.0",
"@babel/core": "^7.22.9",
"@types/node": "^20.4.8",
"@types/react": "^18.2.18",
"eslint": "^8.46.0",
"eslint-config-custom": "*",
"next-transpile-modules": "9.0.0",
"serve": "^14.0.1",
"next-transpile-modules": "^10.0.1",
"serve": "^14.2.0",
"tsconfig": "*",
"typescript": "^4.5.3"
"typescript": "^5.1.6"
}
}
8 changes: 8 additions & 0 deletions examples/web/pages/[lang]/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ export default function Home() {
{t("Message count -")}
</button>
</p>
<pre>
Example name: {process.env.NEXT_PUBLIC_EXAMPLE_NAME}
{"\n"}
Example version: {process.env.NEXT_PUBLIC_EXAMPLE_VERSION}
{"\n"}
Next.js version: {process.env.NEXT_PUBLIC_NEXT_VERSION}
{"\n"}
</pre>
</div>
);
}
Expand Down
Loading

0 comments on commit d9851be

Please sign in to comment.