CN-121996209-A - Scaffold-based multi-project integrated front end development method and device
Abstract
The embodiment of the specification discloses a scaffold-based multi-project integrated front end development method and device. The method comprises the steps of building a scaffold system based on a preset scaffold tool, adding target configuration files for managing various items in global configuration files of the scaffold system, searching entry files in item folders corresponding to items based on the target configuration files when an execution instruction for any item is detected, and executing operation according to the entry files. According to the embodiment of the specification, through the file folder management and resource file sharing mechanism, a plurality of projects can use one scaffold at the same time, so that the projects can be concentrated in one scaffold system for management, balance of independence among the projects and resource sharing is achieved, and development efficiency is improved.
Inventors
- SHEN XIAOQIN
- LI TAO
- XU WEIFENG
- REN FUJIA
- GE HAO
Assignees
- 杭州老板电器股份有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20241104
Claims (10)
- 1. A scaffold-based multi-project integrated front-end development method, the method comprising: Building a scaffold system based on a preset scaffold tool, and additionally arranging a target configuration file for managing each item in a global configuration file of the scaffold system, wherein a source code file directory of the scaffold system comprises a shared folder and at least one item folder, the shared folder is used for storing standardized multiplexing resources, each item folder is used for storing item resources of one independent item, and the number of the item folders is matched with that of the independent items; And when an execution instruction aiming at any item is detected, searching an entry file in an item folder corresponding to the item based on the target configuration file, and executing an operation according to the entry file.
- 2. The method of claim 1, wherein the standardized multiplexing resources include shared generic pages, generic components, and generic scripts, and the project resources include project routes, project pages, portal scripts, and portal pages.
- 3. The method according to claim 1, wherein when an execution instruction for any item is detected, searching for an entry file in an item folder corresponding to the item based on the target configuration file, and performing an operation according to the entry file, includes: When an execution instruction aiming at any item is detected, calling a metadata file of the item, and determining an item name and a target configuration file corresponding to the item according to the metadata file; and determining a project folder corresponding to the project according to the project name, searching an entry file in the project folder based on the target configuration file, and executing operation according to the entry file.
- 4. The method according to claim 1, wherein the method further comprises: When an item merging instruction is detected, determining each target item to be merged, and creating a merging folder in a source code file directory of the scaffold system, wherein the merging folder is used for storing merging item resources, the merging item resources comprise merging item routes, merging item pages, an entry script and an entry page, and the merging item pages comprise item pages of each target item; And adding a routing configuration file in the project resource of each target project, adding the routing configuration file of each target project to the combined project route, and storing all routes of the target project by the routing configuration file.
- 5. The method of claim 4, wherein when an item merge instruction is detected, determining each target item to be merged and creating a merge folder in a source code file directory of the scaffolding system, comprising: When an item merging instruction is detected, determining each target item to be merged; Creating a combined folder in a source code file directory of the scaffold system when the scaffold systems corresponding to the target items are the same; When the scaffold systems corresponding to the target projects are different, creating a new scaffold system, creating one project folder for each target project in the new scaffold system, copying the target projects into the project folder, and creating a combined folder in a source code file directory of the new scaffold system.
- 6. The method according to claim 1, wherein the method further comprises: And creating a local component library, adding universal components and universal scripts of standardized multiplexing resources in each scaffold system to the local component library, and publishing library resources of the local component library based on an online package manager.
- 7. The method of claim 6, wherein the method further comprises: Labeling resource information corresponding to each library resource, wherein the resource information comprises version information and update record information; and updating version information corresponding to the current library resource when the local component library is updated.
- 8. A scaffold-based multi-project integrated front-end development device, the device comprising: the scaffold system comprises a building module, a scaffold system and a source code file directory, wherein the building module is used for building a scaffold system based on a preset scaffold tool, adding a target configuration file for managing each item in a global configuration file of the scaffold system, the source code file directory of the scaffold system comprises a shared folder and at least one item folder, the shared folder is used for storing standardized multiplexing resources, each item folder is used for storing item resources of one independent item, and the number of the item folders is matched with that of the independent items; And the searching module is used for searching an entry file in the item folder corresponding to the item based on the target configuration file when the execution instruction for any item is detected, and executing the operation according to the entry file.
- 9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1-7 when the computer program is executed.
- 10. A computer readable storage medium having stored thereon a computer program having instructions stored therein, which when run on a computer or processor, cause the computer or processor to perform the steps of the method according to any of claims 1-7.
Description
Scaffold-based multi-project integrated front end development method and device Technical Field One or more embodiments of the present disclosure relate to software development technology, and in particular, to a scaffold-based multi-project integrated front end development method and apparatus. Background Scaffolds are a set of basic code and tool sets for quickly initializing the basic structure of a project, providing basic configuration and functionality required for project development, to help a developer quickly build an initial code structure of a new project, so that the developer can begin writing business logic more quickly without setting up the entire project environment from scratch. All types of front-end development scaffolds widely circulated in the current market are corresponding to one project, so that the projects are scattered, the projects of the same type cannot be placed together in a centralized manner for management, and development efficiency is affected. Disclosure of Invention To solve the above problems, one or more embodiments of the present disclosure describe a scaffold-based multi-project integrated front end development method, apparatus, and electronic device. According to a first aspect, there is provided a scaffold-based multi-project integrated front end development method, the method comprising: Building a scaffold system based on a preset scaffold tool, and additionally arranging a target configuration file for managing each item in a global configuration file of the scaffold system, wherein a source code file directory of the scaffold system comprises a shared folder and at least one item folder, the shared folder is used for storing standardized multiplexing resources, each item folder is used for storing item resources of one independent item, and the number of the item folders is matched with that of the independent items; And when an execution instruction aiming at any item is detected, searching an entry file in an item folder corresponding to the item based on the target configuration file, and executing an operation according to the entry file. Preferably, the standardized multiplexing resources include shared generic pages, generic components and generic scripts, and the project resources include project routes, project pages, entry scripts and entry pages. Preferably, when an execution instruction for any item is detected, searching an entry file in an item folder corresponding to the item based on the target configuration file, and executing an operation according to the entry file, including: When an execution instruction aiming at any item is detected, calling a metadata file of the item, and determining an item name and a target configuration file corresponding to the item according to the metadata file; and determining a project folder corresponding to the project according to the project name, searching an entry file in the project folder based on the target configuration file, and executing operation according to the entry file. Preferably, the method further comprises: When an item merging instruction is detected, determining each target item to be merged, and creating a merging folder in a source code file directory of the scaffold system, wherein the merging folder is used for storing merging item resources, the merging item resources comprise merging item routes, merging item pages, an entry script and an entry page, and the merging item pages comprise item pages of each target item; And adding a routing configuration file in the project resource of each target project, adding the routing configuration file of each target project to the combined project route, and storing all routes of the target project by the routing configuration file. Preferably, when the project merging instruction is detected, determining each target project to be merged, and creating a merging folder in a source code file directory of the scaffold system, including: When an item merging instruction is detected, determining each target item to be merged; Creating a combined folder in a source code file directory of the scaffold system when the scaffold systems corresponding to the target items are the same; When the scaffold systems corresponding to the target projects are different, creating a new scaffold system, creating one project folder for each target project in the new scaffold system, copying the target projects into the project folder, and creating a combined folder in a source code file directory of the new scaffold system. Preferably, the method further comprises: And creating a local component library, adding universal components and universal scripts of standardized multiplexing resources in each scaffold system to the local component library, and publishing library resources of the local component library based on an online package manager. Preferably, the method further comprises: Labeling resource information corresponding to each library resource, wherein