Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Elevate support to hs project create and helpful info for hs fetch #1184

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

joeyblake
Copy link

@joeyblake joeyblake commented Sep 26, 2024

Description and Context

The new HubSpot Elevate theme requires a HubSpot project to run. This feature consists of 3 parts.

  1. An update to HubSpot project components for configuration to spin up a new hs project with the Elevate theme as a starting point.
image
  1. An update to hs project create that will create a new HubSpot project with no-template and then hs fetch the Elevate theme into the newly scaffolded project. This also includes a helpful error message in the event that fetching fails to get all of the files the first time.
image
  1. A message and **prompt when attempting to hs fetch @hubspot/elevate to let the user know that Elevate requires a project to work, that allows the user to continue fetching the files if desired,
image or abort the fetch, where the cli shows a message to `hs project create` to get started. image

** If the fetch destination is already an HS project, this prompt will not show and fetching with proceed as normal.

To test

  • Pull this branch
  • fetching - from the root of this directory run yarn hs fetch @hubspot/elevate <somedestination that is not a project>
  • fetching to a project folder - from the root of this directory run yarn hs fetch @hubspot/elevate <somedestination that is in a project folder> <- nested folders of a project will work too
  • create - from the root of this directory run yarn hs project create --templateSource "joeyblake/hubspot-project-components" the templateSource will stub in the elevate option into the project create choices.

TODO

Who to Notify

@TanyaScales @jsines

@joeyblake joeyblake changed the title add message and prompt if fetching elevate into a non-project locatio… Add Elevate support to hs project create and helpful info for hs fetch Sep 27, 2024
@joeyblake joeyblake marked this pull request as ready for review September 27, 2024 14:16
Copy link
Contributor

@jsines jsines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the case of hs fetch @hubspot/elevate outside of a project folder - instead of "Would you like to continue fetching without creating a project? [y/N]", would it be feasible to ask "Would you like to create one? [Y/n]", and then "re-route" them to the hs project create flow without making them retype a command?

Otherwise code seems good!

@@ -1064,6 +1066,8 @@ en:
logFeedbackMessage:
feedbackHeader: "We'd love to hear your feedback!"
feedbackMessage: "How are you liking the new projects and developer tools? \n > Run `{{#yellow}}hs feedback{{/yellow}}` to let us know what you think!\n"
errors:
downloadFileOrFolder: "Not all files in folder \"{{ src }}\" were successfully fetched. Run `{{#yellow}}{{ command }}{{/yellow}}` again to finish download"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use the uiAccountDescription util here to format the command.

@kemmerle
Copy link
Contributor

kemmerle commented Oct 3, 2024

@joeyblake, out of curiosity, why didn't you include the elevate theme template in the hubspot-project-components repo? Do you want to keep the source code off GitHub? Or are you concerned about keeping the theme updated?

@joeyblake
Copy link
Author

@joeyblake, out of curiosity, why didn't you include the elevate theme template in the hubspot-project-components repo? Do you want to keep the source code off GitHub? Or are you concerned about keeping the theme updated?

Oh, we're going to, the PR is here 😁 .

Copy link

@bmatto bmatto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it.

@kemmerle
Copy link
Contributor

kemmerle commented Oct 4, 2024

@joeyblake, I meant that you can move the source code for the Elevate theme directly into the hubspot-project-components repo and download it directly from that repo, as we do with private and public app sample templates. That would save you from having to download a blank template and then downloading the elevate theme separately, unless you don't want to maintain the latest version of the theme in another repo.

EDIT: Nevermind! This comment became moot after the CMS Sync today (10/8). I think the Elevate theme has too many files for the GitHub endpoints to handle reliably.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants