Skip to content

v4 #181

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

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

v4 #181

wants to merge 320 commits into from

Conversation

alvarosabu
Copy link
Contributor

Brand new fancy Storyblok CLI

…tadata-program

chore: add maintenance oriented readme and improve debugging
BREAKING CHANGE: Generated files will no longer be saved on the root of the project by default, they will be encapsulated inside of a `.storyblok` folder.
BREAKING CHANGE: generated file naming syntax is now standard between all the commands, following the structure `<filename>.<suffix>.json`. Both filename and suffix are customizable and by default would be the command name and the spaceId respectively. Ex: `components.12345.json`
…fault

feat!: `.storyblok` directory default
…syntax

feat!: generated file naming syntax
alvarosabu and others added 10 commits May 13, 2025 08:38
- Improved image alt text for better accessibility in the debugging section.
- Corrected issue submission link to point to the Storyblok CLI repository.
- Updated contribution documentation link to reflect the correct repository.
- Improved the phrasing of the sync command's benefits for better readability and understanding.
chore: updated the package.json detection and removed the STUB env var
@angelikatyborska
Copy link
Member

@alvarosabu there's a .DS_Store being added in this PR, that's probably a mistake. Somebody didn't set up their local gitignore correctly 🧐

@alvarosabu
Copy link
Contributor Author

@alvarosabu there's a .DS_Store being added in this PR, that's probably a mistake. Somebody didn't set up their local gitignore correctly 🧐

Done @angelikatyborska #196

angelikatyborska and others added 15 commits May 19, 2025 15:43
fix: prevent infinite loop on push component
* fix: fetchComponent when common name prefix

* test: 422 responses when upserting components

* fix: finding matching preset when names aren't unique
…n-the-list (#204)

* fix: call spinner.failed on warning

- Added a spinner failure indication when no languages are found.
- Updated the warning message format in the konsola utility for better readability.

* chore: enable sourcemaps for debugging

* tests: update warning message format in tests
* fix: skip region select if region flag is used

* tests: update tests messages
… Storyblok types (#208)

- Updated the path resolution for the Storyblok types file to use __dirname for better reliability.
- Simplified the type extraction process by directly using the content of the storyblokTypesContent instead of manually collecting type definitions.
- Ensured that the schema handling is more robust by adding a fallback for component.schema.
* fix(creds): get first credential to operate

* fix(creds): update getCredentials to return empty object instead of null

- Modified the getCredentials function to return an empty object when the credentials file does not exist, improving type consistency.
- Updated related tests to reflect this change, ensuring that the expected output aligns with the new implementation.
- Introduced a utility function isEmptyObject to check for empty objects, enhancing code readability and maintainability.

* fix(creds): update getCredentials to return null for empty credentials

- Modified the getCredentials function to return null instead of an empty object when the credentials file is empty or does not exist, improving type consistency.
- Updated related tests to reflect this change, ensuring that the expected output aligns with the new implementation.
- Adjusted session handling to check for null credentials, enhancing the robustness of the session creation process.

* refactor(session): remove unused isEmptyObject import

- Removed the unused import of isEmptyObject from utils, streamlining the session.ts file and improving code clarity.
- This change does not affect the functionality of the session handling.
…210)

* fix(type):  generate single and multi options fields types correctly

* refactor(types): correctly handle camelCase
…ntsFiles (#212)

- Improved error messages in readComponentsFiles to provide clearer instructions for users when no local components are found for a specified space.
- Added a new optional `space` parameter to the ReadComponentsOptions interface to support better context in component operations.
- Updated related tests to ensure the new space parameter is correctly utilized and error messages are formatted with chalk for better readability.
- Included the @storyblok/js package in package.json to enhance Storyblok integration.
- Updated pnpm-lock.yaml to reflect the new dependency and its version.
* fix(type): import ISbStoryData from storyblok-js package

- Added an import statement for the Storyblok type to the generated types file, enhancing type safety and ensuring proper type definitions are utilized in the generated output.

* fix(tests): enhance verification of generated Storyblok types in tests

- Updated the test for `generateStoryblokTypes` to verify the first three lines of the generated content, ensuring that the output includes the correct header comments and the import statement for `ISbStoryData`.
- This change improves the accuracy of the tests by checking specific content rather than relying on a regex match, enhancing maintainability and clarity.
- Introduced a new `handleVerboseError` function to centralize and enhance the logging of different error types (CommandError, APIError, FileSystemError).
- Simplified the `handleError` function by delegating verbose error handling to the new function, improving code readability and maintainability.
- This change ensures that all error types are logged consistently and provides clearer information for debugging.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Changes that cause backward compatibility issues and will require a major version. v4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants