Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
feat: update dependencies (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhrebecek authored Apr 5, 2024
1 parent 1afb36d commit ae972e8
Show file tree
Hide file tree
Showing 5 changed files with 473 additions and 1,244 deletions.
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,13 +290,15 @@ Both of them take 2 arguments: an url and a locale. `fileUrlToUrl` can take an e
You will probably want to indicate alternate pages for SEO optimization. Here is how you can do that:
```tsx
const { pathname, query, locale, locale } = useRouter()

return (
<Head>
{locales.map((l) => l !== locale && <link rel="alternate" hrefLang={l} href={fileUrlToUrl({ pathname, query }, l)} />)}
</Head>
)
const { pathname, query, locale, locale } = useRouter()

return (
<Head>
{locales.map(
(l) => l !== locale && <link rel="alternate" hrefLang={l} href={fileUrlToUrl({ pathname, query }, l)} />,
)}
</Head>
)
```

You can do it in the `_app` component if you are sure to do that for all your pages. You can also use a dedicated package, like [next-seo](https://github.com/garmeeh/next-seo).
Expand Down Expand Up @@ -460,7 +462,7 @@ You will have to execute createNtrData in a node script and store the result som
```typescript
// nextRouterMock.ts
import withTranslateRoutes from '@almacareer/edu-next-translate-routes'
import { RouterContext } from 'next/dist/shared/lib/router-context'
import { RouterContext } from 'next/dist/shared/lib/router-context.shared-runtime'
import ntrData from 'path/to/your/ntrData'

//[...]
Expand Down Expand Up @@ -493,7 +495,7 @@ export const WithNextRouter: DecoratorFn = (Story, context): JSX.Element => (
```typescript
// nextRouterMock.ts
import withTranslateRoutes from '@almacareer/edu-next-translate-routes'
import { RouterContext } from 'next/dist/shared/lib/router-context'
import { RouterContext } from 'next/dist/shared/lib/router-context.shared-runtime'

//[...]

Expand Down
6 changes: 3 additions & 3 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
},
"devDependencies": {
"@next/eslint-plugin-next": "^14.1.4",
"@types/node": "^20.11.30",
"@types/react": "^18.2.67",
"@types/react-dom": "^18.2.22",
"@types/node": "^20.12.2",
"@types/react": "^18.2.73",
"@types/react-dom": "^18.2.23",
"eslint": "^8.57.0",
"eslint-config-next": "^14.1.4",
"typescript": "^5.4.3",
Expand Down
33 changes: 16 additions & 17 deletions example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ __metadata:
url: ^0.11.3
yamljs: ^0.3.0
peerDependencies:
next: ">13.5.0"
next: ">=13.5.0"
react: ">=16.8.0"
languageName: node
linkType: soft
Expand Down Expand Up @@ -252,12 +252,12 @@ __metadata:
languageName: node
linkType: hard

"@types/node@npm:^20.11.30":
version: 20.11.30
resolution: "@types/node@npm:20.11.30"
"@types/node@npm:^20.12.2":
version: 20.12.2
resolution: "@types/node@npm:20.12.2"
dependencies:
undici-types: ~5.26.4
checksum: 7597767aa3e44b0f1bf62efa522dd17741135f283c11de6a20ead8bb7016fb4999cc30adcd8f2bb29ebb216906c92894346ccd187de170927dc1e212d2c07c81
checksum: 3242ab04fe69ae32a2da29a7a2fce41fccb370bc1189de43d2dfbb491bd3253d3ee2070cbb5613061148e4862fdaa9cf62722c43128ce5c7d33fe83750956613
languageName: node
linkType: hard

Expand All @@ -268,12 +268,12 @@ __metadata:
languageName: node
linkType: hard

"@types/react-dom@npm:^18.2.22":
version: 18.2.22
resolution: "@types/react-dom@npm:18.2.22"
"@types/react-dom@npm:^18.2.23":
version: 18.2.24
resolution: "@types/react-dom@npm:18.2.24"
dependencies:
"@types/react": "*"
checksum: 83bb3ddcd7894f20a9a6cbc2befe75d8b76984734020c455b4c50cad625a4025250d8e1d247ef6264e484d47d5a94f2dd11f77c1dcac6a5de998cb447d85b720
checksum: 7fb0dd0c88c5219bcc27f1f9bf14d9e1b1593014ee7938dd46ee9782c77c39d1ccc79d2b8364a6113019d7f65c94e4dc3c37425c3972910bb2674cce98d3f3ca
languageName: node
linkType: hard

Expand All @@ -288,14 +288,13 @@ __metadata:
languageName: node
linkType: hard

"@types/react@npm:^18.2.67":
version: 18.2.67
resolution: "@types/react@npm:18.2.67"
"@types/react@npm:^18.2.73":
version: 18.2.73
resolution: "@types/react@npm:18.2.73"
dependencies:
"@types/prop-types": "*"
"@types/scheduler": "*"
csstype: ^3.0.2
checksum: 9e48122b0e8d0ae20601f613aca32289eeb94d55c58ff03a7dc532d80ed289a1ba9715f14b773bd926ccdd63e503717f14264143ef531dc370063abe09dee0b2
checksum: 0921d3e3286f11365e796f01eff4fb64de315c68f569e0bbfdaa7680dc4b774c7e8dc416d72d77f7f16a0c2075048429386a55bbfd43ac507d1dddc8d44142e7
languageName: node
linkType: hard

Expand Down Expand Up @@ -3745,9 +3744,9 @@ __metadata:
dependencies:
"@almacareer/edu-next-translate-routes": "portal:../symlink-used-by-example"
"@next/eslint-plugin-next": ^14.1.4
"@types/node": ^20.11.30
"@types/react": ^18.2.67
"@types/react-dom": ^18.2.22
"@types/node": ^20.12.2
"@types/react": ^18.2.73
"@types/react-dom": ^18.2.23
eslint: ^8.57.0
eslint-config-next: ^14.1.4
next: ^14.1.4
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@almacareer/edu-next-translate-routes",
"version": "1.0.0",
"version": "1.1.0",
"description": "Flexible and translated routes for Next.js without custom server",
"main": "index.js",
"repository": {
Expand Down Expand Up @@ -45,12 +45,12 @@
"src/**"
],
"devDependencies": {
"@babel/core": "^7.24.3",
"@babel/core": "^7.24.4",
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
"@testing-library/react": "^14.2.2",
"@types/jest": "^29.5.12",
"@types/react": "^18.2.73",
"@types/react-dom": "^18.2.23",
"@types/react": "^18.2.74",
"@types/react-dom": "^18.2.24",
"@types/yamljs": "^0.2.34",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
Expand All @@ -68,7 +68,7 @@
"react-dom": "^18.2.0",
"rimraf": "^3.0.2",
"ts-jest": "^29.1.2",
"typescript": "5.4.3",
"typescript": "^5.4.4",
"webpack": "^5.91.0",
"yarn-or-npm": "^3.0.1"
},
Expand Down
Loading

0 comments on commit ae972e8

Please sign in to comment.