-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adding storybook 7.0 into template (#61)
- Loading branch information
Showing
55 changed files
with
10,017 additions
and
2,252 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 |
---|---|---|
@@ -1,11 +1,10 @@ | ||
strict-peer-dependencies=false | ||
engine-strict=true | ||
engine-strict=false | ||
|
||
### https://gist.github.com/belgattitude/838b2eba30c324f1f0033a797bab2e31#recommended-npmrc | ||
# https://pnpm.io/next/npmrc#strict-peer-dependencies | ||
strict-peer-dependencies=false | ||
|
||
# https://pnpm.io/npmrc#auto-install-peers | ||
auto-install-peers=false | ||
auto-install-peers=true | ||
|
||
store-dir=.pnpm-store/v3 |
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,2 +1,2 @@ | ||
# next.js build output | ||
.next | ||
.next/* |
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,19 @@ | ||
const path = require('path'); | ||
module.exports = { | ||
"stories": [ | ||
"../src/**/*.mdx", | ||
"../src/**/*.stories.@(js|jsx|ts|tsx)" | ||
], | ||
"addons": [ | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
"@storybook/addon-interactions" | ||
], | ||
"framework": { | ||
"name": "@storybook/nextjs", | ||
"options": {} | ||
}, | ||
"docs": { | ||
"autodocs": "tag" | ||
} | ||
} |
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,9 @@ | ||
export const parameters = { | ||
actions: { argTypesRegex: '^on[A-Z].*' }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
} |
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,21 @@ | ||
import type { Session } from 'next-auth' | ||
import type { FC, PropsWithChildren } from 'react' | ||
import { AppProviders } from '../../src/AppProviders' | ||
import { I18nextTestStubProvider } from './I18nextTestStubProvider' | ||
|
||
const fakeNextAuthSession: Session = { | ||
user: { | ||
email: '[email protected]', | ||
role: 'guest', | ||
name: 'AppTestProvider', | ||
}, | ||
expires: '2050-01-01T00:00:00.000Z', | ||
} | ||
|
||
export const AppTestProviders: FC<PropsWithChildren> = ({ children }) => { | ||
return ( | ||
<AppProviders session={fakeNextAuthSession}> | ||
<I18nextTestStubProvider>{children}</I18nextTestStubProvider> | ||
</AppProviders> | ||
) | ||
} |
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,31 @@ | ||
import i18next from 'i18next' | ||
import type { FC, ReactNode } from 'react' | ||
import { initReactI18next, I18nextProvider } from 'react-i18next' | ||
import type { I18nNamespace } from '@/lib/i18n' | ||
|
||
/** | ||
* Fully wrapped strategy for i18next, you can use stub/mocks as well | ||
* @link {https://react.i18next.com/misc/testing} | ||
*/ | ||
// eslint-disable-next-line import/no-named-as-default-member | ||
i18next.use(initReactI18next).init({ | ||
lng: 'en', | ||
fallbackLng: 'en', | ||
ns: ['common'], | ||
defaultNS: 'common', | ||
debug: false, | ||
interpolation: { | ||
escapeValue: false, // not needed for react!! | ||
}, | ||
// Let empty, so you can test on translation keys rather than translated strings | ||
resources: { | ||
en: { common: {}, demo: {}, home: {}, system: {} } as Record< | ||
I18nNamespace, | ||
Record<string, never> | ||
>, | ||
}, | ||
}) | ||
|
||
export const I18nextTestStubProvider: FC<{ children: ReactNode }> = ({ children }) => { | ||
return <I18nextProvider i18n={i18next}>{children}</I18nextProvider> | ||
} |
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,19 @@ | ||
/** | ||
* Automatically add app-providers | ||
* @see https://testing-library.com/docs/react-testing-library/setup#configuring-jest-with-test-utils | ||
*/ | ||
import { render } from '@testing-library/react' | ||
import type { ReactElement } from 'react' | ||
import type {} from '@testing-library/dom/types' | ||
import { AppTestProviders } from './AppTestProviders' | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
const customRender = (ui: ReactElement, options?: any) => | ||
render(ui, { wrapper: AppTestProviders, ...options }) | ||
|
||
// re-export everything | ||
export * from '@testing-library/react' | ||
export { default as userEvent } from '@testing-library/user-event' | ||
|
||
// override render method | ||
export { customRender as render } |
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 |
---|---|---|
|
@@ -30,6 +30,7 @@ module.exports = { | |
'custom-properties': supportsIE11, | ||
}, | ||
}, | ||
cssnano: {}, | ||
} | ||
: {}), | ||
}, | ||
|
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,27 @@ | ||
// This file configures the initialization of Sentry on the server. | ||
// The config you add here will be used whenever the server handles a request. | ||
// https://docs.sentry.io/platforms/javascript/guides/nextjs/ | ||
|
||
import { init as sentryInit } from '@sentry/nextjs' | ||
|
||
sentryInit({ | ||
dsn: process.env.SENTRY_DSN || process.env.NEXT_SENTRY_DSN, | ||
|
||
// Adjust this value in production, or use tracesSampler for greater control | ||
// @see https://develop.sentry.dev/sdk/performance/ | ||
// To turn it off, remove the line | ||
// @see https://github.com/getsentry/sentry-javascript/discussions/4503#discussioncomment-2143116 | ||
tracesSampleRate: ['false', '0'].includes(process.env.NEXT_SENTRY_TRACING ?? '') ? undefined : 1, | ||
|
||
// ... | ||
// Note: if you want to override the automatic release value, do not set a | ||
// `release` value here - use the environment variable `SENTRY_RELEASE`, so | ||
// that it will also get attached to your source maps | ||
beforeSend: async (event, hint) => { | ||
if (process.env.NODE_ENV === 'development') { | ||
console.log('Sentry event', event) | ||
console.log('Sentry hint', hint) | ||
} | ||
return event | ||
}, | ||
}) |
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,3 @@ | ||
defaults.url=https://sentry.io/ | ||
defaults.org=wayofdev | ||
defaults.project=next-starter-tpl |
Oops, something went wrong.
1611944
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.
Successfully deployed to the following URLs:
next-starter-tpl-web – ./apps/web
next-starter-tpl.wayof.dev
next-starter-tpl-web.vercel.app
next-starter-tpl-web-wayofdev.vercel.app
next-starter-tpl-web-git-master-wayofdev.vercel.app
1611944
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.
Successfully deployed to the following URLs:
next-starter-tpl-docs – ./apps/docs
next-starter-tpl-docs-git-master-wayofdev.vercel.app
next-starter-tpl-docs.vercel.app
next-starter-tpl-docs.wayof.dev
next-starter-tpl-docs-wayofdev.vercel.app