-
Notifications
You must be signed in to change notification settings - Fork 30
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
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alvarosabu
added
p3-significant
[Priority] Moderate issues, major enhancements
feature
[Issue] New feature or request
labels
Dec 3, 2024
…ing suffix optional
…ure/pull-components-cmd
- Updated actions to use customFetch instead of ofetch - Modified the `saveComponentsToFiles` function to accept a structured `spaceData` object containing components, groups, and presets, instead of separate parameters. - Updated the default filename behavior to save as `components.json` instead of including the space ID in the filename. - Enhanced test cases to reflect changes in the function signature and filename generation logic. - Removed unused imports and interfaces to streamline the codebase.
- Deleted the entire block command implementation from the codebase. - Removed unused imports related to the block command in the components test file.
…pport fetching individual components - Introduced a new `fetchComponent` function to retrieve a specific component by name. - Updated the `componentsCommand` to allow pulling a single component by name, enhancing the command's functionality. - Modified tests to cover the new component fetching feature, including scenarios for successful retrieval and handling of non-existent components. - Adjusted the structure of the command's output to reflect the new functionality, ensuring clarity in success messages.
edodusi
reviewed
Jan 21, 2025
Co-authored-by: Edoardo Dusi <[email protected]>
edodusi
reviewed
Jan 21, 2025
edodusi
approved these changes
Jan 21, 2025
Co-authored-by: Edoardo Dusi <[email protected]>
…to" instead of "in"
…and with loading spinners - Changed COMPONENTS color from '#FF5722' to '#a185ff' in src/constants.ts for better visual consistency. - Added loading spinners to the components command in src/commands/components/index.ts to improve user experience during data fetching operations. - Each data fetching step now provides visual feedback, enhancing the command's interactivity.
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces the new implementation of the
pull-components
commandHow to test this PR
295017
or295018
pnpm install
pnpm run dev components pull --space <SPACE_ID>
Testing checklist
components.json
file inside of.storyblok/components/295017
directory containing an array with all the components available✔ Components downloaded successfully in ./storyblok/components/295017/components.json
Please provide the space as argument --space YOUR_SPACE_ID.
--separate-files
Space A Component Inside Folder 1
should generatespace-a-component-inside-folder-1.json
The --filename option is ignored when using --separate-files
if--filename
flag is used along--sf
--path
components.295017.json
file inside of the path provided.--separate-files
--filename
custom-filename.json
inside of the.storyblok/components/295017
directorycustom-filename.json
inside of the provided path if--path
is provided--suffix
components.suffix.json
inside of the.storyblok/components/295017
directorycustom-filename.suffix.json
inside of the provided path if--path
is provided--separate-files
is used. Example: component namedSpace A Component Inside Folder 1
should generatespace-a-component-inside-folder-1.suffix.json
storyblok components pull component-name
component-name.json
file inside.storyblok/components/295017