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!: generated file naming syntax #135

Open
wants to merge 2 commits into
base: next
Choose a base branch
from

Conversation

alvarosabu
Copy link
Contributor

The current implementation applies the flags --filename differently and has different naming conventions for generated files depending on the command

This PR introduces another breaking change requested by clients which solves the situation by establishing a common format for generated files:

<filename>.<suffix>.<extension>

Where:

  • <filename> is the name of the file. Customizable by the user with the --filename flag
  • <suffix> is an optional suffix to differentiate the files. By default is going to be the spaceId and is customizable by the user with the --suffix flag
  • <extension> is the file extension. By default is json (Not configurable)

Example:

storyblok pull-languages --space=12345 --filename=my-languages --suffix=dev

Will generate the languages in the following path .storyblok/languages/my-languages.dev.json

If you would like to use a timestamp as the suffix you can use:

storyblok pull-languages --space=12345 --filename=my-languages --suffix="$(date +%s)"

Warning

The --filename will be ignored in the case that --separate-files is used on the commands that supports it.

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`
@alvarosabu alvarosabu self-assigned this Nov 13, 2024
@alvarosabu alvarosabu added feature [Issue] New feature or request breaking-change Changes that cause backward compatibility issues and will require a major version. labels Nov 13, 2024
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. feature [Issue] New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant