Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@jungvonmatt/contentful-migrations

Package Overview
Dependencies
Maintainers
4
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jungvonmatt/contentful-migrations

Helper to handle migrations in contentful

Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
1.5K
12.46%
Maintainers
4
Weekly downloads
 
Created
Source

JvM Contentful Migrations

Getting started

Install

npm i @jungvonmatt/contentful-migrations

Commands

help

npx migrations help [command]

init

npx migrations init

Initializes migrations and stores the config values in the package.json or the .migrationsrc file.

Configuration values

NameDefaultDescription
accessTokenundefinedContentful Management Token. Just run npx contentful login and you're done.
spaceIdundefinedContentful Space id
defaultEnvironment'master'Contentful Space environment. Acts as default if there is no environment named after the current git branch or the passed env doesn't exist
contentTypeId'config'Id of a content model holding global config values (Required for storing the migration version)
fieldId'migration'Id of the field where the migration version is stored
directory'./migrations'Directory where the migration files are stored

generate

Generate an empty migration script. This command will also add an initial migration to add the contentType and the field if they not already exist.

npx migrations generate

fetch

Generate a migration script based on passed content-type. This command will also add an initial migration to add the contentType and the field if they not already exist.

npx migrations fetch -c <my-content-type>

migrate

Runs all "new" migrations on the current environment or the environment specified by the -e param

npx migrations migrate

content

Transfer content from one contentful environment to another.
This command will not overwrite existing content unless you say so.

npx migrations content --source-env <environment>  --dest-env <environment>
Optional Arguments

--content-type: Limit to specific content-type and it's dependencies.
--diff: Manually choose skip/overwrite for every conflicting content.
--force: No manual diffing. Overwrites all conflicting entries/assets.
--verbose: Show tree of entries/assets which should be migrated.

Diff example

Can I contribute?

Of course. We appreciate all of our contributors and welcome contributions to improve the project further. If you're uncertain whether an addition should be made, feel free to open up an issue and we can discuss it.

Keywords

contentful

FAQs

Package last updated on 26 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts