Skip to content

stackbit/create-sourcebit

 
 

Repository files navigation

create-sourcebit

npm version

An interactive setup process for Sourcebit

Introduction

Sourcebit uses a configuration file of sourcebit.js to define and configure all of its plugins. While this file can be created manually, this command-line interface provides an interactive setup that gathers enough information about the user's environment and content architecture to create a working configuration.

Every Sourcebit plugin must define the questions that should be asked and process the answers. This takes place via the getSetup and getOptionsFromSetup methods.

Plugin registry

The list of plugins offered by the interactive setup process is pulled from the plugins.json file in the root of the repository. It's an array of objects with the following properties:

  • module (String): The name of the plugin's npm module
    • Example: sourcebit-source-contentful
  • description (String): A human-friendly description of the plugin
    • Example: A Contentful source plugin for Sourcebit
  • author (String): The name/handle of the plugin's author
    • Example: John Doe <john.doe@example.com>
  • type (enum: source|target): The type of plugin
    • Example: source

plugins.json

[
  {
    "module": "/Users/eduardoboucas/Sites/sourcebit-source-contentful",
    "description": "A Contentful source plugin for Sourcebit",
    "author": "Stackbit",
    "type": "source"
  },
  {
    "module": "/Users/eduardoboucas/Sites/sourcebit-target-jekyll",
    "description": "A Sourcebit plugin for Jekyll",
    "author": "Stackbit",
    "type": "target"
  }
]

If you are developing a plugin and you'd like for it to appear on the setup process without having to publish it to npm, you can add it to this array and set the value of module to an absolute path on your filesystem.

About

An interactive setup process for Sourcebit

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors