Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: format code with Prettier #394

Closed
wants to merge 80 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
d62c1b6
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
e878e1a
chore: lint & format
InReach-svc Apr 11, 2024
6285262
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
9567cf6
chore: lint & format
InReach-svc Apr 11, 2024
5f9ee93
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
2c8cd1f
chore: lint & format
InReach-svc Apr 11, 2024
1eb324f
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
4b8d8a9
chore: lint & format
InReach-svc Apr 11, 2024
aee3399
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
913b07d
chore: lint & format
InReach-svc Apr 11, 2024
24708f3
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
b5221a0
chore: lint & format
InReach-svc Apr 11, 2024
b6a4843
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
521e84c
chore: lint & format
InReach-svc Apr 11, 2024
2d3c022
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
5f3f6d8
chore: lint & format
InReach-svc Apr 11, 2024
332feac
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
373cdf2
chore: lint & format
InReach-svc Apr 11, 2024
5f9a688
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
d5d48a1
chore: lint & format
InReach-svc Apr 11, 2024
4efedf9
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
cd28c34
chore: lint & format
InReach-svc Apr 11, 2024
6fc32d5
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
bb75403
chore: lint & format
InReach-svc Apr 11, 2024
fd3c757
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
b30eaed
chore: lint & format
InReach-svc Apr 11, 2024
21dc965
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
f6164ff
chore: lint & format
InReach-svc Apr 11, 2024
832aea5
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
6f86c45
chore: lint & format
InReach-svc Apr 11, 2024
5b5c2b0
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
5edf485
chore: lint & format
InReach-svc Apr 11, 2024
2edcc6d
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
064fcf6
chore: lint & format
InReach-svc Apr 11, 2024
77b5cd3
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
d9b6e82
chore: lint & format
InReach-svc Apr 11, 2024
723a461
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
10ce2fb
chore: lint & format
InReach-svc Apr 11, 2024
22de239
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
acc591d
chore: lint & format
InReach-svc Apr 11, 2024
a2f1f26
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
d53e527
chore: lint & format
InReach-svc Apr 11, 2024
7a6d192
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
7fcdd3c
chore: lint & format
InReach-svc Apr 11, 2024
128a10c
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
f769ea5
chore: lint & format
InReach-svc Apr 11, 2024
20edacd
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
a2e9fe1
chore: lint & format
InReach-svc Apr 11, 2024
16d5f7b
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
0f08f1e
chore: lint & format
InReach-svc Apr 11, 2024
35b22a3
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
bdb1904
chore: lint & format
InReach-svc Apr 11, 2024
592c789
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
cbbddf2
chore: lint & format
InReach-svc Apr 11, 2024
2425921
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
6cf8d38
chore: lint & format
InReach-svc Apr 11, 2024
a750959
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
b0471ae
chore: lint & format
InReach-svc Apr 11, 2024
d20379f
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
8eebf66
chore: lint & format
InReach-svc Apr 11, 2024
c6b704c
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
4bd9381
chore: lint & format
InReach-svc Apr 11, 2024
8cd9e4e
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
82f68dc
chore: lint & format
InReach-svc Apr 11, 2024
4423fba
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
b1cad5b
chore: lint & format
InReach-svc Apr 11, 2024
358a929
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
c171b73
chore: lint & format
InReach-svc Apr 11, 2024
1c73c13
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
513c034
chore: lint & format
InReach-svc Apr 11, 2024
a67bccb
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
57457d9
chore: lint & format
InReach-svc Apr 11, 2024
5fe4b02
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
40c9b7c
chore: lint & format
InReach-svc Apr 11, 2024
c5b82ce
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
c56714e
chore: lint & format
InReach-svc Apr 11, 2024
a7b7ee9
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
0f8e500
chore: lint & format
InReach-svc Apr 11, 2024
d4f4f2c
style: format code with Prettier
deepsource-autofix[bot] Apr 11, 2024
d97d042
chore: lint & format
InReach-svc Apr 11, 2024
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
38 changes: 19 additions & 19 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
import { type StorybookConfig } from "@storybook/nextjs";
import { merge } from "merge-anything";
import { type StorybookConfig } from '@storybook/nextjs'
import { merge } from 'merge-anything'

