From 27565b02743c4f7224e6bd71d8d61a68f0248293 Mon Sep 17 00:00:00 2001 From: Simon Howe Date: Fri, 13 May 2022 14:43:37 +0200 Subject: [PATCH 1/7] Export node module as esm - Has better support by consuming tooling to "pass through" assets like svgs --- package.json | 4 +++- ui/lib/images.ts | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 50c4011600..53ba16f6ce 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "@weaveworks/weave-gitops", "version": "0.10.2-rc.1", "description": "Weave GitOps core", + "module": "index.js", "targets": { "default": { "distDir": "bin/dist", @@ -11,7 +12,8 @@ "lib": { "includeNodeModules": false, "isLibrary": true, - "outputFormat": "commonjs", + "optimize": false, + "outputFormat": "esmodule", "distDir": "dist", "source": "ui/index.ts", "sourceMap": false diff --git a/ui/lib/images.ts b/ui/lib/images.ts index eb50b739fe..ddb59f4030 100644 --- a/ui/lib/images.ts +++ b/ui/lib/images.ts @@ -1,16 +1,16 @@ /* eslint-disable */ // @ts-nocheck -import bg from "data-url:../images/bg-circles.png"; -import failedSrc from "data-url:../images/failed.svg"; -import fluxIconHoverSrc from "data-url:../images/flux-icon-hover.svg"; -import fluxIconSrc from "data-url:../images/flux-icon.svg"; -import logoSrc from "data-url:../images/logo.svg"; -import reconcileSrc from "data-url:../images/reconcile.svg"; -import signInWheel from "data-url:../images/SignInWheel.svg"; -import successSrc from "data-url:../images/success.svg"; -import suspendedSrc from "data-url:../images/suspended.svg"; -import weaveLogo from "data-url:../images/WeaveLogo.svg"; +import bg from "../images/bg-circles.png"; +import failedSrc from "../images/failed.svg"; +import fluxIconHoverSrc from "../images/flux-icon-hover.svg"; +import fluxIconSrc from "../images/flux-icon.svg"; +import logoSrc from "../images/logo.svg"; +import reconcileSrc from "../images/reconcile.svg"; +import signInWheel from "../images/SignInWheel.svg"; +import successSrc from "../images/success.svg"; +import suspendedSrc from "../images/suspended.svg"; +import weaveLogo from "../images/WeaveLogo.svg"; export default { bg, From f2bf6f3f50335299a86373c49836dd826580300d Mon Sep 17 00:00:00 2001 From: Simon Howe Date: Sat, 6 Aug 2022 16:56:29 +0200 Subject: [PATCH 2/7] Don't export types --- ui/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/index.ts b/ui/index.ts index 8eba225a85..0bde64500f 100644 --- a/ui/index.ts +++ b/ui/index.ts @@ -81,7 +81,6 @@ export { Auth, AuthCheck, AuthContextProvider, - Automation, AutomationsTable, Bucket, BucketDetail, From 733eca3e972fdd6c3ec2d88397df045f7f59c622 Mon Sep 17 00:00:00 2001 From: Simon Howe Date: Sun, 21 Aug 2022 21:56:28 +0200 Subject: [PATCH 3/7] more module like --- package.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package.json b/package.json index 53ba16f6ce..38cd82e6f0 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,12 @@ "version": "0.10.2-rc.1", "description": "Weave GitOps core", "module": "index.js", + "type": "module", + "exports": { + ".": { + "import": "./index.js" + } + }, "targets": { "default": { "distDir": "bin/dist", From 721fd6472612324d8919d597cf7950c6e6f22d22 Mon Sep 17 00:00:00 2001 From: Simon Howe Date: Mon, 22 Aug 2022 18:18:13 +0200 Subject: [PATCH 4/7] Corrects some imports --- ui/components/Button.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/components/Button.tsx b/ui/components/Button.tsx index b4f68edd63..2cdebda112 100644 --- a/ui/components/Button.tsx +++ b/ui/components/Button.tsx @@ -1,6 +1,10 @@ // eslint-disable-next-line -import { CircularProgress, PropTypes } from "@material-ui/core"; -import MaterialButton, { ButtonProps } from "@material-ui/core/Button/Button"; +import { + CircularProgress, + PropTypes, + Button as MaterialButton, + ButtonProps, +} from "@material-ui/core"; import * as React from "react"; import styled, { useTheme } from "styled-components"; From f69359dbc9a7594cec101acf9813b106bc074106 Mon Sep 17 00:00:00 2001 From: Simon Howe Date: Wed, 24 Aug 2022 07:48:38 +0200 Subject: [PATCH 5/7] Revert "Corrects some imports" This reverts commit c8a65c110df4fb0e0fcc9c47f3a27b65e1ced4bb. --- ui/components/Button.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/ui/components/Button.tsx b/ui/components/Button.tsx index 2cdebda112..b4f68edd63 100644 --- a/ui/components/Button.tsx +++ b/ui/components/Button.tsx @@ -1,10 +1,6 @@ // eslint-disable-next-line -import { - CircularProgress, - PropTypes, - Button as MaterialButton, - ButtonProps, -} from "@material-ui/core"; +import { CircularProgress, PropTypes } from "@material-ui/core"; +import MaterialButton, { ButtonProps } from "@material-ui/core/Button/Button"; import * as React from "react"; import styled, { useTheme } from "styled-components"; From e6b551a70e5db809d024ebb58c596992a9a6efbb Mon Sep 17 00:00:00 2001 From: Simon Howe Date: Wed, 24 Aug 2022 08:30:47 +0200 Subject: [PATCH 6/7] Avoid importing entire icon module --- ui/pages/SignIn.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/pages/SignIn.tsx b/ui/pages/SignIn.tsx index 64af30fc5b..aeb7dce611 100644 --- a/ui/pages/SignIn.tsx +++ b/ui/pages/SignIn.tsx @@ -1,5 +1,6 @@ import { Divider, IconButton, Input, InputAdornment } from "@material-ui/core"; -import { Visibility, VisibilityOff } from "@material-ui/icons"; +import Visibility from "@material-ui/icons/Visibility"; +import VisibilityOff from "@material-ui/icons/VisibilityOff"; import * as React from "react"; import styled from "styled-components"; import Alert from "../components/Alert"; From 69ce1f136e1056464cca3e12ed16596f5da45074 Mon Sep 17 00:00:00 2001 From: Simon Howe Date: Tue, 8 Nov 2022 09:33:11 +0100 Subject: [PATCH 7/7] don't export types --- ui/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/index.ts b/ui/index.ts index 0bde64500f..7f6137a16b 100644 --- a/ui/index.ts +++ b/ui/index.ts @@ -57,7 +57,6 @@ import { Core as coreClient } from "./lib/api/core/core.pb"; import { Kind } from "./lib/api/core/types.pb"; import { formatURL } from "./lib/nav"; import { - Automation, Bucket, GitRepository, HelmChart,