Skip to content

Commit

Permalink
Merge pull request #172 from theodo-group/update-deps-dsaiodsk
Browse files Browse the repository at this point in the history
update deps
  • Loading branch information
Jeremie-Chauvel authored Dec 20, 2023
2 parents f574c44 + 326ee0d commit 255041b
Show file tree
Hide file tree
Showing 20 changed files with 2,035 additions and 1,443 deletions.
4 changes: 2 additions & 2 deletions documentation/docs/technos/next/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ _[Reference documentation by React](https://reactjs.org/docs/error-boundaries.ht

### ✅ What to do if you want to use it on your project

The ErrorBoundary is wrapped by default around the main [`App`](../../../../examples/bifrost-starter/apps/frontend/pages/_app.tsx) and renders the [`AppCrashFallback`](../../../../examples/bifrost-starter/apps/frontend/components/AppCrashFallback/AppCrashFallback.tsx) for generic errors.
An example of ErrorBoundary usage in client component can be found on the profile page [`Profile`](../../../../examples/bifrost-starter/apps/frontend/components/pages/Profile/Profile.tsx) and renders the [`CrashFallback`](../../../../examples/bifrost-starter/apps/frontend/components/CrashFallback/CrashFallback.tsx) for generic errors.

- Edit the [`AppCrashFallback`](../../../../examples/bifrost-starter/apps/frontend/components/AppCrashFallback/AppCrashFallback.tsx) to fit your design guidelines.
- Edit the [`CrashFallback`](../../../../examples/bifrost-starter/apps/frontend/components/CrashFallback/CrashFallback.tsx) to fit your design guidelines.
- Send error to your monitoring system using the `componentDidCatch` from the [`ErrorBoundary`](../../../../examples/bifrost-starter/apps/frontend/components/ErrorBoundary/ErrorBoundary.tsx).

### 💡 Where to use
Expand Down
126 changes: 0 additions & 126 deletions documentation/docusaurus.config.js

This file was deleted.

123 changes: 123 additions & 0 deletions documentation/docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
import type * as Preset from '@docusaurus/preset-classic';
import type { Config } from '@docusaurus/types';
import { themes } from 'prism-react-renderer';

const { github: lightCodeTheme, dracula: darkCodeTheme } = themes;

const config: Config = {
title: 'Bifrost',
tagline: 'Start your project in the best conditions',
url: 'https://your-docusaurus-test-site.com',
baseUrl: '/bifrost/',
baseUrlIssueBanner: true,
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'throw',
trailingSlash: false,
favicon: 'img/favicon.ico',
organizationName: 'theodo', // Usually your GitHub org/user name.
projectName: 'bifrost', // Usually your repo name.
// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: ['en'],
},

presets: [
[
'classic',

{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
},
blog: {
showReadingTime: true,
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
} satisfies Preset.Options,
],
],

themeConfig: {
respectPrefersColorScheme: true,
navbar: {
title: 'Bifrost',
logo: {
alt: 'Bifrost Logo',
src: 'img/bifrost.png',
},
items: [
{
type: 'doc',
docId: 'introduction',
position: 'left',
label: 'Docs',
},
{
href: 'https://github.com/theodo-group/bifrost',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{
label: 'Introduction',
to: '/docs',
},
{
label: 'Getting started',
to: '/docs/getting-started',
},
],
},
{
title: 'More',
items: [
{
label: 'GitHub',
href: 'https://github.com/theodo-group/bifrost',
},
],
},
{
title: 'Acknowledgments',
items: [
{
label: 'Icons created by Freepik - Flaticon',
href: 'https://www.flaticon.com',
},
{
label: 'Bifrost icons created by Flat Icons - Flaticon',
href: 'https://www.flaticon.com/free-icons/bifrost',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
} satisfies Preset.ThemeConfig,
};

export default config;
5 changes: 4 additions & 1 deletion documentation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"dependencies": {
"@docusaurus/core": "3.0.1",
"@docusaurus/preset-classic": "3.0.1",
"@docusaurus/theme-classic": "3.0.1",
"@mdx-js/react": "3.0.0",
"clsx": "2.0.0",
"prettier": "3.1.1",
Expand All @@ -42,7 +43,9 @@
"devDependencies": {
"@algolia/client-search": "4.22.0",
"@docusaurus/module-type-aliases": "3.0.1",
"@tsconfig/docusaurus": "2.0.2",
"@docusaurus/tsconfig": "3.0.1",
"@docusaurus/types": "3.0.1",
"@types/node": "20.10.5",
"@types/react": "18.2.45",
"typescript": "5.3.3"
},
Expand Down
2 changes: 1 addition & 1 deletion documentation/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
// This file is not used in compilation. It is here just for a nice editor experience.
"extends": "@tsconfig/docusaurus/tsconfig.json",
"extends": "@docusaurus/tsconfig",
"compilerOptions": {
"baseUrl": "."
}
Expand Down
6 changes: 3 additions & 3 deletions examples/bifrost-starter/apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"@types/jest": "29.5.2",
"@types/jsonwebtoken": "9.0.2",
"@types/lodash": "4.14.195",
"@types/node": "16.11.59",
"@types/node": "20.10.5",
"@types/passport-jwt": "3.0.8",
"@types/supertest": "2.0.12",
"@types/validator": "13.7.17",
Expand All @@ -91,9 +91,9 @@
"supertest": "6.3.3",
"ts-jest": "29.1.1",
"ts-loader": "9.4.4",
"ts-node": "10.9.1",
"ts-node": "10.9.2",
"tsconfig": "workspace:*",
"typescript": "5.1.3",
"typescript": "5.3.3",
"webpack": "5.88.1"
},
"engines": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import nextJest from 'next/jest';
const nextJest = require('next/jest');

// Providing the path to your Next.js app which will enable loading next.config.js and .env files
const createJestConfig = nextJest({ dir: './' });

const TEST_REGEX = '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|js?|tsx?|ts?)$';

/**
* @type {import(@jest/types).Config.InitialOptions}
* @type {import('jest').Config}
* Any custom config you want to pass to Jest
*/
const config = {
Expand All @@ -18,13 +18,18 @@ const config = {
testPathIgnorePatterns: [
'<rootDir>/.next/',
'<rootDir>/node_modules/',
'<rootDir>/e2e/',
'<rootDir>/cypress/',
],
coveragePathIgnorePatterns: [
'<rootDir>/.next/',
'<rootDir>/node_modules/',
'<rootDir>/.*.js',
],

coveragePathIgnorePatterns: ['<rootDir>/src/.next/'],
// if using TypeScript with a baseUrl set to the root directory then you need the below for alias' to work
moduleDirectories: ['node_modules', '<rootDir>'],
testEnvironment: 'jest-environment-jsdom',
};

export default createJestConfig(config);
module.exports = createJestConfig(config);
20 changes: 11 additions & 9 deletions examples/bifrost-starter/apps/frontend/locales/i18n.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { getRequestConfig } from 'next-intl/server';

export default getRequestConfig(async ({ locale }) => ({
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
messages: (
await (locale === 'en'
? // When using Turbopack, this will enable HMR for `en`
import('./translations/en.json')
: import(`./translations/${locale}.json`))
).default,
}));
import { isValidLocale } from './locales';

export default getRequestConfig(async ({ locale }) => {
if (!isValidLocale(locale)) {
throw new Error(`Invalid locale: ${locale}`);
}

return {
messages: (await import('./translations/en.json')).default,
};
});
Loading

0 comments on commit 255041b

Please sign in to comment.