Feature: Add Glob Patterns to Typedefs Generation #104
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
How to test this PR
./storyblok/components
storyblok --space <SPACE-ID> pull-components --sf -p ./storyblok/components/
storyblok --space <SPACE-ID> generate-typescript-typedefs --source './storyblok/components/*' --target ./storyblok/storyblok-types.d.ts
What is the new behavior?
You can now provide a glob pattern string to the
generate-typescript-typedefs
command to allow for advanced file matching (e.g.: all files within a directory) while maintaining backwards compatibility.Other information
This proposal stems from a problem I am currently facing where I want to generate types for specific components only without having to add each one of them separately to an npm script.
More Context
In a storyblok project I am currently working on we have separate teams for the creation of the bloks in the blok library and the development of the components in the frontend. Since the blok library team is constantly creating new bloks – primarily to try things out – the generated types in the frontend get littered with "test" components and types.
I now want to be able to pull all of the components with one command, only commit those I need to the codebase (folder) and then generate the types only for the components in that folder.
Thanks for your time and have a great weekend :)