diff --git a/apps/app/src/App.tsx b/apps/app/src/App.tsx index 88dcd88..298f0b0 100644 --- a/apps/app/src/App.tsx +++ b/apps/app/src/App.tsx @@ -1,10 +1,5 @@ -import React, { useEffect, useMemo } from "react"; -import { - Outlet, - useNavigate, - useParams, - useSearchParams, -} from "react-router-dom"; +import _React, { useEffect, useMemo } from "react"; +import { Outlet, useSearchParams } from "react-router-dom"; import { AppShell, Navbar, Header, Flex, Modal, Box } from "@mantine/core"; import { useDisclosure } from "@mantine/hooks"; import { useSnapshot } from "valtio"; @@ -36,12 +31,9 @@ import { notifications } from "@mantine/notifications"; function App() { const configSnapshot = useSnapshot(config); - const remoteConfigSnapshot = useSnapshot(remoteConfig); - const remoteMetadataSnapshot = useSnapshot(remoteMetadata); - const [searchParams, setSearchParams] = useSearchParams(); - const navigate = useNavigate(); - - const hasLoggedInParam = searchParams.has("logged_in"); + useSnapshot(remoteConfig); + useSnapshot(remoteMetadata); + const [_searchParams, setSearchParams] = useSearchParams(); const [ hostingConfigModalOpened, @@ -55,14 +47,7 @@ function App() { } }, []); - const { - accessToken, - repositoryName, - owner, - targetBranch, - shouldCreatePullRequest, - branchNamePrefix, - } = + const { accessToken, repositoryName, owner, targetBranch } = config.hosting.provider === "github" ? config.hosting : { @@ -70,8 +55,6 @@ function App() { repositoryName: "", owner: "", targetBranch: "", - shouldCreatePullRequest: true, - branchNamePrefix: "", }; const groups = config.groups; @@ -243,8 +226,8 @@ function App() { if (cleanConfig.hosting.providerType === "git") { cleanConfig.hosting.accessToken = ""; } else if (cleanConfig.hosting.providerType === "direct") { - cleanConfig.hosting.accessKeyId = ""; - cleanConfig.hosting.secretAccessKey = ""; + // cleanConfig.hosting.accessKeyId = ""; + // cleanConfig.hosting.secretAccessKey = ""; } cleanConfig.groups = cleanConfig.groups.map((group) => { diff --git a/apps/app/src/components/CustomCard.tsx b/apps/app/src/components/CustomCard.tsx index 1991010..4db17e7 100644 --- a/apps/app/src/components/CustomCard.tsx +++ b/apps/app/src/components/CustomCard.tsx @@ -1,4 +1,4 @@ -import React, { PropsWithChildren, ReactNode } from "react"; +import _React, { PropsWithChildren, ReactNode } from "react"; import { Box, Flex, Text } from "@mantine/core"; import { CustomTooltip } from "./CustomTooltip"; diff --git a/apps/app/src/components/CustomList.tsx b/apps/app/src/components/CustomList.tsx index f1fcaa3..0582fe7 100644 --- a/apps/app/src/components/CustomList.tsx +++ b/apps/app/src/components/CustomList.tsx @@ -1,5 +1,5 @@ -import React, { ReactNode } from "react"; -import { Outlet, Link, NavLink } from "react-router-dom"; +import _React, { ReactNode } from "react"; +import { Link } from "react-router-dom"; import { Flex, ActionIcon, diff --git a/apps/app/src/components/CustomNumberInput.tsx b/apps/app/src/components/CustomNumberInput.tsx index 0af825f..3daa28b 100644 --- a/apps/app/src/components/CustomNumberInput.tsx +++ b/apps/app/src/components/CustomNumberInput.tsx @@ -1,4 +1,4 @@ -import React, { useMemo } from "react"; +import _React, { useMemo } from "react"; import { Input, NumberInput } from "@mantine/core"; import { VexillaNumberType } from "@vexilla/types"; diff --git a/apps/app/src/components/CustomSlider.tsx b/apps/app/src/components/CustomSlider.tsx index e67366e..612899f 100644 --- a/apps/app/src/components/CustomSlider.tsx +++ b/apps/app/src/components/CustomSlider.tsx @@ -1,4 +1,4 @@ -import React, { useRef } from "react"; +import _React, { useRef } from "react"; import { Slider, Flex, NumberInput, Button, Text } from "@mantine/core"; import { nanoid } from "../utils/nanoid"; diff --git a/apps/app/src/components/CustomTooltip.tsx b/apps/app/src/components/CustomTooltip.tsx index 1b9bcdf..a88df21 100644 --- a/apps/app/src/components/CustomTooltip.tsx +++ b/apps/app/src/components/CustomTooltip.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import _React from "react"; import { ActionIcon, Tooltip } from "@mantine/core"; import Icon from "@iconify/react"; diff --git a/apps/app/src/components/PageLayout.tsx b/apps/app/src/components/PageLayout.tsx index db467f7..2ae95a1 100644 --- a/apps/app/src/components/PageLayout.tsx +++ b/apps/app/src/components/PageLayout.tsx @@ -1,5 +1,4 @@ -import { Box } from "@mantine/core"; -import React, { PropsWithChildren } from "react"; +import _React, { PropsWithChildren } from "react"; export function PageLayout({ children, diff --git a/apps/app/src/components/Status.tsx b/apps/app/src/components/Status.tsx index f70531a..53c7104 100644 --- a/apps/app/src/components/Status.tsx +++ b/apps/app/src/components/Status.tsx @@ -1,4 +1,4 @@ -import React, { PropsWithChildren, useState } from "react"; +import _React, { PropsWithChildren, useState } from "react"; import { useSnapshot } from "valtio"; import { Difference } from "microdiff"; import { @@ -63,9 +63,9 @@ export function Status({ mergeRemoteConfig, }: StatusProps) { const validationSnapshot = useSnapshot(validation); - const localDifferencesSnapshot = useSnapshot(localDifferences); - const remoteDifferencesSnapshot = useSnapshot(remoteDifferences); - const remoteMetadataSnapshot = useSnapshot(remoteMetadata); + useSnapshot(localDifferences); + useSnapshot(remoteDifferences); + useSnapshot(remoteMetadata); const [ remoteChangesModalOpened, diff --git a/apps/app/src/components/TimelineItemTitle.tsx b/apps/app/src/components/TimelineItemTitle.tsx index eb3a923..4e6deb1 100644 --- a/apps/app/src/components/TimelineItemTitle.tsx +++ b/apps/app/src/components/TimelineItemTitle.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import _React from "react"; import { Flex } from "@mantine/core"; import { CustomTooltip } from "./CustomTooltip"; diff --git a/apps/app/src/components/app/OnboardingForm.tsx b/apps/app/src/components/app/OnboardingForm.tsx index 550f10f..d81a4f6 100644 --- a/apps/app/src/components/app/OnboardingForm.tsx +++ b/apps/app/src/components/app/OnboardingForm.tsx @@ -1,7 +1,7 @@ -import React, { useState } from "react"; -import { Select, Flex, Switch } from "@mantine/core"; +import _React, { useState } from "react"; +import { Select, Flex } from "@mantine/core"; import { AppState } from "@vexilla/types"; -import { snapshot, useSnapshot } from "valtio"; +import { useSnapshot } from "valtio"; import { EmptyForm } from "./forms/_EmptyForm"; import { GithubForm } from "./forms/GithubForm"; import { HostingProvider, HostingProviderType } from "@vexilla/hosts"; @@ -68,7 +68,7 @@ export function OnboardingForm({ updateProvider, }: OnboardingFormProps) { const configSnapshot = useSnapshot(config); - const [providerType, setProviderType] = useState( + const [_providerType, setProviderType] = useState( configSnapshot?.hosting?.providerType ); diff --git a/apps/app/src/components/app/forms/GithubForm.tsx b/apps/app/src/components/app/forms/GithubForm.tsx index 1a02650..401ed7b 100644 --- a/apps/app/src/components/app/forms/GithubForm.tsx +++ b/apps/app/src/components/app/forms/GithubForm.tsx @@ -1,23 +1,12 @@ -import React, { useEffect, useState, useCallback, useMemo } from "react"; -import { - Button, - Timeline, - Select, - ActionIcon, - Flex, - Tooltip, -} from "@mantine/core"; +import _React, { useEffect, useState, useMemo } from "react"; +import { Button, Timeline, Select, ActionIcon, Flex } from "@mantine/core"; import { cloneDeep } from "lodash-es"; import { AppState } from "@vexilla/types"; import { Branch, Repository } from "./_GitForm.types"; import { GitHubFetcher } from "./GithubForm.fetchers"; -import { - GitHubBranch, - GitHubInstallation, - GitHubRepository, -} from "./GithubForm.types"; +import { GitHubInstallation } from "./GithubForm.types"; import { GitForm } from "./_GitForm"; import { TimelineItemTitle } from "../../TimelineItemTitle"; @@ -57,7 +46,7 @@ const disabledButtonStyling = { maxWidth: "calc(100% - 28px - 0.25rem)", }; -export function GithubForm({ config, updateConfig }: GithubFormProps) { +export function GithubForm({ config }: GithubFormProps) { const configSnapshot = useSnapshot(config); const { accessToken, diff --git a/apps/app/src/components/app/forms/GithubForm.types.ts b/apps/app/src/components/app/forms/GithubForm.types.ts index 1178041..2508d48 100644 --- a/apps/app/src/components/app/forms/GithubForm.types.ts +++ b/apps/app/src/components/app/forms/GithubForm.types.ts @@ -853,11 +853,11 @@ export interface GitHubApp { * The set of permissions for the GitHub app */ permissions: { - issues?: string; - checks?: string; - metadata?: string; - contents?: string; - deployments?: string; + issues: string; + checks: string; + metadata: string; + contents: string; + deployments: string; [k: string]: string; }; /** diff --git a/apps/app/src/components/app/forms/S3Form.tsx b/apps/app/src/components/app/forms/S3Form.tsx index bba9cb3..96377c4 100644 --- a/apps/app/src/components/app/forms/S3Form.tsx +++ b/apps/app/src/components/app/forms/S3Form.tsx @@ -1,86 +1,86 @@ -import React from "react"; -import { Button } from "@mantine/core"; -import { AppState } from "@vexilla/types"; +// import _React from "react"; +// import { Button } from "@mantine/core"; +// import { AppState } from "@vexilla/types"; -import { GithubLogo } from "../../logos/GithubLogo"; +// import { GithubLogo } from "../../logos/GithubLogo"; -import { Icon } from "@iconify/react"; -import verifiedCheckBold from "@iconify/icons-solar/verified-check-bold"; +// import { Icon } from "@iconify/react"; +// import verifiedCheckBold from "@iconify/icons-solar/verified-check-bold"; -const githubAppName = `vexilla-dev`; -// const githubAppName = `vexilla`; +// const githubAppName = `vexilla-dev`; +// // const githubAppName = `vexilla`; -interface S3FormProps { - config: AppState; -} +// interface S3FormProps { +// config: AppState; +// } -const buttonStyling = { backgroundColor: "black", color: "white" }; -const disabledButtonStyling = { - backgroundColor: "black", - color: "white", - opacity: 0.6, -}; +// const buttonStyling = { backgroundColor: "black", color: "white" }; +// const disabledButtonStyling = { +// backgroundColor: "black", +// color: "white", +// opacity: 0.6, +// }; -export function GithubForm({ config }: S3FormProps) { - return ( -
-

Installation

-

The app must be installed into a repo via the Github marketplace.

- {!config.hosting?.config.installationId && ( - - )} +// export function GithubForm({ config }: S3FormProps) { +// return ( +//
+//

Installation

+//

The app must be installed into a repo via the Github marketplace.

+// {!config.hosting?.config.installationId && ( +// +// )} - {!!config.hosting?.config.installationId && ( - - )} +// {!!config.hosting?.config.installationId && ( +// +// )} -

Login

-

- You need to login via Github so that the app can make PRs on your - behalf. -

+//

Login

+//

+// You need to login via Github so that the app can make PRs on your +// behalf. +//

- {!config.hosting?.config.accessToken && ( - - )} +// {!config.hosting?.config.accessToken && ( +// +// )} - {!!config.hosting?.config.accessToken && ( - - )} -
- ); -} +// {!!config.hosting?.config.accessToken && ( +// +// )} +//
+// ); +// } diff --git a/apps/app/src/components/app/forms/_EmptyForm.tsx b/apps/app/src/components/app/forms/_EmptyForm.tsx index 75d8a58..fa4365e 100644 --- a/apps/app/src/components/app/forms/_EmptyForm.tsx +++ b/apps/app/src/components/app/forms/_EmptyForm.tsx @@ -1,10 +1,10 @@ -import React from "react"; +import _React from "react"; import { AppState } from "@vexilla/types"; interface EmptyFormProps { config: AppState; } -export function EmptyForm({ config }: EmptyFormProps) { +export function EmptyForm({}: EmptyFormProps) { return
Empty Form
; } diff --git a/apps/app/src/components/app/forms/_GitForm.tsx b/apps/app/src/components/app/forms/_GitForm.tsx index ff02de7..1084de2 100644 --- a/apps/app/src/components/app/forms/_GitForm.tsx +++ b/apps/app/src/components/app/forms/_GitForm.tsx @@ -1,4 +1,4 @@ -import React, { PropsWithChildren } from "react"; +import _React, { PropsWithChildren } from "react"; import { Timeline, Select, @@ -26,8 +26,6 @@ const githubAppName = `vexilla-dev`; export function GitForm({ config, - updateConfig, - totalElements, activeElement, children, repositories, diff --git a/apps/app/src/components/features/ScheduledForm.tsx b/apps/app/src/components/features/ScheduledForm.tsx index 6dd04d7..3d10158 100644 --- a/apps/app/src/components/features/ScheduledForm.tsx +++ b/apps/app/src/components/features/ScheduledForm.tsx @@ -10,14 +10,12 @@ declare namespace Intl { function supportedValuesOf(input: Key): string[]; } -import React, { useRef } from "react"; +import _React, { useRef } from "react"; import { Flex, Box, ActionIcon, Select, - Radio, - Group, SegmentedControl, Input, } from "@mantine/core"; diff --git a/apps/app/src/components/features/SelectiveList.tsx b/apps/app/src/components/features/SelectiveList.tsx index e166252..6ccb154 100644 --- a/apps/app/src/components/features/SelectiveList.tsx +++ b/apps/app/src/components/features/SelectiveList.tsx @@ -1,5 +1,5 @@ -import React from "react"; -import { Input, Modal, TextInput, Group, Button, Radio } from "@mantine/core"; +import _React from "react"; +import { Modal, TextInput, Group, Button } from "@mantine/core"; import { useDisclosure } from "@mantine/hooks"; import { CustomList, CustomListItem } from "../CustomList"; diff --git a/apps/app/src/main.tsx b/apps/app/src/main.tsx index 4e3a67f..80c189f 100644 --- a/apps/app/src/main.tsx +++ b/apps/app/src/main.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import _React from "react"; import ReactDOM from "react-dom/client"; import { MantineProvider } from "@mantine/core"; import { Notifications } from "@mantine/notifications"; diff --git a/apps/app/src/routes/Configuration.tsx b/apps/app/src/routes/Configuration.tsx index 1013748..069fc3c 100644 --- a/apps/app/src/routes/Configuration.tsx +++ b/apps/app/src/routes/Configuration.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import _React from "react"; import { PageLayout } from "../components/PageLayout"; export function Configuration() { diff --git a/apps/app/src/routes/Home.tsx b/apps/app/src/routes/Home.tsx index 614ceb1..977dda7 100644 --- a/apps/app/src/routes/Home.tsx +++ b/apps/app/src/routes/Home.tsx @@ -1,9 +1,7 @@ -import React from "react"; -import { Timeline, Text, Button } from "@mantine/core"; +import _React from "react"; +import { Timeline, Text } from "@mantine/core"; import { PageLayout } from "../components/PageLayout"; -import { useSnapshot } from "valtio"; -import { config } from "../stores/config-valtio"; export function Home() { return ( diff --git a/apps/app/src/routes/Publish.tsx b/apps/app/src/routes/Publish.tsx index d595a10..8951da0 100644 --- a/apps/app/src/routes/Publish.tsx +++ b/apps/app/src/routes/Publish.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import _React from "react"; import { PageLayout } from "../components/PageLayout"; export function Publish() { diff --git a/apps/app/src/routes/auth/AuthCallback.tsx b/apps/app/src/routes/auth/AuthCallback.tsx index c5443eb..bd5c6ed 100644 --- a/apps/app/src/routes/auth/AuthCallback.tsx +++ b/apps/app/src/routes/auth/AuthCallback.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from "react"; +import _React, { useEffect, useState } from "react"; import { PageLayout } from "../../components/PageLayout"; import { config } from "../../stores/config-valtio"; diff --git a/apps/app/src/routes/environments/EditEnvironment.tsx b/apps/app/src/routes/environments/EditEnvironment.tsx index 36b3c4b..7c4bd1d 100644 --- a/apps/app/src/routes/environments/EditEnvironment.tsx +++ b/apps/app/src/routes/environments/EditEnvironment.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useEffect, useMemo } from "react"; +import _React from "react"; import { TextInput, Switch, @@ -9,8 +9,7 @@ import { Radio, Group, } from "@mantine/core"; -import { useForm } from "@mantine/form"; -import { Link, useNavigate, useParams } from "react-router-dom"; +import { useNavigate, useParams } from "react-router-dom"; import { useSnapshot } from "valtio"; import { config } from "../../stores/config-valtio"; @@ -19,16 +18,11 @@ import { PageLayout } from "../../components/PageLayout"; import { CustomSlider } from "../../components/CustomSlider"; import { CustomTooltip } from "../../components/CustomTooltip"; import { SelectiveList } from "../../components/features/SelectiveList"; -import { ScheduledForm } from "../../components/features/ScheduledForm"; import { Icon } from "@iconify/react"; import rewindBackBroken from "@iconify/icons-solar/rewind-back-broken"; import shieldWarningBroken from "@iconify/icons-solar/shield-warning-broken"; -enum FormFields { - name = "name", -} - export function EditEnvironment() { const navigate = useNavigate(); const params = useParams(); diff --git a/apps/app/src/routes/features/EditFeature.tsx b/apps/app/src/routes/features/EditFeature.tsx index afa7abf..280f657 100644 --- a/apps/app/src/routes/features/EditFeature.tsx +++ b/apps/app/src/routes/features/EditFeature.tsx @@ -1,4 +1,4 @@ -import React, { forwardRef, useCallback, useEffect, useMemo } from "react"; +import _React, { forwardRef } from "react"; import { Group, Select, @@ -10,13 +10,11 @@ import { Radio, Flex, } from "@mantine/core"; -import { useForm } from "@mantine/form"; -import { Link, useNavigate, useParams } from "react-router-dom"; +import { useNavigate, useParams } from "react-router-dom"; import { useSnapshot } from "valtio"; import { VexillaFeature, - VexillaFeatureTypeSelective, VexillaFeatureTypeString, VexillaInputType, VexillaNumberType, @@ -35,13 +33,8 @@ import rewindBackBroken from "@iconify/icons-solar/rewind-back-broken"; import { CustomSlider } from "../../components/CustomSlider"; import { SelectiveList } from "../../components/features/SelectiveList"; import { ScheduledForm } from "../../components/features/ScheduledForm"; -import { logProxy } from "../../utils/logging"; import { CustomNumberInput } from "../../components/CustomNumberInput"; -enum FormFields { - name = "name", -} - interface ItemProps extends React.ComponentPropsWithoutRef<"div"> { label: string; description: string; diff --git a/apps/app/src/routes/groups/EditGroup.tsx b/apps/app/src/routes/groups/EditGroup.tsx index 83765ab..dea676b 100644 --- a/apps/app/src/routes/groups/EditGroup.tsx +++ b/apps/app/src/routes/groups/EditGroup.tsx @@ -1,12 +1,11 @@ -import React, { useEffect, useState } from "react"; +import _React, { useEffect, useState } from "react"; import { useNavigate, useParams } from "react-router-dom"; import { Button, TextInput, Flex, Box } from "@mantine/core"; import { DefaultFeatureValues, - Environment, - Group as FeatureGroup, + VexillaEnvironment, VexillaFeature, VexillaGradualFeature, VexillaSchedule, @@ -99,7 +98,7 @@ export function EditGroup() { return newEnvironments; }, - {} as Record + {} as Record ); } @@ -168,7 +167,7 @@ export function EditGroup() { /> - + title="Environments" itemType="Environment" items={Object.values(environments)} diff --git a/apps/app/src/stores/config-valtio.ts b/apps/app/src/stores/config-valtio.ts index 786793a..7dc2573 100644 --- a/apps/app/src/stores/config-valtio.ts +++ b/apps/app/src/stores/config-valtio.ts @@ -4,7 +4,6 @@ import { derive } from "valtio/utils"; import { z } from "zod"; import microdiff from "microdiff"; import { HostingConfigValidators } from "../utils/validators"; -import { omit } from "lodash-es"; const CONFIG_KEY = "config"; const REMOTE_CONFIG_KEY = "remoteConfig"; diff --git a/apps/app/src/stores/utils/storage.ts b/apps/app/src/stores/utils/storage.ts deleted file mode 100644 index e06a784..0000000 --- a/apps/app/src/stores/utils/storage.ts +++ /dev/null @@ -1,26 +0,0 @@ -import localforage from "localforage"; -import { atom } from "jotai"; - -// type StorageValue = string | number | any[] | Object; - -export function atomWithStorage(key: string, initialValue: T) { - const baseAtom = atom(initialValue); - baseAtom.onMount = (setValue) => { - (async () => { - const item = (await localforage.getItem(key)) as string; - if (item) { - setValue(JSON.parse(item)); - } - })(); - }; - const derivedAtom = atom( - (get) => get(baseAtom), - (get, set, update) => { - const nextValue = - typeof update === "function" ? update(get(baseAtom)) : update; - set(baseAtom, nextValue); - localforage.setItem(key, JSON.stringify(nextValue)); - } - ); - return derivedAtom; -} diff --git a/apps/app/src/utils/fetcher.ts b/apps/app/src/utils/fetcher.ts index 2a68250..aa89e2c 100644 --- a/apps/app/src/utils/fetcher.ts +++ b/apps/app/src/utils/fetcher.ts @@ -8,8 +8,8 @@ export class Fetcher { } async publish( - branchName: string, - files: { + _branchName: string, + _files: { content: string; filePath: string; }[] @@ -27,7 +27,7 @@ export class GitFetcher extends Fetcher { throw new Error("getRepositories() not implemented"); } - async getBranches(branch: string) { + async getBranches(_branch: string) { throw new Error("getBranches() not implemented"); } } diff --git a/apps/app/src/utils/fetchers.map.ts b/apps/app/src/utils/fetchers.map.ts index 7719050..78ae658 100644 --- a/apps/app/src/utils/fetchers.map.ts +++ b/apps/app/src/utils/fetchers.map.ts @@ -14,4 +14,13 @@ export const fetchersMap: Record< s3: () => { throw new Error("No fetcher found for S3 provider"); }, + azure: () => { + throw new Error("No fetcher found for S3 provider"); + }, + gcloud: () => { + throw new Error("No fetcher found for S3 provider"); + }, + firebase: () => { + throw new Error("No fetcher found for S3 provider"); + }, };