storyblok / storyblok-cli

Storyblok CLI
https://www.npmjs.com/package/storyblok
MIT License
31 stars 30 forks source link

Storyblok CLI - Add argument to pass the migration file path #10

Open anderson-marques opened 4 years ago

anderson-marques commented 4 years ago

The feature would affect: (check one with "x")

Is your feature request related to a problem? Please describe. We're using the storyblok run-migration command. However, it requires a strict folder convention and script file name.

Describe the solution you'd like I would like to be able to pass the full path of my migration script.

Example:

storyblok run-migration --space <SPACE_ID> --component <COMPONENT_NAME> --field <FIELD> --migration-file <MIGRATION_FILE>

That way, we would be more flexible to automate the CLI usage and give self-explanatory names for our migration scripts. Ex: move_article_title_to_footer_nav.js.

Describe alternatives you've considered Using the underline API, but seen the CLI code, looks like it is not a good idea.

maoberlehner commented 2 years ago

Furthermore I'd like to have a configuration file to specify default directories and space ID.

// storyblok.config.js
module.exports = {
  space: 123,
  migrationsFolder: './cms/migrations',
  componentsFolder: './cms/components',
};
edv-ns commented 1 year ago

Any updates on this? 🙌

I see there is no possiblity to change ./migrations folder location: https://github.com/storyblok/storyblok-cli/blob/master/src/tasks/migrations/utils.js#L132 even though the internal util is capable to do that.

pixelmultiplo commented 1 year ago

I don't get why I should use this incomplete cli instead of the old migrations.

edvinasjurele commented 1 year ago

Hey there, any updates on this?

I see there is an internal function runMigration which is capable to set migrationPath (ref), but it is not exposed in the CLI tool itself (ref). We really need that functionality, and we are pretty sure it is one of core features to be in place.

shchypylov commented 8 months ago

@ademarCardoso, could you please look into it! 🙏