HubSpot / hubspot-cli

A CLI for HubSpot
https://developers.hubspot.com
Other
154 stars 60 forks source link

Fix bugs with hs project add --type flag #1143

Closed camden11 closed 2 months ago

camden11 commented 2 months ago

Description and Context

Noticed recently that the --type flag on the hs project add command was broken in a few ways:

This PR fixed both of these things

Screenshots

Before

Screenshot 2024-08-22 at 11 36 46 AM

After

Screenshot 2024-08-22 at 11 36 42 AM

Testing

To test, try running with a valid component type

yarn hs project add  --type="components/example-app" --name="test"

and an invalid component type

yarn hs project add  --type="components/not-a-real-type" --name="test"

Who to Notify

@brandenrodgers @kemmerle @joe-yeager

brandenrodgers commented 2 months ago

How does type work? Should it be the path to the component, or should it be the name that we display? I'm asking because I tried this and it was a little confusing:

image
camden11 commented 2 months ago

It's the path to the component in the hubspot project components repo. Not exactly the most intuitive, but that's why the prompt is there. Figure its mostly helpful if you ever needed to automate something like this.

That said, just noticed the help command doesn't make it clear what --type is supposed to be so I'll update that

camden11 commented 2 months ago

@brandenrodgers Updated with a better description of the --type flag and an example with flags