Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Fixes errors when generating TypeScript components #2605

Merged
merged 1 commit into from
Jul 1, 2021

Conversation

liamrathke
Copy link
Contributor

@liamrathke liamrathke commented Jun 28, 2021

What this PR does / why we need it:

Currently, TypeScript component generation leads to TS components that do not compile, meaning that it is not possible to write plugins for the latest version of Octant in TypeScript. This PR fixes two bugs preventing TS component generation:

  • Recursive/nested component types yielding incorrect code (FormFieldConfig is imported and redeclared, causing errors)
  • Under specific conditions, variable names from Go code are interjected into the generated TypeScript files, causing errors

Testing Steps:

  • Follow the steps in https://github.com/vmware-tanzu/plugin-library-for-octant/tree/main/yeoman-generator to set up a TypeScript plugin on your local environment
  • Inside your new plugin, replace node_modules/@project-octant/plugin/helpers.ts with the latest version (available here)
  • Checkout this branch on your local environment
  • Run go run ./cmd/ts-component-gen/main.go -dest <directory> to generate TypeScript components, where <directory> is the path to node_modules/@project-octant/plugin/components inside your local TypeScript plugin
  • Verify that the plugin compiles and displays correctly

Which issue(s) this PR fixes

Signed-off-by: Liam Rathke <[email protected]>
Signed-off-by: Liam Rathke <[email protected]>
@wwitzel3 wwitzel3 merged commit eea8713 into vmware-archive:master Jul 1, 2021
@wwitzel3 wwitzel3 added this to In progress in 0.22 via automation Jul 1, 2021
@liamrathke liamrathke deleted the form-field-fix branch July 1, 2021 15:01
@wwitzel3 wwitzel3 moved this from In progress to Done in 0.22 Jul 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
No open projects
0.22
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants