目录
Mason Malone

chore: fix exports for types (#630)

I’m trying to update Argo Workflows to pull in the changes from https://github.com/argoproj/argo-ui/pull/614, but Webpack gives a lot of warnings like this:


WARNING in ./node_modules/argo-ui/src/components/index.ts 32:0-49:23
export 'FormApi' (reexported as 'FormApi') was not found in './form/compat' (possible exports: Checkbox, Form, FormField, NestedForm, Text, TextArea)
 @ ./node_modules/argo-ui/src/index.ts 2:0-29 2:0-29
 @ ./src/cron-workflows/cron-workflow-row.tsx 1:0-43 22:2028-2034
 @ ./src/cron-workflows/cron-workflow-list.tsx 42:0-54 133:8-23
 @ ./src/cron-workflows/cron-workflow-container.tsx 4:0-56 5:208-224
 @ ./src/cron-workflows/index.ts 1:0-66 3:13-34
 @ ./src/app-router.tsx 25:0-45 164:1125-1148
 @ ./src/app.tsx 6:0-41 18:119-128
 @ ./src/index.tsx 4:0-28 8:48-51

I think this is happening because FormApi is a type, so we should be using a type-only export. To prevent this from happening again, I enabled isolatedModules so tsc will give an error like this:


src/components/index.ts:49:5 - error TS1205: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.

49     ValidateValuesFunction,
       ~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Mason Malone 651224+MasonM@users.noreply.github.com

12天前502次提交

Argo UI Components

Argo Image

Set of React components used by Argo Workflows, Argo CD, and Argo Rollouts.

Build & Run

  1. Install Toolset: NodeJS and pnpm
  2. Install Dependencies: run pnpm install
  3. Run: pnpm start - starts the Storybook v8 dev server

Local Development

To test your changes locally against Argo CD or another Argo project, we recommend using yalc.

First, install yalc:

npm i -g yalc

Next, in your local argo-ui directory, run

yalc publish

Finally, in your local argo-cd/ui directory, run

yalc add argo-ui

Your local changes to the argo-ui package will now be seen by your local argo-cd.

邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号