Movatterモバイル変換


[0]ホーム

URL:


CN112835568A - A project construction method and device - Google Patents

A project construction method and device
Download PDF

Info

Publication number
CN112835568A
CN112835568ACN201911165865.2ACN201911165865ACN112835568ACN 112835568 ACN112835568 ACN 112835568ACN 201911165865 ACN201911165865 ACN 201911165865ACN 112835568 ACN112835568 ACN 112835568A
Authority
CN
China
Prior art keywords
project
configuration information
file
files
packaging
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.)
Granted
Application number
CN201911165865.2A
Other languages
Chinese (zh)
Other versions
CN112835568B (en
Inventor
单开元
王戈
李龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co LtdfiledCriticalBeijing Jingdong Century Trading Co Ltd
Priority to CN201911165865.2ApriorityCriticalpatent/CN112835568B/en
Publication of CN112835568ApublicationCriticalpatent/CN112835568A/en
Application grantedgrantedCritical
Publication of CN112835568BpublicationCriticalpatent/CN112835568B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

The invention discloses a project construction method and device, and relates to the technical field of computers. One embodiment of the method comprises: acquiring project basic information and a project template, and modifying project configuration information according to the project basic information to generate a plurality of project files; wherein the project configuration information comprises a feature tag set for the project file; scanning a folder belonging to a target directory to determine an item management list according to the characteristic marks; and executing a starting command on the project files belonging to the project management list so as to compile the project files according to predefined packaging configuration information by adopting a packaging tool to generate a first static file. The method sets the characteristic marks for the project files in the project configuration information so as to compile the project files based on the characteristic marks, and realizes the starting management of a plurality of project files.

Description

Project construction method and device
Technical Field
The invention relates to the field of computers, in particular to a project construction method and device.
Background
In recent years, the front-end technology is developed vigorously like bamboo shoots in spring after rain, and with the emergence of new technologies such as an ES6 module, Babel conversion, webpack packaging and the like, the front-end application can be completed in a modularized mode, and the maintenance is convenient. Under the tidal flow of continuous development of the front-end technology, front-end developers need to spend great energy on paying attention to the processes of development, module dependence in the construction stage, file packaging and the like, and the development efficiency is reduced to a certain extent. Therefore, a build tool that can be used out of box is highly appreciated by front-end developers, such as the Creact-retrieve-app.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
existing build tools can only manage a single project; the development interface is invisible; the webpack configuration cannot be flexibly modified; the dependent packages can only be installed online.
Disclosure of Invention
In view of this, embodiments of the present invention provide a project construction method and apparatus, where a feature tag is set in project configuration information for a project file, and the project file is compiled based on the feature tag, so that startup management of multiple project files is implemented.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a project construction method.
The project construction method provided by the embodiment of the invention comprises the following steps: acquiring project basic information and a project template, and modifying project configuration information according to the project basic information to generate a plurality of project files; wherein the project configuration information comprises a feature tag set for the project file; scanning a folder belonging to a target directory to determine an item management list according to the characteristic marks; and executing a starting command on the project files belonging to the project management list so as to compile the project files according to predefined packaging configuration information by adopting a packaging tool to generate a first static file.
Optionally, before the step of compiling the project file according to the predefined packaging configuration information by using a packaging tool, the method further includes: monitoring whether a setting operation exists in the project files belonging to the project management list; if the setting operation of the project files belonging to the project management list is not monitored, no processing is carried out; compiling the project file according to predefined packaging configuration information by adopting a packaging tool, wherein the compiling comprises the following steps: and if the setting operation of the project files belonging to the project management list is monitored, compiling the project files according to predefined packaging configuration information by adopting a packaging tool.
Optionally, the setting operation is a modification or saving operation performed on the project file.
Optionally, the method further comprises: and executing a construction command on the project files belonging to the project management list so as to package the project files by adopting a packaging tool and generate a second static file.
Optionally, the method further comprises: detecting a set port set, determining a target port, and designating the target port as a port of a local development environment when executing the starting command; and starting the local development environment, receiving an access request sent through the target port, and displaying the first static file on a browser.
Optionally, the method further comprises: receiving updated packaging configuration information through an application program interface in a plug-in form; compiling the project file according to predefined packaging configuration information, comprising: and compiling the project file according to the updated packing configuration information.
Optionally, the method further comprises: and building a dependency package used by the local development environment and the production environment in order to install the dependency package off line.
To achieve the above object, according to another aspect of an embodiment of the present invention, there is provided a project building apparatus.
The project construction device of the embodiment of the invention comprises: the project creating module is used for acquiring project basic information and a project template, and modifying project configuration information according to the project basic information to generate a plurality of project files; wherein the project configuration information comprises a feature tag set for the project file; the project management module is used for scanning the folder belonging to the target directory to determine a project management list according to the characteristic mark; and the project starting module is used for executing a starting command on the project files belonging to the project management list, compiling the project files according to predefined packing configuration information by adopting a packing tool and generating a first static file.
Optionally, the apparatus further comprises: the monitoring processing module is used for monitoring whether the project files belonging to the project management list have setting operation or not; if the setting operation of the project files belonging to the project management list is not monitored, no processing is carried out; the item starting module is further configured to: and if the setting operation of the project files belonging to the project management list is monitored, compiling the project files according to predefined packaging configuration information by adopting a packaging tool.
Optionally, the setting operation is a modification or saving operation performed on the project file.
Optionally, the apparatus further comprises: and the project construction module is used for executing a construction command on the project files belonging to the project management list so as to package the project files by adopting a packaging tool and generate a second static file.
Optionally, the apparatus further comprises: the display module is used for detecting a set port set, determining a target port and appointing the target port as a port of a local development environment when executing the starting command; and starting the local development environment, receiving an access request sent through the target port, and displaying the first static file on a browser.
Optionally, the apparatus further comprises: the information updating module is used for receiving updated packaging configuration information through an application program interface in a plug-in form; compiling the project file according to predefined packaging configuration information, comprising: and compiling the project file according to the updated packing configuration information.
Optionally, the apparatus further comprises: and the built-in module is used for building in the dependency package used by the local development environment and the production environment so as to install the dependency package off line.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided an electronic apparatus.
An electronic device of an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement a project construction method of an embodiment of the present invention.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided a computer-readable medium.
A computer-readable medium of an embodiment of the present invention has stored thereon a computer program that, when executed by a processor, implements a project construction method of an embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: setting a characteristic mark for the project file in the project configuration information to compile the project file based on the characteristic mark, so that the starting management of a plurality of project files is realized; whether a developer sets an action on a project file or not is monitored, the project file needing to be compiled is determined, compiling efficiency is improved, and resource overhead is saved; after the developer finishes developing, the developer can execute the construction command to finish the construction of the production environment; the server is started locally, so that a developer can access the server to view the content of the current project in a browser, and visual development is realized; providing an application program interface in a plug-in form so as to flexibly modify the packaging configuration information; and a dependency package is built in, and offline installation of the dependency package is realized.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main steps of a project construction method according to an embodiment of the invention;
FIG. 2 is a main flow diagram of a project construction method according to yet another embodiment of the present invention;
FIG. 3 is a main flow diagram of a project construction method according to another embodiment of the present invention;
FIG. 4 is a main flow diagram of a project construction method according to yet another embodiment of the present invention;
FIG. 5 is a schematic diagram of the main modules of a project building apparatus according to one embodiment of the invention;
FIG. 6 is a schematic diagram of the main modules of a project building apparatus according to yet another embodiment of the present invention;
FIG. 7 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
FIG. 8 is a schematic diagram of a computer apparatus suitable for use in an electronic device to implement an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Technical terms related to the present invention are explained below.
ES 6: is the next generation standard of the JavaScript language.
Babel: is a JavaScript compiler.
Webpack: the JavaScript files are packaged together, and the packaged files are used in a browser.
#"0043">Creact-act-app: the method is used for constructing the React development environment, and the React is a JavaScript library used for constructing the user interface.
git: a distributed version control system.
Fig. 1 is a schematic diagram of the main steps of a project construction method according to an embodiment of the present invention. As shown in fig. 1, the project construction method according to the embodiment of the present invention mainly includes the following steps:
step S101: and acquiring project basic information and a project template, and modifying project configuration information according to the project basic information to generate a plurality of project files. This step is used to create a new project. The project basic information comprises a project name, a project description and the like, and the project description comprises an executed command and a task which is required to be executed and corresponds to the command. The project template is the designed webpage. The project configuration information includes a project name, a version number, a git warehouse address, a feature tag, and the like, wherein the feature tag is used for identifying whether the project is a project developed by a specific tool. And modifying the project configuration information, namely writing the project name, the project description, the version number and the like based on the project basic information input by the user. A project file is generated based on the project configuration information and the project template.
Step S102: and scanning folders belonging to the target directory to determine an item management list according to the characteristic marks. Scanning all folders in the target directory, wherein each folder contains project configuration information, and determining whether the project is a project developed by a specified tool or not according to the value of the feature mark of the project configuration information. And extracting the project developed by the specified tool to obtain a project management list. For example, if the feature flag corresponding to the project developed by the designated tool is set to 1 and the feature flag corresponding to the project developed by the unspecified tool is set to 9, the project with the feature flag of 1 may be extracted to obtain the project management list.
Step S103: and executing a starting command on the project files belonging to the project management list so as to compile the project files according to predefined packaging configuration information by adopting a packaging tool to generate a first static file. The local development environment is started by executing the start command, i.e., the npm start command, and then the item files included in the item management list are compiled according to the packaging configuration information using a packaging tool, such as webpack, to generate a first static file. The packaging configuration information includes an entry file, an exit file, a loader, a plug-in, and the like, and is used for loading and packaging resources. The server may then be opened locally, and the developer may access the server at the browser to view the contents of the first static file.
The project developed by the developer may be a complete web application or may be only a block of the web application, i.e. a part of the application without application integrity. Development tiles can facilitate functional reuse, and therefore project management is needed, especially for projects of multiple tile types. This is explained in detail below with reference to fig. 2.
Fig. 2 is a main flow diagram of a project construction method according to still another embodiment of the present invention. As shown in fig. 2, a project construction method (a device corresponding to the method and a project construction device) according to an embodiment of the present invention mainly includes the following steps:
step S201: and acquiring project basic information and a project template, and modifying project configuration information according to the project basic information to generate a plurality of project files. The basic information of the project is input by a developer and comprises a project name, a project description and the like. Item descriptions, such as: commit, i.e., the command to be executed, and git-cz, i.e., the task that the computer operating system will perform when executing the command. The project template is then copied locally, where the project template may be custom generated. And modifying the project configuration information, and writing information such as project names, project descriptions, version numbers and the like into the project configuration information according to the input of a developer. And determining a dependency package required by the project according to the project template, wherein the project configuration information and the dependency package form a project file.
The developer needs to build a plurality of projects, and at this time, the project needs to be managed, and the management content includes the starting, updating and building of the project. In this embodiment, a feature flag is set in the project configuration information to indicate whether the project is a project created by a specific tool. In a preferred embodiment, the item configuration information is a package.json file, and an attribute field is set in the package.json file, and is used to mark whether the item is created by the item construction apparatus of the embodiment.
Step S202: folders belonging to the target directory are scanned to determine an item management list based on the characteristic tags of the item configuration information. Scanning all folders under the current level of directory, wherein one folder is a project by default, and a package json file exists under each folder. Json file is based on whether or not the mark item is an attribute field created by the item construction apparatus of the present embodiment. After the scanning is completed, all the project management lists created by using the project building device of the embodiment in the current level of the directory can be obtained.
Step S203: monitoring whether a setting operation exists in the project files belonging to the project management list, and if the setting operation exists, executing a step S204; if there is no setting operation, no processing is done. Wherein the setting operation is to modify or save the project file. After the project is started, the project is defaulted to be lazy to compile, namely, all the projects are not compiled at the beginning, so that the time overhead and the resource overhead are saved, hot updating is supported by the method, and the experience of developers is improved. The method specifically comprises the following steps: when a developer opens a corresponding code of a project file and modifies or saves the code of the project file, the implementation can monitor the behavior of the developer, then compile the project file with the behavior, and do not process other project files.
Step S204: reading predefined packaging configuration information, executing a starting command on the project file with the setting operation to start a local development environment, and generating a first static file by adopting a packaging tool. The packaging configuration information is customized by a developer and comprises an entry file, an exit file, a loader, a plug-in and the like.
In the example, the packing tool is webpack. Executing the npm start command starts the local development environment, starting the local server using the webackdevserver command, and then compiling the project file using the weback to generate the first static file. Among them, webpack devserver is a small Express server offered by webpack officials. In a preferred embodiment, the background service may be started while the local development environment is started, for presenting the configuration information of the current project.
Step S205: and detecting the set port set, determining a target port, and designating the target port as a port of the local server when executing the starting command. The currently available ports are detected and one of the available ports is determined as the target port. When the npm start command is executed, the determined target port is taken as a port of the local server.
Step S206: an access request sent through the destination port is received to expose the first static file on the browser. And the developer accesses the server of the local development environment through the target port, and the server feeds the first static file back to the browser of the client for display, so that the developer can conveniently view the content of the first static file.
The embodiment shown in FIG. 2 enables project development in a local development environment, where developers can see the contents of the project through a designated server. After the development of the developer is completed, codes of the production environment can be constructed, and after the construction is completed, the developer can upload the codes to different servers according to the requirements of the developer and browse the codes by users. This is explained in detail below with reference to fig. 3.
Fig. 3 is a main flow diagram of a project construction method according to another embodiment of the present invention. As shown in fig. 3, the project construction method according to the embodiment of the present invention mainly includes the following steps:
step S301: and acquiring project basic information and a project template, and modifying project configuration information according to the project basic information to generate a plurality of project files. The implementation process of this step is the same as step S201, and is not described herein again.
Step S302: folders belonging to the target directory are scanned to determine an item management list based on the characteristic tags of the item configuration information. The implementation process of this step is the same as step S202, and is not described here again.
Step S303: monitoring whether a setting operation exists in the project files belonging to the project management list, and if the setting operation exists, executing a step S304; if there is no setting operation, no processing is done. The implementation process of this step is the same as step S203, and is not described herein again.
Step S304: reading the defined packaging configuration information, executing a starting command on the project file with the setting operation to start the local development environment, and generating a first static file by adopting a packaging tool. The implementation process of this step is the same as step S204, and is not described here again.
Step S305: and detecting the set port set, determining a target port, and designating the target port as a port of a local development environment when executing a starting command. The implementation process of this step is the same as step S205, and is not described herein again.
Step S306: an access request sent through the destination port is received to expose the first static file on the browser. The implementation process of this step is the same as step S206, and is not described here again.
Step S307: reading the packaging configuration information, executing a construction command on the project file with the setting operation, packaging the project file by adopting a packaging tool, and generating a second static file. And the construction of the production environment can be completed by executing the nmp build command. The command may produce a file with a hash value, which may be removed in an embodiment using a-hash parameter. And the compression of the codes, the quality of the codes and the grammar check are completed in the construction process. And compiling the project file by adopting webpack to generate a second static file.
It should be noted that, when executing the build command, the specified project files (i.e. the project files with setting operation) may be packaged, or all the project files in the current folder may be built at the same time, so as to facilitate management of multiple sub-projects.
Step S308: and deploying the second static file to the server so as to browse the second static file through the server. After the construction is completed, the sender can upload the information to different servers according to the requirements of the sender, and the information is browsed by a user. Assuming that the project file is a code file corresponding to a certain html (hypertext markup language) webpage, a static file is obtained through webpack compilation, and the html webpage can be seen by opening the static file in a browser.
The project created by the embodiment is mainly developed by using a act framework, the matched dependency packages comprise act and act-dom, and if data management is needed, the reduce dependency package or the mobxreduc dependency package is used; if a ui (user interface) library is required, then the ant dependent package is used. Installation of these dependent packages typically requires access to foreign websites, which is slow if installed online and unsuccessful for a long time, and may have a series of error messages, which costs developers a lot of time.
In order to solve the above problem, in a preferred embodiment, the dependency packages may be built into the project building apparatus, and the user may install and complete the dependency packages when installing the project building apparatus of this embodiment. Specifically, if the local network is abnormal, when the yann install command is used for installing the dependent package, the local resource is taken by default, and the dependent package is directly installed into the project. If the local network is normal, when the yann install command is used for installing the dependency package, local resources can still be moved, the time for installing the dependency package is greatly reduced, and the possibility of error installation is avoided. In addition, for projects of multiple block types, blocks can be quickly created in a built-in dependency package mode, the dependency package does not need to be installed on each block, and development efficiency is improved.
Fig. 4 is a main flow diagram of a project construction method according to still another embodiment of the present invention. As shown in fig. 4, the project construction method according to the embodiment of the present invention mainly includes the following steps:
step S401: and installing a project construction device and initializing the project. The developer may use the npm install socket-g command for global installation. The project construction device of the embodiment is installed in a global catalog, and projects can be created, developed and constructed by the project construction device at any position of a computer.
The item is initialized under the item directory using the ticket createprojectName command. In the initialization process, the project building apparatus of this embodiment downloads the files and the dependency packages required for initializing the project. The files such as html, css, js and the like rely on packages such as acts, vue and the like, and after initialization is completed, development of projects can be carried out.
Step S402: the local development project is started. The entry file under the page folder of the project root directory needs to be appointed before starting the project is the same as the html file name, so that the packaging tool can conveniently identify the entry file. The entry file is the first file when the system is accessed. In this embodiment, the item may include a single page or may include multiple pages. The single page refers to switching different contents only in one page depending on routing, and the multi-page refers to switching contents in a plurality of pages depending on routing. If the project contains multiple pages, multiple entry files may be created, i.e., one entry file for each page. When a packaging tool is used for packaging subsequently, the directory needs to be read, and whether a single page or multiple pages are constructed is determined.
Executing the npm start command may start the local development environment. The local development environment supports basic functions of SASS pre-compiling, hot updating, code checking and the like. When the npm start command is executed at the same time, the port number of the local development environment can be specified, and in the embodiment, the port parameter is taken as the port number to start the local server, and the port number is accessed. After the local development environment is started, a visual web interface is generated, page management and dependency management can be performed on the interface, and operations such as upgrading of a dependency package, deleting of the dependency package, installing of a new dependency package and the like can be completed. And a plurality of command line windows are not required to be opened or closed without a development environment, so that great convenience is brought to a front-end developer.
In the development phase, if the img tag refers to the local picture, the import of the picture can be completed by using the ES6 grammar; if the picture is introduced from the CSS, the picture can be referred by using a reference manner of a relative path, and the project building apparatus of this embodiment will finally complete the loading and building of the picture. The specific implementation of this step is shown in step S201 and step S206, which are not described herein again.
Step S403: the packaging configuration information is modified. The project building device contains predefined packaging configuration information. The developer may modify the packaged configuration information in the form of a plug-in. In the embodiment, the plug-ins add the modified configuration to the project construction device in a webpack-chain form, so that developers can flexibly customize the project construction device according to own business requirements.
In an embodiment, the plug-in includes three Application Program Interfaces (APIs), namely, chainWebpack, registerCommand and resolveWebpack Config. Wherein, chainWebpack is used for modifying the packaging configuration information through chain operation; the register command is used for registering a command, and when the corresponding command is executed, the registered content is executable; resolvewebpackackconfig is used to retrieve parsed packaged configuration information.
Step S404: and constructing a production environment. After the developer completes development, the code of the production environment needs to be built. The build of the production environment can be completed by executing the npm build command. The specific implementation of this step is shown in step S307 and step S308, which are not described herein again. And the compression of the codes, the quality of the codes and the grammar check are completed in the construction process. After the construction is completed, developers can upload the information to different servers according to the requirements of the developers, and the developers can browse the information by users.
According to the project construction method provided by the embodiment of the invention, the feature marks are set for the project files in the project configuration information, so that the project files are compiled based on the feature marks, and the starting management of a plurality of project files is realized; whether a developer sets an action on a project file or not is monitored, the project file needing to be compiled is determined, compiling efficiency is improved, and resource overhead is saved; after the developer finishes developing, the developer can execute the construction command to finish the construction of the production environment; the server is started locally, so that a developer can access the server to view the content of the current project in a browser, and visual development is realized; providing an application program interface in a plug-in form so as to flexibly modify the packaging configuration information; and a dependency package is built in, and offline installation of the dependency package is realized.
Fig. 5 is a schematic diagram of main modules of a project building apparatus according to an embodiment of the present invention. As shown in fig. 5, theproject building apparatus 500 according to the embodiment of the present invention mainly includes:
theproject creating module 501 is configured to obtain project basic information and a project template, and modify project configuration information according to the project basic information to generate a plurality of project files. This module is used to create a new project. The project basic information comprises a project name, a project description and the like, and the project description comprises an executed command and a task which is required to be executed and corresponds to the command. The project template is the designed webpage. The project configuration information includes a project name, a version number, a git warehouse address, a feature tag, and the like, wherein the feature tag is used for identifying whether the project is a project developed by a specific tool. And modifying the project configuration information, namely writing the project name, the project description, the version number and the like based on the project basic information input by the user. A project file is generated based on the project configuration information and the project template.
Theitem management module 502 is configured to scan folders belonging to the target directory to determine an item management list according to the feature tag. Scanning all folders in the target directory, wherein each folder contains project configuration information, and determining whether the project is a project developed by a specified tool or not according to the value of the feature mark of the project configuration information. And extracting the project developed by the specified tool to obtain a project management list. For example, if the feature flag corresponding to the project developed by the designated tool is set to 1 and the feature flag corresponding to the project developed by the unspecified tool is set to 9, the project with the feature flag of 1 may be extracted to obtain the project management list.
Aproject starting module 503, configured to execute a starting command on the project file belonging to the project management list, so as to compile the project file according to predefined package configuration information by using a packaging tool, and generate a first static file. And executing a starting command, namely executing an npm start command, starting a local development environment, opening a visual web interface by default after the local development environment is started, and performing page management and dependency management on the interface.
Then, a packing tool, such as webpack, is used to compile the project files contained in the project management list according to the packing configuration information, and a first static file is generated. The packaging configuration information includes an entry file, an exit file, a loader, a plug-in, and the like, and is used for loading and packaging resources. The server may then be opened locally, and the developer may access the server at the browser to view the contents of the first static file.
In addition, theproject building apparatus 500 according to the embodiment of the present invention may further include: a listening processing module, a presentation module, an information update module and a built-in module (not shown in fig. 5). The monitoring processing module is used for monitoring whether the project files belonging to the project management list have setting operation or not; and if the setting operation of the item file belonging to the item management list is not monitored, no processing is performed.
The display module is used for detecting a set port set, determining a target port and appointing the target port as a port of a local development environment when executing the starting command; and starting the local development environment, receiving an access request sent through the target port, and displaying the first static file on a browser.
The information updating module is used for receiving updated packaging configuration information through an application program interface in a plug-in form; compiling the project file according to predefined packaging configuration information, comprising: and compiling the project file according to the updated packing configuration information. And the built-in module is used for building in the dependency package used by the local development environment and the production environment so as to install the dependency package off line.
Fig. 6 is a schematic diagram of main modules of a project building apparatus according to still another embodiment of the present invention. As shown in fig. 6, aproject building apparatus 600 according to an embodiment of the present invention mainly includes: aproject creation module 501, aproject management module 502, aproject launch module 503, and aproject build module 604. Theproject management module 502 manages the execution of theproject launch module 503 and theproject build module 604. Theproject building module 604 is configured to execute a building command on the project files belonging to the project management list, so as to package the project files by using a packaging tool, and generate a second static file.
As can be seen from the above description, the present embodiment provides a flexible, convenient, and visual construction tool (i.e., a project construction apparatus) for a developer, reduces project construction difficulty, can support multiple platforms such as windows and mac, and can visually view a current project page and a dependency package through a visual interface. Meanwhile, the visual construction tool is convenient for developers to flexibly manage the page and the dependency package, and the installation of the dependency package can be completed without closing the current development process. The flexible plug-in mechanism can facilitate developers to realize the customization of webpack according to own services. And a multi-project management function is provided, so that a developer can conveniently develop a plurality of projects at the same time. The offline installation function is provided, convenience is provided for developers, and the working efficiency of the developers is improved.
Fig. 7 illustrates anexemplary system architecture 700 to which a project construction method or project construction apparatus of an embodiment of the present invention may be applied.
As shown in fig. 7, thesystem architecture 700 may includeterminal devices 701, 702, 703, anetwork 704, and aserver 705. Thenetwork 704 serves to provide a medium for communication links between theterminal devices 701, 702, 703 and theserver 705.Network 704 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use theterminal devices 701, 702, 703 to interact with aserver 705 over anetwork 704, to receive or send messages or the like. Various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, and the like, may be installed on theterminal devices 701, 702, and 703.
Theterminal devices 701, 702, 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
Theserver 705 may be a server that provides various services, such as a background management server that an administrator performs processing using item basic information transmitted by theterminal devices 701, 702, and 703. The background management server can modify the project configuration information, generate project files, scan the target directory, execute data processing such as a start command, and feed back the processing result (e.g., the first static file) to the terminal device.
It should be noted that the project building method provided in the embodiment of the present application is generally executed by theserver 705, and accordingly, the project building apparatus is generally disposed in theserver 705.
It should be understood that the number of terminal devices, networks, and servers in fig. 7 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
The invention also provides an electronic device and a computer readable medium according to the embodiment of the invention.
The electronic device of the present invention includes: one or more processors; a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement a project construction method of an embodiment of the present invention.
The computer-readable medium of the present invention has stored thereon a computer program which, when executed by a processor, implements a project construction method of an embodiment of the present invention.
Referring now to FIG. 8, shown is a block diagram of acomputer system 800 suitable for use in implementing an electronic device of an embodiment of the present invention. The electronic device shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 8, thecomputer system 800 includes a Central Processing Unit (CPU)801 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)802 or a program loaded from astorage section 808 into a Random Access Memory (RAM) 803. In theRAM 803, various programs and data necessary for the operation of thecomputer system 800 are also stored. TheCPU 801,ROM 802, andRAM 803 are connected to each other via abus 804. An input/output (I/O)interface 805 is also connected tobus 804.
The following components are connected to the I/O interface 805: aninput portion 806 including a keyboard, a mouse, and the like; anoutput section 807 including a signal such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; astorage portion 808 including a hard disk and the like; and acommunication section 809 including a network interface card such as a LAN card, a modem, or the like. Thecommunication section 809 performs communication processing via a network such as the internet. Adrive 810 is also connected to the I/O interface 805 as necessary. Aremovable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on thedrive 810 as necessary, so that a computer program read out therefrom is mounted on thestorage section 808 as necessary.
In particular, the processes described above with respect to the main step diagrams may be implemented as computer software programs, according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program containing program code for performing the method illustrated in the main step diagram. In such an embodiment, the computer program can be downloaded and installed from a network through thecommunication section 809 and/or installed from theremovable medium 811. The computer program executes the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 801.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a project creation module, a project management module, and a project initiation module. The names of these modules do not form a limitation on the module itself in some cases, for example, the project creation module may also be described as a "module for acquiring project basic information and project templates, and modifying project configuration information according to the project basic information to generate a plurality of project files".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: acquiring project basic information and a project template, and modifying project configuration information according to the project basic information to generate a plurality of project files; wherein the project configuration information comprises a feature tag set for the project file; scanning a folder belonging to a target directory to determine an item management list according to the characteristic marks; and executing a starting command on the project files belonging to the project management list so as to compile the project files according to predefined packaging configuration information by adopting a packaging tool to generate a first static file.
As can be seen from the above description, setting a feature flag for a project file in the project configuration information to compile the project file based on the feature flag enables startup management of a plurality of project files.
The product can execute the method provided by the embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method. For technical details that are not described in detail in this embodiment, reference may be made to the method provided by the embodiment of the present invention.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

Translated fromChinese
1.一种项目构建方法,其特征在于,包括:1. a project construction method, is characterized in that, comprises:获取项目基本信息和项目模板,根据所述项目基本信息修改项目配置信息,以生成多个项目文件;其中,所述项目配置信息包括为所述项目文件设置的特征标记;Acquiring basic project information and a project template, and modifying project configuration information according to the basic project information to generate a plurality of project files; wherein, the project configuration information includes a feature tag set for the project file;扫描归属于目标目录的文件夹,以根据所述特征标记确定项目管理列表;Scanning folders belonging to the target directory to determine a project management list based on the signature;对归属于所述项目管理列表的项目文件执行启动命令,以采用打包工具,按照预定义的打包配置信息编译所述项目文件,生成第一静态文件。A startup command is executed on the project files belonging to the project management list, so as to use a packaging tool to compile the project files according to the predefined packaging configuration information to generate a first static file.2.根据权利要求1所述的方法,其特征在于,采用打包工具,按照预定义的打包配置信息编译所述项目文件的步骤之前,所述方法还包括:2. The method according to claim 1, characterized in that, before the step of compiling the project file according to the predefined packaging configuration information using a packaging tool, the method further comprises:监听归属于所述项目管理列表的项目文件是否存在设定操作;Monitor whether there is a setting operation in the project file belonging to the project management list;如果未监听到归属于所述项目管理列表的项目文件存在所述设定操作,则不做处理;If the setting operation is not detected in the project file belonging to the project management list, no processing is performed;采用打包工具,按照预定义的打包配置信息编译所述项目文件,包括:Using a packaging tool, compile the project file according to the predefined packaging configuration information, including:如果监听到归属于所述项目管理列表的项目文件存在所述设定操作,则采用打包工具,按照预定义的打包配置信息编译所述项目文件。If it is detected that the project file belonging to the project management list has the setting operation, a packaging tool is used to compile the project file according to the predefined packaging configuration information.3.根据权利要求2所述的方法,其特征在于,所述设定操作为对所述项目文件执行修改或者保存操作。3 . The method according to claim 2 , wherein the setting operation is to perform a modification or save operation on the project file. 4 .4.根据权利要求1所述的方法,其特征在于,所述方法还包括:4. The method according to claim 1, wherein the method further comprises:对归属于所述项目管理列表的项目文件执行构建命令,以采用打包工具对所述项目文件进行打包,生成第二静态文件。A build command is executed on the project files belonging to the project management list, so as to package the project files by using a packaging tool to generate a second static file.5.根据权利要求1所述的方法,其特征在于,所述方法还包括:5. The method according to claim 1, wherein the method further comprises:检测设定端口集,确定目标端口,以在执行所述启动命令时,指定所述目标端口为本地开发环境的端口;Detecting a set port set, determining a target port, to specify the target port as the port of the local development environment when executing the startup command;启动所述本地开发环境,接收通过所述目标端口发送的访问请求,以在浏览器上展示所述第一静态文件。The local development environment is started, and an access request sent through the target port is received, so as to display the first static file on the browser.6.根据权利要求1所述的方法,其特征在于,所述方法还包括:6. The method of claim 1, wherein the method further comprises:通过插件形式的应用程序接口接收更新的打包配置信息;Receive updated packaging configuration information through an API in the form of a plug-in;按照预定义的打包配置信息编译所述项目文件,包括:按照更新后的打包配置信息编译所述项目文件。Compiling the project file according to the predefined packaging configuration information includes: compiling the project file according to the updated packaging configuration information.7.根据权利要求5所述的方法,其特征在于,所述方法还包括:7. The method according to claim 5, wherein the method further comprises:内置所述本地开发环境和生产环境所使用的依赖包,以离线安装所述依赖包。The dependency packages used by the local development environment and the production environment are built in to install the dependency packages offline.8.一种项目构建装置,其特征在于,包括:8. A project construction device, characterized in that, comprising:项目创建模块,用于获取项目基本信息和项目模板,根据所述项目基本信息修改项目配置信息,以生成多个项目文件;其中,所述项目配置信息包括为所述项目文件设置的特征标记;a project creation module, configured to acquire basic project information and a project template, and modify project configuration information according to the basic project information to generate a plurality of project files; wherein, the project configuration information includes feature tags set for the project files;项目管理模块,用于扫描归属于目标目录的文件夹,以根据所述特征标记确定项目管理列表;The project management module is used for scanning the folders belonging to the target directory to determine the project management list according to the feature mark;项目启动模块,用于对归属于所述项目管理列表的项目文件执行启动命令,以采用打包工具,按照预定义的打包配置信息编译所述项目文件,生成第一静态文件。The project startup module is configured to execute a startup command on the project files belonging to the project management list, so as to use a packaging tool to compile the project files according to the predefined packaging configuration information to generate a first static file.9.一种电子设备,其特征在于,包括:9. An electronic device, characterized in that, comprising:一个或多个处理器;one or more processors;存储装置,用于存储一个或多个程序,storage means for storing one or more programs,当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-7中任一所述的方法。The one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.10.一种计算机可读介质,其上存储有计算机程序,其特征在于,所述程序被处理器执行时实现如权利要求1-7中任一所述的方法。10. A computer-readable medium on which a computer program is stored, characterized in that, when the program is executed by a processor, the method according to any one of claims 1-7 is implemented.
CN201911165865.2A2019-11-252019-11-25 A project construction method and deviceActiveCN112835568B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201911165865.2ACN112835568B (en)2019-11-252019-11-25 A project construction method and device

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201911165865.2ACN112835568B (en)2019-11-252019-11-25 A project construction method and device

Publications (2)

Publication NumberPublication Date
CN112835568Atrue CN112835568A (en)2021-05-25
CN112835568B CN112835568B (en)2025-05-16

Family

ID=75922249

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201911165865.2AActiveCN112835568B (en)2019-11-252019-11-25 A project construction method and device

Country Status (1)

CountryLink
CN (1)CN112835568B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN113535182A (en)*2021-06-302021-10-22上海浦东发展银行股份有限公司Project engineering construction method and device, computer equipment and storage medium
CN113542249A (en)*2021-07-082021-10-22昆明学院 A multi-protocol data publishing system
CN113849217A (en)*2021-08-302021-12-28北京达佳互联信息技术有限公司 Resource packaging method, device, electronic device and storage medium
CN113918137A (en)*2021-10-272022-01-11挂号网(杭州)科技有限公司 Item processing method, device, electronic device and storage medium
CN114064048A (en)*2021-11-152022-02-18深圳市同为数码科技股份有限公司Method, device, equipment and medium for processing various deeply customized web projects
CN114995807A (en)*2022-05-262022-09-02厦门立林科技有限公司Configuration method and system of front-end multi-project framework

Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP2003330731A (en)*2002-05-092003-11-21Matsushita Electric Ind Co Ltd Project management file generator
CN106843869A (en)*2017-01-162017-06-13百融(北京)金融信息服务股份有限公司A kind of front end Development Engineering system and method
CN107330640A (en)*2017-08-142017-11-07四川恒创博联科技有限责任公司It is a kind of to build the method that intelligence produces project library
CN109710272A (en)*2018-11-092019-05-03深圳壹账通智能科技有限公司Update the packaging method and device of file
CN110347376A (en)*2019-06-272019-10-18无线生活(杭州)信息科技有限公司Project development method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP2003330731A (en)*2002-05-092003-11-21Matsushita Electric Ind Co Ltd Project management file generator
CN106843869A (en)*2017-01-162017-06-13百融(北京)金融信息服务股份有限公司A kind of front end Development Engineering system and method
CN107330640A (en)*2017-08-142017-11-07四川恒创博联科技有限责任公司It is a kind of to build the method that intelligence produces project library
CN109710272A (en)*2018-11-092019-05-03深圳壹账通智能科技有限公司Update the packaging method and device of file
CN110347376A (en)*2019-06-272019-10-18无线生活(杭州)信息科技有限公司Project development method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李明: "综合信息汇聚平台业务版本管理子系统的设计与实现", 中国优秀硕士学位论文全文数据库信息科技辑, no. 11, 15 November 2018 (2018-11-15), pages 46 - 69*

Cited By (8)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN113535182A (en)*2021-06-302021-10-22上海浦东发展银行股份有限公司Project engineering construction method and device, computer equipment and storage medium
CN113535182B (en)*2021-06-302023-02-17上海浦东发展银行股份有限公司Project engineering construction method and device, computer equipment and storage medium
CN113542249A (en)*2021-07-082021-10-22昆明学院 A multi-protocol data publishing system
CN113849217A (en)*2021-08-302021-12-28北京达佳互联信息技术有限公司 Resource packaging method, device, electronic device and storage medium
CN113918137A (en)*2021-10-272022-01-11挂号网(杭州)科技有限公司 Item processing method, device, electronic device and storage medium
CN113918137B (en)*2021-10-272025-05-27挂号网(杭州)科技有限公司 Project processing method, device, electronic equipment and storage medium
CN114064048A (en)*2021-11-152022-02-18深圳市同为数码科技股份有限公司Method, device, equipment and medium for processing various deeply customized web projects
CN114995807A (en)*2022-05-262022-09-02厦门立林科技有限公司Configuration method and system of front-end multi-project framework

Also Published As

Publication numberPublication date
CN112835568B (en)2025-05-16

Similar Documents

PublicationPublication DateTitle
US12282762B2 (en)System and methods for integration of an application runtime environment into a user computing environment
CN112835568B (en) A project construction method and device
CN111381852A (en)Application dynamic updating method and device based on Flutter, storage medium and electronic equipment
WO2018177260A1 (en)Application development method and tool, device, and storage medium thereof
CN112685105B (en)Front-end component sharing method and device, computer equipment and storage medium
CN113760324A (en)Method and device for constructing micro front-end application
CN110895471A (en) Installation package generation method, device, medium and electronic device
CN107463406A (en)Issue the method and electronic equipment of Mobile solution
CN110928571A (en)Business program development method and device
US10120661B2 (en)Multi-flavored software execution from a singular code base
CN115421740A (en) Deployment method and device for cloud-native applications
CN113495730B (en) Resource package generation and parsing method and device
US10514940B2 (en)Virtual application package reconstruction
CN107608672B (en)UI module manager, UI module management method and system
CN114115855A (en)Code multiplexing method and device, computer readable storage medium and electronic equipment
CN112087370A (en)Method, system, electronic device and computer-readable storage medium for issuing GitHub Issues
CN116820445A (en)Front-end project deployment method and device based on VS Code
CN113805878A (en)Plug-in engineering method, device, computer system and medium
CN112905164A (en)Project code processing method and device
CN115934151A (en)Method and device for building multi-terminal small program
CN113791778B (en)Software item generation method and device, electronic equipment and storage medium
CN115495049A (en)Method and device for constructing project development space required by iOS application
CN115576624A (en)Programming framework optimization method, system, terminal equipment and storage medium
CN113918525A (en) Data exchange scheduling method, system, electronic device, medium and program product
CN114089996A (en) A page rendering method, device and system

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp