From 2ef1d5a9bd3f17271db2d0ba06146b7b18b0c920 Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Fri, 29 Mar 2024 12:14:06 -0400 Subject: [PATCH 01/59] New translations common.json (French) --- public/locales/fr/common.json | 186 ++++++++++++++++++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100644 public/locales/fr/common.json diff --git a/public/locales/fr/common.json b/public/locales/fr/common.json new file mode 100644 index 00000000..8d78ed43 --- /dev/null +++ b/public/locales/fr/common.json @@ -0,0 +1,186 @@ +{ + "about": { + "campaign": "This trans-led digital campaign organized by InReach and GLAAD aims to showcase positive stories from the diverse trans masculine community and increase access to safe, verified resources through the free InReach App.", + "hollister": "And special thanks to <Link>The Hollister Confidence Fund</Link> for their support.", + "stats": { + "stat1-text": "of trans men and trans masculine youth have considered suicide", + "stat1-title": "56%", + "stat2-text": "transgender and nonbinary youth have attempted suicide.", + "stat2-title": "1 in 5", + "stat3-text": "of the U.S. trans population identify as trans men.", + "stat3-title": "36%" + }, + "supporting-partners": "Supporting Partners", + "trans-people": "Trans people are everywhere. This campaign includes stories from trans men and trans masculine adults across the country." + }, + "act": { + "card1": "Participate in this campaign\nWe're currently accepting submissions from trans men and trans masculine adults in the U.S. to share their story.\nClick here to participate.", + "card2": "Help increase resource access for the diverse trans masculine community\nInReach is always looking for new resource suggestions to help expand our free app. Know an organization that is affirming and safe for trans masculine people?\nYou can suggest a resource to be listed on the free InReach App here.", + "card3": "Access affirming resources, 24/7\nUse the free InReach App to access safe, independently verified legal, medical, mental health and social services near you. Click here to find resources. Stay tuned for our new trans men and trans masculine community 'sort by' filter coming soon!" + }, + "artist-credit": "Character drawings by Joey Borrelli.", + "back": "Previous", + "donate": "Donate", + "errors": { + "consent-all-3": "You must consent to all three.", + "min-21": "You must be at least 21 years old to participate.", + "other-val": "Please specify", + "select-min-one": "Select at least one item", + "verify-all-3": "You must verify that all three are true." + }, + "logo-alt": "InReach & GLAAD #TransMascFutures logo", + "main-page": { + "tagline1": "Trans men and trans masculine adults share their stories of trans joy.", + "tagline2": "Trans futures are InReach." + }, + "nav": { + "about": "About", + "act": "Act", + "find-resources": "Find resources", + "gallery": "Gallery", + "home": "Home", + "share": "Share", + "share-your-story": "Share your story", + "stories": "Stories", + "switch-lang": "Haz clic aquí para cambiar a español.", + "switch-lang-short": "Cambiar a español" + }, + "next": "Next", + "page-title": { + "gallery": "Trans Joy: Gallery", + "general": "#TransMascFutures - InReach x GLAAD", + "general-template": "{{page}} - #TransMascFutures - InReach x GLAAD" + }, + "participate": "Click here to participate", + "see-x-stories": "See {{category}} Stories", + "share": { + "download-button": "Download Kit", + "list1": "Multiple 1080 x 1080 PNG graphics", + "list2": "PDF document with sample sharing language", + "press-release": "Press Release", + "subtitle": "For your sharing convenience:", + "title": "Use our #TransMascFutures social media toolkit." + }, + "story": { + "prompt1": "The first moment I could see my future as a trans man or trans masculine person was...", + "prompt2": "Resources that helped me..." + }, + "story-gallery": { + "bipoc": "Trans Masc + BIPOC + Proud", + "disabled": "Trans Masc + Disabled + Proud", + "elder": "Trans Masc + Elder + Proud", + "gallery-joy": "Trans joy: Gallery", + "immigrant": "Trans Masc + Immigrant + Proud", + "queer": "Trans Masc + Queer + Proud", + "transman": "Trans man + Proud", + "transmasc": "Trans Masc / Nonbinary + Proud" + }, + "submit": "Submit", + "survey-form": { + "eligiblity": "Participant eligiblity critera:\nYou are a trans man or a trans masculine person\nYou are 21 years old or over\nYou are currently living anywhere in the United States", + "intro": "InReach is partnering with GLAAD to organize #TransMascFutures. This trans-led digital campaign aims to showcase positive stories from the diverse trans masculine community and increase access to safe, verified resources through the InReach App. The #TransMascFutures Campaign launched on June 7th, 2023. Submit this form to add your story to the campaign website.", + "prefer-not-answer": "Prefer not to answer", + "q1": "You verify that the following is true (check all that apply):", + "q1-opts": { + "00_transmasc": "I am a trans man or trans masculine person", + "01_over21": "I am at least 21 years old", + "02_us": "I currently live in the United States" + }, + "q10": "Which gender-related terms best describe your personal identity?
(Select all that apply.)", + "q10-opts": { + "00_transman": "Trans man or male", + "01_transmasc": "Trans Masculine ", + "02_nonbinary": "Nonbinary", + "03_genderfluid": "Genderfluid or Genderqueer", + "04_afab": "Assigned Female at Birth (AFAB)", + "05_other": "Other (please specify)" + }, + "q11": "Select how you describe your sexual orientation.
(Select all that apply.)", + "q11-opts": { + "00_straight": "Straight/Heterosexual", + "01_gay": "Gay", + "02_lesbian": "Lesbian", + "03_bisexual": "Bisexual", + "04_pansexual": "Pansexual", + "05_asexual": "Asexual/Demisexual/Ace", + "06_queer": "Queer", + "07_other": "Other (please specify)" + }, + "q12": "Select how you identify your race/ethnicity.
(Select all that apply.)", + "q12-opts": { + "00_indigenous": "American Indian/Native American/Indigenous People", + "01_asian": "Asian/Asian American", + "02_biracial": "Biracial/Multiracial", + "03_black": "Black/African American", + "04_latinx": "Latino/a/x/e/Hispanic", + "05_AME": "Middle Eastern/North African", + "06_hawaii-pacific": "Native Hawaiian/Pacific Islander", + "07_south-asian": "South Asian", + "08_white": "White", + "09_no-answer": "Prefer not to answer", + "10_other": "Other (please specify)" + }, + "q13": "Select which U.S. region you live in.", + "q13-opts": { + "00_northeast": "Northeast", + "01_midwest": "Midwest", + "02_southeast": "Southeast", + "03_southwest": "Southwest", + "04_west": "West Coast ", + "05_territories": "U.S. Territories ", + "06_no-answer": "Prefer not to answer" + }, + "q14": "Select which U.S. state you live in.", + "q15": "Do you identify as any of the following?
(Select all that apply.)", + "q15-opts": { + "00_asylum-seeker": "Asylum seeker", + "01_asylee": "Asylee (received asylum)", + "02_daca": "DACA recipient", + "03_resettled": "Resettled refugee", + "04_other": "Other immigrant", + "05_no-answer": "Prefer not to answer", + "06_none": "I do not identify as any of these" + }, + "q2": "I consent to having my submission shared by InReach via", + "q2-opts": { + "00_website": "#TransMascFutures Campaign Website", + "01_social": "Social Media (@weareinreach across socials) ", + "02_media": "Media/Press" + }, + "q3": "Please provide your email address if you would like to stay updated on the status of the #TransMascFutures Campaign.", + "q4": " Please enter your name as you would like it to appear on the campaign website.
(Only a first name will be displayed. Aliases are welcome.)", + "q5": "I identify as:
(Please select all that apply to you)", + "q5-opts": { + "00_transman": "Trans Man ", + "01_transmasc": "Nonbinary/Trans Masculine", + "02_queer": "Queer (i.e., identify your sexual orientation as something other than heterosexual)", + "03_elder": "Elder (i.e., came out or transitioned before the year 2000)", + "04_disabled": "Disabled (i.e., physical, mental, invisible disability", + "05_immigrant": "Immigrant (i.e., asylum seeker, asylee, resettled refugee, DACA recipient, etc.)", + "06_bipoc": "BIPOC (i.e., non-white, Person of Color)" + }, + "q6": "How old are you?", + "q7": "Select which pronouns you use:", + "q7-opts": { + "00_he": "He/Him/His", + "01_they": "They/Them/Theirs", + "02_ze": "Ze/Hir/Hirs", + "03_xe": "Xe/Xem/Xyr", + "04_ey": "Ey/Em/Eir", + "05_none": "No Pronouns", + "06_any": "Any Pronouns", + "07_other": "Other (please specify)" + }, + "q8": "Describe the first moment you could see your future as a trans man or trans masculine person.", + "q9": "What resources have helped you see your future as a trans man or trans masculine adult?
*Note: To maximize safety, please refrain from sharing personally identifying information, such as naming specific doctors or small clinics.", + "section2": "This section will ask you questions about yourself and your experiences. Please limit your responses to each question to 250 words or less.", + "section3": "This section helps to ensure diversity within our responses to represent the range of differences in trans masculine experiences.", + "step1": "Campaign Participation Requirements and Consent", + "step2": "Campaign Story Questions", + "step3": "Demographic Information (optional)", + "step4": "Confirmation", + "switch-lang": "Haz clic aquí para la versión en español de la encuesta.", + "thank-you": "Thank you for sharing your story!
Assuming your submission meets our participant eligibility criteria, we will add your story to our campaign website shortly. In the meantime, be sure to follow @weareinreach on social media for updates and download our campaign social media toolkit to share the campaign.

If you have any questions, please email marketing@inreach.org." + }, + "vercel": "Powered by Vercel" +} \ No newline at end of file From 44a18f2d0d579d2cb2f8de0c43a71c6c7591647c Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:41:06 +0000 Subject: [PATCH 02/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From 710f936346e337f02f6b95d1c1e3a8cb7534f959 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:41:22 +0000 Subject: [PATCH 03/59] style: format code with Prettier This commit fixes the style issues introduced in 44a18f2 according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From 7f696ae490c43d6c324c3f74e06a9c895f9ceb19 Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:42:04 +0000 Subject: [PATCH 04/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From b58039b515db7c153900be66518f30b824102b82 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:42:19 +0000 Subject: [PATCH 05/59] style: format code with Prettier This commit fixes the style issues introduced in 7f696ae according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From a1e7e9f43a2a30250c6233b8cac07382dc4bf961 Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:43:01 +0000 Subject: [PATCH 06/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From b1956837bd80a0aee2b3534211a76897ef9060c9 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:43:23 +0000 Subject: [PATCH 07/59] style: format code with Prettier This commit fixes the style issues introduced in a1e7e9f according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From 90fecff37d320be8877a50f462e6234606791b49 Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:44:03 +0000 Subject: [PATCH 08/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From 7049589293be7654a8cad15a28a8919ca23469ea Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:44:19 +0000 Subject: [PATCH 09/59] style: format code with Prettier This commit fixes the style issues introduced in 90fecff according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From 34348dbf22d2ec34447eadb977607e5528717a1f Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:45:08 +0000 Subject: [PATCH 10/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From dfd343226710dfb126f9a5eb910937e3a47c5aff Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:45:25 +0000 Subject: [PATCH 11/59] style: format code with Prettier This commit fixes the style issues introduced in 34348db according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From 6ee924d8bbbf9eb17cafc22d9d3f3e0addd7832e Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:46:13 +0000 Subject: [PATCH 12/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From 0dcd651a2a09ed94d6b72652e284512aa11db550 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:46:39 +0000 Subject: [PATCH 13/59] style: format code with Prettier This commit fixes the style issues introduced in 6ee924d according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From 822055c221834b2ae6b7823364bbbb40039d3b10 Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:47:23 +0000 Subject: [PATCH 14/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From c1c87f01bd2da56e1e5ed49a038a43d0e692126d Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:47:38 +0000 Subject: [PATCH 15/59] style: format code with Prettier This commit fixes the style issues introduced in 822055c according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From 0871324875c8f1940267b89038656ead341c5e34 Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:48:18 +0000 Subject: [PATCH 16/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From 87e7f31be9734b82baecf1002642acb2436b4bcd Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:48:37 +0000 Subject: [PATCH 17/59] style: format code with Prettier This commit fixes the style issues introduced in 0871324 according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From 981acb959872319804e62bc95f9b5d8d70025b72 Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:49:18 +0000 Subject: [PATCH 18/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From f6f1601cbfc617f7cd8ffd45c2cf23022283b1eb Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:49:32 +0000 Subject: [PATCH 19/59] style: format code with Prettier This commit fixes the style issues introduced in 981acb9 according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From 14107cc13a4882294df67042a8dfe4c035353de1 Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:50:13 +0000 Subject: [PATCH 20/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From 0f53db09368fe4d70ee649e31d9d72a156223cd4 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:50:29 +0000 Subject: [PATCH 21/59] style: format code with Prettier This commit fixes the style issues introduced in 14107cc according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From daa77d309327dcebcc3dffe03ad389aa18058c67 Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:51:10 +0000 Subject: [PATCH 22/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From 0aa57d6c080a17faacfea5507e0933a5bcbb9e5e Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:51:26 +0000 Subject: [PATCH 23/59] style: format code with Prettier This commit fixes the style issues introduced in daa77d3 according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From 994edfceab3d09fad0352ea59238adfa6d65a4f6 Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:52:07 +0000 Subject: [PATCH 24/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From c12fb0d5f4eb6a62d1e87df5497ea27f9074e4f5 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:52:25 +0000 Subject: [PATCH 25/59] style: format code with Prettier This commit fixes the style issues introduced in 994edfc according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From c281daf6775c149cda0f9d2819f6221902c04d82 Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:53:12 +0000 Subject: [PATCH 26/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From 5b0725db0a20b20548a0bec53eee19dbbd57fdcf Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:53:28 +0000 Subject: [PATCH 27/59] style: format code with Prettier This commit fixes the style issues introduced in c281daf according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From b415d9c44bbc84918af68cf13307d4fa691b026f Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:54:27 +0000 Subject: [PATCH 28/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From 5f53b45727a810e4dd9d22e067e623fd1f56a9b9 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:54:42 +0000 Subject: [PATCH 29/59] style: format code with Prettier This commit fixes the style issues introduced in b415d9c according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From c6d91d6f661fce4333b85cc55d309c0ed15bd6af Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:55:32 +0000 Subject: [PATCH 30/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From 7507eb3e6590b1d9ec446f4092e25899933bafc1 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:55:48 +0000 Subject: [PATCH 31/59] style: format code with Prettier This commit fixes the style issues introduced in c6d91d6 according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From 6e06c18be3e2ee913c22c788f52bcf322d0ccfbc Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:56:34 +0000 Subject: [PATCH 32/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From 262d7aced03bf8f3405ceff0d29649bf4664d9e1 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:56:51 +0000 Subject: [PATCH 33/59] style: format code with Prettier This commit fixes the style issues introduced in 6e06c18 according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From a63d02bf5e9dedeebd1fee0e52cdf6183481152a Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:57:33 +0000 Subject: [PATCH 34/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From ce09fb90049f2c930ffd76b58313710d6883853c Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:57:48 +0000 Subject: [PATCH 35/59] style: format code with Prettier This commit fixes the style issues introduced in a63d02b according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From f883c78ca6e9b249259be42433f4969d96cc8b48 Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:58:39 +0000 Subject: [PATCH 36/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From b74b499e4f9bb252efe2a7c5f19b82828e977d57 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:58:55 +0000 Subject: [PATCH 37/59] style: format code with Prettier This commit fixes the style issues introduced in f883c78 according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From 22a3369f863b499bab5785372f1b8effda779e0d Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:59:42 +0000 Subject: [PATCH 38/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From 717e0cff96abe28fe3607c90cd7a9ac26e61151f Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:00:05 +0000 Subject: [PATCH 39/59] style: format code with Prettier This commit fixes the style issues introduced in 22a3369 according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From ba3b26096f69edd011e854e3fa79c568b03dd745 Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:00:52 +0000 Subject: [PATCH 40/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From 5e62f01ac8a495077c028d4101147a8c3d4689f0 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:01:09 +0000 Subject: [PATCH 41/59] style: format code with Prettier This commit fixes the style issues introduced in ba3b260 according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From 6f1fd74f3afed0207179856d84efd0c48aa58bc3 Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:01:50 +0000 Subject: [PATCH 42/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From 297f9ff0594dfcd27fdd5559a4447289bac9dae6 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:02:12 +0000 Subject: [PATCH 43/59] style: format code with Prettier This commit fixes the style issues introduced in 6f1fd74 according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From 7097427faa88aaa6dcfb728fffc6387b48430243 Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:02:58 +0000 Subject: [PATCH 44/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From 620c96ef411fd6cb871710382c996b35b93813bb Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:03:14 +0000 Subject: [PATCH 45/59] style: format code with Prettier This commit fixes the style issues introduced in 7097427 according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From 0caaae486dcb97873d7742e7dcb94f608118cea7 Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:03:58 +0000 Subject: [PATCH 46/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From f1dadfa9336f03d9169fd494c2bd3b32aeba8b8b Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:04:15 +0000 Subject: [PATCH 47/59] style: format code with Prettier This commit fixes the style issues introduced in 0caaae4 according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From 5c5d4e28f0dd261713d030ac6215f5c6c0f6b470 Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:05:00 +0000 Subject: [PATCH 48/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From 16b13fc0f2c7f76b81c1b75c518300ab6fde054a Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:05:18 +0000 Subject: [PATCH 49/59] style: format code with Prettier This commit fixes the style issues introduced in 5c5d4e2 according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From 9e4e8ff0e3dcc252f14904783002ad220cb03e33 Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:06:00 +0000 Subject: [PATCH 50/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From 7f498aa4cd1d3b120a4c5b4ed2c4b9c36470ec1d Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:06:20 +0000 Subject: [PATCH 51/59] style: format code with Prettier This commit fixes the style issues introduced in 9e4e8ff according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From 21586b9faa158594fe4fcb0616e68b53cf202d96 Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:07:01 +0000 Subject: [PATCH 52/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From 7ac159247e834dec186640c04ac47dae918ceba9 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:07:17 +0000 Subject: [PATCH 53/59] style: format code with Prettier This commit fixes the style issues introduced in 21586b9 according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From b62bddbe58e04fa57401693b2b279ce35bae89b8 Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:08:01 +0000 Subject: [PATCH 54/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From b505e6c4857df1efb4c184779562206674930ae1 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:08:17 +0000 Subject: [PATCH 55/59] style: format code with Prettier This commit fixes the style issues introduced in b62bddb according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From 3f4b9d1cac4e052601fdeac3c955b7d9b0e1b530 Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:08:58 +0000 Subject: [PATCH 56/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From b88eba6f49e08e7ce2cb146968bc68ff7275d487 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:09:14 +0000 Subject: [PATCH 57/59] style: format code with Prettier This commit fixes the style issues introduced in 3f4b9d1 according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr; From 617b392a940d336f289a426778e119fa4525811f Mon Sep 17 00:00:00 2001 From: "InReach [bot]" <108850934+InReach-svc@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:09:56 +0000 Subject: [PATCH 58/59] chore: lint & format Signed-off-by: InReach [bot] <108850934+InReach-svc@users.noreply.github.com> --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 +++++++++++++---------------- 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 6addc407..429d8ad4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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'))) } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 14d43838..e01ec016 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: "en", + locale: 'en', locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -}; -const mantineProviderProps: Omit = { +} +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -}; +} const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ); -}; + ) +} export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -]; +] type DecoratorProps = { - children: ReactNode; -}; + children: ReactNode +} diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 10f72349..17572a98 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: "wrap", + formatOutput: 'wrap', timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,21 +42,17 @@ const jobs = new Listr( 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; + error?: boolean +} +export type PassedTask = ListrTaskWrapper +export type ListrJob = ListrTaskObj export type ListrTask = ( ctx: Context, - task: PassedTask, -) => void | Promise> | Listr; + task: PassedTask +) => void | Promise> | Listr From add6b1cecbb1b4b740e91636130030c8c5d31c9a Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:10:12 +0000 Subject: [PATCH 59/59] style: format code with Prettier This commit fixes the style issues introduced in 617b392 according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr;