“This is the 27th day of my participation in the First Challenge 2022. For details: First Challenge 2022”

Scaffolding requirement analysis and architecture design

What will be gained

  • Master the whole process of architecture design and technical scheme design
  • Scaffolding performs core processes and passescommanderComplete scaffolding construction and command registration
  • Graphic architecture design + drawing skills
  • How do you get a guyNodeProject supportES Module

The main content

  • Scaffolding requirement analysis and architecture design
  • Scaffold module split strategy
  • The core modulecoreTechnical scheme design
  • Implement scaffolding execution preparation process
  • Based on thecommanderImplement scaffolding command registration
  • To make aNodeProject supportES Module

Research and development process

Pain points analysis

  • When creating a project/component, there are many duplicate copies of the code, how to quickly reuse the existing sediment.
  • When co-developing, due togitOperation is not standard, resulting in branch chaos, operation time consuming, how to formulate standardsgitOperation specification and integration into scaffolding.
  • How to develop a standard online process and specification and integrate it into scaffolding?

Demand analysis

  • Universal R & D scaffolding solves all pain points.
  • Common project/component creation capabilities
    • Templates can be customized to take effect quickly
    • Templates support fast access and low access costs
  • Common project/component publishing capabilities
    • The release process automatically completes the standardgitprocess
    • The development branch is automatically deleted and created upon successful publicationtag
    • Automatically complete the cloud build upon successful release,OSSUpload,CDNUpload, domain binding
    • The release process supports testing and formalizes both environments

Git Operation Specification

Draw architecture diagram

Scaffold module split strategy

Divide a large project into multiple modules for easy management and maintenance.

Our scaffolding will be dismantled as planned below.

  • Core process Core
  • The commandCommand
    • Initialize the
    • release
    • Clear the cache
  • The model layerModel
    • CommandThe command
    • Projectproject
    • Componentcomponent
    • NpmThe module
    • Gitwarehouse
  • Support moduleUtils
    • Gitoperation
    • Cloud build
    • Utility methods
    • APIrequest
    • Git Api

Core module technical solution

Command Execution Process

  • Preparation stage
  • The command register
  • Command execution

Design Technical points

Core library

  • import-local
  • commander

Tool library

  • npmlog: Prints logs.
  • fs-extra: File operation
  • semver: Version comparison
  • colors: Prints text without color
  • user-home: Gets the user’s home directory
  • dotenv: Gets environment variables
  • root-checkCheck:rootUser, degrade