1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2025-05-29 22:37:44 +02:00

chore: config updates

This commit is contained in:
2024-10-12 23:51:58 +02:00
parent 12f1d6cdf2
commit 0a7094005c
36 changed files with 2797 additions and 2709 deletions

View File

@ -7,7 +7,11 @@ const config: StorybookConfig = {
docs: {
defaultName: "Documentation",
},
stories: ["../../../packages/**/*.stories.tsx", "../stories/*.mdx"],
stories: [
"../../../packages/ui/src/**/*.stories.tsx",
"../../../packages/blog/src/**/*.stories.tsx",
"../stories/*.mdx",
],
addons: [
"@storybook/addon-essentials",
"@storybook/addon-storysource",

View File

@ -1,7 +1,7 @@
import "@repo/config-tailwind/styles.css"
import { defaultTranslationValues } from "@repo/i18n/config"
import i18nMessagesEnglish from "@repo/i18n/translations/en-US.json"
import type { Locale } from "@repo/utils/constants"
import { LOCALE_DEFAULT } from "@repo/utils/constants"
import type { Preview } from "@storybook/react"
import { NextIntlClientProvider } from "next-intl"
import { ThemeProvider as NextThemeProvider } from "next-themes"
@ -25,6 +25,7 @@ const preview: Preview = {
stylePreview: true,
},
controls: {
disableSaveFromUI: true,
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
@ -33,14 +34,13 @@ const preview: Preview = {
},
decorators: [
(Story) => {
const locale = "en-US" satisfies Locale
return (
<NextThemeProvider enableColorScheme={false}>
<NextIntlClientProvider
messages={i18nMessagesEnglish}
locale={locale}
locale={LOCALE_DEFAULT}
defaultTranslationValues={defaultTranslationValues}
timeZone={process.env["TZ"] ?? "UTC"}
>
<Story />
</NextIntlClientProvider>

View File

@ -7,9 +7,9 @@
"build": "storybook build",
"dev": "storybook dev --port 6006 --no-open",
"start": "http-server \"storybook-static\" --port 6006 --silent",
"test": "start-server-and-test \"dev\" http://127.0.0.1:6006 \"test:storybook\"",
"test:storybook": "test-storybook",
"test:storybook-coverage": "test-storybook --coverage",
"test": "start-server-and-test \"start\" http://127.0.0.1:6006 \"test:storybook\"",
"test:dev": "start-server-and-test \"dev\" http://127.0.0.1:6006 \"test:storybook\"",
"test:storybook": "test-storybook --testTimeout=60000 --maxWorkers=2",
"chromatic": "chromatic"
},
"dependencies": {

View File

@ -2,7 +2,11 @@ import sharedConfig from "@repo/config-tailwind"
/** @type {Pick<import('tailwindcss').Config, "presets" | "content">} */
const config = {
content: [".storybook/preview.tsx", "../../packages/*/src/**/*.tsx"],
content: [
".storybook/preview.tsx",
"../../packages/ui/src/**/*.tsx",
"../../packages/blog/src/**/*.tsx",
],
presets: [sharedConfig],
}

View File

@ -0,0 +1,9 @@
{
"$schema": "https://turbo.build/schema.json",
"extends": ["//"],
"tasks": {
"test": {
"dependsOn": ["^test", "build"]
}
}
}