Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

New project structure for Infrahub Frontend #5434

Merged
merged 25 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions frontend/app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/coverage
cypress/videos
cypress/screenshots
**/__screenshots__

# production
/build
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"./playwright-report",
"./test-results",
"./tests/e2e/.auth",
"./src/generated",
"./src/infraops.d.ts"
"./src/shared/api/rest/types.generated.ts",
"./src/shared/api/graphql/generated"
]
},
"formatter": {
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/cypress/support/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { ReactRouter6Adapter } from "use-query-params/adapters/react-router-6";
// Import commands.js using ES2015 syntax:
import "./commands";

import "../../src/styles/index.css";
import "../../src/app/styles/index.css";

// Alternatively you can use CommonJS syntax:
// require('./commands')
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/graphql.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const config: CodegenConfig = {
documents: ["src/**/*.tsx", "src/**/*.ts"],
ignoreNoDocuments: true, // for better experience with the watcher
generates: {
"src/generated/": {
"src/shared/api/graphql/generated/": {
config: {
withHooks: true,
},
Expand Down
171 changes: 171 additions & 0 deletions frontend/app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion frontend/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"serve": "vite preview",
"build-serve": "npm run build && npm run serve",
"codegen": "graphql-codegen --config graphql.config.ts",
"codegen:openapi": "npx openapi-typescript http://localhost:8000/api/openapi.json --output src/infraops.d.ts",
"codegen:openapi": "npx openapi-typescript http://localhost:8000/api/openapi.json --output src/shared/api/rest/types.generated.ts",
"ci:test:e2e": "CI=1 DEBUG=pw:browser npm run test:e2e 2>/dev/null",
"test": "vitest run",
"test:watch": "vitest watch",
Expand Down Expand Up @@ -125,6 +125,7 @@
"playwright": "^1.49.1",
"postcss": "^8.4.23",
"tailwindcss": "^3.4.3",
"ts-node": "^10.9.2",
"typescript": "^5.5.3",
"vitest": "^2.1.8",
"vitest-browser-react": "^0.0.4"
Expand Down
16 changes: 8 additions & 8 deletions frontend/app/src/App.tsx → frontend/app/src/app/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ import { ErrorBoundary } from "react-error-boundary";
import { RouterProvider } from "react-router-dom";
import { Slide, ToastContainer } from "react-toastify";

import graphqlClient from "@/graphql/graphqlClientApollo";
import { AuthProvider } from "@/hooks/useAuth";
import { router } from "@/router";
import ErrorFallback from "@/screens/errors/error-fallback";
import { store } from "@/state";
import { router } from "@/app/router";
import { AuthProvider } from "@/entities/authentication/ui/useAuth";
import graphqlClient from "@/shared/api/graphql/graphqlClientApollo";
import ErrorFallback from "@/shared/components/errors/error-fallback";
import { store } from "@/shared/stores";
import { ApolloProvider } from "@apollo/client";
import { addCollection } from "@iconify-icon/react";
import mdiIcons from "@iconify-json/mdi/icons.json";
import { QueryClientProvider } from "@tanstack/react-query";

import "./styles/index.css";
import "@/app/styles/index.css";
import "react-toastify/dist/ReactToastify.css";
import { queryClient } from "@/api/client";
import { TanStackQueryDevtools } from "@/devtools";
import { TanStackQueryDevtools } from "@/app/devtools";
import { queryClient } from "@/shared/api/rest/client";

addCollection(mdiIcons);

Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions frontend/app/src/Root.tsx → frontend/app/src/app/root.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ALERT_TYPES, Alert } from "@/components/ui/alert";
import { CONFIG } from "@/config/config";
import LoadingScreen from "@/screens/loading-screen/loading-screen";
import { fetchUrl } from "@/utils/fetch";
import { Config, configState } from "@/config/config.atom";
import { fetchUrl } from "@/shared/api/rest/fetch";
import LoadingScreen from "@/shared/components/loading-screen";
import { ALERT_TYPES, Alert } from "@/shared/components/ui/alert";
import { useSetAtom } from "jotai";
import { ReactNode, useEffect, useState } from "react";
import { toast } from "react-toastify";
import { Config, configState } from "./state/atoms/config.atom";

export const Root = ({ children }: { children?: ReactNode }) => {
const setConfig = useSetAtom(configState);
Expand Down
Loading
Loading