“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 passes
commander
Complete scaffolding construction and command registration - Graphic architecture design + drawing skills
- How do you get a guy
Node
Project supportES Module
The main content
- Scaffolding requirement analysis and architecture design
- Scaffold module split strategy
- The core module
core
Technical scheme design - Implement scaffolding execution preparation process
- Based on the
commander
Implement scaffolding command registration - To make a
Node
Project 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 to
git
Operation is not standard, resulting in branch chaos, operation time consuming, how to formulate standardsgit
Operation 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 standard
git
process - The development branch is automatically deleted and created upon successful publication
tag
- Automatically complete the cloud build upon successful release,
OSS
Upload,CDN
Upload, domain binding - The release process supports testing and formalizes both environments
- The release process automatically completes the standard
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
Command
The commandProject
projectComponent
componentNpm
The moduleGit
warehouse
- Support moduleUtils
Git
operation- Cloud build
- Utility methods
API
requestGit 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 operationsemver
: Version comparisoncolors
: Prints text without coloruser-home
: Gets the user’s home directorydotenv
: Gets environment variablesroot-check
Check:root
User, degrade