JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q46155F
  • License ISC

Create and configure a Sourcebit installation

Package Exports

  • create-sourcebit

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (create-sourcebit) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

create-sourcebit

npm version

An interactive setup process for Sourcebit

Introduction

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

It's the responsibility of each plugin to define the questions and process the answers, which takes place via the getSetup and getOptionsFromSetup methods.

Using local plugins

Normally, the interactive setup process will fetch available plugins from the npm registry by looking for packages whose name begin with sourcebit-source, sourcebit-target or sourcebit-plugin. 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 provide a mock response for the npm API.

For this, you first need to create a JSON file and add some mock npm modules to it, following the structure below:

my-project/npm-override.json

[
  {
    "package": {
      "name": "/Users/johndoe/sourcebit-source-contentful",
      "version": "0.1.0",
      "description": "A Contentful source plugin for Sourcebit"
    }
  },
  {
    "package": {
      "name": "/Users/johndoe/sourcebit-target-jekyll",
      "version": "0.1.0",
      "description": "A Sourcebit plugin for Jekyll"
    }
  }
]

Note that name needs to contain an absolute path to the plugin directory.

After creating this file, you can run the setup process with the --registry-override parameter like so:

$ npx create-sourcebit --registry-override=./npm-override.json