import { dirname, join } from "path";
import { dirname, join } from 'path'

const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
staticDirs: [
{
from: "../public",
to: "/",
from: '../public',
to: '/',
},
],
addons: [
getAbsolutePath("@storybook/addon-a11y"),
getAbsolutePath("@storybook/addon-links"),
getAbsolutePath("@storybook/addon-essentials"),
getAbsolutePath("@storybook/addon-interactions"),
getAbsolutePath('@storybook/addon-a11y'),
getAbsolutePath('@storybook/addon-links'),
getAbsolutePath('@storybook/addon-essentials'),
getAbsolutePath('@storybook/addon-interactions'),
],
framework: {
name: "@storybook/nextjs",
name: '@storybook/nextjs',
options: {},
},
docs: {
autodocs: "tag",
autodocs: 'tag',
},
typescript: {
check: true,
reactDocgen: "react-docgen-typescript", //'react-docgen-typescript',
reactDocgen: 'react-docgen-typescript', //'react-docgen-typescript',
reactDocgenTypescriptOptions: {
shouldExtractLiteralValuesFromEnum: true,
shouldExtractValuesFromUnion: true,
Expand All @@ -42,14 +42,14 @@ const config: StorybookConfig = {
// 'next-i18next': 'react-i18next',
},
},
};
const mergedConfig = merge(config, configAdditions);
return mergedConfig;
}
const mergedConfig = merge(config, configAdditions)
return mergedConfig
},
};
}

export default config;
export default config

function getAbsolutePath(value: string): string {
return dirname(require.resolve(join(value, "package.json")));
return dirname(require.resolve(join(value, 'package.json')))
}
38 changes: 19 additions & 19 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
import { Global, MantineProvider } from "@mantine/core";
import { type MantineProviderProps } from "@mantine/core";
import { INITIAL_VIEWPORTS } from "@storybook/addon-viewport";
import { type StoryFn } from "@storybook/react";
import { type ReactNode } from "react";
import { I18nextProvider } from "react-i18next";
import { Global, MantineProvider } from '@mantine/core'
import { type MantineProviderProps } from '@mantine/core'
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport'
import { type StoryFn } from '@storybook/react'
import { type ReactNode } from 'react'
import { I18nextProvider } from 'react-i18next'

import { i18n, i18nLocales } from "./i18next";
import { storybookFont } from "../src/styles";
import { theme } from "../src/styles/theme";
import { i18n, i18nLocales } from './i18next'
import { storybookFont } from '../src/styles'
import { theme } from '../src/styles/theme'

export const parameters = {
layout: "centered",
layout: 'centered',
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
i18n,
locale: "en",
locale: 'en',
locales: i18nLocales,
viewport: {
viewports: INITIAL_VIEWPORTS,
},
};
const mantineProviderProps: Omit<MantineProviderProps, "children"> = {
}
const mantineProviderProps: Omit<MantineProviderProps, 'children'> = {
withCSSVariables: false,
withGlobalStyles: true,
withNormalizeCSS: false,
};
}

const ThemeWrapper = ({ children }: DecoratorProps) => {
return (
Expand All @@ -38,17 +38,17 @@ const ThemeWrapper = ({ children }: DecoratorProps) => {
<I18nextProvider i18n={i18n}>{children}</I18nextProvider>
{/* </TypographyStylesProvider> */}
</MantineProvider>
);
};
)
}

export const decorators = [
(Story: StoryFn) => (
<ThemeWrapper>
<Story />
</ThemeWrapper>
),
];
]

type DecoratorProps = {
children: ReactNode;
};
children: ReactNode
}
32 changes: 14 additions & 18 deletions prisma/dataMigrationRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import {
type ListrTaskWrapper,
PRESET_TIMER,
PRESET_TIMESTAMP,
} from "listr2";
} from 'listr2'

