-
Notifications
You must be signed in to change notification settings - Fork 34
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: types-generate-cmd WIP #169
Open
alvarosabu
wants to merge
9
commits into
next
Choose a base branch
from
feature/types-generate-cmd
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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
…tion - Introduced new utility functions in `format.ts` for converting strings to PascalCase, CamelCase, and SnakeCase. - Added functions for masking tokens, slugifying text, and recursively removing properties from objects. - Implemented a method to convert objects to string parameters for URLSearchParams. - Created a function to generate regex patterns from glob patterns. - Updated `index.ts` to export the new formatting utilities.
- Refactored the type generation logic to improve handling of component types, including sanitization of component names. - Introduced a new `ComponentPropertySchema` interface and related types in `schemas.ts` for better type safety and organization. - Updated the `generateStoryblokTypes` function to read type definitions from an external file, ensuring a more robust extraction process. - Removed redundant type definitions from `storyblok.ts` to streamline the codebase and avoid duplication.
- Added support for component restrictions based on groups and individual whitelists in `getComponentPropertiesTypeAnnotations`. - Introduced a new parameter `componentsMaps` to facilitate the mapping of component groups and names. - Updated the `generateTypes` function to pass the new `componentsMaps` parameter, improving type safety and flexibility in handling component properties.
- Updated `generateTypes` and `getComponentPropertiesTypeAnnotations` functions to utilize `spaceData` instead of `componentsMaps`, improving type safety and flexibility. - Added null checks for `spaceData.components` to prevent runtime errors. - Removed the redundant `generateComponentGroupsAndComponentNames` function to streamline the codebase. - Improved error handling in the `generateTypes` function by implementing a try/catch block to manage asynchronous errors effectively.
- Refactored `GenerateTypesOptions` to replace `typeNamesPrefix` and `typeNamesSuffix` with a single `typePrefix` option for improved clarity and usability. - Enhanced `getComponentType` function to utilize the new `typePrefix` option, simplifying the type name generation process. - Updated command options in `index.ts` to include `--type-prefix` for better user experience when generating component types. - Adjusted handling of Storyblok property types to ensure consistent type generation without unnecessary prefixes.
- Introduced a new launch configuration in `.vscode/launch.json` for debugging the type generation process with separate files. - This configuration allows for easier debugging of the type generation command, enhancing the development experience.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull request type
Jira Link: INT-
How to test this PR
What is the new behavior?
Other information