From ac9c61b824d33de2fba678712cb97bbe73428a90 Mon Sep 17 00:00:00 2001 From: Jordan Pellizzari Date: Wed, 6 Sep 2023 10:35:57 -0700 Subject: [PATCH 1/2] Fix some typescript project settings affecting local dev --- tsconfig.json | 2 +- ui/src/App.tsx | 6 +++--- ui/src/svg.d.ts | 6 ++++++ 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 ui/src/svg.d.ts diff --git a/tsconfig.json b/tsconfig.json index a273b0cfc..f833b1b21 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,6 +21,6 @@ "jsx": "react-jsx" }, "include": [ - "src" + "ui" ] } diff --git a/ui/src/App.tsx b/ui/src/App.tsx index bab403358..857f62fce 100644 --- a/ui/src/App.tsx +++ b/ui/src/App.tsx @@ -6,13 +6,13 @@ import { AppContextProvider, AuthCheck, AuthContextProvider, + coreClient, CoreClientContextProvider, LinkResolverProvider, Pendo, SignIn, - ThemeTypes, - coreClient, theme, + ThemeTypes, } from '@weaveworks/weave-gitops'; import React, { ReactNode } from 'react'; import { @@ -24,7 +24,7 @@ import { import { BrowserRouter, Route, Switch } from 'react-router-dom'; import { ToastContainer } from 'react-toastify'; import 'react-toastify/dist/ReactToastify.css'; -import { ThemeProvider, createGlobalStyle } from 'styled-components'; +import { createGlobalStyle, ThemeProvider } from 'styled-components'; import { Pipelines } from './api/pipelines/pipelines.pb'; import { Query } from './api/query/query.pb'; import { Terraform } from './api/terraform/terraform.pb'; diff --git a/ui/src/svg.d.ts b/ui/src/svg.d.ts new file mode 100644 index 000000000..d9abef945 --- /dev/null +++ b/ui/src/svg.d.ts @@ -0,0 +1,6 @@ +declare module '*.svg' { + import React = require('react'); + export const ReactComponent: React.ElementType; + const src: string; + export default src; +} From 9877295e85fe9f42cf674337bc079d3da0f8e713 Mon Sep 17 00:00:00 2001 From: Simon Howe Date: Thu, 7 Sep 2023 15:39:14 +0200 Subject: [PATCH 2/2] Some Makefile fixes too --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ceac5eefe..3e8129ba0 100644 --- a/Makefile +++ b/Makefile @@ -205,7 +205,7 @@ ui-build: node_modules $(shell find ui/src -type f) # This job assumes that the weave-gitops repo located next to this repo in the filesystem core-ui: - cd ../../weave-gitops && \ + cd ../weave-gitops && \ npm run build:lib && \ npm run typedefs && \ cd ../weave-gitops-enterprise @@ -213,7 +213,7 @@ core-ui: core-lib: rm -rf node_modules/@weaveworks/weave-gitops/ rm -rf .parcel-cache/ - yarn add ../../weave-gitops/dist + yarn add ../weave-gitops/dist ui-audit: # Check js packages for any high or critical vulnerabilities