WO2019007016A1 - 脚手架管理方法、装置及电子设备 - Google Patents
脚手架管理方法、装置及电子设备 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
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/20—Software design
- G06F8/22—Procedural
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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
一种脚手架管理方法、装置及电子设备,应用于与服务器通信连接的用户端,该服务器预存有包括多个脚手架模板的Git仓库。所述方法包括:从服务器的Git仓库中获取多个脚手架模板,并保存至本地以生成本地仓库(S101);从Git仓库或本地仓库中获取与待处理的脚手架模板名对应的脚手架模块,作为指定脚手架模板(S103);对指定脚手架模板进行解压获得解压文件并存放至本地文件夹(S105);对解压文件中的脚手架代码进行配置,生成所需的脚手架文件(S107)。上述脚手架管理方案,节省了整个过程的处理时间且降低了系统处理负担,可方便、快捷地生成所需的脚手架文件,对于使用者及开发者来说均无需多余的操作,是一种便捷的管理工具。
Description
相关申请的交叉引用
本申请要求于2017年07月06日提交中国专利局的申请号为2017105476215、名称为“脚手架管理方法、装置及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本发明涉及计算机技术领域,具体而言,涉及一种脚手架管理方法、装置及电子设备。
Git是一个开源的分布式版本控制系统,可以有效地、高速地处理从很小到非常大的项目版本管理。脚手架可为项目提供初期的基本骨架,开发环境等,方便进行快速开发,节省时间。现有技术中,通常需要经过比较繁琐的操作才能对脚手架进行开发及使用,且十分不方便追踪脚手架的操作历史。因此,如何实现简单、快捷的脚手架配置及使用十分重要。
发明内容
有鉴于此,本发明的目的在于提供一种脚手架管理方法、装置及电子设备,以解决上述问题中的至少一个。
本发明实施例提供一种脚手架管理方法,应用于与服务器通信连接的用户端,所述服务器预存有包括多个脚手架模板的Git仓库,所述方法包括:
从所述服务器的Git仓库中获取多个脚手架模板,并保存至本地以生成本地仓库;
从所述Git仓库或所述本地仓库中获取与待处理的脚手架模板名对应的脚手架模块,作为指定脚手架模板;
对所述指定脚手架模板进行解压获得解压文件并存放至本地文件夹;
对所述解压文件中的脚手架代码进行配置,生成所需的脚手架文件。
可选地,所述从所述Git仓库或所述本地仓库中获取与待处理的脚手架模板名对应的脚手架模块的步骤之前,所述方法还包括:
接收查询指令,判断所述查询指令是否与预设指令相一致,若所述查询指令与所述 预设指令相一致,则根据所述查询指令查询得到所述Git仓库中的所有脚手架模板信息。
可选地,所述指定脚手架模板通过以下步骤获得:
查询所述本地仓库中是否存在与所述待处理的脚手架模板名对应的脚手架模板;
若存在,则从所述本地仓库中提取出与所述待处理的脚手架模板名对应的脚手架模板,作为指定脚手架模板,若不存在,则从所述Git仓库中下载获得与所述待处理的脚手架模板名对应的脚手架模板,作为指定脚手架模板。
可选地,在查询得到所述本地仓库中存在与所述待处理的脚手架模板名对应的脚手架模板后,所述方法还包括:
判断当前系统模式是否为离线模式,若为离线模式,则执行从所述本地仓库中提取出与所述待处理的脚手架模板名对应的脚手架模板的步骤,若不为离线模式,则执行从所述Git仓库中下载获得与所述待处理的脚手架模板名对应的脚手架模板的步骤。
可选地,所述对所述解压文件中的脚手架代码进行配置,生成所需的脚手架文件的步骤,包括:
根据获得的自定义配置表对所述解压文件中的脚手架代码进行配置,生成所需的脚手架文件;
所述自定义配置表通过以下步骤获得:
设置指定配置信息并展示,以供用户选择;
接收用户输入的选择结果,并生成与所述选择结果相对应的自定义配置表。
可选地,所述对所述解压文件中的脚手架代码进行配置,生成所需的脚手架文件的步骤,包括:
在获得所述解压文件时,展示预设的配置信息,以供用户选择;
获得用户的选择结果,并生成与所述选择结果相对应的自定义配置表;
根据所述自定义配置表对所述解压文件中的脚手架代码进行配置,从而生成所需的脚手架文件。
可选地,所述服务器为GitHub服务器或GitLab服务器。
本发明另一实施例还提供一种脚手架管理装置,应用于与服务器通信连接的用户端,所述服务器预存有包括多个脚手架模板的Git仓库,所述脚手架管理装置包括:
第一获取模块,配置成从所述服务器的Git仓库中获取多个脚手架模板,并保存至本地以生成本地仓库;
第二获取模块,配置成从所述Git仓库或所述本地仓库中获取与待处理的脚手架模板名对应的脚手架模块,作为指定脚手架模板;
解压模块,配置成对所述指定脚手架模板进行解压获得解压文件并存放至本地文件夹;
配置模块,配置成对所述解压文件中的脚手架代码进行配置,生成所需的脚手架文件。
可选地,所述脚手架管理装置还包括接收模块、判断模块以及第一查询模块;
所述接收模块配置成接收查询指令;
所述判断模块配置成判断所述查询指令是否与预设指令相一致;
所述第一查询模块配置成在所述查询指令与所述预设指令相一致时,根据所述查询指令查询得到所述Git仓库中的所有脚手架模板信息。
可选地,所述脚手架管理装置还包括第二查询模块、提取模块以及下载模块;
所述第二查询模块配置成查询所述本地仓库中是否存在与所述待处理的脚手架模板名对应的脚手架模板;
所述提取模块配置成在所述本地仓库中存在与所述待处理的脚手架模板名对应的脚手架模板时,从所述本地仓库中提取出与所述待处理的脚手架模板名对应的脚手架模板,作为指定脚手架模板;
所述下载模块配置成在所述本地仓库中不存在与所述待处理的脚手架模板名对应的脚手架模板时,从所述Git仓库中下载获得与所述待处理的脚手架模板名对应的脚手架模板,作为指定脚手架模板。
可选地,所述脚手架管理装置还包括:
模式判断模块,配置成在查询得到所述本地仓库中存在与所述待处理的脚手架模板名对应的脚手架模板后,判断当前系统模式是否为离线模式,若为离线模式,则执行从所述本地仓库中提取出与所述待处理的脚手架模板名对应的脚手架模板的步骤,若不为离线模式,再触发所述下载模块从所述Git仓库中下载获得与所述待处理的脚手架模板名对应的脚手架模板。
可选地,所述配置模块包括:
展示子模块,配置成在获得所述解压文件时,展示预设的配置信息,以供用户选择;
第一生成子模块,配置成获得用户的选择结果,并生成与所述选择结果相对应的自定义配置表;
第二生成子模块,配置成根据所述自定义配置表对所述解压文件中的脚手架代码进行配置,从而生成所需的脚手架文件。
本发明另一实施例还提供一种电子设备,所述电子设备与服务器通信连接,所述服务器预存有包括多个脚手架模板的Git仓库,所述电子设备包括:
存储器;
处理器;及
脚手架管理装置,所述脚手架管理装置安装于所述存储器中并包括一个或多个由所述处理器执行的软件功能模块。
本发明另一实施例还提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述的脚手架管理方法的步骤。
本发明实施例提供一种脚手架管理方法、装置及电子设备,将项目所需的多个脚手架模板统一存放至远程的Git仓库中,并从Git仓库中提取多个脚手架模板保存至本地以生成本地仓库。从本地仓库或远程的Git仓库中获取用户所需的指定脚手架模板,对获得的指定脚手架模板进行解压得到解压文件,并通过交互式提问获得与用户需求相匹配的自定义配置表,根据该自定义配置表对解压文件中的脚手架代码进行配置,最终生成所需的脚手架文件。本发明实施例提供的脚手架管理方案,节省了整个过程的处理时间且降低了系统处理负担,可方便、快捷地生成所需的脚手架文件,对于使用者及开发者来说均无需多余的操作,是一种便捷的管理工具。
为使本发明的上述目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附附图,作详细说明如下。
为了更清楚地说明本发明实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,应当理解,以下附图仅示出了本发明的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以 根据这些附图获得其他相关的附图。
图1为本发明实施例提供的一种脚手架管理方法的应用场景示意图。
图2为本发明实施例提供的用户端的示意性结构框图。
图3为本发明实施例提供的一种脚手架管理方法的流程图。
图4为本发明实施例提供的脚手架管理方法的另一流程图。
图5为本发明实施例提供的脚手架管理方法的另一流程图。
图6为本发明实施例提供的脚手架管理装置的功能模块框图。
图7为本发明实施例提供的脚手架管理装置的另一功能模块框图。
图8为本发明实施例提供的脚手架管理装置的另一功能模块框图。
图9为本发明实施例提供的脚手架管理装置的另一功能模块框图。
图标:100-用户端;110-脚手架管理装置;111-第一获取模块;112-第二获取模块;113-解压模块;114-配置模块;115-接收模块;116-判断模块;117-第一查询模块;118-第二查询模块;119-提取模块;1110-下载模块;1111-设置模块;1112-生成模块;120-处理器;130-存储器;200-服务器。
下面将结合本发明实施例中附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本发明实施例的组件可以以各种不同的配置来布置和设计。因此,以下对在附图中提供的本发明的实施例的详细描述并非旨在限制要求保护的本发明的范围,而是仅仅表示本发明的选定实施例。基于本发明的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本发明保护的范围。
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。同时,在本发明的描述中,除非另有明确的规定和限定,术语“安装”、“设置”、“连接”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本发明中的具体含义。
请参阅图1,为本发明实施例提供的一种脚手架管理方法的应用场景示意图。该场景包括用户端100和服务器200。所述用户端100通过网络与所述服务器200通信连接,以进行数据通信或交互。其中,所述用户端100可以为多个(图中只示出一个),多个所述用户端100通过网络与所述服务器200通信连接。所述用户端100可以是但不限于个人电脑、平板电脑、智能手机、移动上网设备等。所述服务器200可以是网络服务器、数据库服务器,可以是单独的服务器也可以是服务器集群等。
可选地,在本实施例中,所述服务器200可以是GitHub服务器或GitLab服务器,配置成管理Git仓库(Git Repository)。其中,在Git中,将需要进行版本控制的文件目录称为仓库,每个仓库相当于一个目录,该目录中的所有文件均通过Git来实现版本管理,Git能够跟踪并记录在该目录中发生的所有更新(如,增加文件、删除文件、修改文件等)。
请参阅图2,为本发明实施例提供的一种电子设备的示意性结构框图。在本实施例中,所述电子设备可以为上述的用户端100,所述用户端100包括脚手架管理装置110、处理器120及存储器130。其中,所述存储器130与所述处理器120之间直接或间接的电性连接,以实现数据的传输或交互。所述脚手架管理装置110包括至少一个可以软件或固件的形式存储于所述存储器130中或固化在所述用户端100的操作系统中的软件功能模块。所述处理器120配置成执行所述存储器130中存储的可执行模块,例如所述脚手架管理装置110包括的软件功能模块或计算机程序。
请参阅图3,是本发明实施例提供的一种应用于上述用户端100的脚手架管理方法的流程图。所应说明的是,本发明提供的方法不以图3及以下所述的具体顺序为限制。下面将对图3中示出的各步骤进行详细说明。
步骤S101,从所述服务器200的Git仓库中获取多个脚手架模板,并保存至本地以生成本地仓库。
在本实施例中,所述用户端100与所述服务器200通信连接,且所述服务器200中预存有包括多个脚手架模板的Git仓库。应当理解,该Git仓库中的脚手架模板为多个用户端100推送至服务器200中的脚手架模板的总和,例如,同一个项目的所有团队人员所推送的脚手架模板的总和。
在本实施例中,为了便于后续在采用离线模式进行脚手架模板配置等工作,可首先从所述服务器200的Git仓库中拉取多个脚手架模板,并保存至本地以生成本地仓库。应当理解,从服务器200中获取的多个脚手架模板为Git仓库中的部分脚手架模板,例 如之前所使用过的脚手架模板。
可选地,在建立本地仓库的目录中,会生成一个后缀名为“.git”的文件夹,所有的版本信息、更新记录以及仓库管理的相关信息都保存在该文件夹中。其中,该文件夹在初始化仓库的时候自动创建。通过本地仓库的创建,并将所述多个脚手架模板保存至该本地仓库中,便于在后续使用中对所述多个脚手架模板的更新记录进行追踪。
可选地,在本实施例中,是基于nodeJS进行开发,nodeJS可以模拟并发出获取请求,则可以进行下载等操作。nodeJS社区已经有很多开源的库,可以直接调用其中一个就行,实现将Git仓库中的内容拷贝到本地。
可选地,在实施时,用户可通过查询动作来获取到当前所有可用的脚手架模板。在本实施例中,所述脚手架管理方法还包括以下步骤:
接收查询指令,判断所述查询指令是否与预设指令相一致,若所述查询指令与所述预设指令相一致,则根据所述查询指令查询得到所述Git仓库中的所有脚手架模板信息。
可选地,所述用户端100在接收到用户输入的查询指令后,首先需要检验接收到查询指令是否为预设指令相一致,例如可将用于查询的预设指令设置为odin list,则若接收到的用户输入的查询指令为odin list,则查询得到当前所述Git仓库中所有可用的脚手架模板信息,并反馈给用户,以便用户获知当前所有可用的脚手架模板。若接收到的用户输入的查询指令与预设命令不一致,则不作响应。
步骤S103,从所述Git仓库或所述本地仓库中获取与待处理的脚手架模板名对应的脚手架模块,作为指定脚手架模板。
用户在获知当前所有可用的脚手架模板信息后,可根据自身需求选择相应的脚手架模板以便后续对其进行处理。即,用户可输入待处理的脚手架模板名,用户端100根据接收到的获取指令从远程的Git仓库或者是本地仓库中获取与该待处理的脚手架模板名对应的脚手架模板,将其作为指定脚手架模板。
可选地,请参阅图4,在本实施例中,所述指定脚手架模板可通过以下步骤获得:
步骤S201,查询所述本地仓库中是否存在与所述待处理的脚手架模板名对应的脚手架模板,若存在,则执行以下步骤S203,若不存在,则执行以下步骤S205。
步骤S203,从所述本地仓库中提取出与所述待处理的脚手架模板名对应的脚手架模板,作为指定脚手架模板。
步骤S205,从所述Git仓库中下载获得与所述待处理的脚手架模板名对应的脚手架模板,作为指定脚手架模板。
应当理解,用户端100的本地仓库中的脚手架模板是远程Git仓库中的脚手架模板的一部分。用户在输入查询指令后所获知的是当前所有可用的脚手架模板,即当前Git仓库中的所有脚手架模板。根据该信息用户所选择的指定脚手架模板可能存在于本地仓库中,但也可能在本地仓库中并不存在,只存在于远程的Git仓库中。
在本实施例中,为了节省处理时间及降低系统负担,用户端100在获得用户输入的待处理的脚手架模板名时,例如输入指令odin gen+脚手架模板名,首先会查询本地仓库中是否存在与该脚手架模板名对应的脚手架模板,若存在该脚手架模板,则直接从本地仓库中提取出该脚手架模板,将其作为指定脚手架模板。
当然,若当前在本地仓库中不存在与该待处理的脚手架模板名对应的脚手架模板,则从远程的Git仓库中去下载以获取该脚手架模板。
在本实施例中,采用一查询流程,在本地仓库存在相应的所需的脚手架模板时,可直接从本地仓库中获取,则可不必每次都去远程的Git仓库下载相应所需的脚手架模板,通过上述设计,可以节省处理时间并降低系统的处理负担。
实施时,在进行脚手架模板获取时,还可以考虑当前的网络状态及用户需求,可选地,在本实施例中,所述脚手架管理方法还可以包括以下步骤:
判断当前系统模式是否为离线模式,若为离线模式,则执行从所述本地仓库中提取出与所述待处理的脚手架模板名对应的脚手架模板的步骤,若不为离线模式,则执行从所述Git仓库中下载获得与所述待处理的脚手架模板名对应的脚手架模板的步骤。
步骤S105,对所述指定脚手架模板进行解压获得解压文件并存放至本地文件夹。
在本实施例中,所获取到的指定脚手架模板是一个压缩包文件,所以需要将其解压缩并存放在本地的个人文件夹中,以便后续使用。例如,当前进行的项目存放文件的文件夹名为.odin-template,当然也可以是用户自定义的文件夹,在本实施例中并不作具体限制。将所述指定脚手架模板的压缩包解压到对应文件夹下,例如,该指定脚手架模板的模板名为test。那么在.odin-template中,解压缩后就会生成一个test文件夹,里面存放着该指定脚手架模板的所有脚手架代码。
步骤S107,对所述解压文件中的脚手架代码进行配置,生成所需的脚手架文件。
可选地,作为一种实施方式,所述步骤S107可以包括如下子步骤:
在获得所述解压文件时,展示预设的配置信息,以供用户选择;
获得用户的选择结果,并生成与所述选择结果相对应的自定义配置表;
根据所述自定义配置表对所述解压文件中的脚手架代码进行配置,从而生成所需的脚手架文件。
可选地,在使用脚手架时,除了一些基本的规范、约定俗成的内容是不需要更改的之外,还需要进行一定程度的可定制化设置。对于该需求,不同的管理工具采用的是不同的逻辑。例如在yeoman中,是在模版开始下载前,即对用户进行交互式提问,让用户选择部分内容。在本实施例中,则是在脚手架代码被下载到本地之后,且在解压缩完成之后再进行交互式提问,以获取到用户的自定义配置表,根据该自定义配置表对解压文件中的脚手架代码进行配置,生成所需的脚手架文件。其中,所述交互式提问的内容即为所述预设的配置信息。
可选地,作为另一种实施方式,请参阅图5,在本实施例中,所述自定义配置表通过以下步骤获得:
步骤S301,设置指定配置信息并展示,以供用户选择。
步骤S303,接收用户输入的选择结果,并生成与所述选择结果相对应的自定义配置表。
可选地,本实施例所提供的脚手架管理方法是基于nodeJS开发,nodeJS中的现有的库,可用于精确地操控文件及文件内容。在本实施例中,用于与用户进行交互式提问的问题逻辑在所述解压文件中预设有规定格式,可根据该预设格式设置指定的多个配置信息并展示,以供用户选择。例如,该规定格式可为将配置信息设置为是否需要A这样的格式,用户在使用的时候,可根据该配置信息并结合自身需求来作出相应的选择,例如可选择需要A,或者是不需要A。根据用户的选择结果生成相应的自定义配置表,并根据该自定义配置表对解压文件中的脚手架代码进行配置,生成与用户需求及选择内容相匹配的脚手架文件。例如,若用户的选择为需要A,则后续生产的脚手架文件中就会相应的包含A的内容。
在本实施例中,通过可交互式提问与用户进行交互,可得到与用户选择结果相匹配的自定义配置表。根据该自定义配置表可以定义解压文件及文件夹的目录筛选,且对解压文件中的脚手架代码进行精确控制,最后复制生成所需的脚手架文件。在本实施例中,开发者可遵循解压文件中的问题逻辑的预设规定格式,便捷地开发出多类型的用户适用 的脚手架,使得脚手架功能更加灵活。
在本实施例中,通过将项目中的所有的脚手架模板统一存放在远程的Git仓库中,脚手架用户在使用时,只需通过输入与预设指令相符的查询指令即可获知当前所有可用的脚手架模板信息。且输入所需的待处理的脚手架模板名,即可获得所需的脚手架模板,并对其进行一系列处理之后即可快捷地生成所需的脚手架文件。对脚手架使用者来说整个过程十分方便且快捷,不需要任何多余的操作。
此外,对于脚手架开发者来说,由于Git本身是一个版本控制平台,因此在本实施例中使用Git进行脚手架代码托管,不会对脚手架开发者造成任何负担。其次,在开发过程中不需要新的学习成本,也没有多余的操作。且在进行版本迭代之后,不再需要同步发布至npm平台。并且,由于Git本身即是一个版本控制系统,因此,使得本实施例中的脚手架管理装置110具备了追踪脚手架的操作历史的功能。
请参阅图6,为本发明实施例提供的一种脚手架管理装置110的功能模块框图。所述脚手架管理装置110包括第一获取模块111、第二获取模块112、解压模块113以及配置模块114。
所述第一获取模块111配置成从所述服务器200的Git仓库中获取多个脚手架模板,并保存至本地以生成本地仓库。在本实施例中,该第一获取模块111可配置成执行图3中所示的步骤S101,具体的操作方法可参考步骤S101的详细描述。
所述第二获取模块112配置成从所述Git仓库或所述本地仓库中获取与待处理的脚手架模板名对应的脚手架模块,作为指定脚手架模板。在本实施例中,该第二获取模块112可配置成执行图3中所示的步骤S103,具体的操作方法可参考步骤S103的详细描述。
所述解压模块113配置成对所述指定脚手架模板进行解压获得解压文件并存放至本地文件夹。在本实施例中,该解压模块113可配置成执行图3中所示的步骤S105,具体的操作方法可参考步骤S105的详细描述。
所述配置模块114配置成对所述解压文件中的脚手架代码进行配置,生成所需的脚手架文件。在本实施例中,该配置模块114可配置成执行图3中所示的步骤S107,具体的操作方法可参考步骤S107的详细描述。
可选地,在本实施例中,所述配置模块114可以包括展示子模块、第一生成子模块以及第二生成子模块。
其中,所述展示子模块配置成在获得所述解压文件时,展示预设的配置信息,以供用户选择。
所述第一生成子模块配置成获得用户的选择结果,并生成与所述选择结果相对应的自定义配置表。
所述第二生成子模块配置成根据所述自定义配置表对所述解压文件中的脚手架代码进行配置,从而生成所需的脚手架文件。
请参阅图7,在本实施例中,所述脚手架管理装置110还包括接收模块115、判断模块116以及第一查询模块117。
所述接收模块115配置成接收查询指令。所述判断模块116配置成判断所述查询指令是否与预设指令相一致。所述第一查询模块117配置成在所述查询指令与所述预设指令相一致时,根据所述查询指令查询得到所述Git仓库中的所有脚手架模板信息。
可选地,请参阅图8,在本实施例中,所述脚手架管理装置110还包括第二查询模块118、提取模块119以及下载模块1110。
所述第二查询模块118配置成查询所述本地仓库中是否存在与所述待处理的脚手架模板名对应的脚手架模板。在本实施例中,该第二查询模块118可配置成执行图4中所示的步骤S201,具体的操作方法可参考步骤S201的详细描述。
所述提取模块119配置成在所述本地仓库中存在与所述待处理的脚手架模板名对应的脚手架模板时,从所述本地仓库中提取出与所述待处理的脚手架模板名对应的脚手架模板,作为指定脚手架模板。在本实施例中,该提取模块119可配置成执行图4中所示的步骤S203,具体的操作方法可参考步骤S203的详细描述。
所述下载模块1110配置成在所述本地仓库中不存在与所述待处理的脚手架模板名对应的脚手架模板时,从所述Git仓库中下载获得与所述待处理的脚手架模板名对应的脚手架模板,作为指定脚手架模板。在本实施例中,该下载模块1110可配置成执行图4中所示的步骤S205,具体的操作方法可参考步骤S205的详细描述。
可选地,所述脚手架管理装置110还可以包括模式判断模块。
所述模式判断模块配置成在查询得到所述本地仓库中存在与所述待处理的脚手架模板名对应的脚手架模板后,判断当前系统模式是否为离线模式,若为离线模式,则执行从所述本地仓库中提取出与所述待处理的脚手架模板名对应的脚手架模板的步骤,若不为离线模式,再触发所述下载模块1110从所述Git仓库中下载获得与所述待处理的脚 手架模板名对应的脚手架模板。
可选地,在本实施例,根据获得的自定义配置表对解压文件中的脚手架代码进行配置,生成所需的脚手架文件。可选地,请参阅图9,所述脚手架管理装置110还可以包括设置模块1111以及生成模块1112。
所述设置模块1111用户设置指定配置信息并展示,以供用户选择。具体地,该设置模块1111可配置成执行图5中所示的步骤S301,具体的操作方法可参考步骤S301的详细描述。
所述生成模块1112配置成接收用户输入的选择结果,并生成与所述选择结果相对应的自定义配置表。具体地,该生成模块1112可配置成执行图5中所示的步骤S303,具体的操作方法可参考步骤S303的详细描述。
此外,本发明另一实施例还提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器120执行时实现上述的脚手架管理方法的步骤。
综上所述,本发明实施例提供的脚手架管理方法、装置及电子设备,将项目所需的多个脚手架模板统一存放至远程的Git仓库中,并从Git仓库中提取多个脚手架模板保存至本地以生成本地仓库。对于用户所需的指定脚手架模板,首先查询本地仓库,若本地仓库中存在,则直接从本地仓库中提取,若不存在,再从远程Git仓库中下载。对下载下来的指定脚手架模板进行解压得到解压文件,并通过交互式提问获得与用户需求相匹配的自定义配置表,根据该自定义配置表对解压文件中的脚手架代码进行配置,最终生成所需的脚手架文件。本发明提供的脚手架管理方案,节省了整个过程的处理时间且降低了系统处理负担,可方便、快捷地生成所需的脚手架文件,对于使用者及开发者来说均无需多余的操作,是一种便捷的管理工具。
进一步地,该脚手架管理方案预先设置有使用规范,可对用户输入的查询指令进行验证,若查询指令与预设指令相一致,则根据查询指令查询获得当前所有可用的脚手架模板信息以供用户获知。
在本申请所提供的实施例中,应该理解到,所揭露的装置和方法,也可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,附图中的流程图和框图显示了根据本发明的实施例的装置、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,所述模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的 可执行指令。也应当注意,在有些作为替换的实现方式中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。
本发明实施例提供的脚手架管理方法、装置及电子设备,节省了脚手架管理过程的处理时间且降低了系统的处理负担,可以方便、快捷地生成所需的脚手架文件,对脚手架开发者及使用者而言均无需多余的操作。
Claims (14)
- 一种脚手架管理方法,其特征在于,应用于与服务器通信连接的用户端,所述服务器预存有包括多个脚手架模板的Git仓库,所述方法包括:从所述服务器的Git仓库中获取多个脚手架模板,并保存至本地以生成本地仓库;从所述Git仓库或所述本地仓库中获取与待处理的脚手架模板名对应的脚手架模块,作为指定脚手架模板;对所述指定脚手架模板进行解压获得解压文件并存放至本地文件夹;对所述解压文件中的脚手架代码进行配置,生成所需的脚手架文件。
- 根据权利要求1所述的脚手架管理方法,其特征在于,所述从所述Git仓库或所述本地仓库中获取与待处理的脚手架模板名对应的脚手架模块的步骤之前,所述方法还包括:接收查询指令,判断所述查询指令是否与预设指令相一致,若所述查询指令与所述预设指令相一致,则根据所述查询指令查询得到所述Git仓库中的所有脚手架模板信息。
- 根据权利要求1或2所述的脚手架管理方法,其特征在于,所述指定脚手架模板通过以下步骤获得:查询所述本地仓库中是否存在与所述待处理的脚手架模板名对应的脚手架模板;若存在,则从所述本地仓库中提取出与所述待处理的脚手架模板名对应的脚手架模板,作为指定脚手架模板,若不存在,则从所述Git仓库中下载获得与所述待处理的脚手架模板名对应的脚手架模板,作为指定脚手架模板。
- 根据权利要求3所述的脚手架管理方法,其特征在于,在查询得到所述本地仓库中存在与所述待处理的脚手架模板名对应的脚手架模板后,所述方法还包括:判断当前系统模式是否为离线模式,若为离线模式,则执行从所述本地仓库中提取出与所述待处理的脚手架模板名对应的脚手架模板的步骤,若不为离线模式,则执行从所述Git仓库中下载获得与所述待处理的脚手架模板名对应的脚手架模板的步骤。
- 根据权利要求1-4任一项所述的脚手架管理方法,其特征在于,所述对所述解压文件中的脚手架代码进行配置,生成所需的脚手架文件的步骤,包括:根据获得的自定义配置表对所述解压文件中的脚手架代码进行配置,生成所需的脚 手架文件;所述自定义配置表通过以下步骤获得:设置指定配置信息并展示,以供用户选择;接收用户输入的选择结果,并生成与所述选择结果相对应的自定义配置表。
- 根据权利要求1-4任一项所述的脚手架管理方法,其特征在于,所述对所述解压文件中的脚手架代码进行配置,生成所需的脚手架文件的步骤,包括:在获得所述解压文件时,展示预设的配置信息,以供用户选择;获得用户的选择结果,并生成与所述选择结果相对应的自定义配置表;根据所述自定义配置表对所述解压文件中的脚手架代码进行配置,从而生成所需的脚手架文件。
- 根据权利要求1-6任一项所述的脚手架管理方法,其特征在于,所述服务器为GitHub服务器或GitLab服务器。
- 一种脚手架管理装置,其特征在于,应用于与服务器通信连接的用户端,所述服务器预存有包括多个脚手架模板的Git仓库,所述脚手架管理装置包括:第一获取模块,配置成从所述服务器的Git仓库中获取多个脚手架模板,并保存至本地以生成本地仓库;第二获取模块,配置成从所述Git仓库或所述本地仓库中获取与待处理的脚手架模板名对应的脚手架模块,作为指定脚手架模板;解压模块,配置成对所述指定脚手架模板进行解压获得解压文件并存放至本地文件夹;配置模块,配置成对所述解压文件中的脚手架代码进行配置,生成所需的脚手架文件。
- 根据权利要求8所述的脚手架管理装置,其特征在于,所述脚手架管理装置还包括接收模块、判断模块以及第一查询模块;所述接收模块配置成接收查询指令;所述判断模块配置成判断所述查询指令是否与预设指令相一致;所述第一查询模块配置成在所述查询指令与所述预设指令相一致时,根据所述查询 指令查询得到所述Git仓库中的所有脚手架模板信息。
- 根据权利要求8或9所述的脚手架管理装置,其特征在于,所述脚手架管理装置还包括第二查询模块、提取模块以及下载模块;所述第二查询模块配置成查询所述本地仓库中是否存在与所述待处理的脚手架模板名对应的脚手架模板;所述提取模块配置成在所述本地仓库中存在与所述待处理的脚手架模板名对应的脚手架模板时,从所述本地仓库中提取出与所述待处理的脚手架模板名对应的脚手架模板,作为指定脚手架模板;所述下载模块配置成在所述本地仓库中不存在与所述待处理的脚手架模板名对应的脚手架模板时,从所述Git仓库中下载获得与所述待处理的脚手架模板名对应的脚手架模板,作为指定脚手架模板。
- 根据权利要求10所述的脚手架管理装置,其特征在于,所述脚手架管理装置还包括:模式判断模块,配置成在查询得到所述本地仓库中存在与所述待处理的脚手架模板名对应的脚手架模板后,判断当前系统模式是否为离线模式,若为离线模式,则执行从所述本地仓库中提取出与所述待处理的脚手架模板名对应的脚手架模板的步骤,若不为离线模式,再触发所述下载模块从所述Git仓库中下载获得与所述待处理的脚手架模板名对应的脚手架模板。
- 根据权利要求9-11任一项所述的脚手架管理装置,其特征在于,所述配置模块包括:展示子模块,配置成在获得所述解压文件时,展示预设的配置信息,以供用户选择;第一生成子模块,配置成获得用户的选择结果,并生成与所述选择结果相对应的自定义配置表;第二生成子模块,配置成根据所述自定义配置表对所述解压文件中的脚手架代码进行配置,从而生成所需的脚手架文件。
- 一种电子设备,其特征在于,所述电子设备与服务器通信连接,所述服务器预存有包括多个脚手架模板的Git仓库,所述电子设备包括:存储器;处理器;及脚手架管理装置,所述脚手架管理装置安装于所述存储器中并包括一个或多个由所述处理器执行的软件功能模块,所述脚手架管理装置包括:第一获取模块,用于从所述服务器的Git仓库中获取多个脚手架模板,并保存至本地以生成本地仓库;第二获取模块,用于从所述Git仓库或所述本地仓库中获取与待处理的脚手架模板名对应的脚手架模块,作为指定脚手架模板;解压模块,用于对所述指定脚手架模板进行解压获得解压文件并存放至本地文件夹;配置模块,用于对所述解压文件中的脚手架代码进行配置,生成所需的脚手架文件。
- 一种计算机可读存储介质,其特征在于,其上存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1-8任意一项所述的脚手架管理方法的步骤。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710547621.5A CN107273140B (zh) | 2017-07-06 | 2017-07-06 | 脚手架管理方法、装置及电子设备 |
| CN201710547621.5 | 2017-07-06 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2019007016A1 true WO2019007016A1 (zh) | 2019-01-10 |
Family
ID=60071826
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2018/071608 Ceased WO2019007016A1 (zh) | 2017-07-06 | 2018-01-05 | 脚手架管理方法、装置及电子设备 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN107273140B (zh) |
| WO (1) | WO2019007016A1 (zh) |
Families Citing this family (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107273140B (zh) * | 2017-07-06 | 2018-09-21 | 武汉斗鱼网络科技有限公司 | 脚手架管理方法、装置及电子设备 |
| CN108182056A (zh) * | 2017-12-28 | 2018-06-19 | 天脉聚源(北京)科技有限公司 | 一种智能配置多个网络页面的框架的方法及装置 |
| CN110580152B (zh) * | 2018-06-07 | 2023-05-12 | 北京怡合春天科技有限公司 | 一种前端自动化脚手架 |
| CN109343835A (zh) * | 2018-08-28 | 2019-02-15 | 苏州浪潮智能软件有限公司 | 一种基于模板的快速构建业务脚手架代码工具 |
| CN109683887B (zh) * | 2018-12-17 | 2022-04-26 | 杭州玳数科技有限公司 | 一种支持多方案自定义web项目的构建方法及装置 |
| CN112015375A (zh) * | 2020-08-21 | 2020-12-01 | 广州欢网科技有限责任公司 | 后台管理系统创建方法、装置及电子设备 |
| CN113419730B (zh) * | 2021-06-22 | 2024-12-24 | 中电金信软件有限公司 | 前端工程构建方法、装置及电子设备 |
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 (zh) * | 2017-01-16 | 2017-06-13 | 百融(北京)金融信息服务股份有限公司 | 一种前端开发工程化系统和方法 |
| CN107273140A (zh) * | 2017-07-06 | 2017-10-20 | 武汉斗鱼网络科技有限公司 | 脚手架管理方法、装置及电子设备 |
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 (zh) * | 2014-12-17 | 2018-10-16 | 用友网络科技股份有限公司 | 资源和配置的自动生成装置和方法 |
| CN105989098B (zh) * | 2015-02-12 | 2020-04-07 | 阿里巴巴集团控股有限公司 | 图标包的生成方法及服务器、图标的处理方法及系统 |
| CN106095408B (zh) * | 2016-05-31 | 2019-05-14 | 浙江网新恒天软件有限公司 | 一种数据监控和代码自动生成与部署的系统及方法 |
| CN106095442B (zh) * | 2016-06-13 | 2021-07-02 | 福州智永信息科技有限公司 | 基于web的自动高速出包方法 |
-
2017
- 2017-07-06 CN CN201710547621.5A patent/CN107273140B/zh active Active
-
2018
- 2018-01-05 WO PCT/CN2018/071608 patent/WO2019007016A1/zh not_active Ceased
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 (zh) * | 2017-01-16 | 2017-06-13 | 百融(北京)金融信息服务股份有限公司 | 一种前端开发工程化系统和方法 |
| CN107273140A (zh) * | 2017-07-06 | 2017-10-20 | 武汉斗鱼网络科技有限公司 | 脚手架管理方法、装置及电子设备 |
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 |
|---|---|
| CN107273140A (zh) | 2017-10-20 |
| CN107273140B (zh) | 2018-09-21 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN107273140B (zh) | 脚手架管理方法、装置及电子设备 | |
| CN104113774A (zh) | 一种电视机设备控制方法、设备和系统 | |
| CN105210031A (zh) | 用于操作系统的自助服务机应用模式 | |
| CN112068873A (zh) | 网页生成方法、装置、服务器及存储介质 | |
| CN113360211A (zh) | 基于控件的加载显示方法及相关设备 | |
| US20250390283A1 (en) | Configuration file editor with intelligent code-based interface and visual interface | |
| CN110333874B (zh) | 一种iOS系统安装包数据采集方法、装置、设备及介质 | |
| CN113312083A (zh) | 应用生成方法、装置及设备 | |
| CN111125205A (zh) | 看板数据显示方法、终端及存储介质 | |
| CN114860304A (zh) | 配置信息的处理方法、装置、存储介质和电子装置 | |
| CN111147402A (zh) | 交换机出厂设置项的定制方法、装置、交换机及系统 | |
| JP7691624B2 (ja) | 情報処理システム、処理方法及びプログラム | |
| CN108132832B (zh) | 应用程序启动方法和装置 | |
| CN115544041A (zh) | 一种合并冲突的处理方法、装置、电子设备及存储介质 | |
| JP5959535B2 (ja) | クライアントからネットワークを介して携帯端末にアクセスするためのサーバ、方法、及び、コンピュータを該サーバとして機能させるプログラム | |
| CN104142824A (zh) | 一种基于类库的代码生成器及其实现方法 | |
| CN107391132B (zh) | 目标App执行预设动作的方法及装置、设备 | |
| CN112579554A (zh) | 服务器配置文件的批量对比方法、装置及电子设备 | |
| CN113377346B (zh) | 集成环境搭建方法、装置、电子设备及存储介质 | |
| CN114489617A (zh) | 分支策略生成方法、装置、终端设备及存储介质 | |
| CN115408120A (zh) | 脚本语言文件的运行方法、装置、设备、介质及产品 | |
| JP2019021176A (ja) | データ分析システム、及びデータ分析方法 | |
| JP2017146748A (ja) | 入力内容確認促進装置、入力内容確認促進方法および入力内容確認促進プログラム | |
| CN113010059A (zh) | 应用程序图标管理方法、装置及电子设备 | |
| CN106484245B (zh) | 信息处理方法、装置及电子设备 |
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 |