Skip to content

Commit

Permalink
chore: Recover storybooks (#33565)
Browse files Browse the repository at this point in the history
  • Loading branch information
tassoevan authored Oct 15, 2024
1 parent 2b84a46 commit e476624
Show file tree
Hide file tree
Showing 301 changed files with 3,832 additions and 8,817 deletions.
10 changes: 5 additions & 5 deletions .vscode/client.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
"scope": "typescriptreact",
"prefix": "sbmodule",
"body": [
"import type { ComponentMeta, ComponentStory } from '@storybook/react';",
"import type { Meta, StoryFn } from '@storybook/react';",
"import React from 'react';",
"",
"import $1 from './$1';",
"",
"export default {",
"\ttitle: '$2',",
"\tcomponent: $1,",
"} as ComponentMeta<typeof $1>;",
"} satisfies Meta<typeof $1>;",
"",
"export const Example: ComponentStory<typeof $1> = (args) => <$1 {...args} />;",
"export const Example: StoryFn<typeof $1> = (args) => <$1 {...args} />;",
]
},
"Storybook meta": {
Expand All @@ -23,14 +23,14 @@
"export default {",
"\ttitle: '$1',",
"\tcomponent: $2,",
"} as ComponentMeta<typeof $2>;"
"} satisfies Meta<typeof $2>;"
]
},
"Storybook story": {
"scope": "typescriptreact",
"prefix": "sbstory",
"body": [
"export const $1: ComponentStory<typeof $2> = (args) => <$2 {...args} />;"
"export const $1: StoryFn<typeof $2> = (args) => <$2 {...args} />;"
]
}
}

This file was deleted.

13 changes: 0 additions & 13 deletions .yarn/patches/preact-npm-10.15.1-bd458de913.patch

This file was deleted.

11 changes: 10 additions & 1 deletion apps/meteor/.babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"],
"presets": [
"@babel/preset-env",
"@babel/preset-react",
[
"@babel/preset-typescript",
{
"allowDeclareFields": true
}
]
],
"env": {
"coverage": {
"plugins": [
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
!/.mocharc.js
!/.mocharc.*.js
!/.scripts/
#!/.storybook/
!/.storybook/
!/client/.eslintrc.js
!/ee/client/.eslintrc.js
2 changes: 1 addition & 1 deletion apps/meteor/.scripts/translation-check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const parseFile = async (path: PathLike) => {
throw new SyntaxError(`Invalid JSON on file ${path}:${line}:${column}`);
}
}
throw new SyntaxError(`Invalid JSON on file ${path}: ${e.message}`);
throw new SyntaxError(`Invalid JSON on file ${path}: ${(e as Error).message}`);
}

if (hasDuplicatedKeys(content, json)) {
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/.scripts/translation-diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ async function translationDiff(source: string, target: string) {
console.debug('loading translations from', translationDir);

function diffKeys(a: Record<string, string>, b: Record<string, string>) {
const diff = {};
const diff: Record<string, string> = {};
Object.keys(a).forEach((key) => {
if (!b[key]) {
diff[key] = a[key];
Expand Down
3 changes: 0 additions & 3 deletions apps/meteor/.storybook/.eslintrc.json

This file was deleted.

6 changes: 2 additions & 4 deletions apps/meteor/.storybook/decorators.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import { mockAppRoot } from '@rocket.chat/mock-providers';
import type { DecoratorFunction } from '@storybook/addons';
import type { ReactElement } from 'react';
import type { Decorator } from '@storybook/react';
import React from 'react';

import ModalContextMock from '../client/stories/contexts/ModalContextMock';
import QueryClientProviderMock from '../client/stories/contexts/QueryClientProviderMock';
import RouterContextMock from '../client/stories/contexts/RouterContextMock';
import ServerContextMock from '../client/stories/contexts/ServerContextMock';
import TranslationContextMock from '../client/stories/contexts/TranslationContextMock';

const MockedAppRoot = mockAppRoot().build();

export const rocketChatDecorator: DecoratorFunction<ReactElement<unknown>> = (fn, { parameters }) => {
export const rocketChatDecorator: Decorator = (fn, { parameters }) => {
const linkElement = document.getElementById('theme-styles') || document.createElement('link');
if (linkElement.id !== 'theme-styles') {
require('../app/theme/client/main.css');
Expand Down
86 changes: 0 additions & 86 deletions apps/meteor/.storybook/main.js

This file was deleted.

Loading

0 comments on commit e476624

Please sign in to comment.