Skip to content

Latest commit

 

History

History
87 lines (61 loc) · 1.63 KB

CONTRIBUTING.md

File metadata and controls

87 lines (61 loc) · 1.63 KB

Contribute Guide

Pull Request Guidelines

  • Checkout a topic branch from main branch, and merge back against that branch.

  • Work in the src and templates folders.

  • Use fbi commit to commit your code.

    # install
    npx fbi add factory-commands
    # usage
    npx fbi commit

Development

  • Setup

    npm i -g fbi
    yarn
    
    # link local factory to global env, so you can use it everywhere in terminal. (like `npm link`)
    fbi link
  • Start development

    yarn dev

Test

  • Create an examples folder

    cd [project-root]
    mkdir examples
    cd examples
  • Create a project

    fbi create

    Exit when showing Installing dependencies... in terminal.

  • Change project to use local deps. In project's package.json devDependencies

    <!-- before -->
    {
      "@fbi-js/factory-web": "^1.4.0"
    }
    
    <!-- after -->
    {
      "@fbi-js/factory-web": "file:../" <!-- relative to factory-web's root -->
    }
  • Install dependencies

    npm i
  • Run npm scripts

    yarn dev
    
    yarn build

Project Structure

  • src
    • index.ts: factory class entry file. It extends fbi Factory.
    • src/commands: contains all executable commands which extends fbi Command.
    • src/templates: contains all templates which extends fbi Template.
  • templates: contains all static files of each template, used by src/templates.