Skip to content

Commit

Permalink
fix: refactor the emui components to the shared package (#1959)
Browse files Browse the repository at this point in the history
## Description:
This PR refactors the `components` from the emui into the new
`kurtosis-ui-components` package, additionally it makes use of
`kurtosis-package-indexer-sdk` from
kurtosis-tech/kurtosis-package-indexer#81 for
the package indexer types (types are used by the shared components, and
the actual client definition is used by the app).

## Is this change user facing?
NO

## References (if applicable):
*
https://www.notion.so/kurtosistech/2023-12-December-Frontend-Burndown-ad4ea71b05d843fe8efc97c2e61607b7
  • Loading branch information
Dartoxian committed Dec 14, 2023
1 parent 12ff56e commit a406973
Show file tree
Hide file tree
Showing 116 changed files with 259 additions and 719 deletions.
7 changes: 6 additions & 1 deletion enclave-manager/web/package.json
Expand Up @@ -7,11 +7,16 @@
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"framer-motion": "^10.16.4",
"lodash": "^4.17.21",
"luxon": "^3.4.3",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react-dom": "^18.2.0",
"react-icons": "^4.11.0",
"true-myth": "^7.1.0"
},
"devDependencies": {
"@craco/craco": "^7.1.0",
"@types/luxon": "^3.3.3",
"@types/node": "^16.7.13",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
Expand Down
14 changes: 1 addition & 13 deletions enclave-manager/web/packages/app/package.json
Expand Up @@ -4,31 +4,19 @@
"private": true,
"homepage": ".",
"dependencies": {
"@monaco-editor/react": "^4.6.0",
"@tanstack/react-table": "^8.10.7",
"ansi-to-html": "^0.7.2",
"enclave-manager-sdk": "file:../../../api/typescript",
"html-react-parser": "^4.2.2",
"js-cookie": "^3.0.5",
"kurtosis-cloud-indexer-sdk": "^0.0.2",
"kurtosis-ui-components": "0.0.1",
"lodash": "^4.17.21",
"luxon": "^3.4.3",
"react-error-boundary": "^4.0.11",
"react-hook-form": "^7.47.0",
"react-icons": "^4.11.0",
"react-markdown": "^9.0.0",
"react-router-dom": "^6.17.0",
"react-virtuoso": "^4.6.2",
"streamsaver": "^2.0.6",
"true-myth": "^7.1.0",
"yaml": "^2.3.4"
},
"devDependencies": {
"@types/js-cookie": "^3.0.6",
"@types/luxon": "^3.3.3",
"@types/node": "^16.7.13",
"@types/streamsaver": "^2.0.4",
"monaco-editor": "^0.44.0",
"serve": "^14.2.1",
"source-map-explorer": "^2.5.3"
},
Expand Down
2 changes: 1 addition & 1 deletion enclave-manager/web/packages/app/src/client/constants.ts
@@ -1,4 +1,4 @@
import { isDefined } from "../utils";
import { isDefined } from "kurtosis-ui-components";

// Configurable:
export const KURTOSIS_CLOUD_PROTOCOL = "https";
Expand Down
Expand Up @@ -23,9 +23,8 @@ import {
InspectFilesArtifactContentsRequest,
RunStarlarkPackageRequest,
} from "enclave-manager-sdk/build/kurtosis_enclave_manager_api_pb";
import { assertDefined, asyncResult, isDefined, RemoveFunctions } from "kurtosis-ui-components";
import { EnclaveFullInfo } from "../../emui/enclaves/types";
import { assertDefined, asyncResult, isDefined } from "../../utils";
import { RemoveFunctions } from "../../utils/types";

export abstract class KurtosisClient {
protected readonly client: PromiseClient<typeof KurtosisEnclaveManagerServer>;
Expand Down
@@ -1,8 +1,7 @@
import { Flex, Heading, Spinner } from "@chakra-ui/react";
import Cookies from "js-cookie";
import { assertDefined, isDefined, KurtosisAlert, stringifyError } from "kurtosis-ui-components";
import { createContext, PropsWithChildren, useContext, useEffect, useMemo, useState } from "react";
import { KurtosisAlert } from "../../components/KurtosisAlert";
import { assertDefined, isDefined, stringifyError } from "../../utils";
import { KURTOSIS_CLOUD_EM_PAGE, KURTOSIS_CLOUD_EM_URL } from "../constants";
import { AuthenticatedKurtosisClient } from "./AuthenticatedKurtosisClient";
import { KurtosisClient } from "./KurtosisClient";
Expand Down
@@ -1,10 +1,8 @@
import { createPromiseClient, PromiseClient } from "@connectrpc/connect";
import { createConnectTransport } from "@connectrpc/connect-web";
import { asyncResult } from "../../utils";
import { parsePackageUrl } from "../../utils/packageUtils";
import { KurtosisPackageIndexer, PackageRepository, ReadPackageRequest } from "kurtosis-cloud-indexer-sdk";
import { asyncResult, parsePackageUrl } from "kurtosis-ui-components";
import { KURTOSIS_PACKAGE_INDEXER_URL } from "../constants";
import { KurtosisPackageIndexer } from "./api/kurtosis_package_indexer_connect";
import { PackageRepository, ReadPackageRequest } from "./api/kurtosis_package_indexer_pb";

export class KurtosisPackageIndexerClient {
private client: PromiseClient<typeof KurtosisPackageIndexer>;
Expand Down
@@ -1,5 +1,5 @@
import { assertDefined } from "kurtosis-ui-components";
import { createContext, PropsWithChildren, useContext, useMemo } from "react";
import { assertDefined } from "../../utils";
import { KurtosisPackageIndexerClient } from "./KurtosisPackageIndexerClient";

type KurtosisPackageIndexerClientContextState = {
Expand Down

This file was deleted.

0 comments on commit a406973

Please sign in to comment.