WO2019007016A1 - Scaffolding management method and apparatus, and electronic device - Google Patents
Scaffolding management method and apparatus, and electronic device Download PDFInfo
- Publication number
- WO2019007016A1 WO2019007016A1 PCT/CN2018/071608 CN2018071608W WO2019007016A1 WO 2019007016 A1 WO2019007016 A1 WO 2019007016A1 CN 2018071608 W CN2018071608 W CN 2018071608W WO 2019007016 A1 WO2019007016 A1 WO 2019007016A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- scaffolding
- scaffold
- template
- module
- local
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/20—Software design
- G06F8/22—Procedural
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/72—Code refactoring
Definitions
- the present invention relates to the field of computer technologies, and in particular, to a scaffold management method, apparatus, and electronic device.
- Git is an open source distributed version control system that efficiently and quickly handles project management from very small to very large. Scaffolding can provide the initial basic skeleton, development environment, etc. for the project, which is convenient for rapid development and saves time. In the prior art, it is usually necessary to carry out the development and use of the scaffold after relatively cumbersome operations, and it is very inconvenient to track the operation history of the scaffold. Therefore, how to implement simple and fast scaffolding configuration and use is very important.
- an object of the present invention is to provide a scaffold management method, apparatus, and electronic device to solve at least one of the above problems.
- An embodiment of the present invention provides a scaffold management method, which is applied to a client connected to a server, where the server prestores a Git repository including a plurality of scaffold templates, and the method includes:
- the scaffolding code in the decompressed file is configured to generate the required scaffolding files.
- the method before the step of obtaining the scaffolding module corresponding to the scaffolding template name to be processed from the Git repository or the local repository, the method further includes:
- the specified scaffolding template is obtained by the following steps:
- the method further includes:
- the step of downloading the scaffold template corresponding to the name of the scaffold template to be processed is downloaded in the Git repository.
- the step of configuring the scaffolding code in the decompressed file to generate a required scaffolding file includes:
- the custom configuration table is obtained by the following steps:
- a selection result input by the user is received, and a custom configuration table corresponding to the selection result is generated.
- the step of configuring the scaffolding code in the decompressed file to generate a required scaffolding file includes:
- the scaffolding code in the decompressed file is configured according to the custom configuration table to generate the required scaffolding file.
- the server is a GitHub server or a GitLab server.
- Another embodiment of the present invention further provides a scaffold management apparatus, which is applied to a user end communicatively connected to a server, wherein the server prestores a Git repository including a plurality of scaffold templates, the scaffold management apparatus comprising:
- a first obtaining module configured to acquire a plurality of scaffold templates from the Git repository of the server, and save the local template to generate a local warehouse
- a second obtaining module configured to obtain, from the Git warehouse or the local warehouse, a scaffolding module corresponding to a scaffolding template name to be processed, as a designated scaffolding template;
- the decompression module is configured to decompress the specified scaffold template to obtain a decompressed file and store the file in a local folder;
- a configuration module configured to configure scaffolding code in the decompressed file to generate a required scaffolding file.
- the scaffold management device further includes a receiving module, a determining module, and a first query module;
- the receiving module is configured to receive a query instruction
- the determining module is configured to determine whether the query instruction is consistent with a preset instruction
- the first query module is configured to query, according to the query instruction, all scaffold template information in the Git repository when the query instruction is consistent with the preset instruction.
- the scaffold management device further includes a second query module, an extraction module, and a download module;
- the second query module is configured to query whether there is a scaffold template corresponding to the to-be-processed scaffold template name in the local warehouse;
- the extraction module is configured to: when a scaffold template corresponding to the scaffold template name to be processed exists in the local warehouse, extract a scaffold template corresponding to the to-be-processed scaffold template name from the local warehouse, As a designated scaffolding template;
- the downloading module is configured to download a scaffolding template corresponding to the to-be-processed scaffolding template name from the Git repository when there is no scaffolding template corresponding to the scaffolding template name to be processed in the local warehouse. As a designated scaffolding template.
- the scaffold management device further includes:
- the mode determining module is configured to determine whether the current system mode is an offline mode after the query obtains the scaffold template corresponding to the to-be-processed scaffold template name in the local warehouse, and if the offline mode is performed, execute the local mode The step of extracting the scaffold template corresponding to the template name of the scaffold to be processed in the warehouse, if not in the offline mode, triggering the download module to download from the Git repository to obtain the template name of the scaffold to be processed. Scaffolding template.
- the configuration module includes:
- Displaying a sub-module configured to display preset configuration information for the user to select when obtaining the decompressed file
- a first generation submodule configured to obtain a selection result of the user, and generate a custom configuration table corresponding to the selection result
- a second generation submodule configured to configure the scaffolding code in the decompressed file according to the custom configuration table to generate a required scaffolding file.
- Another embodiment of the present invention further provides an electronic device, wherein the electronic device is in communication with a server, and the server prestores a Git repository including a plurality of scaffold templates, the electronic device comprising:
- a scaffolding management device is installed in the memory and includes one or more software function modules executed by the processor.
- Another embodiment of the present invention also provides a computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements the steps of the scaffolding management method described above.
- the embodiment of the invention provides a method, a device and an electronic device for managing a scaffold.
- the multiple scaffold templates required for the project are uniformly stored in a remote Git warehouse, and multiple scaffold templates are extracted from the Git repository and saved locally to generate local warehouse.
- the scaffolding management solution provided by the embodiment of the invention saves the processing time of the whole process and reduces the processing load of the system, and can generate the required scaffolding files conveniently and quickly, and does not require unnecessary operations for the user and the developer. It is a convenient management tool.
- FIG. 1 is a schematic diagram of an application scenario of a scaffold management method according to an embodiment of the present invention.
- FIG. 2 is a schematic structural block diagram of a user end according to an embodiment of the present invention.
- FIG. 3 is a flowchart of a scaffold management method according to an embodiment of the present invention.
- FIG. 4 is another flowchart of a method for managing a scaffold according to an embodiment of the present invention.
- FIG. 5 is another flowchart of a method for managing a scaffold according to an embodiment of the present invention.
- FIG. 6 is a functional block diagram of a scaffold management apparatus according to an embodiment of the present invention.
- FIG. 7 is a block diagram of another functional module of the scaffold management apparatus according to an embodiment of the present invention.
- FIG. 8 is a block diagram of another functional module of the scaffold management apparatus according to an embodiment of the present invention.
- FIG. 9 is a block diagram of another functional module of the scaffold management apparatus according to an embodiment of the present invention.
- Icons 100-user; 110-scaffold management device; 111-first acquisition module; 112-second acquisition module; 113-decompression module; 114-configuration module; 115-receive module; 116-judgment module; a query module; 118-second query module; 119-extraction module; 1110-download module; 1111-setup module; 1112-generation module; 120-processor; 130-memory;
- connection is to be understood broadly, and may be, for example, a fixed connection or a detachable connection, or Connected integrally; can be mechanical or electrical; can be directly connected or indirectly connected through an intermediate medium, which can be the internal communication between the two components.
- installation can be understood in a specific case by those skilled in the art.
- FIG. 1 is a schematic diagram of an application scenario of a scaffold management method according to an embodiment of the present invention.
- the scenario includes a client 100 and a server 200.
- the client 100 is in communication with the server 200 via a network for data communication or interaction.
- the client 100 may be multiple (only one is shown), and the plurality of clients 100 are communicably connected to the server 200 through a network.
- the client 100 can be, but is not limited to, a personal computer, a tablet, a smart phone, a mobile internet device, and the like.
- the server 200 may be a network server or a database server, and may be a separate server or a server cluster.
- the server 200 may be a GitHub server or a GitLab server configured to manage a Git Repository.
- Git the file directory that needs to be versioned is called a warehouse, and each warehouse is equivalent to a directory. All files in the directory are managed by Git, and Git can track and record in the directory. All updates (eg, adding files, deleting files, modifying files, etc.).
- FIG. 2 is a schematic structural block diagram of an electronic device according to an embodiment of the present invention.
- the electronic device may be the client 100 described above, and the client 100 includes a scaffolding management device 110, a processor 120, and a memory 130.
- the memory 130 is directly or indirectly electrically connected to the processor 120 to implement data transmission or interaction.
- the scaffolding management apparatus 110 includes at least one software function module that can be stored in the memory 130 or in an operating system of the client 100 in the form of software or firmware.
- the processor 120 is configured to execute executable modules stored in the memory 130, such as software functional modules or computer programs included in the scaffolding management device 110.
- FIG. 3 is a flowchart of a scaffold management method applied to the client 100 according to an embodiment of the present invention. It should be noted that the method provided by the present invention is not limited to the specific order described in FIG. 3 and below. The steps shown in Fig. 3 will be described in detail below.
- Step S101 Acquire a plurality of scaffold templates from the Git repository of the server 200, and save them to the local to generate a local warehouse.
- the client 100 is communicatively coupled to the server 200, and the Git repository including a plurality of scaffold templates is pre-stored in the server 200.
- the scaffolding template in the Git repository is the sum of the scaffolding templates pushed by the plurality of clients 100 to the server 200, for example, the sum of the scaffolding templates pushed by all team members of the same project.
- multiple scaffold templates may be first pulled from the Git repository of the server 200 and saved to the local to generate a local warehouse. It should be understood that the plurality of scaffolding templates obtained from the server 200 are part of the scaffolding templates in the Git repository, such as the scaffolding templates previously used.
- a folder with the suffix ".git" is generated, and all version information, update records, and information about the warehouse management are saved in the folder.
- the folder is automatically created when the warehouse is initialized.
- the development is based on nodeJS, and the nodeJS can simulate and issue an acquisition request, and then can perform operations such as downloading.
- the nodeJS community already has a lot of open source libraries, you can directly call one of them to copy the contents of the Git repository to the local.
- the user can obtain all currently available scaffold templates by querying actions.
- the scaffold management method further includes the following steps:
- Receiving the query instruction determining whether the query instruction is consistent with the preset instruction, and if the query instruction is consistent with the preset instruction, querying all the scaffold template information in the Git repository according to the query instruction.
- the user terminal 100 after receiving the query instruction input by the user, the user terminal 100 first needs to check whether the received query instruction is consistent with the preset instruction, for example, the preset instruction used for the query may be set to the odin list. If the received query command input by the user is odin list, the query obtains all available scaffolding template information in the current Git repository, and feeds back to the user, so that the user can know all currently available scaffold templates. If the received query command input by the user is inconsistent with the preset command, it will not respond.
- the preset instruction used for the query may be set to the odin list. If the received query command input by the user is odin list, the query obtains all available scaffolding template information in the current Git repository, and feeds back to the user, so that the user can know all currently available scaffold templates. If the received query command input by the user is inconsistent with the preset command, it will not respond.
- Step S103 Obtain a scaffolding module corresponding to the scaffolding template name to be processed from the Git warehouse or the local warehouse as a designated scaffolding template.
- the user can select the corresponding scaffolding template according to his own needs for subsequent processing. That is, the user can input the name of the scaffold template to be processed, and the client 100 obtains the scaffold template corresponding to the template name of the scaffold to be processed from the remote Git repository or the local repository according to the received acquisition instruction, and uses it as the designated scaffolding. template.
- the specified scaffold template can be obtained by the following steps:
- Step S201 Query whether there is a scaffold template corresponding to the template name of the scaffold to be processed in the local warehouse. If yes, perform the following step S203. If not, perform the following step S205.
- Step S203 extracting a scaffold template corresponding to the scaffold template name to be processed from the local warehouse as a designated scaffold template.
- Step S205 Download and obtain a scaffold template corresponding to the scaffold template name to be processed from the Git repository as a designated scaffold template.
- the scaffolding template in the local repository of the client 100 is part of the scaffolding template in the remote Git repository. What the user knows after entering the query command is all currently available scaffold templates, ie all scaffold templates in the current Git repository. Based on this information, the specified scaffolding template selected by the user may exist in the local repository, but may not exist in the local repository, but only in the remote Git repository.
- the user terminal 100 obtains the name of the scaffold template to be processed input by the user, for example, inputting the command odin gen + scaffold template name, firstly, it is checked whether the local warehouse exists and The scaffold template corresponding to the scaffold template name. If the scaffold template exists, the scaffold template is directly extracted from the local warehouse as a designated scaffold template.
- a query process is adopted, and when the corresponding required scaffolding template exists in the local warehouse, it can be directly obtained from the local warehouse, so that it is not necessary to go to the remote Git warehouse to download the corresponding scaffolding template every time.
- processing time can be saved and the processing load of the system can be reduced.
- the scaffold management method may further include the following steps:
- the step of downloading the scaffold template corresponding to the name of the scaffold template to be processed is downloaded in the Git repository.
- step S105 the specified scaffold template is decompressed to obtain a decompressed file and stored in a local folder.
- the obtained specified scaffolding template is a compressed package file, so it needs to be decompressed and stored in a local personal folder for subsequent use.
- the folder of the current project storage file is named .odin-template, and of course, it may be a user-defined folder, which is not specifically limited in this embodiment.
- the compressed package of the specified scaffold template is decompressed to a corresponding folder.
- the template of the specified scaffold template is named test. Then in .odin-template, after decompressing, a test folder is generated, which stores all the scaffolding code of the specified scaffolding template.
- Step S107 configuring the scaffolding code in the decompressed file to generate a required scaffolding file.
- step S107 may include the following sub-steps:
- the scaffolding code in the decompressed file is configured according to the custom configuration table to generate the required scaffolding file.
- customary content does not need to be changed, a certain degree of customizable settings are required. Different management tools use different logic for this requirement. For example, in yeoman, the user is asked interactively before the template starts to download, allowing the user to select some content.
- an interactive question is made to obtain a custom configuration table of the user, and the decompressed file is obtained according to the customized configuration table.
- the scaffolding code is configured to generate the required scaffolding files.
- the content of the interactive question is the preset configuration information.
- the customized configuration table is obtained by the following steps:
- step S301 the specified configuration information is set and displayed for the user to select.
- Step S303 receiving a selection result input by the user, and generating a custom configuration table corresponding to the selection result.
- the scaffolding management method provided in this embodiment is based on nodeJS development, and the existing library in nodeJS can be used to accurately manipulate files and file contents.
- the problem logic for interactively asking questions with the user is pre-set with a prescribed format in the decompressed file, and the specified plurality of configuration information may be set according to the preset format and displayed for the user to select.
- the prescribed format may be a format in which the configuration information is set to whether A is needed.
- the user may make a corresponding selection according to the configuration information and the needs of the user. For example, the A may be selected, or may not be needed.
- A may be selected, or may not be needed.
- a corresponding custom configuration table is generated according to the selection result of the user, and the scaffolding code in the decompressed file is configured according to the customized configuration table, and a scaffolding file matching the user requirement and the selected content is generated. For example, if the user's choice is A, then the content of A will be included in the subsequent production scaffolding file.
- a custom configuration table matching the user selection result can be obtained.
- the developer can conveniently develop a multi-type scaffold suitable for the user according to the preset format of the problem logic in the decompression file, so that the scaffolding function is more flexible.
- the scaffold management apparatus 110 in the present embodiment is provided with a function of tracking the operation history of the scaffold.
- FIG. 6 is a functional block diagram of a scaffold management apparatus 110 according to an embodiment of the present invention.
- the scaffold management device 110 includes a first acquisition module 111, a second acquisition module 112, a decompression module 113, and a configuration module 114.
- the first obtaining module 111 is configured to acquire a plurality of scaffold templates from the Git repository of the server 200 and save them locally to generate a local warehouse.
- the first obtaining module 111 may be configured to perform step S101 shown in FIG. 3, and the specific operation method may refer to the detailed description of step S101.
- the second obtaining module 112 is configured to obtain a scaffolding module corresponding to the scaffolding template name to be processed from the Git warehouse or the local warehouse as a designated scaffolding template.
- the second obtaining module 112 may be configured to perform step S103 shown in FIG. 3, and the specific operation method may refer to the detailed description of step S103.
- the decompression module 113 is configured to decompress the specified scaffold template to obtain a decompressed file and store it in a local folder.
- the decompression module 113 can be configured to perform step S105 shown in FIG. 3, and the specific operation method can refer to the detailed description of step S105.
- the configuration module 114 is configured to configure the scaffolding code in the decompressed file to generate the required scaffolding file.
- the configuration module 114 can be configured to perform the step S107 shown in FIG. 3, and the specific operation method can refer to the detailed description of step S107.
- the configuration module 114 may include a presentation submodule, a first generation submodule, and a second generation submodule.
- the display sub-module is configured to display preset configuration information for the user to select when the decompressed file is obtained.
- the first generation submodule is configured to obtain a selection result of the user, and generate a custom configuration table corresponding to the selection result.
- the second generation submodule is configured to configure the scaffolding code in the decompressed file according to the custom configuration table to generate a required scaffolding file.
- the scaffolding management apparatus 110 further includes a receiving module 115 , a determining module 116 , and a first query module 117 .
- the receiving module 115 is configured to receive a query instruction.
- the determining module 116 is configured to determine whether the query instruction is consistent with a preset instruction.
- the first query module 117 is configured to query, according to the query instruction, all scaffold template information in the Git repository when the query instruction is consistent with the preset instruction.
- the scaffold management apparatus 110 further includes a second query module 118 , an extraction module 119 , and a download module 1110 .
- the second query module 118 is configured to query whether there is a scaffold template corresponding to the to-be-processed scaffold template name in the local warehouse.
- the second query module 118 can be configured to perform step S201 shown in FIG. 4, and the specific operation method can refer to the detailed description of step S201.
- the extraction module 119 is configured to extract a scaffold template corresponding to the to-be-processed scaffold template name from the local warehouse when there is a scaffold template corresponding to the scaffold template name to be processed in the local warehouse. As a designated scaffolding template.
- the extraction module 119 can be configured to perform step S203 shown in FIG. 4, and the specific operation method can refer to the detailed description of step S203.
- the downloading module 1110 is configured to download, from the Git repository, a scaffold corresponding to the to-be-processed scaffolding template name when the scaffolding template corresponding to the scaffolding template name to be processed does not exist in the local warehouse. Template as a template for specifying scaffolding.
- the downloading module 1110 can be configured to perform step S205 shown in FIG. 4, and the specific operation method can refer to the detailed description of step S205.
- the scaffold management device 110 may further include a mode determination module.
- the mode determining module is configured to determine whether the current system mode is an offline mode after the query obtains a scaffold template corresponding to the to-be-processed scaffold template name in the local warehouse, and if the offline mode is The step of extracting the scaffold template corresponding to the scaffold template name to be processed in the local warehouse, if not in the offline mode, triggering the download module 1110 to download and obtain the scaffold template to be processed from the Git repository.
- the corresponding scaffolding template is configured to determine whether the current system mode is an offline mode after the query obtains a scaffold template corresponding to the to-be-processed scaffold template name in the local warehouse, and if the offline mode is The step of extracting the scaffold template corresponding to the scaffold template name to be processed in the local warehouse, if not in the offline mode, triggering the download module 1110 to download and obtain the scaffold template to be processed from the Git repository.
- the corresponding scaffolding template is configured to determine whether the current system mode is an offline mode after the query obtains a scaffold template corresponding to the to-be
- the scaffolding code in the decompressed file is configured according to the obtained custom configuration table to generate a required scaffolding file.
- the scaffolding management apparatus 110 further includes a setting module 1111 and a generating module 1112 .
- the setting module 1111 sets the specified configuration information and displays it for the user to select.
- the setting module 1111 can be configured to perform step S301 shown in FIG. 5, and the specific operation method can refer to the detailed description of step S301.
- the generating module 1112 is configured to receive a selection result input by the user and generate a custom configuration table corresponding to the selection result. Specifically, the generating module 1112 can be configured to perform step S303 shown in FIG. 5, and the specific operation method can refer to the detailed description of step S303.
- another embodiment of the present invention provides a computer readable storage medium having stored thereon a computer program that, when executed by the processor 120, implements the steps of the scaffolding management method described above.
- the scaffolding management method, apparatus, and electronic device uniformly store a plurality of scaffold templates required for a project into a remote Git warehouse, and extract multiple scaffold templates from the Git repository to save to Local to generate a local repository.
- the local warehouse is first queried. If it exists in the local warehouse, it is directly extracted from the local warehouse. If it does not exist, it is downloaded from the remote Git repository. Decompress the downloaded specified scaffolding template to obtain the decompressed file, and obtain a custom configuration table matching the user's requirements through interactive questioning. Configure the scaffolding code in the decompressed file according to the customized configuration table, and finally generate the required Scaffolding files.
- the scaffolding management solution provided by the invention saves the processing time of the whole process and reduces the processing load of the system, and can generate the required scaffolding files conveniently and quickly, and does not require unnecessary operations for the user and the developer. A convenient management tool.
- the scaffold management scheme is preset with a usage specification, and the query instruction input by the user can be verified. If the query instruction is consistent with the preset instruction, the current available scaffold template information is obtained according to the query instruction for the user to know. .
- each block of the flowchart or block diagram can represent a module, a program segment, or a portion of code that includes one or more of the Executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the blocks may also occur in a different order than those illustrated in the drawings.
- each block of the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts can be implemented in a dedicated hardware-based system that performs the specified function or action. Or it can be implemented by a combination of dedicated hardware and computer instructions.
- the scaffolding management method, device and electronic device provided by the embodiments of the invention save the processing time of the scaffolding management process and reduce the processing load of the system, and can conveniently and quickly generate the required scaffolding files for the scaffolding developers and users. No extra operations are required.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Stored Programmes (AREA)
Abstract
A scaffolding management method and apparatus, and an electronic device, applied to a user terminal in communicative connection with a server. The server pre-stores a Git storehouse comprising a plurality of scaffolding templates. The method comprises: acquiring the plurality of scaffolding templates from the Git storehouse of the server, and storing the plurality of scaffolding templates to local, thereby generating a local storehouse (S101); acquiring, from the Git storehouse or the local storehouse, a scaffolding module corresponding to the name of a scaffolding template to be processed, and using the scaffolding module as a designated scaffolding template (S103); decompressing the designated scaffolding template to obtain a decompression file, and storing the decompression file to a local folder (S105); and configuring scaffolding codes in the decompression file, and generating a required scaffolding file (S107). According to the scaffolding management scheme, the processing time of the whole process is saved; system processing loads are reduced; the required scaffolding file can be generated conveniently and rapidly; for a user and a developer, no redundant operation is required; and a convenient management tool is achieved.
Description
相关申请的交叉引用Cross-reference to related applications
本申请要求于2017年07月06日提交中国专利局的申请号为2017105476215、名称为“脚手架管理方法、装置及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims the priority of the Chinese Patent Application entitled "Scaffolding Management Method, Apparatus, and Electronic Apparatus" by the Chinese Patent Office, which is filed on Jul. 6, 2017, the entire contents of which is incorporated herein by reference. .
本发明涉及计算机技术领域,具体而言,涉及一种脚手架管理方法、装置及电子设备。The present invention relates to the field of computer technologies, and in particular, to a scaffold management method, apparatus, and electronic device.
Git是一个开源的分布式版本控制系统,可以有效地、高速地处理从很小到非常大的项目版本管理。脚手架可为项目提供初期的基本骨架,开发环境等,方便进行快速开发,节省时间。现有技术中,通常需要经过比较繁琐的操作才能对脚手架进行开发及使用,且十分不方便追踪脚手架的操作历史。因此,如何实现简单、快捷的脚手架配置及使用十分重要。Git is an open source distributed version control system that efficiently and quickly handles project management from very small to very large. Scaffolding can provide the initial basic skeleton, development environment, etc. for the project, which is convenient for rapid development and saves time. In the prior art, it is usually necessary to carry out the development and use of the scaffold after relatively cumbersome operations, and it is very inconvenient to track the operation history of the scaffold. Therefore, how to implement simple and fast scaffolding configuration and use is very important.
发明内容Summary of the invention
有鉴于此,本发明的目的在于提供一种脚手架管理方法、装置及电子设备,以解决上述问题中的至少一个。In view of the above, an object of the present invention is to provide a scaffold management method, apparatus, and electronic device to solve at least one of the above problems.
本发明实施例提供一种脚手架管理方法,应用于与服务器通信连接的用户端,所述服务器预存有包括多个脚手架模板的Git仓库,所述方法包括:An embodiment of the present invention provides a scaffold management method, which is applied to a client connected to a server, where the server prestores a Git repository including a plurality of scaffold templates, and the method includes:
从所述服务器的Git仓库中获取多个脚手架模板,并保存至本地以生成本地仓库;Obtain multiple scaffold templates from the server's Git repository and save them locally to generate a local repository;
从所述Git仓库或所述本地仓库中获取与待处理的脚手架模板名对应的脚手架模块,作为指定脚手架模板;Obtaining, from the Git warehouse or the local warehouse, a scaffolding module corresponding to the name of the scaffolding template to be processed, as a designated scaffolding template;
对所述指定脚手架模板进行解压获得解压文件并存放至本地文件夹;Decompressing the specified scaffold template to obtain a decompressed file and storing it in a local folder;
对所述解压文件中的脚手架代码进行配置,生成所需的脚手架文件。The scaffolding code in the decompressed file is configured to generate the required scaffolding files.
可选地,所述从所述Git仓库或所述本地仓库中获取与待处理的脚手架模板名对应的脚手架模块的步骤之前,所述方法还包括:Optionally, before the step of obtaining the scaffolding module corresponding to the scaffolding template name to be processed from the Git repository or the local repository, the method further includes:
接收查询指令,判断所述查询指令是否与预设指令相一致,若所述查询指令与所述 预设指令相一致,则根据所述查询指令查询得到所述Git仓库中的所有脚手架模板信息。Receiving a query instruction, determining whether the query instruction is consistent with the preset instruction, and if the query instruction is consistent with the preset instruction, querying, according to the query instruction, all scaffold template information in the Git repository.
可选地,所述指定脚手架模板通过以下步骤获得:Optionally, the specified scaffolding template is obtained by the following steps:
查询所述本地仓库中是否存在与所述待处理的脚手架模板名对应的脚手架模板;Querying, in the local warehouse, whether there is a scaffold template corresponding to the name of the scaffold template to be processed;
若存在,则从所述本地仓库中提取出与所述待处理的脚手架模板名对应的脚手架模板,作为指定脚手架模板,若不存在,则从所述Git仓库中下载获得与所述待处理的脚手架模板名对应的脚手架模板,作为指定脚手架模板。If yes, extracting a scaffold template corresponding to the scaffold template name to be processed from the local warehouse as a designated scaffold template, if not, downloading and obtaining the to-be-processed from the Git repository The scaffolding template corresponding to the scaffolding template name serves as the designated scaffolding template.
可选地,在查询得到所述本地仓库中存在与所述待处理的脚手架模板名对应的脚手架模板后,所述方法还包括:Optionally, after the query obtains the scaffold template corresponding to the to-be-processed scaffold template name in the local warehouse, the method further includes:
判断当前系统模式是否为离线模式,若为离线模式,则执行从所述本地仓库中提取出与所述待处理的脚手架模板名对应的脚手架模板的步骤,若不为离线模式,则执行从所述Git仓库中下载获得与所述待处理的脚手架模板名对应的脚手架模板的步骤。Determining whether the current system mode is an offline mode, and if it is an offline mode, performing a step of extracting a scaffold template corresponding to the to-be-processed scaffold template name from the local warehouse, if not in the offline mode, executing the slave mode The step of downloading the scaffold template corresponding to the name of the scaffold template to be processed is downloaded in the Git repository.
可选地,所述对所述解压文件中的脚手架代码进行配置,生成所需的脚手架文件的步骤,包括:Optionally, the step of configuring the scaffolding code in the decompressed file to generate a required scaffolding file includes:
根据获得的自定义配置表对所述解压文件中的脚手架代码进行配置,生成所需的脚手架文件;Configuring the scaffolding code in the decompressed file according to the obtained custom configuration table to generate the required scaffolding file;
所述自定义配置表通过以下步骤获得:The custom configuration table is obtained by the following steps:
设置指定配置信息并展示,以供用户选择;Set the specified configuration information and display it for the user to select;
接收用户输入的选择结果,并生成与所述选择结果相对应的自定义配置表。A selection result input by the user is received, and a custom configuration table corresponding to the selection result is generated.
可选地,所述对所述解压文件中的脚手架代码进行配置,生成所需的脚手架文件的步骤,包括:Optionally, the step of configuring the scaffolding code in the decompressed file to generate a required scaffolding file includes:
在获得所述解压文件时,展示预设的配置信息,以供用户选择;When the decompressed file is obtained, preset configuration information is displayed for the user to select;
获得用户的选择结果,并生成与所述选择结果相对应的自定义配置表;Obtaining a selection result of the user, and generating a custom configuration table corresponding to the selection result;
根据所述自定义配置表对所述解压文件中的脚手架代码进行配置,从而生成所需的脚手架文件。The scaffolding code in the decompressed file is configured according to the custom configuration table to generate the required scaffolding file.
可选地,所述服务器为GitHub服务器或GitLab服务器。Optionally, the server is a GitHub server or a GitLab server.
本发明另一实施例还提供一种脚手架管理装置,应用于与服务器通信连接的用户端,所述服务器预存有包括多个脚手架模板的Git仓库,所述脚手架管理装置包括:Another embodiment of the present invention further provides a scaffold management apparatus, which is applied to a user end communicatively connected to a server, wherein the server prestores a Git repository including a plurality of scaffold templates, the scaffold management apparatus comprising:
第一获取模块,配置成从所述服务器的Git仓库中获取多个脚手架模板,并保存至本地以生成本地仓库;a first obtaining module, configured to acquire a plurality of scaffold templates from the Git repository of the server, and save the local template to generate a local warehouse;
第二获取模块,配置成从所述Git仓库或所述本地仓库中获取与待处理的脚手架模板名对应的脚手架模块,作为指定脚手架模板;a second obtaining module, configured to obtain, from the Git warehouse or the local warehouse, a scaffolding module corresponding to a scaffolding template name to be processed, as a designated scaffolding template;
解压模块,配置成对所述指定脚手架模板进行解压获得解压文件并存放至本地文件夹;The decompression module is configured to decompress the specified scaffold template to obtain a decompressed file and store the file in a local folder;
配置模块,配置成对所述解压文件中的脚手架代码进行配置,生成所需的脚手架文件。A configuration module configured to configure scaffolding code in the decompressed file to generate a required scaffolding file.
可选地,所述脚手架管理装置还包括接收模块、判断模块以及第一查询模块;Optionally, the scaffold management device further includes a receiving module, a determining module, and a first query module;
所述接收模块配置成接收查询指令;The receiving module is configured to receive a query instruction;
所述判断模块配置成判断所述查询指令是否与预设指令相一致;The determining module is configured to determine whether the query instruction is consistent with a preset instruction;
所述第一查询模块配置成在所述查询指令与所述预设指令相一致时,根据所述查询指令查询得到所述Git仓库中的所有脚手架模板信息。The first query module is configured to query, according to the query instruction, all scaffold template information in the Git repository when the query instruction is consistent with the preset instruction.
可选地,所述脚手架管理装置还包括第二查询模块、提取模块以及下载模块;Optionally, the scaffold management device further includes a second query module, an extraction module, and a download module;
所述第二查询模块配置成查询所述本地仓库中是否存在与所述待处理的脚手架模板名对应的脚手架模板;The second query module is configured to query whether there is a scaffold template corresponding to the to-be-processed scaffold template name in the local warehouse;
所述提取模块配置成在所述本地仓库中存在与所述待处理的脚手架模板名对应的脚手架模板时,从所述本地仓库中提取出与所述待处理的脚手架模板名对应的脚手架模板,作为指定脚手架模板;The extraction module is configured to: when a scaffold template corresponding to the scaffold template name to be processed exists in the local warehouse, extract a scaffold template corresponding to the to-be-processed scaffold template name from the local warehouse, As a designated scaffolding template;
所述下载模块配置成在所述本地仓库中不存在与所述待处理的脚手架模板名对应的脚手架模板时,从所述Git仓库中下载获得与所述待处理的脚手架模板名对应的脚手架模板,作为指定脚手架模板。The downloading module is configured to download a scaffolding template corresponding to the to-be-processed scaffolding template name from the Git repository when there is no scaffolding template corresponding to the scaffolding template name to be processed in the local warehouse. As a designated scaffolding template.
可选地,所述脚手架管理装置还包括:Optionally, the scaffold management device further includes:
模式判断模块,配置成在查询得到所述本地仓库中存在与所述待处理的脚手架模板名对应的脚手架模板后,判断当前系统模式是否为离线模式,若为离线模式,则执行从所述本地仓库中提取出与所述待处理的脚手架模板名对应的脚手架模板的步骤,若不为离线模式,再触发所述下载模块从所述Git仓库中下载获得与所述待处理的脚手架模板名对应的脚手架模板。The mode determining module is configured to determine whether the current system mode is an offline mode after the query obtains the scaffold template corresponding to the to-be-processed scaffold template name in the local warehouse, and if the offline mode is performed, execute the local mode The step of extracting the scaffold template corresponding to the template name of the scaffold to be processed in the warehouse, if not in the offline mode, triggering the download module to download from the Git repository to obtain the template name of the scaffold to be processed. Scaffolding template.
可选地,所述配置模块包括:Optionally, the configuration module includes:
展示子模块,配置成在获得所述解压文件时,展示预设的配置信息,以供用户选择;Displaying a sub-module, configured to display preset configuration information for the user to select when obtaining the decompressed file;
第一生成子模块,配置成获得用户的选择结果,并生成与所述选择结果相对应的自定义配置表;a first generation submodule configured to obtain a selection result of the user, and generate a custom configuration table corresponding to the selection result;
第二生成子模块,配置成根据所述自定义配置表对所述解压文件中的脚手架代码进行配置,从而生成所需的脚手架文件。And a second generation submodule configured to configure the scaffolding code in the decompressed file according to the custom configuration table to generate a required scaffolding file.
本发明另一实施例还提供一种电子设备,所述电子设备与服务器通信连接,所述服务器预存有包括多个脚手架模板的Git仓库,所述电子设备包括:Another embodiment of the present invention further provides an electronic device, wherein the electronic device is in communication with a server, and the server prestores a Git repository including a plurality of scaffold templates, the electronic device comprising:
存储器;Memory
处理器;及Processor; and
脚手架管理装置,所述脚手架管理装置安装于所述存储器中并包括一个或多个由所述处理器执行的软件功能模块。A scaffolding management device is installed in the memory and includes one or more software function modules executed by the processor.
本发明另一实施例还提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述的脚手架管理方法的步骤。Another embodiment of the present invention also provides a computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements the steps of the scaffolding management method described above.
本发明实施例提供一种脚手架管理方法、装置及电子设备,将项目所需的多个脚手架模板统一存放至远程的Git仓库中,并从Git仓库中提取多个脚手架模板保存至本地以生成本地仓库。从本地仓库或远程的Git仓库中获取用户所需的指定脚手架模板,对获得的指定脚手架模板进行解压得到解压文件,并通过交互式提问获得与用户需求相匹配的自定义配置表,根据该自定义配置表对解压文件中的脚手架代码进行配置,最终生成所需的脚手架文件。本发明实施例提供的脚手架管理方案,节省了整个过程的处理时间且降低了系统处理负担,可方便、快捷地生成所需的脚手架文件,对于使用者及开发者来说均无需多余的操作,是一种便捷的管理工具。The embodiment of the invention provides a method, a device and an electronic device for managing a scaffold. The multiple scaffold templates required for the project are uniformly stored in a remote Git warehouse, and multiple scaffold templates are extracted from the Git repository and saved locally to generate local warehouse. Obtain the specified scaffolding template required by the user from the local warehouse or the remote Git repository, decompress the obtained specified scaffolding template to obtain the decompressed file, and obtain a customized configuration table matching the user's requirements through interactive questioning, according to the self-defined configuration table. Define the configuration table to configure the scaffolding code in the decompressed file to produce the required scaffolding files. The scaffolding management solution provided by the embodiment of the invention saves the processing time of the whole process and reduces the processing load of the system, and can generate the required scaffolding files conveniently and quickly, and does not require unnecessary operations for the user and the developer. It is a convenient management tool.
为使本发明的上述目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附附图,作详细说明如下。The above described objects, features, and advantages of the invention will be apparent from the description and appended claims appended claims
为了更清楚地说明本发明实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,应当理解,以下附图仅示出了本发明的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以 根据这些附图获得其他相关的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments will be briefly described below. It should be understood that the following drawings show only certain embodiments of the present invention, and therefore It should be seen as a limitation on the scope, and those skilled in the art can obtain other related drawings according to these drawings without any creative work.
图1为本发明实施例提供的一种脚手架管理方法的应用场景示意图。FIG. 1 is a schematic diagram of an application scenario of a scaffold management method according to an embodiment of the present invention.
图2为本发明实施例提供的用户端的示意性结构框图。FIG. 2 is a schematic structural block diagram of a user end according to an embodiment of the present invention.
图3为本发明实施例提供的一种脚手架管理方法的流程图。FIG. 3 is a flowchart of a scaffold management method according to an embodiment of the present invention.
图4为本发明实施例提供的脚手架管理方法的另一流程图。FIG. 4 is another flowchart of a method for managing a scaffold according to an embodiment of the present invention.
图5为本发明实施例提供的脚手架管理方法的另一流程图。FIG. 5 is another flowchart of a method for managing a scaffold according to an embodiment of the present invention.
图6为本发明实施例提供的脚手架管理装置的功能模块框图。FIG. 6 is a functional block diagram of a scaffold management apparatus according to an embodiment of the present invention.
图7为本发明实施例提供的脚手架管理装置的另一功能模块框图。FIG. 7 is a block diagram of another functional module of the scaffold management apparatus according to an embodiment of the present invention.
图8为本发明实施例提供的脚手架管理装置的另一功能模块框图。FIG. 8 is a block diagram of another functional module of the scaffold management apparatus according to an embodiment of the present invention.
图9为本发明实施例提供的脚手架管理装置的另一功能模块框图。FIG. 9 is a block diagram of another functional module of the scaffold management apparatus according to an embodiment of the present invention.
图标:100-用户端;110-脚手架管理装置;111-第一获取模块;112-第二获取模块;113-解压模块;114-配置模块;115-接收模块;116-判断模块;117-第一查询模块;118-第二查询模块;119-提取模块;1110-下载模块;1111-设置模块;1112-生成模块;120-处理器;130-存储器;200-服务器。Icons: 100-user; 110-scaffold management device; 111-first acquisition module; 112-second acquisition module; 113-decompression module; 114-configuration module; 115-receive module; 116-judgment module; a query module; 118-second query module; 119-extraction module; 1110-download module; 1111-setup module; 1112-generation module; 120-processor; 130-memory;
下面将结合本发明实施例中附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本发明实施例的组件可以以各种不同的配置来布置和设计。因此,以下对在附图中提供的本发明的实施例的详细描述并非旨在限制要求保护的本发明的范围,而是仅仅表示本发明的选定实施例。基于本发明的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of the embodiments of the invention, which are generally described and illustrated in the figures herein, may be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the invention in the claims All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。同时,在本发明的描述中,除非另有明确的规定和限定,术语“安装”、“设置”、“连接”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本发明中的具体含义。It should be noted that similar reference numerals and letters indicate similar items in the following figures. Therefore, once an item is defined in one figure, it is not necessary to further define and explain it in the subsequent figures. Meanwhile, in the description of the present invention, the terms "installation", "setting", and "connection" are to be understood broadly, and may be, for example, a fixed connection or a detachable connection, or Connected integrally; can be mechanical or electrical; can be directly connected or indirectly connected through an intermediate medium, which can be the internal communication between the two components. The specific meaning of the above terms in the present invention can be understood in a specific case by those skilled in the art.
请参阅图1,为本发明实施例提供的一种脚手架管理方法的应用场景示意图。该场景包括用户端100和服务器200。所述用户端100通过网络与所述服务器200通信连接,以进行数据通信或交互。其中,所述用户端100可以为多个(图中只示出一个),多个所述用户端100通过网络与所述服务器200通信连接。所述用户端100可以是但不限于个人电脑、平板电脑、智能手机、移动上网设备等。所述服务器200可以是网络服务器、数据库服务器,可以是单独的服务器也可以是服务器集群等。FIG. 1 is a schematic diagram of an application scenario of a scaffold management method according to an embodiment of the present invention. The scenario includes a client 100 and a server 200. The client 100 is in communication with the server 200 via a network for data communication or interaction. The client 100 may be multiple (only one is shown), and the plurality of clients 100 are communicably connected to the server 200 through a network. The client 100 can be, but is not limited to, a personal computer, a tablet, a smart phone, a mobile internet device, and the like. The server 200 may be a network server or a database server, and may be a separate server or a server cluster.
可选地,在本实施例中,所述服务器200可以是GitHub服务器或GitLab服务器,配置成管理Git仓库(Git Repository)。其中,在Git中,将需要进行版本控制的文件目录称为仓库,每个仓库相当于一个目录,该目录中的所有文件均通过Git来实现版本管理,Git能够跟踪并记录在该目录中发生的所有更新(如,增加文件、删除文件、修改文件等)。Optionally, in this embodiment, the server 200 may be a GitHub server or a GitLab server configured to manage a Git Repository. Among them, in Git, the file directory that needs to be versioned is called a warehouse, and each warehouse is equivalent to a directory. All files in the directory are managed by Git, and Git can track and record in the directory. All updates (eg, adding files, deleting files, modifying files, etc.).
请参阅图2,为本发明实施例提供的一种电子设备的示意性结构框图。在本实施例中,所述电子设备可以为上述的用户端100,所述用户端100包括脚手架管理装置110、处理器120及存储器130。其中,所述存储器130与所述处理器120之间直接或间接的电性连接,以实现数据的传输或交互。所述脚手架管理装置110包括至少一个可以软件或固件的形式存储于所述存储器130中或固化在所述用户端100的操作系统中的软件功能模块。所述处理器120配置成执行所述存储器130中存储的可执行模块,例如所述脚手架管理装置110包括的软件功能模块或计算机程序。FIG. 2 is a schematic structural block diagram of an electronic device according to an embodiment of the present invention. In this embodiment, the electronic device may be the client 100 described above, and the client 100 includes a scaffolding management device 110, a processor 120, and a memory 130. The memory 130 is directly or indirectly electrically connected to the processor 120 to implement data transmission or interaction. The scaffolding management apparatus 110 includes at least one software function module that can be stored in the memory 130 or in an operating system of the client 100 in the form of software or firmware. The processor 120 is configured to execute executable modules stored in the memory 130, such as software functional modules or computer programs included in the scaffolding management device 110.
请参阅图3,是本发明实施例提供的一种应用于上述用户端100的脚手架管理方法的流程图。所应说明的是,本发明提供的方法不以图3及以下所述的具体顺序为限制。下面将对图3中示出的各步骤进行详细说明。Please refer to FIG. 3 , which is a flowchart of a scaffold management method applied to the client 100 according to an embodiment of the present invention. It should be noted that the method provided by the present invention is not limited to the specific order described in FIG. 3 and below. The steps shown in Fig. 3 will be described in detail below.
步骤S101,从所述服务器200的Git仓库中获取多个脚手架模板,并保存至本地以生成本地仓库。Step S101: Acquire a plurality of scaffold templates from the Git repository of the server 200, and save them to the local to generate a local warehouse.
在本实施例中,所述用户端100与所述服务器200通信连接,且所述服务器200中预存有包括多个脚手架模板的Git仓库。应当理解,该Git仓库中的脚手架模板为多个用户端100推送至服务器200中的脚手架模板的总和,例如,同一个项目的所有团队人员所推送的脚手架模板的总和。In this embodiment, the client 100 is communicatively coupled to the server 200, and the Git repository including a plurality of scaffold templates is pre-stored in the server 200. It should be understood that the scaffolding template in the Git repository is the sum of the scaffolding templates pushed by the plurality of clients 100 to the server 200, for example, the sum of the scaffolding templates pushed by all team members of the same project.
在本实施例中,为了便于后续在采用离线模式进行脚手架模板配置等工作,可首先从所述服务器200的Git仓库中拉取多个脚手架模板,并保存至本地以生成本地仓库。应当理解,从服务器200中获取的多个脚手架模板为Git仓库中的部分脚手架模板,例 如之前所使用过的脚手架模板。In this embodiment, in order to facilitate subsequent work such as scaffolding template configuration in the offline mode, multiple scaffold templates may be first pulled from the Git repository of the server 200 and saved to the local to generate a local warehouse. It should be understood that the plurality of scaffolding templates obtained from the server 200 are part of the scaffolding templates in the Git repository, such as the scaffolding templates previously used.
可选地,在建立本地仓库的目录中,会生成一个后缀名为“.git”的文件夹,所有的版本信息、更新记录以及仓库管理的相关信息都保存在该文件夹中。其中,该文件夹在初始化仓库的时候自动创建。通过本地仓库的创建,并将所述多个脚手架模板保存至该本地仓库中,便于在后续使用中对所述多个脚手架模板的更新记录进行追踪。Optionally, in the directory where the local repository is created, a folder with the suffix ".git" is generated, and all version information, update records, and information about the warehouse management are saved in the folder. Among them, the folder is automatically created when the warehouse is initialized. Through the creation of the local warehouse, and saving the plurality of scaffolding templates into the local warehouse, it is convenient to track the update records of the plurality of scaffold templates in subsequent use.
可选地,在本实施例中,是基于nodeJS进行开发,nodeJS可以模拟并发出获取请求,则可以进行下载等操作。nodeJS社区已经有很多开源的库,可以直接调用其中一个就行,实现将Git仓库中的内容拷贝到本地。Optionally, in this embodiment, the development is based on nodeJS, and the nodeJS can simulate and issue an acquisition request, and then can perform operations such as downloading. The nodeJS community already has a lot of open source libraries, you can directly call one of them to copy the contents of the Git repository to the local.
可选地,在实施时,用户可通过查询动作来获取到当前所有可用的脚手架模板。在本实施例中,所述脚手架管理方法还包括以下步骤:Optionally, during implementation, the user can obtain all currently available scaffold templates by querying actions. In this embodiment, the scaffold management method further includes the following steps:
接收查询指令,判断所述查询指令是否与预设指令相一致,若所述查询指令与所述预设指令相一致,则根据所述查询指令查询得到所述Git仓库中的所有脚手架模板信息。Receiving the query instruction, determining whether the query instruction is consistent with the preset instruction, and if the query instruction is consistent with the preset instruction, querying all the scaffold template information in the Git repository according to the query instruction.
可选地,所述用户端100在接收到用户输入的查询指令后,首先需要检验接收到查询指令是否为预设指令相一致,例如可将用于查询的预设指令设置为odin list,则若接收到的用户输入的查询指令为odin list,则查询得到当前所述Git仓库中所有可用的脚手架模板信息,并反馈给用户,以便用户获知当前所有可用的脚手架模板。若接收到的用户输入的查询指令与预设命令不一致,则不作响应。Optionally, after receiving the query instruction input by the user, the user terminal 100 first needs to check whether the received query instruction is consistent with the preset instruction, for example, the preset instruction used for the query may be set to the odin list. If the received query command input by the user is odin list, the query obtains all available scaffolding template information in the current Git repository, and feeds back to the user, so that the user can know all currently available scaffold templates. If the received query command input by the user is inconsistent with the preset command, it will not respond.
步骤S103,从所述Git仓库或所述本地仓库中获取与待处理的脚手架模板名对应的脚手架模块,作为指定脚手架模板。Step S103: Obtain a scaffolding module corresponding to the scaffolding template name to be processed from the Git warehouse or the local warehouse as a designated scaffolding template.
用户在获知当前所有可用的脚手架模板信息后,可根据自身需求选择相应的脚手架模板以便后续对其进行处理。即,用户可输入待处理的脚手架模板名,用户端100根据接收到的获取指令从远程的Git仓库或者是本地仓库中获取与该待处理的脚手架模板名对应的脚手架模板,将其作为指定脚手架模板。After the user knows all available scaffolding template information, the user can select the corresponding scaffolding template according to his own needs for subsequent processing. That is, the user can input the name of the scaffold template to be processed, and the client 100 obtains the scaffold template corresponding to the template name of the scaffold to be processed from the remote Git repository or the local repository according to the received acquisition instruction, and uses it as the designated scaffolding. template.
可选地,请参阅图4,在本实施例中,所述指定脚手架模板可通过以下步骤获得:Optionally, referring to FIG. 4, in the embodiment, the specified scaffold template can be obtained by the following steps:
步骤S201,查询所述本地仓库中是否存在与所述待处理的脚手架模板名对应的脚手架模板,若存在,则执行以下步骤S203,若不存在,则执行以下步骤S205。Step S201: Query whether there is a scaffold template corresponding to the template name of the scaffold to be processed in the local warehouse. If yes, perform the following step S203. If not, perform the following step S205.
步骤S203,从所述本地仓库中提取出与所述待处理的脚手架模板名对应的脚手架模板,作为指定脚手架模板。Step S203, extracting a scaffold template corresponding to the scaffold template name to be processed from the local warehouse as a designated scaffold template.
步骤S205,从所述Git仓库中下载获得与所述待处理的脚手架模板名对应的脚手架模板,作为指定脚手架模板。Step S205: Download and obtain a scaffold template corresponding to the scaffold template name to be processed from the Git repository as a designated scaffold template.
应当理解,用户端100的本地仓库中的脚手架模板是远程Git仓库中的脚手架模板的一部分。用户在输入查询指令后所获知的是当前所有可用的脚手架模板,即当前Git仓库中的所有脚手架模板。根据该信息用户所选择的指定脚手架模板可能存在于本地仓库中,但也可能在本地仓库中并不存在,只存在于远程的Git仓库中。It should be understood that the scaffolding template in the local repository of the client 100 is part of the scaffolding template in the remote Git repository. What the user knows after entering the query command is all currently available scaffold templates, ie all scaffold templates in the current Git repository. Based on this information, the specified scaffolding template selected by the user may exist in the local repository, but may not exist in the local repository, but only in the remote Git repository.
在本实施例中,为了节省处理时间及降低系统负担,用户端100在获得用户输入的待处理的脚手架模板名时,例如输入指令odin gen+脚手架模板名,首先会查询本地仓库中是否存在与该脚手架模板名对应的脚手架模板,若存在该脚手架模板,则直接从本地仓库中提取出该脚手架模板,将其作为指定脚手架模板。In this embodiment, in order to save processing time and reduce system load, when the user terminal 100 obtains the name of the scaffold template to be processed input by the user, for example, inputting the command odin gen + scaffold template name, firstly, it is checked whether the local warehouse exists and The scaffold template corresponding to the scaffold template name. If the scaffold template exists, the scaffold template is directly extracted from the local warehouse as a designated scaffold template.
当然,若当前在本地仓库中不存在与该待处理的脚手架模板名对应的脚手架模板,则从远程的Git仓库中去下载以获取该脚手架模板。Of course, if there is currently no scaffold template corresponding to the name of the scaffold template to be processed in the local warehouse, download from the remote Git repository to obtain the scaffold template.
在本实施例中,采用一查询流程,在本地仓库存在相应的所需的脚手架模板时,可直接从本地仓库中获取,则可不必每次都去远程的Git仓库下载相应所需的脚手架模板,通过上述设计,可以节省处理时间并降低系统的处理负担。In this embodiment, a query process is adopted, and when the corresponding required scaffolding template exists in the local warehouse, it can be directly obtained from the local warehouse, so that it is not necessary to go to the remote Git warehouse to download the corresponding scaffolding template every time. With the above design, processing time can be saved and the processing load of the system can be reduced.
实施时,在进行脚手架模板获取时,还可以考虑当前的网络状态及用户需求,可选地,在本实施例中,所述脚手架管理方法还可以包括以下步骤:In the implementation, when the scaffolding template is obtained, the current network status and the user's requirements may be considered. Optionally, in the embodiment, the scaffold management method may further include the following steps:
判断当前系统模式是否为离线模式,若为离线模式,则执行从所述本地仓库中提取出与所述待处理的脚手架模板名对应的脚手架模板的步骤,若不为离线模式,则执行从所述Git仓库中下载获得与所述待处理的脚手架模板名对应的脚手架模板的步骤。Determining whether the current system mode is an offline mode, and if it is an offline mode, performing a step of extracting a scaffold template corresponding to the to-be-processed scaffold template name from the local warehouse, if not in the offline mode, executing the slave mode The step of downloading the scaffold template corresponding to the name of the scaffold template to be processed is downloaded in the Git repository.
步骤S105,对所述指定脚手架模板进行解压获得解压文件并存放至本地文件夹。In step S105, the specified scaffold template is decompressed to obtain a decompressed file and stored in a local folder.
在本实施例中,所获取到的指定脚手架模板是一个压缩包文件,所以需要将其解压缩并存放在本地的个人文件夹中,以便后续使用。例如,当前进行的项目存放文件的文件夹名为.odin-template,当然也可以是用户自定义的文件夹,在本实施例中并不作具体限制。将所述指定脚手架模板的压缩包解压到对应文件夹下,例如,该指定脚手架模板的模板名为test。那么在.odin-template中,解压缩后就会生成一个test文件夹,里面存放着该指定脚手架模板的所有脚手架代码。In this embodiment, the obtained specified scaffolding template is a compressed package file, so it needs to be decompressed and stored in a local personal folder for subsequent use. For example, the folder of the current project storage file is named .odin-template, and of course, it may be a user-defined folder, which is not specifically limited in this embodiment. The compressed package of the specified scaffold template is decompressed to a corresponding folder. For example, the template of the specified scaffold template is named test. Then in .odin-template, after decompressing, a test folder is generated, which stores all the scaffolding code of the specified scaffolding template.
步骤S107,对所述解压文件中的脚手架代码进行配置,生成所需的脚手架文件。Step S107, configuring the scaffolding code in the decompressed file to generate a required scaffolding file.
可选地,作为一种实施方式,所述步骤S107可以包括如下子步骤:Optionally, as an implementation manner, the step S107 may include the following sub-steps:
在获得所述解压文件时,展示预设的配置信息,以供用户选择;When the decompressed file is obtained, preset configuration information is displayed for the user to select;
获得用户的选择结果,并生成与所述选择结果相对应的自定义配置表;Obtaining a selection result of the user, and generating a custom configuration table corresponding to the selection result;
根据所述自定义配置表对所述解压文件中的脚手架代码进行配置,从而生成所需的脚手架文件。The scaffolding code in the decompressed file is configured according to the custom configuration table to generate the required scaffolding file.
可选地,在使用脚手架时,除了一些基本的规范、约定俗成的内容是不需要更改的之外,还需要进行一定程度的可定制化设置。对于该需求,不同的管理工具采用的是不同的逻辑。例如在yeoman中,是在模版开始下载前,即对用户进行交互式提问,让用户选择部分内容。在本实施例中,则是在脚手架代码被下载到本地之后,且在解压缩完成之后再进行交互式提问,以获取到用户的自定义配置表,根据该自定义配置表对解压文件中的脚手架代码进行配置,生成所需的脚手架文件。其中,所述交互式提问的内容即为所述预设的配置信息。Alternatively, when using scaffolding, in addition to some basic specifications, customary content does not need to be changed, a certain degree of customizable settings are required. Different management tools use different logic for this requirement. For example, in yeoman, the user is asked interactively before the template starts to download, allowing the user to select some content. In this embodiment, after the scaffolding code is downloaded to the local, and after the decompression is completed, an interactive question is made to obtain a custom configuration table of the user, and the decompressed file is obtained according to the customized configuration table. The scaffolding code is configured to generate the required scaffolding files. The content of the interactive question is the preset configuration information.
可选地,作为另一种实施方式,请参阅图5,在本实施例中,所述自定义配置表通过以下步骤获得:Optionally, as another implementation manner, refer to FIG. 5. In this embodiment, the customized configuration table is obtained by the following steps:
步骤S301,设置指定配置信息并展示,以供用户选择。In step S301, the specified configuration information is set and displayed for the user to select.
步骤S303,接收用户输入的选择结果,并生成与所述选择结果相对应的自定义配置表。Step S303, receiving a selection result input by the user, and generating a custom configuration table corresponding to the selection result.
可选地,本实施例所提供的脚手架管理方法是基于nodeJS开发,nodeJS中的现有的库,可用于精确地操控文件及文件内容。在本实施例中,用于与用户进行交互式提问的问题逻辑在所述解压文件中预设有规定格式,可根据该预设格式设置指定的多个配置信息并展示,以供用户选择。例如,该规定格式可为将配置信息设置为是否需要A这样的格式,用户在使用的时候,可根据该配置信息并结合自身需求来作出相应的选择,例如可选择需要A,或者是不需要A。根据用户的选择结果生成相应的自定义配置表,并根据该自定义配置表对解压文件中的脚手架代码进行配置,生成与用户需求及选择内容相匹配的脚手架文件。例如,若用户的选择为需要A,则后续生产的脚手架文件中就会相应的包含A的内容。Optionally, the scaffolding management method provided in this embodiment is based on nodeJS development, and the existing library in nodeJS can be used to accurately manipulate files and file contents. In this embodiment, the problem logic for interactively asking questions with the user is pre-set with a prescribed format in the decompressed file, and the specified plurality of configuration information may be set according to the preset format and displayed for the user to select. For example, the prescribed format may be a format in which the configuration information is set to whether A is needed. When the user is in use, the user may make a corresponding selection according to the configuration information and the needs of the user. For example, the A may be selected, or may not be needed. A. A corresponding custom configuration table is generated according to the selection result of the user, and the scaffolding code in the decompressed file is configured according to the customized configuration table, and a scaffolding file matching the user requirement and the selected content is generated. For example, if the user's choice is A, then the content of A will be included in the subsequent production scaffolding file.
在本实施例中,通过可交互式提问与用户进行交互,可得到与用户选择结果相匹配的自定义配置表。根据该自定义配置表可以定义解压文件及文件夹的目录筛选,且对解压文件中的脚手架代码进行精确控制,最后复制生成所需的脚手架文件。在本实施例中,开发者可遵循解压文件中的问题逻辑的预设规定格式,便捷地开发出多类型的用户适用 的脚手架,使得脚手架功能更加灵活。In this embodiment, by interactively questioning and interacting with the user, a custom configuration table matching the user selection result can be obtained. According to the custom configuration table, you can define the directory filtering of the extracted files and folders, and precisely control the scaffolding code in the decompressed file, and finally copy and generate the required scaffolding files. In this embodiment, the developer can conveniently develop a multi-type scaffold suitable for the user according to the preset format of the problem logic in the decompression file, so that the scaffolding function is more flexible.
在本实施例中,通过将项目中的所有的脚手架模板统一存放在远程的Git仓库中,脚手架用户在使用时,只需通过输入与预设指令相符的查询指令即可获知当前所有可用的脚手架模板信息。且输入所需的待处理的脚手架模板名,即可获得所需的脚手架模板,并对其进行一系列处理之后即可快捷地生成所需的脚手架文件。对脚手架使用者来说整个过程十分方便且快捷,不需要任何多余的操作。In this embodiment, by storing all the scaffold templates in the project in the remote Git warehouse, when the scaffolding user is in use, it is only necessary to input all the available scaffolds by inputting a query instruction that matches the preset command. Template information. And enter the desired scaffolding template name to get the desired scaffolding template and perform a series of processing to quickly generate the required scaffolding files. The entire process is convenient and fast for scaffolding users and does not require any extra work.
此外,对于脚手架开发者来说,由于Git本身是一个版本控制平台,因此在本实施例中使用Git进行脚手架代码托管,不会对脚手架开发者造成任何负担。其次,在开发过程中不需要新的学习成本,也没有多余的操作。且在进行版本迭代之后,不再需要同步发布至npm平台。并且,由于Git本身即是一个版本控制系统,因此,使得本实施例中的脚手架管理装置110具备了追踪脚手架的操作历史的功能。In addition, for the scaffolding developer, since Git itself is a version control platform, using Git for scaffolding code hosting in this embodiment does not impose any burden on the scaffolding developer. Second, there is no need for new learning costs and no extra operations during the development process. And after the version iteration, there is no longer a need to publish to the npm platform synchronously. Further, since Git itself is a version control system, the scaffold management apparatus 110 in the present embodiment is provided with a function of tracking the operation history of the scaffold.
请参阅图6,为本发明实施例提供的一种脚手架管理装置110的功能模块框图。所述脚手架管理装置110包括第一获取模块111、第二获取模块112、解压模块113以及配置模块114。FIG. 6 is a functional block diagram of a scaffold management apparatus 110 according to an embodiment of the present invention. The scaffold management device 110 includes a first acquisition module 111, a second acquisition module 112, a decompression module 113, and a configuration module 114.
所述第一获取模块111配置成从所述服务器200的Git仓库中获取多个脚手架模板,并保存至本地以生成本地仓库。在本实施例中,该第一获取模块111可配置成执行图3中所示的步骤S101,具体的操作方法可参考步骤S101的详细描述。The first obtaining module 111 is configured to acquire a plurality of scaffold templates from the Git repository of the server 200 and save them locally to generate a local warehouse. In this embodiment, the first obtaining module 111 may be configured to perform step S101 shown in FIG. 3, and the specific operation method may refer to the detailed description of step S101.
所述第二获取模块112配置成从所述Git仓库或所述本地仓库中获取与待处理的脚手架模板名对应的脚手架模块,作为指定脚手架模板。在本实施例中,该第二获取模块112可配置成执行图3中所示的步骤S103,具体的操作方法可参考步骤S103的详细描述。The second obtaining module 112 is configured to obtain a scaffolding module corresponding to the scaffolding template name to be processed from the Git warehouse or the local warehouse as a designated scaffolding template. In this embodiment, the second obtaining module 112 may be configured to perform step S103 shown in FIG. 3, and the specific operation method may refer to the detailed description of step S103.
所述解压模块113配置成对所述指定脚手架模板进行解压获得解压文件并存放至本地文件夹。在本实施例中,该解压模块113可配置成执行图3中所示的步骤S105,具体的操作方法可参考步骤S105的详细描述。The decompression module 113 is configured to decompress the specified scaffold template to obtain a decompressed file and store it in a local folder. In this embodiment, the decompression module 113 can be configured to perform step S105 shown in FIG. 3, and the specific operation method can refer to the detailed description of step S105.
所述配置模块114配置成对所述解压文件中的脚手架代码进行配置,生成所需的脚手架文件。在本实施例中,该配置模块114可配置成执行图3中所示的步骤S107,具体的操作方法可参考步骤S107的详细描述。The configuration module 114 is configured to configure the scaffolding code in the decompressed file to generate the required scaffolding file. In this embodiment, the configuration module 114 can be configured to perform the step S107 shown in FIG. 3, and the specific operation method can refer to the detailed description of step S107.
可选地,在本实施例中,所述配置模块114可以包括展示子模块、第一生成子模块以及第二生成子模块。Optionally, in this embodiment, the configuration module 114 may include a presentation submodule, a first generation submodule, and a second generation submodule.
其中,所述展示子模块配置成在获得所述解压文件时,展示预设的配置信息,以供用户选择。The display sub-module is configured to display preset configuration information for the user to select when the decompressed file is obtained.
所述第一生成子模块配置成获得用户的选择结果,并生成与所述选择结果相对应的自定义配置表。The first generation submodule is configured to obtain a selection result of the user, and generate a custom configuration table corresponding to the selection result.
所述第二生成子模块配置成根据所述自定义配置表对所述解压文件中的脚手架代码进行配置,从而生成所需的脚手架文件。The second generation submodule is configured to configure the scaffolding code in the decompressed file according to the custom configuration table to generate a required scaffolding file.
请参阅图7,在本实施例中,所述脚手架管理装置110还包括接收模块115、判断模块116以及第一查询模块117。Referring to FIG. 7 , in the embodiment, the scaffolding management apparatus 110 further includes a receiving module 115 , a determining module 116 , and a first query module 117 .
所述接收模块115配置成接收查询指令。所述判断模块116配置成判断所述查询指令是否与预设指令相一致。所述第一查询模块117配置成在所述查询指令与所述预设指令相一致时,根据所述查询指令查询得到所述Git仓库中的所有脚手架模板信息。The receiving module 115 is configured to receive a query instruction. The determining module 116 is configured to determine whether the query instruction is consistent with a preset instruction. The first query module 117 is configured to query, according to the query instruction, all scaffold template information in the Git repository when the query instruction is consistent with the preset instruction.
可选地,请参阅图8,在本实施例中,所述脚手架管理装置110还包括第二查询模块118、提取模块119以及下载模块1110。Optionally, referring to FIG. 8 , in the embodiment, the scaffold management apparatus 110 further includes a second query module 118 , an extraction module 119 , and a download module 1110 .
所述第二查询模块118配置成查询所述本地仓库中是否存在与所述待处理的脚手架模板名对应的脚手架模板。在本实施例中,该第二查询模块118可配置成执行图4中所示的步骤S201,具体的操作方法可参考步骤S201的详细描述。The second query module 118 is configured to query whether there is a scaffold template corresponding to the to-be-processed scaffold template name in the local warehouse. In this embodiment, the second query module 118 can be configured to perform step S201 shown in FIG. 4, and the specific operation method can refer to the detailed description of step S201.
所述提取模块119配置成在所述本地仓库中存在与所述待处理的脚手架模板名对应的脚手架模板时,从所述本地仓库中提取出与所述待处理的脚手架模板名对应的脚手架模板,作为指定脚手架模板。在本实施例中,该提取模块119可配置成执行图4中所示的步骤S203,具体的操作方法可参考步骤S203的详细描述。The extraction module 119 is configured to extract a scaffold template corresponding to the to-be-processed scaffold template name from the local warehouse when there is a scaffold template corresponding to the scaffold template name to be processed in the local warehouse. As a designated scaffolding template. In this embodiment, the extraction module 119 can be configured to perform step S203 shown in FIG. 4, and the specific operation method can refer to the detailed description of step S203.
所述下载模块1110配置成在所述本地仓库中不存在与所述待处理的脚手架模板名对应的脚手架模板时,从所述Git仓库中下载获得与所述待处理的脚手架模板名对应的脚手架模板,作为指定脚手架模板。在本实施例中,该下载模块1110可配置成执行图4中所示的步骤S205,具体的操作方法可参考步骤S205的详细描述。The downloading module 1110 is configured to download, from the Git repository, a scaffold corresponding to the to-be-processed scaffolding template name when the scaffolding template corresponding to the scaffolding template name to be processed does not exist in the local warehouse. Template as a template for specifying scaffolding. In this embodiment, the downloading module 1110 can be configured to perform step S205 shown in FIG. 4, and the specific operation method can refer to the detailed description of step S205.
可选地,所述脚手架管理装置110还可以包括模式判断模块。Optionally, the scaffold management device 110 may further include a mode determination module.
所述模式判断模块配置成在查询得到所述本地仓库中存在与所述待处理的脚手架模板名对应的脚手架模板后,判断当前系统模式是否为离线模式,若为离线模式,则执行从所述本地仓库中提取出与所述待处理的脚手架模板名对应的脚手架模板的步骤,若不为离线模式,再触发所述下载模块1110从所述Git仓库中下载获得与所述待处理的脚 手架模板名对应的脚手架模板。The mode determining module is configured to determine whether the current system mode is an offline mode after the query obtains a scaffold template corresponding to the to-be-processed scaffold template name in the local warehouse, and if the offline mode is The step of extracting the scaffold template corresponding to the scaffold template name to be processed in the local warehouse, if not in the offline mode, triggering the download module 1110 to download and obtain the scaffold template to be processed from the Git repository. The corresponding scaffolding template.
可选地,在本实施例,根据获得的自定义配置表对解压文件中的脚手架代码进行配置,生成所需的脚手架文件。可选地,请参阅图9,所述脚手架管理装置110还可以包括设置模块1111以及生成模块1112。Optionally, in this embodiment, the scaffolding code in the decompressed file is configured according to the obtained custom configuration table to generate a required scaffolding file. Optionally, referring to FIG. 9 , the scaffolding management apparatus 110 further includes a setting module 1111 and a generating module 1112 .
所述设置模块1111用户设置指定配置信息并展示,以供用户选择。具体地,该设置模块1111可配置成执行图5中所示的步骤S301,具体的操作方法可参考步骤S301的详细描述。The setting module 1111 sets the specified configuration information and displays it for the user to select. Specifically, the setting module 1111 can be configured to perform step S301 shown in FIG. 5, and the specific operation method can refer to the detailed description of step S301.
所述生成模块1112配置成接收用户输入的选择结果,并生成与所述选择结果相对应的自定义配置表。具体地,该生成模块1112可配置成执行图5中所示的步骤S303,具体的操作方法可参考步骤S303的详细描述。The generating module 1112 is configured to receive a selection result input by the user and generate a custom configuration table corresponding to the selection result. Specifically, the generating module 1112 can be configured to perform step S303 shown in FIG. 5, and the specific operation method can refer to the detailed description of step S303.
此外,本发明另一实施例还提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器120执行时实现上述的脚手架管理方法的步骤。Furthermore, another embodiment of the present invention provides a computer readable storage medium having stored thereon a computer program that, when executed by the processor 120, implements the steps of the scaffolding management method described above.
综上所述,本发明实施例提供的脚手架管理方法、装置及电子设备,将项目所需的多个脚手架模板统一存放至远程的Git仓库中,并从Git仓库中提取多个脚手架模板保存至本地以生成本地仓库。对于用户所需的指定脚手架模板,首先查询本地仓库,若本地仓库中存在,则直接从本地仓库中提取,若不存在,再从远程Git仓库中下载。对下载下来的指定脚手架模板进行解压得到解压文件,并通过交互式提问获得与用户需求相匹配的自定义配置表,根据该自定义配置表对解压文件中的脚手架代码进行配置,最终生成所需的脚手架文件。本发明提供的脚手架管理方案,节省了整个过程的处理时间且降低了系统处理负担,可方便、快捷地生成所需的脚手架文件,对于使用者及开发者来说均无需多余的操作,是一种便捷的管理工具。In summary, the scaffolding management method, apparatus, and electronic device provided by the embodiments of the present invention uniformly store a plurality of scaffold templates required for a project into a remote Git warehouse, and extract multiple scaffold templates from the Git repository to save to Local to generate a local repository. For the specified scaffolding template required by the user, the local warehouse is first queried. If it exists in the local warehouse, it is directly extracted from the local warehouse. If it does not exist, it is downloaded from the remote Git repository. Decompress the downloaded specified scaffolding template to obtain the decompressed file, and obtain a custom configuration table matching the user's requirements through interactive questioning. Configure the scaffolding code in the decompressed file according to the customized configuration table, and finally generate the required Scaffolding files. The scaffolding management solution provided by the invention saves the processing time of the whole process and reduces the processing load of the system, and can generate the required scaffolding files conveniently and quickly, and does not require unnecessary operations for the user and the developer. A convenient management tool.
进一步地,该脚手架管理方案预先设置有使用规范,可对用户输入的查询指令进行验证,若查询指令与预设指令相一致,则根据查询指令查询获得当前所有可用的脚手架模板信息以供用户获知。Further, the scaffold management scheme is preset with a usage specification, and the query instruction input by the user can be verified. If the query instruction is consistent with the preset instruction, the current available scaffold template information is obtained according to the query instruction for the user to know. .
在本申请所提供的实施例中,应该理解到,所揭露的装置和方法,也可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,附图中的流程图和框图显示了根据本发明的实施例的装置、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,所述模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的 可执行指令。也应当注意,在有些作为替换的实现方式中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。In the embodiments provided by the present application, it should be understood that the disclosed apparatus and method may also be implemented in other manners. The above described device embodiments are merely illustrative, for example, the flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of devices, methods, and computer program products according to embodiments of the invention. In this regard, each block of the flowchart or block diagram can represent a module, a program segment, or a portion of code that includes one or more of the Executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the blocks may also occur in a different order than those illustrated in the drawings. For example, two consecutive blocks may be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts, can be implemented in a dedicated hardware-based system that performs the specified function or action. Or it can be implemented by a combination of dedicated hardware and computer instructions.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It is to be understood that the term "comprises", "comprising" or any other variations thereof is intended to encompass a non-exclusive inclusion, such that a process, method, article, or device that comprises a It also includes other elements that are not explicitly listed, or elements that are inherent to such a process, method, item, or device. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, method, item, or device that comprises the element.
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。The above description is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention. It should be noted that similar reference numerals and letters indicate similar items in the following figures. Therefore, once an item is defined in one figure, it is not necessary to further define and explain it in the subsequent figures.
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope of the present invention. It should be covered by the scope of the present invention. Therefore, the scope of the invention should be determined by the scope of the appended claims.
本发明实施例提供的脚手架管理方法、装置及电子设备,节省了脚手架管理过程的处理时间且降低了系统的处理负担,可以方便、快捷地生成所需的脚手架文件,对脚手架开发者及使用者而言均无需多余的操作。The scaffolding management method, device and electronic device provided by the embodiments of the invention save the processing time of the scaffolding management process and reduce the processing load of the system, and can conveniently and quickly generate the required scaffolding files for the scaffolding developers and users. No extra operations are required.
Claims (14)
- 一种脚手架管理方法,其特征在于,应用于与服务器通信连接的用户端,所述服务器预存有包括多个脚手架模板的Git仓库,所述方法包括:A scaffold management method is characterized in that it is applied to a client connected to a server, and the server prestores a Git repository including a plurality of scaffold templates, the method comprising:从所述服务器的Git仓库中获取多个脚手架模板,并保存至本地以生成本地仓库;Obtain multiple scaffold templates from the server's Git repository and save them locally to generate a local repository;从所述Git仓库或所述本地仓库中获取与待处理的脚手架模板名对应的脚手架模块,作为指定脚手架模板;Obtaining, from the Git warehouse or the local warehouse, a scaffolding module corresponding to the name of the scaffolding template to be processed, as a designated scaffolding template;对所述指定脚手架模板进行解压获得解压文件并存放至本地文件夹;Decompressing the specified scaffold template to obtain a decompressed file and storing it in a local folder;对所述解压文件中的脚手架代码进行配置,生成所需的脚手架文件。The scaffolding code in the decompressed file is configured to generate the required scaffolding files.
- 根据权利要求1所述的脚手架管理方法,其特征在于,所述从所述Git仓库或所述本地仓库中获取与待处理的脚手架模板名对应的脚手架模块的步骤之前,所述方法还包括:The method of claim 1, wherein the method further comprises: before the step of obtaining a scaffolding module corresponding to the scaffolding template name to be processed from the Git repository or the local repository, the method further comprising:接收查询指令,判断所述查询指令是否与预设指令相一致,若所述查询指令与所述预设指令相一致,则根据所述查询指令查询得到所述Git仓库中的所有脚手架模板信息。Receiving the query instruction, determining whether the query instruction is consistent with the preset instruction, and if the query instruction is consistent with the preset instruction, querying all the scaffold template information in the Git repository according to the query instruction.
- 根据权利要求1或2所述的脚手架管理方法,其特征在于,所述指定脚手架模板通过以下步骤获得:The scaffold management method according to claim 1 or 2, wherein the designated scaffold template is obtained by the following steps:查询所述本地仓库中是否存在与所述待处理的脚手架模板名对应的脚手架模板;Querying, in the local warehouse, whether there is a scaffold template corresponding to the name of the scaffold template to be processed;若存在,则从所述本地仓库中提取出与所述待处理的脚手架模板名对应的脚手架模板,作为指定脚手架模板,若不存在,则从所述Git仓库中下载获得与所述待处理的脚手架模板名对应的脚手架模板,作为指定脚手架模板。If yes, extracting a scaffold template corresponding to the scaffold template name to be processed from the local warehouse as a designated scaffold template, if not, downloading and obtaining the to-be-processed from the Git repository The scaffolding template corresponding to the scaffolding template name serves as the designated scaffolding template.
- 根据权利要求3所述的脚手架管理方法,其特征在于,在查询得到所述本地仓库中存在与所述待处理的脚手架模板名对应的脚手架模板后,所述方法还包括:The scaffolding management method according to claim 3, wherein after the query obtains a scaffolding template corresponding to the to-be-processed scaffolding template name in the local warehouse, the method further includes:判断当前系统模式是否为离线模式,若为离线模式,则执行从所述本地仓库中提取出与所述待处理的脚手架模板名对应的脚手架模板的步骤,若不为离线模式,则执行从所述Git仓库中下载获得与所述待处理的脚手架模板名对应的脚手架模板的步骤。Determining whether the current system mode is an offline mode, and if it is an offline mode, performing a step of extracting a scaffold template corresponding to the to-be-processed scaffold template name from the local warehouse, if not in the offline mode, executing the slave mode The step of downloading the scaffold template corresponding to the name of the scaffold template to be processed is downloaded in the Git repository.
- 根据权利要求1-4任一项所述的脚手架管理方法,其特征在于,所述对所述解压文件中的脚手架代码进行配置,生成所需的脚手架文件的步骤,包括:The scaffolding management method according to any one of claims 1 to 4, wherein the step of configuring the scaffolding code in the decompressed file to generate a required scaffolding file comprises:根据获得的自定义配置表对所述解压文件中的脚手架代码进行配置,生成所需的脚 手架文件;Configuring the scaffolding code in the decompressed file according to the obtained custom configuration table to generate the required scaffolding file;所述自定义配置表通过以下步骤获得:The custom configuration table is obtained by the following steps:设置指定配置信息并展示,以供用户选择;Set the specified configuration information and display it for the user to select;接收用户输入的选择结果,并生成与所述选择结果相对应的自定义配置表。A selection result input by the user is received, and a custom configuration table corresponding to the selection result is generated.
- 根据权利要求1-4任一项所述的脚手架管理方法,其特征在于,所述对所述解压文件中的脚手架代码进行配置,生成所需的脚手架文件的步骤,包括:The scaffolding management method according to any one of claims 1 to 4, wherein the step of configuring the scaffolding code in the decompressed file to generate a required scaffolding file comprises:在获得所述解压文件时,展示预设的配置信息,以供用户选择;When the decompressed file is obtained, preset configuration information is displayed for the user to select;获得用户的选择结果,并生成与所述选择结果相对应的自定义配置表;Obtaining a selection result of the user, and generating a custom configuration table corresponding to the selection result;根据所述自定义配置表对所述解压文件中的脚手架代码进行配置,从而生成所需的脚手架文件。The scaffolding code in the decompressed file is configured according to the custom configuration table to generate the required scaffolding file.
- 根据权利要求1-6任一项所述的脚手架管理方法,其特征在于,所述服务器为GitHub服务器或GitLab服务器。The scaffold management method according to any one of claims 1 to 6, wherein the server is a GitHub server or a GitLab server.
- 一种脚手架管理装置,其特征在于,应用于与服务器通信连接的用户端,所述服务器预存有包括多个脚手架模板的Git仓库,所述脚手架管理装置包括:A scaffold management apparatus is characterized in that it is applied to a user end communicatively connected to a server, and the server prestores a Git warehouse including a plurality of scaffolding templates, the scaffolding management apparatus comprising:第一获取模块,配置成从所述服务器的Git仓库中获取多个脚手架模板,并保存至本地以生成本地仓库;a first obtaining module, configured to acquire a plurality of scaffold templates from the Git repository of the server, and save the local template to generate a local warehouse;第二获取模块,配置成从所述Git仓库或所述本地仓库中获取与待处理的脚手架模板名对应的脚手架模块,作为指定脚手架模板;a second obtaining module, configured to obtain, from the Git warehouse or the local warehouse, a scaffolding module corresponding to a scaffolding template name to be processed, as a designated scaffolding template;解压模块,配置成对所述指定脚手架模板进行解压获得解压文件并存放至本地文件夹;The decompression module is configured to decompress the specified scaffold template to obtain a decompressed file and store the file in a local folder;配置模块,配置成对所述解压文件中的脚手架代码进行配置,生成所需的脚手架文件。A configuration module configured to configure scaffolding code in the decompressed file to generate a required scaffolding file.
- 根据权利要求8所述的脚手架管理装置,其特征在于,所述脚手架管理装置还包括接收模块、判断模块以及第一查询模块;The scaffold management device according to claim 8, wherein the scaffold management device further comprises a receiving module, a judging module and a first query module;所述接收模块配置成接收查询指令;The receiving module is configured to receive a query instruction;所述判断模块配置成判断所述查询指令是否与预设指令相一致;The determining module is configured to determine whether the query instruction is consistent with a preset instruction;所述第一查询模块配置成在所述查询指令与所述预设指令相一致时,根据所述查询 指令查询得到所述Git仓库中的所有脚手架模板信息。The first query module is configured to query, according to the query instruction, all scaffold template information in the Git repository when the query instruction is consistent with the preset instruction.
- 根据权利要求8或9所述的脚手架管理装置,其特征在于,所述脚手架管理装置还包括第二查询模块、提取模块以及下载模块;The scaffold management apparatus according to claim 8 or 9, wherein the scaffold management device further comprises a second query module, an extraction module, and a download module;所述第二查询模块配置成查询所述本地仓库中是否存在与所述待处理的脚手架模板名对应的脚手架模板;The second query module is configured to query whether there is a scaffold template corresponding to the to-be-processed scaffold template name in the local warehouse;所述提取模块配置成在所述本地仓库中存在与所述待处理的脚手架模板名对应的脚手架模板时,从所述本地仓库中提取出与所述待处理的脚手架模板名对应的脚手架模板,作为指定脚手架模板;The extraction module is configured to: when a scaffold template corresponding to the scaffold template name to be processed exists in the local warehouse, extract a scaffold template corresponding to the to-be-processed scaffold template name from the local warehouse, As a designated scaffolding template;所述下载模块配置成在所述本地仓库中不存在与所述待处理的脚手架模板名对应的脚手架模板时,从所述Git仓库中下载获得与所述待处理的脚手架模板名对应的脚手架模板,作为指定脚手架模板。The downloading module is configured to download a scaffolding template corresponding to the to-be-processed scaffolding template name from the Git repository when there is no scaffolding template corresponding to the scaffolding template name to be processed in the local warehouse. As a designated scaffolding template.
- 根据权利要求10所述的脚手架管理装置,其特征在于,所述脚手架管理装置还包括:The scaffold management apparatus according to claim 10, wherein the scaffold management apparatus further comprises:模式判断模块,配置成在查询得到所述本地仓库中存在与所述待处理的脚手架模板名对应的脚手架模板后,判断当前系统模式是否为离线模式,若为离线模式,则执行从所述本地仓库中提取出与所述待处理的脚手架模板名对应的脚手架模板的步骤,若不为离线模式,再触发所述下载模块从所述Git仓库中下载获得与所述待处理的脚手架模板名对应的脚手架模板。The mode determining module is configured to determine whether the current system mode is an offline mode after the query obtains the scaffold template corresponding to the to-be-processed scaffold template name in the local warehouse, and if the offline mode is performed, execute the local mode The step of extracting the scaffold template corresponding to the template name of the scaffold to be processed in the warehouse, if not in the offline mode, triggering the download module to download from the Git repository to obtain the template name of the scaffold to be processed. Scaffolding template.
- 根据权利要求9-11任一项所述的脚手架管理装置,其特征在于,所述配置模块包括:The scaffold management apparatus according to any one of claims 9 to 11, wherein the configuration module comprises:展示子模块,配置成在获得所述解压文件时,展示预设的配置信息,以供用户选择;Displaying a sub-module, configured to display preset configuration information for the user to select when obtaining the decompressed file;第一生成子模块,配置成获得用户的选择结果,并生成与所述选择结果相对应的自定义配置表;a first generation submodule configured to obtain a selection result of the user, and generate a custom configuration table corresponding to the selection result;第二生成子模块,配置成根据所述自定义配置表对所述解压文件中的脚手架代码进行配置,从而生成所需的脚手架文件。And a second generation submodule configured to configure the scaffolding code in the decompressed file according to the custom configuration table to generate a required scaffolding file.
- 一种电子设备,其特征在于,所述电子设备与服务器通信连接,所述服务器预存有包括多个脚手架模板的Git仓库,所述电子设备包括:An electronic device, wherein the electronic device is communicatively coupled to a server, the server pre-stored with a Git repository comprising a plurality of scaffold templates, the electronic device comprising:存储器;Memory处理器;及Processor; and脚手架管理装置,所述脚手架管理装置安装于所述存储器中并包括一个或多个由所述处理器执行的软件功能模块,所述脚手架管理装置包括:a scaffolding management device installed in the memory and including one or more software function modules executed by the processor, the scaffolding management device comprising:第一获取模块,用于从所述服务器的Git仓库中获取多个脚手架模板,并保存至本地以生成本地仓库;a first obtaining module, configured to obtain multiple scaffold templates from the Git repository of the server, and save the local template to generate a local warehouse;第二获取模块,用于从所述Git仓库或所述本地仓库中获取与待处理的脚手架模板名对应的脚手架模块,作为指定脚手架模板;a second obtaining module, configured to obtain, from the Git warehouse or the local warehouse, a scaffolding module corresponding to a scaffolding template name to be processed, as a designated scaffolding template;解压模块,用于对所述指定脚手架模板进行解压获得解压文件并存放至本地文件夹;a decompression module, configured to decompress the specified scaffold template to obtain a decompressed file and store the file in a local folder;配置模块,用于对所述解压文件中的脚手架代码进行配置,生成所需的脚手架文件。A configuration module configured to configure scaffolding code in the decompressed file to generate a required scaffolding file.
- 一种计算机可读存储介质,其特征在于,其上存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1-8任意一项所述的脚手架管理方法的步骤。A computer readable storage medium having stored thereon a computer program, the computer program being executed by a processor to implement the steps of the scaffold management method of any of claims 1-8.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710547621.5 | 2017-07-06 | ||
CN201710547621.5A CN107273140B (en) | 2017-07-06 | 2017-07-06 | Scaffold manages method, apparatus and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019007016A1 true WO2019007016A1 (en) | 2019-01-10 |
Family
ID=60071826
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/071608 WO2019007016A1 (en) | 2017-07-06 | 2018-01-05 | Scaffolding management method and apparatus, and electronic device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN107273140B (en) |
WO (1) | WO2019007016A1 (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107273140B (en) * | 2017-07-06 | 2018-09-21 | 武汉斗鱼网络科技有限公司 | Scaffold manages method, apparatus and electronic equipment |
CN108182056A (en) * | 2017-12-28 | 2018-06-19 | 天脉聚源(北京)科技有限公司 | The method and device of the frame of multiple Webpages is configured in a kind of intelligence |
CN110580152B (en) * | 2018-06-07 | 2023-05-12 | 北京怡合春天科技有限公司 | Front-end automatic scaffold |
CN109343835A (en) * | 2018-08-28 | 2019-02-15 | 苏州浪潮智能软件有限公司 | A kind of rapid build business scaffold code instrumentation based on template |
CN109683887B (en) * | 2018-12-17 | 2022-04-26 | 杭州玳数科技有限公司 | Construction method and device supporting multi-scheme user-defined web project |
CN112015375A (en) * | 2020-08-21 | 2020-12-01 | 广州欢网科技有限责任公司 | Background management system creating method and device and electronic equipment |
CN113419730A (en) * | 2021-06-22 | 2021-09-21 | 中电金信软件有限公司 | Front-end engineering construction method and device and electronic equipment |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130305219A1 (en) * | 2010-12-23 | 2013-11-14 | Electronics And Telecommunications Research Institute | Apparatus and method for providing custom software, and method for software customization |
CN106843869A (en) * | 2017-01-16 | 2017-06-13 | 百融(北京)金融信息服务股份有限公司 | A kind of front end Development Engineering system and method |
CN107273140A (en) * | 2017-07-06 | 2017-10-20 | 武汉斗鱼网络科技有限公司 | Scaffold management method, device and electronic equipment |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2014019093A1 (en) * | 2012-08-01 | 2014-02-06 | Sherpa Technologies Inc. | System and method for managing versions of program assets |
CN104461743B (en) * | 2014-12-17 | 2018-10-16 | 用友网络科技股份有限公司 | The automatically generating device and method of resource and configuration |
CN105989098B (en) * | 2015-02-12 | 2020-04-07 | 阿里巴巴集团控股有限公司 | Icon package generation method and server, and icon processing method and system |
CN106095408B (en) * | 2016-05-31 | 2019-05-14 | 浙江网新恒天软件有限公司 | A kind of system and method for data monitoring and Code automatic build and deployment |
CN106095442B (en) * | 2016-06-13 | 2021-07-02 | 福州智永信息科技有限公司 | Automatic high-speed package outputting method based on web |
-
2017
- 2017-07-06 CN CN201710547621.5A patent/CN107273140B/en active Active
-
2018
- 2018-01-05 WO PCT/CN2018/071608 patent/WO2019007016A1/en active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130305219A1 (en) * | 2010-12-23 | 2013-11-14 | Electronics And Telecommunications Research Institute | Apparatus and method for providing custom software, and method for software customization |
CN106843869A (en) * | 2017-01-16 | 2017-06-13 | 百融(北京)金融信息服务股份有限公司 | A kind of front end Development Engineering system and method |
CN107273140A (en) * | 2017-07-06 | 2017-10-20 | 武汉斗鱼网络科技有限公司 | Scaffold management method, device and electronic equipment |
Non-Patent Citations (2)
Title |
---|
HOW VUE-CLI WORKS, 16 June 2017 (2017-06-16), pages 3, 5, 6, Retrieved from the Internet <URL:http://blog.kaolafed.com/2017/06/16/vue-cli%E6%98%AF%E5%A6%82%E4%BD%95%E5%B7%A5%E4%BD%9C%E7%9A%84/#more> * |
TEACH YOU HOW TO BUILD A FRONT-END SCAFFOLD TOOL FROM BEGINNING, 6 August 2016 (2016-08-06), pages 1, 3, Retrieved from the Internet <URL:https://segmentfault.com/a/1190000006190814> * |
Also Published As
Publication number | Publication date |
---|---|
CN107273140B (en) | 2018-09-21 |
CN107273140A (en) | 2017-10-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2019007016A1 (en) | Scaffolding management method and apparatus, and electronic device | |
US11979452B1 (en) | Demo recording utility | |
US20150220245A1 (en) | Branded computer devices and apparatus to connect user and enterprise | |
CN104113774A (en) | Television device control method and system and television device | |
CN105210031A (en) | Kiosk application mode for operating system | |
CN110865834B (en) | Application program interface updating method and device, readable storage medium and terminal equipment | |
CN110875871A (en) | Management method of instant messaging application and electronic equipment | |
JP2019121285A (en) | Configuration change management device, configuration change management method, and program | |
CN111752960B (en) | Data processing method and device | |
CN113360211A (en) | Loading display method based on control and related equipment | |
CN110333874B (en) | iOS system installation packet data acquisition method, device, equipment and medium | |
CN108132832B (en) | Application program starting method and device | |
CN111984248A (en) | Page editing method and device, storage medium and electronic device | |
CN111125205A (en) | Signboard data display method, terminal and storage medium | |
US10798181B2 (en) | Storage medium containing a program, information processing device, and processing method for deploying an application generated to a cloud environment | |
CN107391132B (en) | Method, device and equipment for target App to execute preset action | |
CN114860304A (en) | Configuration information processing method and device, storage medium and electronic device | |
JP2019021176A (en) | Data analysis system and data analysis method | |
JP5959535B2 (en) | Server, method, and program for causing a computer to function as a server for accessing a mobile terminal from a client via a network | |
JP2021149598A (en) | Information processor, control method for the same, and program | |
CN106484245B (en) | Information processing method and device and electronic equipment | |
CN111414190A (en) | Request processing method and device | |
JP2015095035A (en) | Parameter setting support system, parameter setting support method, and parameter setting support program | |
CN109256124A (en) | A kind of phonetic order creation method for user equipment end | |
US20230393818A1 (en) | Configuration file editor with intelligent code-based interface and visual interface |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18827459 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18827459 Country of ref document: EP Kind code of ref document: A1 |