Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ updates:
patterns:
- "jotai"
- "jotai-*"
urql:
patterns:
- "urql"
- "@urql/*"
graphql-codegen:
patterns:
- "@graphql-codegen/*"
Expand Down
12 changes: 9 additions & 3 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,25 @@
"crates/**",
"frontend/src/gql/**",
"frontend/src/routeTree.gen.ts",
"frontend/.storybook/locales.ts",
"frontend/locales/*.json",
"frontend/stories/static/**",
"**/coverage/**",
"**/dist/**"
]
},
"formatter": {
"enabled": true,
"useEditorconfig": true,
"ignore": ["frontend/.storybook/locales.ts", "frontend/locales/*.json"]
"useEditorconfig": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
"recommended": true,
"correctness": {
"noUnusedImports": "warn",
"noUnusedVariables": "warn"
}
}
}
}
11 changes: 10 additions & 1 deletion frontend/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
import type { StorybookConfig } from "@storybook/react-vite";

const config: StorybookConfig = {
stories: ["../src/**/*.stories.@(js|jsx|ts|tsx)"],
stories: ["../{src,stories}/**/*.stories.@(js|jsx|ts|tsx)"],

staticDirs: ["../stories/static"],

addons: [
// Automatic docs pages
Expand All @@ -31,6 +33,9 @@ const config: StorybookConfig = {
// Theme switch toolbar
"@storybook/addon-toolbars",

// Interactions
"@storybook/addon-interactions",

// i18next integration
"storybook-react-i18next",
],
Expand All @@ -48,6 +53,10 @@ const config: StorybookConfig = {
docs: {
autodocs: true,
},

env: {
STORYBOOK: "true",
},
};

export default config;
20 changes: 16 additions & 4 deletions frontend/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,25 @@ import type {
Preview,
} from "@storybook/react";
import { TooltipProvider } from "@vector-im/compound-web";
import { initialize, mswLoader } from "msw-storybook-addon";
import { useLayoutEffect } from "react";

import "../src/shared.css";
import i18n from "../src/i18n";
import i18n, { setupI18n } from "../src/i18n";

import { DummyRouter } from "../src/test-utils/router";
import { handlers } from "../tests/mocks/handlers";
import localazyMetadata from "./locales";

initialize(
{
onUnhandledRequest: "bypass",
},
handlers,
);

setupI18n();

export const parameters: Parameters = {
controls: {
matchers: {
Expand Down Expand Up @@ -74,15 +85,15 @@ const withThemeProvider: Decorator = (Story, context) => {
);
};

const withDummyRouter: Decorator = (Story, context) => {
const withDummyRouter: Decorator = (Story, _context) => {
return (
<DummyRouter>
<Story />
</DummyRouter>
);
};

const withTooltipProvider: Decorator = (Story, context) => {
const withTooltipProvider: Decorator = (Story, _context) => {
return (
<TooltipProvider>
<Story />
Expand All @@ -104,13 +115,14 @@ const locales = Object.fromEntries(
);

const preview: Preview = {
globals: {
initialGlobals: {
locale: localazyMetadata.baseLocale,
locales,
},
parameters: {
i18n,
},
loaders: [mswLoader],
};

export default preview;
3 changes: 3 additions & 0 deletions frontend/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ const config: CodegenConfig = {
generates: {
"./src/gql/": {
preset: "client",
plugins: ["typescript-msw"],
config: {
documentMode: "string",
useTypeImports: true,
enumsAsTypes: true,
// By default, unknown scalars are generated as `any`. This is not ideal for catching potential bugs.
defaultScalarType: "unknown",
maybeValue: "T | null | undefined",
scalars: {
DateTime: "string",
Url: "string",
Expand Down
Loading
Loading