01- Scaffolding development
01- Analyze the necessity of scaffolding development from the perspective of front-end development
R&d performance
The core goal of scaffolding development is to improve front-end development performance
Scaffolding core value
The development process
- Automation: project initialization of duplicate code copies/Git operations/distribution online operations
- Standardization: project creation/Git flow/ release process/rollback process
- Datalization: research and development projects are systematized and datalized to make the research and development process quantifiable
And automated build tools
Q: Why do you need to build your own scaffolding when automated build tools like Jenkins are mature?
- However, Jenkins usually triggers in Githooks and needs to be executed on the server side, which fails to cover the local functions of developers, such as project creation automation and local Git operation automation
- Complicated customization: Jenkins needs to develop plug-ins in the customization process, which is complicated and requires Java language, so it is not friendly to front-end students
02- What is scaffolding in terms of use
Introduction to Scaffolding
Scaffolding is essentially an operating system client that executes from the command line, for example:
vue create vue-test --force
Copy the code
The above command consists of three parts
- Main command: vue
- Command: the create
- Command params: vue-test
- Option: Used to assist scaffolding in determining the user’s choice in a particular scenario
Scaffolding execution Principle
The execution principle of scaffolding is as follows:
- Input at terminal
vue create vue-test-app
- The terminal parses the Vue command
- The terminal finds the Vue command in the environment variable
- The terminal links to the actual file vue.js according to the vue command
- The terminal uses Node to execute vue.js
- Vue. Js parsing the command/options
- Vue. Js parsing the command
- Exit after the command is executed
How to develop a scaffold from an application perspective
Take for example vue – cli
- Develop an NPM project that contains a bin/vue.js file and publish the project to NPM
- Install the NPM project into the node
lib/node_modules
- Configure the vue soft connection in the bin directory of node
lib/node_modules/@vue/cli/bin/vue.js