npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

migrateful

v0.1.0

Published

A migration manager for the Contenful platform

Downloads

12

Readme

Migrateful

Migrateful is a migration manager for the Contentful platform.

  • Represent your data schemas in code
  • Automatically pick up and apply migration scripts
  • Version releases for easy rollback
  • Separate environments for prod, dev, and features
  • No installation necessary

Motivation

Contentful has nice SDK's in place for cloning environments and running migrations scripts. However, these are somewhat low-level. You can either run each migration script by hand or create your own versioning system.

Migrateful gives you a complete migration system out of the box. It is designed based on Contentful's scripting guide with a few more conveniences built in. Just create a new Contentful space, drop in your migration scripts, and run npx migrateful.

Setup the space

You will need the SpaceID and a personal access token

  • Create an empty Space

    • Go to Organization settingsAdd space
    • Name your space and select Empty space
    • In the new space, go to SettingsGeneral settings
    • Copy the Space ID
  • Create a personal access token

    • Go to SettingsAPI keysContent management tokens
    • Click Generate personal token
    • Name the token and copy the key
  • Opt into the master alias

    • Go to SettingsEnvironments
    • Click Set up your first alias
    • It will ask to rename the master environment ... say yes

Usage

Put all of your contentful migration scripts in a folder called migrations. Name them using the format {version}-{name}.js. For example, you might have 01-init.js, 02-add-post-type.js, 03-add-title-field.js.

Run the following command, where <env> is your environment name. For your prod environment, this can be either master or main. For a dev or feature environment, you can name it whatever your want. A new environment will be created and the migrations will be applied.

npx migrateful <env>

Migrateful will read your space ID and access token from the environment.

export CONTENTFUL_SPACE_ID=<spaceId>
export CONTENTFUL_ACCESS_TOKEN=<token>