-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Description Fixes #9 This is the migration path for the incoming new version 2.0.0 ## Type of change Please mark relevant options with an `x` in the brackets. - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [x] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update - [ ] Algorithm update - updates algorithm documentation/questions/answers etc. - [x] Other (please describe): Upgrade and migrate # How Has This Been Tested? Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration - [ ] Integration tests - [ ] Unit tests - [x] Manual tests - [ ] No tests required # Reviewer checklist Mark everything that needs to be checked before merging the PR. - [x] Check if the UI is working as expected and is satisfactory - [ ] Check if the code is well documented - [x] Check if the behavior is what is expected - [ ] Check if the code is well tested - [ ] Check if the code is readable and well formatted - [ ] Additional checks (document below if any) # Screenshots (if appropriate): # Questions (if appropriate): --------- Co-authored-by: Alem Tuzlak <[email protected]>
- Loading branch information
1 parent
082359e
commit 909b7f7
Showing
9 changed files
with
333 additions
and
833 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ side-effects-cache=false | |
save-exact=true | ||
audit=false | ||
fund=false | ||
progress=false | ||
progress=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import type { Context } from "hono" | ||
import { i18next } from "remix-hono/i18next" | ||
import { getClientEnv, initEnv } from "~/env.server" | ||
|
||
// Setup the .env vars | ||
const env = initEnv() | ||
|
||
export const getLoadContext = async (c: Context) => { | ||
// get the locale from the context | ||
const locale = i18next.getLocale(c) | ||
// get t function for the default namespace | ||
const t = await i18next.getFixedT(c) | ||
|
||
const clientEnv = getClientEnv() | ||
return { | ||
lang: locale, | ||
t, | ||
env, | ||
clientEnv, | ||
// We do not add this to AppLoadContext type because it's not needed in the loaders, but it's used above to handle requests | ||
body: c.body, | ||
} | ||
} | ||
|
||
interface LoadContext extends Awaited<ReturnType<typeof getLoadContext>> {} | ||
|
||
/** | ||
* Declare our loaders and actions context type | ||
*/ | ||
declare module "react-router" { | ||
interface AppLoadContext extends Omit<LoadContext, "body"> {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { createHonoServer } from "react-router-hono-server/node" | ||
import { i18next } from "remix-hono/i18next" | ||
import i18nextOpts from "../localization/i18n.server" | ||
import { getLoadContext } from "./context" | ||
|
||
export default await createHonoServer({ | ||
configure(server) { | ||
server.use("*", i18next(i18nextOpts)) | ||
}, | ||
defaultLogger: false, | ||
getLoadContext, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
{ | ||
"$schema": "https://unpkg.com/knip@5/schema.json", | ||
"entry": ["scripts/*.{ts,js}", "app/routes.ts","vite.config.ts"], | ||
"entry": [ | ||
"scripts/*.{ts,js}", | ||
"app/routes.ts", | ||
"vite.config.ts", | ||
"app/server/*.ts" | ||
], | ||
"remix": true, | ||
"project": ["**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}", "vite.config.ts"], | ||
"ignore": ["app/library/icon/icons/types.ts"] | ||
} | ||
"lefthook": true, | ||
"project": [ | ||
"**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}", | ||
"vite.config.ts" | ||
], | ||
"ignore": [ | ||
"app/library/icon/icons/types.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
"clean": "git clean -fdX --exclude=\"!.env\"", | ||
"script": "tsx scripts/setup.ts", | ||
"cleanup": "pnpm run script scripts/cleanup.ts", | ||
"build": "NODE_ENV=production react-router build", | ||
"build": "react-router build", | ||
"dev": "react-router dev", | ||
"start": "NODE_ENV=production node ./build/server/index.js", | ||
"test": "vitest run", | ||
|
@@ -30,7 +30,7 @@ | |
"@forge42/seo-tools": "1.3.0", | ||
"@react-router/node": "7.0.1", | ||
"clsx": "2.1.1", | ||
"hono": "4.6.11", | ||
"hono": "4.6.12", | ||
"i18next": "23.15.2", | ||
"i18next-browser-languagedetector": "8.0.0", | ||
"i18next-fetch-backend": "6.0.0", | ||
|
@@ -40,7 +40,7 @@ | |
"react-dom": "18.3.1", | ||
"react-i18next": "15.1.1", | ||
"react-router": "7.0.1", | ||
"react-router-hono-server": "https://pkg.pr.new/rphlmr/[email protected]", | ||
"react-router-hono-server": "2.0.0", | ||
"remix-hono": "0.0.16", | ||
"remix-i18next": "7.0.0", | ||
"tailwind-merge": "2.5.4", | ||
|
Oops, something went wrong.