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

feat: pull components cmd #139

Draft
wants to merge 11 commits into
base: next
Choose a base branch
from
Draft

Conversation

alvarosabu
Copy link
Contributor

This PR introduces the new implementation of the pull-components command

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Other (please describe):

How to test this PR

  1. Clone the repo and pull the branch
  2. Add several components to a Storyblok Space or use the default test one 295017 or 295018
  3. Run pnpm install
  4. Run pnpm run dev pull-components --space <SPACE_ID>

Testing checklist

  • pull-components from a space
    • should create a components.295017.json file inside of .storyblok/components directory containing an array with all the components available
    • it should prompt the user with a successful message ✔ Components downloaded successfully in ./storyblok/components/components.295017.json
  • should prompt an error if flag space is missing Please provide the space as argument --space YOUR_SPACE_ID.
  • should prompt an API error if the space ID is incorrect
  • should prompt an unauthorized error if the user is not logged in before operating this command
  • pull-components in --separate-files
    • should create a file per component with the same space suffix. Example: component named Space A Component Inside Folder 1 should generate space-a-component-inside-folder-1.295017.json
    • Should prompt a warning The --filename option is ignored when using --separate-files if --filename flag is used along --sf
  • pull-components with custom --path
    • should generate a components.295017.json file inside of the path provided.
    • should generate individual files inside the correspondent path if used together with --separate-files
  • pull-components with custom --filename
    • should generate a custom-filename.295017.json inside of the .storyblok/components directory
    • should generate a custom-filename.295017.json inside of the provided path if --path is provided
  • pull-components with custom --suffix
    • should generate a components.suffix.json inside of the .storyblok/components directory
    • should generate a custom-filename.suffix.json inside of the provided path if --path is provided
    • should create a file per component with the same custom suffix if --separate-files is used. Example: component named Space A Component Inside Folder 1 should generate space-a-component-inside-folder-1.suffix.json

@alvarosabu alvarosabu added p3-significant [Priority] Moderate issues, major enhancements feature [Issue] New feature or request labels Dec 3, 2024
@alvarosabu alvarosabu marked this pull request as draft December 3, 2024 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature [Issue] New feature or request p3-significant [Priority] Moderate issues, major enhancements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant