generated from EasyWebApp/WebCell-scaffold
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[optimize] update Next.js configuration, Docker file & GitHub actions [optimize] upgrade to Node.js 20, KoAJAX 3, MobX RESTful 1 & other latest Upstream packages
- Loading branch information
Showing
15 changed files
with
2,362 additions
and
2,261 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
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
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,20 @@ | ||
import { ErrorProps } from 'next/error'; | ||
import { FC } from 'react'; | ||
|
||
import { i18n } from '../models/Translation'; | ||
|
||
export const NotFoundCard: FC<ErrorProps> = ({ title }) => | ||
i18n.currentLanguage.startsWith('zh') ? ( | ||
<script | ||
src="//cdn.dnpw.org/404/v1.min.js" | ||
// @ts-ignore | ||
jumptarget="/" | ||
jumptime="-1" | ||
error={title} | ||
/> | ||
) : ( | ||
<iframe | ||
className="w-100 vh-100 border-0" | ||
src="https://notfound-static.fwebservices.be/en/404?key=66abb751ed312" | ||
/> | ||
); |
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
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 |
---|---|---|
@@ -1,19 +1,33 @@ | ||
import * as Sentry from '@sentry/nextjs'; | ||
import { parseCookie, parseLanguageHeader } from 'mobx-i18n'; | ||
import type { NextPage } from 'next'; | ||
import type { ErrorProps } from 'next/error'; | ||
import Error from 'next/error'; | ||
|
||
const CustomErrorComponent: NextPage<ErrorProps> = ({ statusCode }) => ( | ||
<Error statusCode={statusCode} /> | ||
import { NotFoundCard } from '../components/NotFoundCard'; | ||
import { i18n } from '../models/Translation'; | ||
|
||
const CustomErrorComponent: NextPage<ErrorProps> = props => ( | ||
<> | ||
<Error {...props} /> | ||
|
||
<NotFoundCard {...props} /> | ||
</> | ||
); | ||
const enableSentry = | ||
process.env.NODE_ENV === 'development' || !process.env.SENTRY_AUTH_TOKEN; | ||
|
||
CustomErrorComponent.getInitialProps = async contextData => { | ||
await Sentry.captureUnderscoreErrorException(contextData); | ||
const { 'accept-language': acceptLanguage, cookie = '' } = | ||
contextData.req!.headers; | ||
const { language } = parseCookie(cookie), | ||
languages = parseLanguageHeader(acceptLanguage || ''); | ||
|
||
await i18n.loadLanguages([language, ...languages].filter(Boolean)); | ||
|
||
if (enableSentry) await Sentry.captureUnderscoreErrorException(contextData); | ||
|
||
return Error.getInitialProps(contextData); | ||
}; | ||
|
||
export default process.env.NODE_ENV === 'development' || | ||
!process.env.SENTRY_AUTH_TOKEN | ||
? Error | ||
: CustomErrorComponent; | ||
export default CustomErrorComponent; |
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
Oops, something went wrong.
f202920
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deploy preview for idea2app ready!
✅ Preview
https://idea2app-ghdm8hd9x-techquerys-projects.vercel.app
Built with commit f202920.
This pull request is being automatically deployed with vercel-action