import * as jobList from "./data-migrations";
import * as jobList from './data-migrations'

/**
* Job Runner
Expand All @@ -22,18 +22,18 @@ const rendererOptions = {
outputBar: 10,
persistentOutput: true,
timer: PRESET_TIMER,
} satisfies ListrJob["rendererOptions"];
} satisfies ListrJob['rendererOptions']

const injectOptions = (job: ListrJob): ListrJob => ({
...job,
rendererOptions,
});
})

const jobs = new Listr<Context>(
Object.values(jobList).map((job) => injectOptions(job)),
{
rendererOptions: {
formatOutput: "wrap",
formatOutput: 'wrap',
timer: PRESET_TIMER,
suffixSkips: true,
},
Expand All @@ -42,21 +42,17 @@ const jobs = new Listr<Context>(
timestamp: PRESET_TIMESTAMP,
},
exitOnError: false,
},
);
}
)

jobs.run();
jobs.run()

export type Context = {
error?: boolean;
};
export type PassedTask = ListrTaskWrapper<
Context,
ListrDefaultRenderer,
ListrDefaultRenderer
>;
export type ListrJob = ListrTaskObj<Context, ListrDefaultRenderer>;
error?: boolean
}
export type PassedTask = ListrTaskWrapper<Context, ListrDefaultRenderer, ListrDefaultRenderer>
export type ListrJob = ListrTaskObj<Context, ListrDefaultRenderer>
export type ListrTask = (
ctx: Context,
task: PassedTask,
) => void | Promise<void | Listr<Context, any, any>> | Listr<Context, any, any>;
task: PassedTask
) => void | Promise<void | Listr<Context, any, any>> | Listr<Context, any, any>
28 changes: 22 additions & 6 deletions src/server/api/routers/stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ export const storyRouter = createTRPCRouter({
tag: category.tag,
},
})),
pronouns: pronouns.map(({ pronoun }) => ({ pronoun: pronoun.pronounsEN })),
pronouns: pronouns.map(({ pronoun }) => ({
pronoun: pronoun.pronounsEN,
})),
}
return formatted
}
Expand Down Expand Up @@ -107,7 +109,9 @@ export const storyRouter = createTRPCRouter({
tag: category.tag,
},
})),
pronouns: pronouns.map(({ pronoun }) => ({ pronoun: pronoun.pronounsES })),
pronouns: pronouns.map(({ pronoun }) => ({
pronoun: pronoun.pronounsES,
})),
}
return formatted
}),
Expand Down Expand Up @@ -159,7 +163,13 @@ export const storyRouter = createTRPCRouter({
return formatted
}),
getByCategory: publicProcedure
.input(z.object({ tag: z.string(), take: z.number().optional(), locale: z.enum(['en', 'es']) }))
.input(
z.object({
tag: z.string(),
take: z.number().optional(),
locale: z.enum(['en', 'es']),
})
)
.query(async ({ ctx, input }) => {
if (input.locale === 'en') {
const stories = await ctx.prisma.story.findMany({
Expand All @@ -173,7 +183,9 @@ export const storyRouter = createTRPCRouter({
categories: {
select: { category: { select: { categoryEN: true, id: true } } },
},
pronouns: { select: { pronoun: { select: { id: true, pronounsEN: true } } } },
pronouns: {
select: { pronoun: { select: { id: true, pronounsEN: true } } },
},
response1EN: true,
response2EN: true,
},
Expand Down Expand Up @@ -204,8 +216,12 @@ export const storyRouter = createTRPCRouter({
select: {
id: true,
name: true,
categories: { select: { category: { select: { categoryES: true, id: true } } } },
pronouns: { select: { pronoun: { select: { id: true, pronounsES: true } } } },
categories: {
select: { category: { select: { categoryES: true, id: true } } },
},
pronouns: {
select: { pronoun: { select: { id: true, pronounsES: true } } },
},
response1ES: true,
response2ES: true,
},
Expand Down