CN111897520A - Front-end project framework construction method and device, computer equipment and storage medium - Google Patents
Front-end project framework construction method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN111897520A CN111897520A CN202010763059.1A CN202010763059A CN111897520A CN 111897520 A CN111897520 A CN 111897520A CN 202010763059 A CN202010763059 A CN 202010763059A CN 111897520 A CN111897520 A CN 111897520A
- Authority
- CN
- China
- Prior art keywords
- end project
- preset
- framework
- frame
- instruction
- 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.)
- Pending
Links
- 238000010276 construction Methods 0.000 title claims abstract description 56
- 238000000034 method Methods 0.000 claims abstract description 39
- 238000004590 computer program Methods 0.000 claims description 14
- 238000010367 cloning Methods 0.000 claims description 10
- 230000008676 import Effects 0.000 claims description 3
- 238000011161 development Methods 0.000 abstract description 44
- 238000005516 engineering process Methods 0.000 abstract 1
- 238000010586 diagram Methods 0.000 description 10
- 230000008569 process Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000001419 dependent effect Effects 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 230000000712 assembly Effects 0.000 description 1
- 238000000429 assembly Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/20—Software design
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses a method and a device for constructing a front-end project framework, computer equipment and a storage medium, wherein the method comprises the following steps: if a construction request for constructing a front-end project frame sent by a user is received, a folder of the front-end project frame is created according to the construction request; calling a preset instruction in a folder of a front-end project frame to initialize the front-end project frame so as to generate a packages. Downloading a preset dependency package and adding the dependency package to a packages. Importing a preset account, coding the account according to a preset coding rule, and adding a preset publishing component in a package. And executing a preset issuing instruction to issue the front-end project framework and storing the issued front-end project framework in a preset warehouse to complete the construction of the front-end project framework. Based on the development framework technology, the front-end project framework constructed by the method can be conveniently and directly developed by service developers, extra time is not needed to be spent again to configure development environment, and development efficiency is improved.
Description
Technical Field
The invention belongs to the technical field of front-end framework frameworks, and particularly relates to a construction method and device of a front-end project framework, computer equipment and a storage medium.
Background
The construction of a project in a traditional front-end development mode can be completed only by needing a plurality of page jq plug-ins, but at present, with increasingly complicated and diversified web services, the project is gradually huge, the traditional project construction mode cannot meet the huge growth of services, developers need to construct frame assemblies of corresponding front-end projects at any time, time and labor are consumed, and the maintenance cost is high.
Disclosure of Invention
The embodiment of the invention provides a method and a device for constructing a front-end project frame, computer equipment and a storage medium, and aims to solve the problems that in the prior art, a frame assembly of a corresponding front-end project needs to be constructed at any time, time and labor are consumed, and the maintenance cost is high.
In a first aspect, an embodiment of the present invention provides a method for constructing a front-end project framework, where the method includes:
if a construction request for constructing a front-end project frame sent by a user is received, a folder of the front-end project frame is created according to the construction request;
calling a preset instruction in a folder of the front-end project frame to initialize the front-end project frame so as to generate a packages.
Downloading a preset dependency package and adding the dependency package to the packages.json file;
importing preset account information, coding the account information according to a preset coding rule, and adding a preset npm packet in a packages json file;
and executing a preset issuing instruction to issue the front-end project framework and storing the issued front-end project framework in a preset warehouse to complete the construction of the front-end project framework.
In a second aspect, an embodiment of the present invention provides an apparatus for constructing a front-end project framework, including:
the file folder construction unit is used for establishing a file folder of the front-end project frame according to a construction request sent by a user if the construction request for constructing the front-end project frame is received;
an initialization unit, configured to call a preset instruction in a folder of the front-end project frame to initialize the front-end project frame to generate a package.
A first adding unit, configured to download a preset dependency package and add the dependency package to the packages.
A second adding unit, configured to import preset account information, encode the account information according to a preset encoding rule, and add a preset npm packet to the package.
And the storage unit executes a preset issuing instruction to issue the front-end project frame and stores the issued front-end project frame in a preset warehouse to complete the construction of the front-end project frame.
In a third aspect, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor, when executing the computer program, implements the method for constructing a front-end project framework as described in the first aspect.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and the computer program, when executed by a processor, causes the processor to execute the method for building a front-end project framework according to the first aspect.
The embodiment of the invention provides a method and a device for constructing a front-end project frame, computer equipment and a storage medium, wherein if a construction request for constructing the front-end project frame sent by a user is received, a folder of the front-end project frame is created according to the construction request; calling a preset instruction in a folder of the front-end project frame to initialize the front-end project frame so as to generate a packages. Downloading a preset dependency package and adding the dependency package to the packages.json file; importing preset account information, coding the account information according to a preset coding rule, and adding a preset npm packet in a packages json file; and executing a preset issuing instruction to issue the front-end project framework and storing the issued front-end project framework in a preset warehouse to complete the construction of the front-end project framework. The front-end project framework constructed by the method can be conveniently and directly developed by service developers, extra time is not needed to be spent again to configure development environment, and development efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flow chart of a method for constructing a front-end project framework according to an embodiment of the present invention;
fig. 2 is an application scenario diagram of a method for constructing a front-end project framework according to an embodiment of the present invention;
fig. 3 is a sub-flow diagram of a method for constructing a front-end project framework according to an embodiment of the present invention;
FIG. 4 is a schematic view of another sub-flow of a method for constructing a front-end project framework according to an embodiment of the present invention;
FIG. 5 is a schematic view of another sub-flow of a method for constructing a front-end project framework according to an embodiment of the present invention;
FIG. 6 is a schematic block diagram of a front-end project framework building apparatus provided by an embodiment of the present invention;
FIG. 7 is a block diagram of a sub-unit of a front-end project framework building apparatus according to an embodiment of the present invention;
FIG. 8 is a schematic block diagram of another subunit of a front-end project framework building apparatus provided by an embodiment of the present invention;
FIG. 9 is a schematic block diagram of a computer device provided by an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Referring to fig. 1 and fig. 2, fig. 1 is a schematic flow chart illustrating a method for constructing a front-end project framework according to an embodiment of the present invention; fig. 2 is an application scenario diagram of a method for constructing a front-end project framework according to an embodiment of the present invention. The construction method of the front-end project framework is applied to a first development terminal 10, the front-end project framework is a node.js project and is constructed based on a React framework, the front-end project framework is stored in a warehouse 30 after construction is completed, when a developer needs to use the front-end project framework, the front-end project framework can be obtained from the warehouse 30 through a second development terminal 20 for development, and the first development terminal 10 and the second development terminal 20 can be terminal devices such as a smart phone, a tablet computer, a notebook computer and a desktop computer. It should be noted that fig. 2 only illustrates one second development terminal 20, and in the actual operation process, a plurality of second development terminals 20 can all obtain the front-end project framework from the warehouse 30 for development.
As shown in fig. 1, the method includes steps S110 to S150.
S110, if a construction request for constructing the front-end project frame sent by a user is received, a folder of the front-end project frame is created according to the construction request.
And if a construction request for constructing the front-end project frame sent by a user is received, creating a folder of the front-end project frame according to the construction request. Specifically, the construction request is that the user inputs instruction information for requesting to construct the front-end project framework in the first development terminal 10, where the instruction information belongs to the source code in the official githu clone, that is, before the user inputs the construction request for constructing the front-end project framework, the githu website or the source code directory is downloaded and forms a basic scaffold, and then some necessary npm packages are installed to facilitate the subsequent creation of folders of the front-end project framework. The first development terminal 10, upon receiving the build request, creates a folder of the front-end project framework in response to the build request sent by the user. The folder is an empty folder and is used for storing relevant codes for subsequent downloading.
And S120, calling a preset instruction in a folder of the front-end project frame to initialize the front-end project frame so as to generate a packages.
A preset instruction (e.g., npm init) is called in a folder of the front-end project framework to initialize the front-end project framework to generate a packages. Specifically, the preset instruction is used for initializing the front-end project framework so as to generate a package. The package json file records all modules required in the front-end project framework, including attributes such as the name, version number, project permission, and declaration of a series of npm script instructions of the tool component package added to the package json file. When the npm install command is executed, the node reads all dependency information from the package json file, and then compares the dependency information with the module in the node _ modules. In addition, a package.json file only records module information installed in an npm install mode, but does not record information of other sub-modules on which the modules depend, wherein npm is a package management tool of node.js and is also the largest software registry in the world and is used for installing various node.js extensions, npm is composed of three different parts, namely a website, a registry and a command line interface, the website is a main way for developers to search packages (packages), set parameters and manage npm use experiences, the registry is a huge database and stores information of each package, and the command line interface is operated through a command line or a terminal.
And S130, downloading a preset dependency package and adding the dependency package to the packages.
Downloading a preset dependency package and adding the dependency package to the packages. Specifically, the dependency package is a necessary tool component package used by a subsequent developer, and includes a tool dependency package, a front-end dependency package, a rear-end dependency package and a UI component dependency package, where the tool dependency package may be a webpack or an eslin package, the front-end dependency package may be any one of a read front-end dependency package, a read-reduce dependency package, a read-router front-end dependency package and an axios dependency package, and the rear-end dependency package may be a mock. The dependent package is remotely downloaded in advance into a local repository, and then the npm install-save command is executed to add the dependent package to the packages. In the embodiment of the invention, the tool dependence package is an esLint tool package, the front end dependence package is an React front end dependence package, the back end dependence package is an Express back end dependence package, the UI component dependence package is a DBox-UI component dependence package, and the DBox-UI component dependence package is a dependence package developed by enterprises.
S140, importing preset account information, encoding the account information according to a preset encoding rule, and adding a preset npm package to the packages.
Importing preset account information, coding the account information according to a preset coding rule, and adding a preset npm packet in the packages json file. Specifically, the preset account information is composed of an account and an account password, and the pass of the front-end project frame is made for the developer at the second development terminal 20 by the first development terminal 10, and the developer at the second development terminal 20 needs to pass through the preset account for verification before using the front-end project frame for service development. The preset encoding rule is rule information of a preset compiling mode for the preset account, and the preset npm packet is a npm packet which is self-made by an enterprise. Json file adds preset npm packages, and the steps are as follows: cloning the preset npm package download path using a git clone command; downloading the preset npm packages according to the download path of the preset npm packages and storing the preset npm packages in a local warehouse; executing the npminshall-save command adds the preset npm packet to the packages json file. In the embodiment of the invention, the preset account information is encoded by adopting a Base64 method, Base64 is one of the most common encoding modes for transmitting 8-Bit byte codes on a network, Base64 is a method for representing binary data based on 64 printable characters, and Base64 encoding is a process from binary to character and can be used for transmitting longer identification information in an HTTP environment.
In another embodiment of the present invention, before adding a preset npm package in the package. An npmrc file is created in the folder of the front end project framework.
An npmrc file is created in the folder of the front end project framework. Specifically, the npmrc file is npm's configuration file, npm may obtain its configuration settings from the command line, environment variables and the npmrc file, and when an error occurs in executing the npminshall-g cordovaionic command, the npm source may be modified by the npmrc file.
S150, executing a preset issuing instruction to issue the front-end project frame and storing the issued front-end project frame in a preset warehouse to complete the construction of the front-end project frame.
And executing a preset issuing instruction to issue the front-end project framework and storing the issued front-end project framework in a preset warehouse to complete the construction of the front-end project framework. Specifically, the issue instruction is instruction information for requesting the first development terminal 10 to execute the front-end project framework of the invention, and after an npmppublish command is usually input in the command tool interface, the first development terminal 10 may execute the step of issuing the front-end project framework in response to the npm publish command, and the front-end project framework is stored in a preset warehouse after being issued, and is available to developers at the second development terminal 20. The preset warehouse may be a remote warehouse shared by the first development terminal 10 and the second development terminal 20, or a local warehouse of the first development terminal 10, and when a developer at the second development terminal 20 needs to use the front-end project frame in the preset warehouse, the developer may be downloaded from the local warehouse of the first development terminal 10, and meanwhile, the preset warehouse may also be a local warehouse of the second development terminal 20, and when a developer at the second development terminal 20 needs to use the front-end project frame in the preset warehouse, the developer may be directly called from the local warehouse. In the embodiment of the present invention, the preset repository is a remote repository shared by the first development terminal 10 and the second development terminal 20.
In another embodiment of the present invention, as shown in fig. 3, the step S150 of executing a preset issue instruction to issue the front-end project framework includes: s151, S152 and S153.
And S151, executing a preset cloning instruction to clone the downloading path of the preset git command line tool package.
Executing the preset clone instruction clones the download path of the preset git command line toolkit. Specifically, the preset cloning instruction is instruction information for cloning a download path of the git command line toolkit, the download path of the git command line toolkit is address information stored in the git command line toolkit, a developer at the first development terminal 10 can download the git command line toolkit after obtaining the download path of the git command line toolkit, and the git command line toolkit is a git command line toolkit which is set by the developer at the first development terminal 10 and is only used by the developer at the first development terminal 20 or the developer at the second development terminal 20.
S152, downloading the git command line tool package according to the downloading path and adding the git command line tool package to the packages.
Downloading the git command line toolkit according to the download path and adding the git command line toolkit to the packages. Specifically, after downloading the git command line toolkit through the download path, the first development terminal 10 executes a preset installation instruction, and then installs the git command line toolkit into a packages. In an embodiment of the present invention, the git command line toolkit is preferably installed into packages json file using the yarn install instruction.
And S153, executing a preset project starting instruction to start the front-end project framework.
And executing a preset project starting instruction to start the front-end project framework. Specifically, the preset project starting instruction is instruction information for starting the front-end project framework, and the first development terminal 10 may complete the step of issuing the front-end project framework after executing the preset project starting instruction to start the front-end project framework. In the embodiment of the present invention, after the developer at the first development terminal 10 inputs the yarn start command, the first development terminal 10 responds to the developer inputting the yarn start command and starts the front-end project framework.
In other embodiments of the present invention, as shown in fig. 4, step S150 is followed by steps S160 and S170.
And S160, receiving an update request for updating the front-end project framework, wherein the update request comprises an update instruction and a data packet with a new version number.
Receiving an update request for updating the front-end project framework, wherein the update request comprises an update instruction and a data packet with a new version number. Specifically, the update request is request information for updating a software package in the front-end project framework, and the data package with the new version number is a software package that can be added to the front-end project framework, and may be an added local software package in the front-end project framework or a global software package for updating the front-end project framework. When the first development terminal 10 receives the software package in the front-end project framework for updating, it first determines the type of the data package with the new version number in the update request, and usually, the determination may be performed according to the suffix of the data package with the new version number to obtain the type of the data package with the new version number.
S170, adding the data packet with the new version number into the front-end project frame and automatically referring to the data packet with the new version number according to the updating instruction.
And adding the data packet with the new version number into the front-end project framework and automatically referencing the data packet with the new version number according to the updating instruction. Specifically, the update instruction is instruction information of the first development terminal 10 for responding to a command input by the user on the command interface. After the type of the new version number package is judged, the data package with the new version number can be automatically quoted according to a corresponding updating instruction, and then the data package with the new version number is added into the warehouse to update the front-end project frame. When the data packet with the new version number is a local packet added in the front-end project frame, firstly, an npm update command is executed in a directory where the package json file is located, and then, the data packet with the new version number can be added in the front-end project frame by executing an npmoutdated command; when the data packet with the new version number is a global packet for updating the front-end project frame, the update of the front-end project frame can be completed by inputting an npm update-g < package > command. Specifically, when the jshint global packet in the front-end project frame is to be updated, npm outdated-g-depth is input to be 0, the jshint global packet in the front-end project frame is found out through a command, and then the jshint global packet in the front-end project frame can be updated through inputting an npm update-g command.
In another embodiment of the present invention, as shown in fig. 5, the adding the data packet with the new version number to the front-end project framework in step S170 includes the following sub-steps: s171 and S172.
And S171, judging whether a data packet with the same name as the data packet with the new version number exists in the front-end project frame.
And judging whether a data packet with the same name as the data packet with the new version number exists in the front-end project frame. Specifically, because the number of software packages in the front-end project frame is large, when naming the data package with the new version number, a developer is likely to overlap the name of the software package in the front-end project frame, which causes a problem of adding an error when adding the data package with the new version number to the front-end project frame.
And S172, if the data packet with the same name as the data packet with the new version number exists in the front-end project frame, deleting the data packet with the same name as the data packet with the new version number in the front-end project frame.
And if the front-end project frame has the data packet with the same name as the data packet with the new version number, deleting the data packet with the same name as the data packet with the new version number in the front-end project frame. Specifically, the deleting of the data packet with the same name as the data packet with the new version number in the front-end project frame is to unload the data packet with the same name as the data packet with the new version number in the front-end project frame. When a packet with the same name as the data packet with the new version number in the front-end project frame is a local software packet, executing an npm uninstantall < package > -command to unload the data packet with the same name as the data packet with the new version number in the front-end project frame; when the data packet with the same name as the data packet with the new version number in the front-end project frame is the software packet in the front-end project frame, the data packet with the same name as the data packet with the new version number in the front-end project frame can be unloaded by executing the npmunostill-g < package >.
In the method for constructing the front-end project frame provided by the embodiment of the invention, if a construction request for constructing the front-end project frame sent by a user is received, a folder of the front-end project frame is created according to the construction request; calling a preset instruction in a folder of the front-end project frame to initialize the front-end project frame so as to generate a packages. Downloading a preset dependency package and adding the dependency package to the packages.json file; importing preset account information, coding the account information according to a preset coding rule, and adding a preset npm packet in a packages json file; and executing a preset issuing instruction to issue the front-end project framework and storing the issued front-end project framework in a preset warehouse to complete the construction of the front-end project framework. The front-end project framework constructed by the method can be conveniently and directly developed by service developers, extra time is not needed to be spent again to configure development environment, and development efficiency is improved.
The embodiment of the invention also provides a front-end project framework construction device 100, which is used for executing any embodiment of the front-end project framework construction method. Specifically, referring to fig. 6, fig. 6 is a schematic block diagram of a front-end project framework building apparatus 100 according to an embodiment of the present invention.
As shown in fig. 6, the front-end project framework building apparatus 100 includes a folder building unit 110, an initialization unit 120, a first adding unit 130, a second adding unit 140, and a storage unit 150.
The folder construction unit 110 is configured to, if a construction request for constructing a front-end project frame sent by a user is received, create a folder of the front-end project frame according to the construction request.
An initializing unit 120, configured to call a preset instruction in a folder of the front-end project frame to initialize the front-end project frame to generate a package.
A first adding unit 130, configured to download a preset dependency package and add the dependency package to the packages.
A second adding unit 140, configured to import preset account information, encode the account information according to a preset encoding rule, and add a preset npm packet to the package.
In another embodiment of the present invention, the apparatus 100 for constructing a front-end project framework further includes: a creating unit 141.
A creating unit 141, configured to create an npmrc file in a folder of the front-end project framework.
The storage unit 150 executes a preset issuing instruction to issue the front-end project framework and stores the issued front-end project framework in a preset warehouse to complete the construction of the front-end project framework.
In another embodiment of the present invention, as shown in fig. 7, the storage unit 150 includes: a cloning unit 151, a downloading unit 152 and an initiating unit 153.
A cloning unit 151 for executing a preset cloning instruction to clone a download path of a preset git command line toolkit.
A downloading unit 152, configured to download the git command line toolkit according to the download path and add the git command line toolkit to the packages.
The starting unit 153 is configured to execute a preset item starting instruction to start the front-end item frame.
In another embodiment of the present invention, the apparatus 100 for constructing a front-end project framework further includes: a receiving unit 160 and an updating unit 170.
A receiving unit 160, configured to receive an update request for updating the front-end item framework, where the update request includes an update instruction and a data packet with a new version number.
The updating unit 170 is configured to add the data packet with the new version number to the front-end project frame and automatically refer to the data packet with the new version number according to the update instruction.
In another embodiment of the present invention, as shown in fig. 8, the updating unit 170 includes: a judgment unit 171 and a deletion unit 172.
The determining unit 171 is configured to determine whether a packet with the same name as the packet with the new version number exists in the front-end project frame.
A deleting unit 172, configured to delete the data packet with the same name as the data packet with the new version number in the front-end item frame if the data packet with the same name as the data packet with the new version number exists in the front-end item frame.
The front-end project framework construction device 100 provided by the embodiment of the present invention is configured to execute the above-mentioned construction request for constructing a front-end project framework sent by a user, and create a folder of the front-end project framework according to the construction request; calling a preset instruction in a folder of the front-end project frame to initialize the front-end project frame so as to generate a packages. Downloading a preset dependency package and adding the dependency package to the packages.json file; importing preset account information, coding the account information according to a preset coding rule, and adding a preset npm packet in a packages json file; and executing a preset issuing instruction to issue the front-end project framework and storing the issued front-end project framework in a preset warehouse to complete the construction of the front-end project framework.
Referring to fig. 9, fig. 9 is a schematic block diagram of a computer device according to an embodiment of the present invention.
Referring to fig. 9, the device 500 includes a processor 502, memory, and a network interface 505 connected by a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer programs 5032, when executed, cause the processor 502 to perform a method of building a front-end project framework.
The processor 502 is used to provide computing and control capabilities that support the operation of the overall device 500.
The internal memory 504 provides an environment for running the computer program 5032 in the non-volatile storage medium 503, and when the computer program 5032 is executed by the processor 502, the processor 502 can be caused to execute the method for building the front-end project framework.
The network interface 505 is used for network communication, such as providing transmission of data information. Those skilled in the art will appreciate that the configuration shown in fig. 9 is a block diagram of only a portion of the configuration associated with aspects of the present invention and does not constitute a limitation of the apparatus 500 to which aspects of the present invention may be applied, and that a particular apparatus 500 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
Wherein the processor 502 is configured to run the computer program 5032 stored in the memory to implement the following functions: if a construction request for constructing a front-end project frame sent by a user is received, a folder of the front-end project frame is created according to the construction request; calling a preset instruction in a folder of the front-end project frame to initialize the front-end project frame so as to generate a packages. Downloading a preset dependency package and adding the dependency package to the packages.json file; importing preset account information, coding the account information according to a preset coding rule, and adding a preset npm packet in a packages json file; and executing a preset issuing instruction to issue the front-end project framework and storing the issued front-end project framework in a preset warehouse to complete the construction of the front-end project framework.
Those skilled in the art will appreciate that the embodiment of the apparatus 500 shown in fig. 9 does not constitute a limitation on the specific construction of the apparatus 500, and in other embodiments, the apparatus 500 may include more or fewer components than shown, or some components may be combined, or a different arrangement of components. For example, in some embodiments, the apparatus 500 may only include the memory and the processor 502, and in such embodiments, the structure and function of the memory and the processor 502 are the same as those of the embodiment shown in fig. 9, and are not repeated herein.
It should be understood that in the present embodiment, the Processor 502 may be a Central Processing Unit (CPU), and the Processor 502 may also be other general-purpose processors 502, a Digital Signal Processor 502 (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. The general-purpose processor 502 may be a microprocessor 502 or the processor 502 may be any conventional processor 502 or the like.
In another embodiment of the present invention, a computer storage medium is provided. The storage medium may be a non-volatile computer-readable storage medium. The storage medium stores a computer program 5032, wherein the computer program 5032 when executed by the processor 502 performs the steps of: if a construction request for constructing a front-end project frame sent by a user is received, a folder of the front-end project frame is created according to the construction request; calling a preset instruction in a folder of the front-end project frame to initialize the front-end project frame so as to generate a packages. Downloading a preset dependency package and adding the dependency package to the packages.json file; importing preset account information, coding the account information according to a preset coding rule, and adding a preset npm packet in a packages json file; and executing a preset issuing instruction to issue the front-end project framework and storing the issued front-end project framework in a preset warehouse to complete the construction of the front-end project framework.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses, devices and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided by the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only a logical division, and there may be other divisions when the actual implementation is performed, or units having the same function may be grouped into one unit, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may also be an electric, mechanical or other form of connection.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a storage medium. Based on such understanding, the technical solution of the present invention essentially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product stored in a storage medium and including instructions for causing a device 500 (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (10)
1. A construction method of a front-end project framework is characterized by comprising the following steps:
if a construction request for constructing a front-end project frame sent by a user is received, a folder of the front-end project frame is created according to the construction request;
calling a preset instruction in a folder of the front-end project frame to initialize the front-end project frame so as to generate a packages.
Downloading a preset dependency package and adding the dependency package to the packages.json file;
importing preset account information, coding the account information according to a preset coding rule, and adding a preset npm packet in a packages json file;
and executing a preset issuing instruction to issue the front-end project framework and storing the issued front-end project framework in a preset warehouse to complete the construction of the front-end project framework.
2. The method for building a front-end project framework according to claim 1, wherein before adding a preset npm package in the packages.
An npmrc file is created in the folder of the front end project framework.
3. The method for building the front-end project framework according to claim 1, wherein the executing of the preset issuing instruction issues the front-end project framework, and comprises:
executing a preset cloning instruction to clone a downloading path of a preset git command line tool packet;
downloading the git command line toolkit according to the download path and adding the git command line toolkit to the packages.json file;
and executing a preset project starting instruction to start the front-end project framework.
4. The method for building a front-end project frame according to claim 1, wherein after storing the published front-end project frame in a preset warehouse to complete building of the front-end project frame, the method further comprises:
receiving an update request for updating the front-end project framework, wherein the update request comprises an update instruction and a data packet of a new version number;
and adding the data packet with the new version number into the front-end project framework and automatically referencing the data packet with the new version number according to the updating instruction.
5. The method for building the front-end project framework according to claim 1, wherein before adding the data packet with the new version number into the front-end project framework, the method comprises:
judging whether a data packet with the same name as the data packet with the new version number exists in the front-end project frame;
and if the front-end project frame has the data packet with the same name as the data packet with the new version number, deleting the data packet with the same name as the data packet with the new version number in the front-end project frame.
6. An apparatus for building a front-end project framework, comprising:
the file folder construction unit is used for establishing a file folder of the front-end project frame according to a construction request sent by a user if the construction request for constructing the front-end project frame is received;
an initialization unit, configured to call a preset instruction in a folder of the front-end project frame to initialize the front-end project frame to generate a package.
A first adding unit, configured to download a preset dependency package and add the dependency package to the packages.
A second adding unit, configured to import preset account information, encode the account information according to a preset encoding rule, and add a preset npm packet to the package.
And the storage unit executes a preset issuing instruction to issue the front-end project frame and stores the issued front-end project frame in a preset warehouse to complete the construction of the front-end project frame.
7. The front-end project framework building apparatus of claim 6, further comprising:
and the creating unit is used for creating the npmrc file in the folder of the front-end project framework.
8. The front-end project framework building device of claim 6, wherein the storage unit comprises:
the cloning unit is used for executing a preset cloning instruction to clone a downloading path of a preset git command line tool packet;
a downloading unit, configured to download the git command line toolkit according to the download path and add the git command line toolkit to the packages.
And the starting unit is used for executing a preset project starting instruction to start the front-end project framework.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of building a front-end project framework according to any one of claims 1 to 5 when executing the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, causes the processor to execute the method of building a front-end project framework according to any one of claims 1 to 5.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010763059.1A CN111897520A (en) | 2020-07-31 | 2020-07-31 | Front-end project framework construction method and device, computer equipment and storage medium |
PCT/CN2020/124660 WO2021135584A1 (en) | 2020-07-31 | 2020-10-29 | Front-end project framework construction method and apparatus, computer device, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010763059.1A CN111897520A (en) | 2020-07-31 | 2020-07-31 | Front-end project framework construction method and device, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111897520A true CN111897520A (en) | 2020-11-06 |
Family
ID=73183155
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010763059.1A Pending CN111897520A (en) | 2020-07-31 | 2020-07-31 | Front-end project framework construction method and device, computer equipment and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN111897520A (en) |
WO (1) | WO2021135584A1 (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112685035A (en) * | 2020-12-25 | 2021-04-20 | 京东数字科技控股股份有限公司 | Project development method and device, computer-readable storage medium and electronic device |
CN113050985A (en) * | 2021-04-19 | 2021-06-29 | 中国工商银行股份有限公司 | Front-end engineering dependence automatic registration method and device |
CN113253997A (en) * | 2021-06-23 | 2021-08-13 | 南京铉盈网络科技有限公司 | Graphical front-end engineering framework construction method |
CN113254040A (en) * | 2021-06-01 | 2021-08-13 | 康键信息技术(深圳)有限公司 | Front-end framework updating method, device, equipment and storage medium |
CN113703822A (en) * | 2021-08-31 | 2021-11-26 | 三一专用汽车有限责任公司 | Differential upgrading method and device and operation machine |
CN113791778A (en) * | 2020-11-18 | 2021-12-14 | 北京沃东天骏信息技术有限公司 | Software project generation method and device, electronic equipment and storage medium |
CN113835737A (en) * | 2021-08-24 | 2021-12-24 | 交控科技股份有限公司 | Method and system for adding authority to front-end project |
CN115129333A (en) * | 2022-09-02 | 2022-09-30 | 城云科技(中国)有限公司 | Npm resource packet management method, device and system suitable for micro front-end framework |
CN115202630A (en) * | 2022-09-08 | 2022-10-18 | 杭州阿启视科技有限公司 | Scaffold construction method based on web front-end engineering |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050204338A1 (en) * | 2004-03-11 | 2005-09-15 | International Business Machines Corporation | Standard application development framework |
US20070162845A1 (en) * | 2006-01-09 | 2007-07-12 | Apple Computer, Inc. | User interface for webpage creation/editing |
CN106502663A (en) * | 2016-10-17 | 2017-03-15 | 成都知道创宇信息技术有限公司 | A kind of front end project skeleton generating method |
CN106843869A (en) * | 2017-01-16 | 2017-06-13 | 百融(北京)金融信息服务股份有限公司 | A kind of front end Development Engineering system and method |
CN110580152A (en) * | 2018-06-07 | 2019-12-17 | 北京怡合春天科技有限公司 | Automatic scaffold frame of front end |
CN110795088A (en) * | 2019-10-29 | 2020-02-14 | 京东数字科技控股有限公司 | Front-end engineering project construction method and tool, and computer-readable storage medium |
CN111273898A (en) * | 2020-02-25 | 2020-06-12 | 安徽以萨数据技术有限公司 | Web front-end code automatic construction method, system and storage medium |
CN111290753A (en) * | 2020-01-20 | 2020-06-16 | 远光软件股份有限公司 | Method, device, equipment and storage medium for building front-end development environment |
CN111427558A (en) * | 2020-04-10 | 2020-07-17 | 创盛视联数码科技(北京)有限公司 | Method for customizing front-end automatic development environment based on webpack |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8266588B2 (en) * | 2007-11-12 | 2012-09-11 | International Business Machines Corporation | Creating projects in a rational application developer workspace |
CN105893014A (en) * | 2015-12-08 | 2016-08-24 | 乐视云计算有限公司 | Project development method and system for front end |
CN105760159A (en) * | 2016-02-01 | 2016-07-13 | 四川长虹电器股份有限公司 | Website developing method and system |
CN110134396B (en) * | 2019-07-09 | 2019-10-15 | 南京唯实科技有限公司 | A kind of Development Framework and method based on Nodejs development interface component |
-
2020
- 2020-07-31 CN CN202010763059.1A patent/CN111897520A/en active Pending
- 2020-10-29 WO PCT/CN2020/124660 patent/WO2021135584A1/en active Application Filing
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050204338A1 (en) * | 2004-03-11 | 2005-09-15 | International Business Machines Corporation | Standard application development framework |
US20070162845A1 (en) * | 2006-01-09 | 2007-07-12 | Apple Computer, Inc. | User interface for webpage creation/editing |
CN106502663A (en) * | 2016-10-17 | 2017-03-15 | 成都知道创宇信息技术有限公司 | A kind of front end project skeleton generating method |
CN106843869A (en) * | 2017-01-16 | 2017-06-13 | 百融(北京)金融信息服务股份有限公司 | A kind of front end Development Engineering system and method |
CN110580152A (en) * | 2018-06-07 | 2019-12-17 | 北京怡合春天科技有限公司 | Automatic scaffold frame of front end |
CN110795088A (en) * | 2019-10-29 | 2020-02-14 | 京东数字科技控股有限公司 | Front-end engineering project construction method and tool, and computer-readable storage medium |
CN111290753A (en) * | 2020-01-20 | 2020-06-16 | 远光软件股份有限公司 | Method, device, equipment and storage medium for building front-end development environment |
CN111273898A (en) * | 2020-02-25 | 2020-06-12 | 安徽以萨数据技术有限公司 | Web front-end code automatic construction method, system and storage medium |
CN111427558A (en) * | 2020-04-10 | 2020-07-17 | 创盛视联数码科技(北京)有限公司 | Method for customizing front-end automatic development environment based on webpack |
Non-Patent Citations (1)
Title |
---|
石小明: "从零使用TypeScript开发项目打包发布到npm", pages 1 - 2, Retrieved from the Internet <URL:https://www.jb51.net/article/180388.htm> * |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113791778A (en) * | 2020-11-18 | 2021-12-14 | 北京沃东天骏信息技术有限公司 | Software project generation method and device, electronic equipment and storage medium |
CN112685035B (en) * | 2020-12-25 | 2024-05-17 | 京东科技控股股份有限公司 | Project development method and device, computer readable storage medium and electronic equipment |
CN112685035A (en) * | 2020-12-25 | 2021-04-20 | 京东数字科技控股股份有限公司 | Project development method and device, computer-readable storage medium and electronic device |
CN113050985A (en) * | 2021-04-19 | 2021-06-29 | 中国工商银行股份有限公司 | Front-end engineering dependence automatic registration method and device |
CN113050985B (en) * | 2021-04-19 | 2024-02-06 | 中国工商银行股份有限公司 | Front-end engineering dependency automatic registration method and device |
CN113254040A (en) * | 2021-06-01 | 2021-08-13 | 康键信息技术(深圳)有限公司 | Front-end framework updating method, device, equipment and storage medium |
CN113254040B (en) * | 2021-06-01 | 2023-10-20 | 康键信息技术(深圳)有限公司 | Front-end framework updating method, device, equipment and storage medium |
CN113253997B (en) * | 2021-06-23 | 2021-10-08 | 南京铉盈网络科技有限公司 | Graphical front-end engineering framework construction method |
CN113253997A (en) * | 2021-06-23 | 2021-08-13 | 南京铉盈网络科技有限公司 | Graphical front-end engineering framework construction method |
CN113835737A (en) * | 2021-08-24 | 2021-12-24 | 交控科技股份有限公司 | Method and system for adding authority to front-end project |
CN113703822A (en) * | 2021-08-31 | 2021-11-26 | 三一专用汽车有限责任公司 | Differential upgrading method and device and operation machine |
CN113703822B (en) * | 2021-08-31 | 2022-11-01 | 三一专用汽车有限责任公司 | Differential upgrading method and device and operation machine |
CN115129333A (en) * | 2022-09-02 | 2022-09-30 | 城云科技(中国)有限公司 | Npm resource packet management method, device and system suitable for micro front-end framework |
CN115129333B (en) * | 2022-09-02 | 2022-11-25 | 城云科技(中国)有限公司 | NPm resource package management method, device and system suitable for micro front-end framework |
CN115202630A (en) * | 2022-09-08 | 2022-10-18 | 杭州阿启视科技有限公司 | Scaffold construction method based on web front-end engineering |
Also Published As
Publication number | Publication date |
---|---|
WO2021135584A1 (en) | 2021-07-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111897520A (en) | Front-end project framework construction method and device, computer equipment and storage medium | |
US8484625B2 (en) | Method and apparatus to vet an executable program using a model | |
CN105786538B (en) | software upgrading method and device based on android system | |
CN104731625A (en) | Method, device and mobile terminal for loading plugin | |
CN109857423B (en) | Program version updating method and device, server and readable storage medium | |
CN111475227B (en) | Business plug-in loading implementation method and device and terminal equipment | |
CN110554876A (en) | Method and device for compiling android project | |
CN111427596B (en) | Software upgrading method and device and terminal equipment | |
CN109669692B (en) | Source code sharing method, server, computer readable storage medium and system | |
CN108958843A (en) | Plug-in unit construction method, system, equipment and medium based on lightweight script | |
CN107844306B (en) | Application program repairing method and device, storage medium and terminal | |
CN107239309B (en) | Patch generation method and device, updating method, electronic device and storage medium | |
CN110597564A (en) | Installation package construction and service component loading method, device and terminal equipment | |
CN111008034A (en) | Patch generation method and device | |
CN108132832B (en) | Application program starting method and device | |
CN111831365A (en) | Interface route forwarding method, system, computer equipment and readable storage medium | |
CN105404522A (en) | Method for building intelligent terminal application program, device for building intelligent terminal application program and intelligent terminal | |
CN113296828A (en) | Method, server and system for issuing application | |
US11023220B2 (en) | Firmware update with integrated smart sequence and action engine | |
CN110610080B (en) | Application isolation implementation method, mobile terminal, computer equipment and storage medium | |
US20140282446A1 (en) | Modification of compiled applications and application management using retrievable policies | |
CN114461223A (en) | Code generation method and device and terminal equipment | |
CN110727416B (en) | Development framework generation method and related device | |
CN114860202A (en) | Project operation method, device, server and storage medium | |
US11010154B2 (en) | System and method for implementing complex patching micro service automation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |