Skip to content

Commit

Permalink
chore: some package updates and minor code fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ovflowd committed Nov 9, 2024
1 parent 3e1aff9 commit 9dc4b6c
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 20 deletions.
6 changes: 0 additions & 6 deletions apps/site/.storybook/__mocks__/navigation.mjs

This file was deleted.

6 changes: 4 additions & 2 deletions apps/site/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { join } from 'node:path';

import type { StorybookConfig } from '@storybook/react-webpack5';

const mocksFolder = join(__dirname, '../components/__mocks__');

const config: StorybookConfig = {
stories: ['../components/**/*.stories.tsx'],
logLevel: 'error',
Expand Down Expand Up @@ -44,8 +46,8 @@ const config: StorybookConfig = {
...config.resolve,
alias: {
'@nodevu/core': false,
'@/navigation.mjs': join(__dirname, '__mocks__/navigation.mjs'),
'@/client-context': join(__dirname, '__mocks__/client-context.mjs'),
'next-intl/navigation': join(mocksFolder, './next-intl.mjs'),
'@/client-context': join(mocksFolder, './client-context.mjs'),
'@': join(__dirname, '../'),
},
},
Expand Down
4 changes: 4 additions & 0 deletions apps/site/app/[locale]/[[...path]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,17 @@ const getPage: FC<DynamicParams> = async props => {
const { path = [], locale = defaultLocale.code } = await props.params;

if (!availableLocaleCodes.includes(locale)) {
// Forces the current locale to be the Default Locale
setRequestLocale(defaultLocale.code);

if (!allLocaleCodes.includes(locale)) {
// when the locale is not listed in the locales, return NotFound
return notFound();
}

// Redirect to the default locale path
const pathname = dynamicRouter.getPathname(path);

return redirect(`/${defaultLocale.code}/${pathname}`);
}

Expand Down
2 changes: 1 addition & 1 deletion apps/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"glob": "~11.0.0",
"gray-matter": "~4.0.3",
"next": "15.0.2",
"next-intl": "~3.23.5",
"next-intl": "~3.24.0",
"next-themes": "^0.3.0",
"postcss": "~8.4.47",
"postcss-calc": "~10.0.2",
Expand Down
30 changes: 20 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"turbo": "2.2.3"
},
"devDependencies": {
"@eslint/js": "~9.10.0",
"@eslint/js": "~9.14.0",
"@types/eslint__js": "~8.42.3",
"commitizen": "4.3.0",
"cz-conventional-changelog": "3.3.0",
Expand Down

0 comments on commit 9dc4b6c

Please sign in to comment.