Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wework/monarch

Package Overview
Dependencies
Maintainers
17
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wework/monarch

service for dynamically generating Contentful Migrations

  • 1.0.0-alpha.0
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
17
Created
Source

monarch

Welcome to Monarch! We offer a node script to allow you to dynamically create Contentful migration files within your application.

See it in action

React Component specs

ProptypeContentful typeNotes
stringSymbol
numberNumber
boolBoolean
arrayOfArraysupports Links to references or assets
objectLink to assetonly if jsdoc @asset flag added
shapeLink to assetonly if jsdoc @asset flag added
instanceOfLink to reference

For ignoring proptypes, use jsdoc comment flag @ignore-content-prop

Read more about contentful content types.

Getting Started

We are not quite ready to be used in production, but in the meantime... Test it out locally (be sure to yarn or npm install before doing anything):

git clone git@github.com:wework/monarch.git

To create and update the migration file, simply run the node script parseMigrate.js with one argument:

node parseMigrate.js <path/to/component/file>

or use command script locally:

yarn parse:migrate <path/to/component/file>

Check out migrations directory and see that the file has been created. If you run this script multiple times, you will see a new file for each time it is run, name spaced with the timestamp of creation.

Running the migration files

Once you have the files generated, you are ready to push them up to Contentful!

  1. Make sure your Contentful space has been initialized with a Migration content model. If you need to initialize a space, use command ctf-migrate init

  2. Once initialized, run the migrations with commands ctf-migrate up to create the model & ctf-migrate down to delete it.

The future

  • support other front-end frameworks
  • export custom validators

FAQs

Package last updated on 23 Oct 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc