CN108363564A - Entry modularization implementation method, device, terminal device and storage medium - Google Patents
Entry modularization implementation method, device, terminal device and storage medium Download PDFInfo
- Publication number
- CN108363564A CN108363564A CN201810063108.3A CN201810063108A CN108363564A CN 108363564 A CN108363564 A CN 108363564A CN 201810063108 A CN201810063108 A CN 201810063108A CN 108363564 A CN108363564 A CN 108363564A
- Authority
- CN
- China
- Prior art keywords
- component
- npm
- entry
- request
- item
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/20—Software design
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses a kind of entry modularization implementation method, device, terminal device and storage mediums.This method includes:At least two items component configuring requests are obtained, each project component configuration request includes request title and request version number;From npm management platforms, npm resources packet corresponding with request title is obtained, npm resource packets include at least one original item common component;From at least one original item common component, destination item common component corresponding with request version number is obtained;Processing is packaged at least two destination item common components, obtains entry component package file.This method improves the efficiency for obtaining destination item common component so that the call operation of items component is simple and convenient by calling entry component package file acquisition destination item common component.
Description
Technical field
The present invention relates to field of computer technology more particularly to a kind of entry modularization implementation method, device, terminal to set
Standby and storage medium.
Background technology
During software project development, the items component according to project demands exploitation different function is needed.Due to different soft
There may be the identical items component of function (hereinafter referred to as project common components) in part project, such as pop-up component and address choice
Component etc. need to call project common component, to improve opening for software project in order to avoid overlapping development in different software project
Send out efficiency.When being equipped with same function there are different software project, when calling the development process of identical project common component, need
The project common component in software project A is copied in software project B by developer, is somebody's turn to do with being realized in software project B
The function of project common component.The process of the calling project common component needs the lookup by manually carrying out project common component
It is completed with copy, since software project is constantly updated, the version of corresponding project common component storage is more and more, leads to project
Common component managerial confusion is susceptible to the case where safeguarding not in time;The application of project common component is influenced simultaneously so that exploitation
There is the low problem of search efficiency when calling project common component in personnel.
Invention content
A kind of entry modularization implementation method of offer of the embodiment of the present invention, device, terminal device and storage medium, with solution
The problem certainly manually searched and call project common component process efficiency low.
In a first aspect, the embodiment of the present invention provides a kind of entry modularization implementation method, including:
At least two items component configuring requests are obtained, each items component configuring request includes request title and asks
Ask version number;
From npm management platforms, npm resources packet corresponding with the request title, the npm resources packet are obtained
Include at least one original item common component;
From at least one original item common component, destination item corresponding with the request version number is obtained
Common component;
Processing is packaged at least two destination item common components, obtains entry component package file.
Second aspect, the embodiment of the present invention provide a kind of entry modularization realization device, including:
Items component configuring request acquisition module, for obtaining at least two items component configuring requests, each item
Mesh component configuration request includes request title and request version number;
Npm resource packet acquisition modules, for from npm management platforms, obtaining npm corresponding with the request title
Resource packet, the npm resources packet include at least one original item common component;
Destination item common component acquisition module, for from least one original item common component, obtain with
The corresponding destination item common component of request version number;
Entry component package file acquisition module, for being packaged at least two destination item common components
Processing obtains entry component package file.
The third aspect, the embodiment of the present invention provide a kind of terminal device, including memory, processor and are stored in described
In memory and the computer program that can run on the processor, the processor are realized when executing the computer program
The step of entry modularization implementation method.
Fourth aspect, the embodiment of the present invention provide a kind of computer readable storage medium, the computer-readable storage medium
Matter is stored with computer program, and the computer program realizes the entry modularization implementation method when being executed by processor
Step.
Entry modularization implementation method, device, terminal device and storage medium provided in an embodiment of the present invention, by obtaining
Corresponding npm resources packet in the request name acquiring npm management platforms at least two items component configuring requests is taken, then
Corresponding destination item common component is obtained from npm resource packets by request version number, at least two targets that will be got
Project common component is packaged processing, obtains an entry component package for including at least two destination item common components
File, it is convenient by calling entry component package file acquisition destination item common component, to improve acquisition destination item
The efficiency of common component so that the call operation of items component is simple and convenient.
Description of the drawings
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below by institute in the description to the embodiment of the present invention
Attached drawing to be used is needed to be briefly described, it should be apparent that, the accompanying drawings in the following description is only some implementations of the present invention
Example, for those of ordinary skill in the art, without having to pay creative labor, can also be according to these attached drawings
Obtain other attached drawings.
Fig. 1 is a flow chart of entry modularization implementation method in the embodiment of the present invention 1.
Fig. 2 is another flow chart of entry modularization implementation method in the embodiment of the present invention 1.
Fig. 3 is another flow chart of entry modularization implementation method in the embodiment of the present invention 1.
Fig. 4 is a specific schematic diagram of step S20 in Fig. 1.
Fig. 5 is a specific schematic diagram of step S30 in Fig. 1.
Fig. 6 is a specific schematic diagram of step S40 in Fig. 1.
Fig. 7 is a functional block diagram of entry modularization realization device in the embodiment of the present invention 2.
Fig. 8 is a schematic diagram of terminal device in the embodiment of the present invention 4.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation describes, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair
Embodiment in bright, the every other implementation that those of ordinary skill in the art are obtained without creative efforts
Example, shall fall within the protection scope of the present invention.
Embodiment 1
Fig. 1 shows the flow chart of entry modularization implementation method in the present embodiment.The entry modularization implementation method
Applying need to call multiple project common components to complete the process of software project development in developer, may make items component
Call operation is simple and convenient, while being also convenient for management and maintenance of the developer to project common component.As shown in Figure 1, this is more
Items component implementation method includes the following steps:
S10:At least two items component configuring requests are obtained, each project component configuration request includes request title and asks
Ask version number.
Items component configuring request is the configuring request for obtaining the items component needed, which is by client
End is sent to server.The client can be the computer that developer uses.The configuring request includes configuring request parameter,
Configuring request parameter includes request title and request version number.Request title refers to that developer wants the project common set obtained
The title of part, request version number refer to the version number that developer wants the project common component obtained.
Specifically, server can get at least two items component configuring requests of client transmission, each project
Component configuration request is to be based on actual development demand using the developer of the client, after the function of being developed required for determining,
The request sent by user end to server, to obtain required project common component.It is asked to distinguish items component configuration
The source asked can also make to carry the User ID of different developers for identification in items component configuring request, to be based on
The items component configuring request gets corresponding destination item common component and feeds back to the corresponding client of the User ID.
S20:From npm management platforms, npm resources packet corresponding with request title is obtained, npm resource packets include extremely
A few original item common component.
Npm management platforms refer to storage npm resource packets, and to tool that npm resource packets are managed.Npm is unified
Management platform provides public registration service, can store all npm resources packets of developer's publication, while npm is managed collectively
Platform provides command-line tool, for downloading, installing, update, search for, issue and checking npm resource packets.Npm resource packets refer to
The javascript codes that developer writes are carried out to a kind of resource packet of unified encapsulation and storage.npm(node package
Manager, node package manager) be node.js package manager, node.js is a kind of running environment of javascript.
It, can be by least one original item common component when developer carries out software project development on node.js
It is encapsulated in npm resource packets, and npm resources is wrapped and pass to npm management platforms, to facilitate developer to passing through npm
The realization of resource packet is managed at least one original item common component and later maintenance.Npm is passed to wrapping npm resources
After management platform, every npm resource packets correspond to a resource packet title, to be based on the resource packet title in the unified pipes of npm
Corresponding npm resources packet is searched in platform.Due at least one original item common component of npm resource encapsulations, in order to
The contact for embodying the two can make the resource packet title of npm resource packets correspond to the project of packaged original item common component
Component Name, i.e. resource packet title and the items component title of original item common component are same or similar.
Server, can be according in items component configuring request after getting at least two items component configuring requests
Title is asked, npm resources packet corresponding with request title is obtained from npm management platforms, is uploaded in advance to obtain
Npm resource packets in npm management platforms.The encapsulating of npm resources is equipped at least one original item common component, and encapsulation is extremely
The items component title of a few original item common component is same or similar, but version number is different.
S30:From at least one original item common component, it is public to obtain destination item corresponding with request version number
Component.
Destination item common component refers to original item common component consistent with request version number in npm resource packets.By
In at least one original item common component that npm resource packets include be title is similar or identical but version number is different item
Mesh common component, it is consistent with the request version number therefore, it is necessary to be obtained according to the request version number in items component configuring request
Original item common component as destination item common component, the destination item common component of acquisition can be made more accurate,
More meet the demand of developer in other words.
Each destination item common component is all obtained by items component configuring request, and server gets client
Send at least two items component configuring requests in request title and request version number differ, so its get to
Few two destination item common components are also different.
It, can be by items component configuring request, directly from npm when developer is needed using a certain project common component
Selection npm resources packet corresponding with request title in management platform, then selection and request version from corresponding npm resources packet
This number corresponding destination item common component, install and use the destination item common component so that obtain target item
Mesh common component it is simple to operate.
S40:Processing is packaged at least two destination item common components, obtains entry component package file.
Entry component package file refers to that at least two destination item common components that will be got are packaged processing
Obtain a component file.Entry component package file, all destination item common components that software project can be needed
Encapsulation is in one file, easy to use.
In the present embodiment, after the destination item common component for obtaining at least two, in order to realize in same software project
In use at least two destination item common components, at least two destination item common components need to be packaged processing.
Encapsulation process refers to that at least two destination item common components that will be got are packaged into the operation of package.json files.It should
Package.json files refer to developer when carrying out the code development of software project, are present under this software project
One file of root.The package.json files include the configuration information of the software project, which refers to this
Software project needs the data informations such as title, the version number of all destination item common components to be used.The package.json
File is then the entry component package file obtained, gives one corresponding interface of entry component package file configuration, when
It when needing to call the interface, is called using export modes, developer is facilitated to call at least one target item needed
Mesh common component.
In the present embodiment, by being packaged processing at least one destination item common component, needed without first downloading
The corresponding source code of destination item common component, the process that uses is decompressed to the corresponding source code of the destination item common component, can
It receives and utilizes the entry component package file after encapsulation process.
Further, in step S40, processing is packaged at least two destination item common components and is specifically included:Sentence
Disconnected at least two destination item common components whether there is associated item common component, if there are associated item common component,
From npm management platforms, corresponding associated item common component, and at least two destination item common components and pass are obtained
Copula mesh common component is packaged processing.
Wherein, associated item common component refers to that must be used when realizing the function of a certain destination item common component
Sundry item common component.When carrying out software project development such as developer, need to obtain original item common component A and original
1.0 editions of project common component B, and original item common component A itself relies on 2.0 editions of original item common component B, this
When, 2.0 editions of original item common component B are associated item common components, therefore, need to obtain original item common component together
2.0 editions of B, in encapsulation process into need to be by 1.0 editions of 1.0 editions of original item common component A and original item common component B
It is packaged into entry component package file with 2.0 editions.
The entry modularization implementation method that the present embodiment is provided, by least two items component configuring requests
Corresponding npm resources packet in name acquiring npm management platforms is asked, then by request version number from corresponding npm resources
Corresponding destination item common component is obtained in packet.Then at least two destination item common components got are packaged
Processing, obtains an entry component package file for including at least two destination item common components.The entry component seals
Dress file configuration has corresponding interface, when developer needs to call the interface, export modes can be used to be called, uses
Export modes call the corresponding interface of entry component package file, can improve the effect for calling entry component package file
Rate.
In a specific embodiment, it as shown in Fig. 2, in step S20, obtains and asks from npm management platforms
Before the step of title corresponding npm resources packet, entry modularization implementation method includes:
S201:Original item component is obtained, original item component includes items component title, version component version number and component category
Property label.
Original item component refers to the items component that a certain function can be achieved, and it is a certain which is specifically as follows realization
The code of function.Specifically, server obtains the original item component that developer is sent by client, the original item group
Part includes items component title, version component version number and component property label.Items component title refers to the original item component pair
The title answered.Version component version number refers to the corresponding version number of original item component, which is by including but not limited to me
The version number of one or more of uncle's number, character and Chinese character composition.Component property label refers to original item component pair
The attribute tags answered, attribute tags refer to the label of mark project component property.The attribute tags include shared attribute tags and
Privately owned attribute tags, shared attribute tags refer to the attribute tags that the original item component is suitable for multiple software projects, privately owned
Attribute tags refer to the attribute tags that the original item component is only applicable to a software project.
S202:Based on the original item component that component property label is shared attribute tags, original item common set is obtained
Part, original item common component are associated with items component title and version component version number.
Each original item component that client is sent carries corresponding component property label, and server is based on component
Attribute tags obtain the original item component for containing shared attribute tags as original item common set from original item component
Part.
Original item common component containing shared attribute tags is pulled out from all original item components, this is original
After project common component extracts, corresponding items component title and component version in original item component can be carried
Number.Original item common component is associated with items component title and version component version number helps to distinguish that the original item got is public
Component altogether, it is convenient public by the corresponding items component title of original item common component and version component version number understanding original item
The content of component.
S203:The same or analogous original item common component of items component title is packaged into the npm of a cmd pattern
Resource packet.
Server is after getting multiple original item common components for carrying shared attribute tags, for the ease of subsequently managing
Reason and use, can be divided all original item common components by items component title, specifically by items component title
Same or analogous at least one original item common component is packaged into a npm resource packet, which corresponds to a resource
Packet title, the resource packet title refer to the title containing the same or analogous original item common component of items component title, i.e.,
If there are one only being encapsulated in npm resource packets when original item common component, the resource packet title and original item common component phase
It is corresponding;If be packaged at least two original item common components in npm resource packets, the resource packet title and at least two original
Items component title is corresponding one of in project common component.
Further, which is packaged using cmd patterns.Cmd patterns are packaged to form npm resource packets
Afterwards, it is only necessary to open cmd windows, input acquisition instruction, so that it may to find the npm resource packets of needs, to find the original of needs
Beginning project common component, being obtained for subsequent development personnel, which needs original item common component to be used to provide, easily obtains road
Diameter.
S204:Npm resource packets are stored in npm management platforms.
All npm resources packets got are stored in npm management platforms, convenient for all npm resource packets
It is managed collectively, can accomplish to safeguard and update in time.Specifically, it is stored in npm management platforms, every npm moneys
The storage address and its resource packet title of source packet, can be by query resource packet name acquiring to its storage address, to obtain
Corresponding npm resource packets, in order to call the npm resource packets in npm management platforms.
It further, can be public by the original item of the new version when new version occurs in original item common component
The npm resource packets that component package arrives and the component Name of the original item common component of the new version is same or analogous, with more
Npm resource packets in new npm management platforms, to realize the more new management to npm resource packets.Specifically, such as Fig. 3 institutes
Show, before the step of npm resource packets are stored in npm management platforms (i.e. step S204), which realizes
Method includes:
S2041:The renewal item component for carrying and sharing attribute tags is obtained, renewal item component includes renewal item component
Title and renewal item version component version number.
Renewal item component refers to being carried out to the code in a certain original item component during software project development
The items component formed after update.It specifically, can be to the generation of software project based on business demand during software project development
Code is continuously updated, and the items component contained in the software item destination code can also be updated accordingly, will be newer
Items component is named as renewal item component.
Renewal item component Name is the corresponding items component title of renewal item component, recognizes and is managed more for convenience
New projects' component can set renewal item component Name and original item component Name to identical title.Renewal item
Version component version number refers to the corresponding version number of renewal item component, corresponding more for the ease of searching renewal item version component version number
New projects' component, in the present embodiment, by renewal item version component version number Arabic numerals and character designation, such as (1.0),
(2.0) (n.0), it is possible to understand that ground, renewal item version component version number are incremented by successively.
S2042:Based on renewal item component Name, determines and whether there is homologous npm resources in npm management platforms
Packet.
Homologous npm resource packets refer to npm resource packets identical with renewal item component Name.If renewal item component name
Title is identical as resource packet title, then can be confirmed that there are homologous npm resources packets in npm management platforms;If not with update
Homologous npm resource packets are then not present in the identical npm resources packet of items component title in npm management platforms.Determine npm
There are homologous npm resource packets in management platform, contribute to step S2043 that will belong to the project of same project component Name
Component package is in same npm resources packet.
S2043:If, will be in renewal item component package to homologous npm resource packets there are homologous npm resource packets.
If there are when homologous npm resource packets, need comparison renewal item version component version number corresponding with npm resource packets
Whether the version number of original item common component is consistent.If renewal item version component version number is corresponding original with npm resource packets
The version number of project common component is consistent, then needs to change renewal item version component version number, obtain modified renewal item group
Part version number, in the homologous npm resource packets of cmd patterns, and it is modified more to retain this by renewal item component package
New projects' version component version number.If the version of renewal item version component version number original item common component corresponding with npm resource packets
This number inconsistent, then directly by corresponding renewal item component package in the homologous npm resource packets of cmd patterns.
It is to be appreciated that by after renewal item component package to homologous npm resource packets, which is
An original item common component in npm resource packets, also allowing for the later stage safeguards code, while developer being facilitated to exist
When the code development of subsequent software project, it will be appreciated that the corresponding all original item common components of same project component Name
Situation.
In a specific embodiment, as shown in figure 4, step S20, obtains and request name from npm management platforms
Claim corresponding npm resources packet, specifically comprises the following steps:
S21:Name list corresponding with request title is obtained from npm management platforms, name list includes at least
One similar names.
Name list refers to the component Name list containing name keys mapping relations.The name keys mapping relations
It refer to the relationship for asking to have in title and resource packet title the identical title of identical title or part.The name list helps
In lookup npm resources packet corresponding with request title.Name list there are one being prestored in npm management platforms, title
List includes at least one similar names.It can be in the feelings of the items component title of imperfect input original item common component
Under condition, name list corresponding with the items component title of input is obtained by inquiring, to find the npm resource packets of needs,
The npm resource packets for facilitating developer's quick obtaining to need.
S22:Selection instruction is obtained, selection instruction includes target designation.
Selection instruction refers to the instruction for the similar names that user selects affinity list.Target designation refers to user from least one
The title for the npm resource packets that the needs selected in a similar names obtain.Developer clicks determination after inputting target designation
Button can input corresponding selection instruction, and server is obtained based on the target designation in selection instruction from npm management platforms
Take corresponding npm resources packet.
S23:Corresponding npm resources packet is obtained from npm management platforms based on target designation.
Specifically, when the target designation of acquisition is consistent with the resource packet title stored in npm management platforms, then directly
It obtains and takes corresponding npm resources packet.When the target designation of acquisition differs with the resource packet title stored in npm management platforms
When cause, then the name list being stored in advance in npm management platforms is called to obtain corresponding npm resources packet.
Further, the name list being stored in advance in npm management platforms is called to obtain opposite with target designation
The npm resource packets answered are realized by Keyword-method-arit hmetic.Wherein, Keywords matching algorithm includes but not limited to gram to exert
Te-Mo Lisi-Alexandre Desplat (Knuth-Morris-Pratt, hereinafter referred to as KMP) algorithm.Specifically, KMP algorithms are a kind of improvement
String matching algorithm, the keys of KMP algorithms is to reduce of pattern string and main string to the greatest extent using the information after it fails to match
With number to achieve the purpose that Rapid matching.In the present embodiment, select KMP algorithms in the target designation and name list of input
The similar names of storage carry out Keywords matching, obtain corresponding resource packet title, facilitate developer to be quickly found out corresponding
Npm resource packets.
Target designation as developer inputs can pass through name list for " public pop-up " or " pop-up component "
In name keys mapping relationship searching to resource packet entitled " public pop-up component " npm resource packets, to realize exist
Corresponding npm resources packet is obtained in the case of without accurately inputting resource packet title.
In a specific embodiment, as shown in figure 5, step S30 is obtained from least one original item common component
Destination item common component corresponding with request version number is taken, is specifically comprised the following steps:
S31:It, will if there is the version component version number consistent with request version number at least one original item common component
The corresponding original item common component of request version number is as destination item common component.
Npm management platforms are based on the corresponding npm resources packet of request name acquiring that client is sent, due to one
Npm resource packets include at least one original item common component, and each original item common component corresponds to a component version
Number, therefore, server from npm management platforms obtain with ask the corresponding npm resources packet of title after, then from the npm
It is obtained with the consistent original item common component of the request version number as destination item common component in resource packet.
S32:If the version component version number consistent with request version number is not present at least one original item common component,
Using the original item common component of newest upload as destination item common component.
If the original item common set consistent with request version number is not present in the npm resource packets based on request name acquiring
Part is then based on the corresponding uplink time of original item common component, using the original item common component of newest upload as target
Project common component.It can also be based on the corresponding version component version number of original item common component, by newest version component version number pair
The original item common component answered is as destination item common component.Such as the original item common component in a npm resource packets
Version component version number is respectively (1.0), (2.0), (3.0) and (4.0), then (4.0) are newest version component version number, then by component version
This number for (4.0) corresponding original item common component as destination item common component.Its is original to be, the original of newest upload
Beginning project common component is the newest adjustment that the actual needs based on software project is made, and is more conform with newest software project
Requirement.
In a specific embodiment, as shown in fig. 6, step S40, seals at least two destination item common components
Dress processing, obtains entry component package file, specifically comprises the following steps:
S41:Pull corresponding component core code respectively from least two destination item common components.
Component core code refer to a destination item common component code in compare the code of core, the component core
The function of the destination item common component may be implemented in code.
It is to be appreciated that when a software project needs to obtain at least two destination item common components, each target
Project common component includes but not limited to component core code, component template code and definitions component model code.Pass through step
S41 pulls corresponding component core code respectively from each destination item common component, it is possible to reduce the code for pulling out
Length.
S42:At least two component core codes are carried out by integration processing using gulp strapping tools, are packaged into
The entry component package file of components.js forms.
Using gulp strapping tools will get at least two component core codes compressed, compile, merge, check and
The operations such as refreshing.Wherein gulp is the tool built to code in the development process of front end, and gulp strapping tools were being developed
To much repeating for task in journey, such as compresses, compiling, merges, checks and refresh, it can be automatically complete using correct tool
At.It is automatically performed as " gulp-less " tool may be used in compiling, it is automatically complete that " gulp-concat " tool may be used in merging
At.The working efficiency that component core code integrates processing is can effectively improve using gulp strapping tools.
It, need to be to this at least two groups by core generation after carrying out integration processing at least two component core codes got
Code is further processed, i.e., at least two components core code is packaged into an entry component package file, this is multinomial
Mesh component package file be in the form of components.js existing for.At least two component core codes of acquisition are packaged into
The entry component package file of components.js forms, all destination item common sets that software project can be needed
Part encapsulates facilitates developer not have to carry out respectively when calling at least two project common component needed in one file
It calls, it is only necessary to call a corresponding entry component package file that can obtain at least two project common sets of needs
Part.
The entry modularization implementation method passes through the request name in at least two items component configuring requests that get
Claim to obtain corresponding npm resources packet in npm management platforms, then obtains correspondence from npm resource packets by request version number
Destination item common component, at least two destination item common components got are then packaged processing, are obtained more
Items component package file.The entry component package file makes developer call the destination item common component needed
When it is simple and convenient, it is efficient.If there is renewal item component, npm management platforms can be based on renewal item component and correspond to
Homologous npm resources packet, if there are homologous npm resources packet, by renewal item component package to corresponding homologous npm resources
Bao Zhong, to facilitate the management to project common component.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process
Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit
It is fixed.
Embodiment 2
Fig. 7 is shown and the one-to-one entry modularization realization device of entry modularization implementation method in embodiment 1
Functional block diagram.As shown in fig. 7, the entry modularization realization device includes items component configuring request acquisition module 10, npm
Resource packet acquisition module 20, destination item common component acquisition module 30 and entry component package file acquisition module 40.Its
In, items component configuring request acquisition module 10, npm resource packets acquisition module 20, destination item common component acquisition module 30
It is corresponding with entry modularization implementation method in embodiment with the realization function of entry component package file acquisition module 40
Step corresponds, and to avoid repeating, the present embodiment is not described in detail one by one.
Items component configuring request acquisition module 10, for obtaining at least two items component configuring requests, each project
Component configuration request includes request title and request version number.
Npm resource packets acquisition module 20 is provided for from npm management platforms, obtaining npm corresponding with request title
Source is wrapped, and npm resource packets include at least one original item common component.
Destination item common component acquisition module 30, for from least one original item common component, obtaining and asking
Seek the corresponding destination item common component of version number.
Entry component package file acquisition module 40, for being packaged place at least two destination item common components
Reason obtains entry component package file.
Preferably, before npm resource packets acquisition module 20, entry modularization realization device includes original item component
Acquiring unit 201, original item common component acquiring unit 202, npm resource packets generation unit 203 and the storage of npm resource packets are single
Member 204.
Original item component acquiring unit 201, for obtaining original item component, original item component includes items component
Title, version component version number and component property label.
Original item common component acquiring unit 202, for being the original of shared attribute tags based on component property label
Items component, obtains original item common component, and original item common component is associated with items component title and version component version number.
Npm resource packets generation unit 203, for sealing the same or analogous original item common component of items component title
Dress up the npm resource packets of a cmd pattern.
Npm resource packets storage unit 204, for npm resource packets to be stored in npm management platforms.
Preferably, before npm resource packets storage unit 204, entry modularization realization device includes renewal item group
Part acquiring unit 2041, homologous npm resource packets judging unit 2042 and homologous npm resource packets storage unit 2043.
Renewal item component acquiring unit 2041 carries the renewal item component for sharing attribute tags, update for obtaining
Items component includes renewal item component Name and renewal item version component version number.
Homologous npm resource packets judging unit 2042 determines that npm is managed collectively for being based on renewal item component Name
It whether there is homologous npm resource packets in platform.
Homologous npm resource packets storage unit 2043, if for there are homologous npm resource packets, by renewal item group
Part is encapsulated into homologous npm resource packets.
Preferably, npm resources packet acquisition module 20 includes name list acquiring unit 21,22 and of selection instruction acquiring unit
Npm resource packets acquiring unit 23.
Name list acquiring unit 21, for obtaining name column corresponding with request title from npm management platforms
Table, name list include at least one similar names.
Selection instruction acquiring unit 22, for obtaining selection instruction, selection instruction includes target designation.
Npm resource packets acquiring unit 23 obtains corresponding npm for being based on target designation from npm management platforms
Resource packet.
Preferably, destination item common component acquisition module 30 includes 31 He of first object project common component acquiring unit
Second destination item common component acquiring unit 32.
First object project common component acquiring unit 31, if for exist at least one original item common component with
The consistent version component version number of request version number, then using the corresponding original item common component of request version number as destination item public affairs
Component altogether.
Second destination item common component acquiring unit 32, if for being not present at least one original item common component
The version component version number consistent with request version number, then using the original item common component of newest upload as destination item common set
Part.
Preferably, entry component package file acquisition module 40 pulls unit 41 and entry including component core code
Component package file obtaining unit 42.
Component core code pulls unit 41, corresponding for being pulled respectively from least two destination item common components
Component core code.
Entry component package file obtaining unit 42, for using gulp strapping tools by least two component core generations
Code carries out integration processing, is packaged into the entry component package file of components.js forms.
Embodiment 3
The present embodiment provides a computer readable storage medium, computer journey is stored on the computer readable storage medium
Sequence realizes entry modularization implementation method in embodiment 1 when the computer program is executed by processor, to avoid repeating, this
In repeat no more.Alternatively, being realized when the computer program is executed by processor in embodiment 2 in entry modularization realization device
The function of each module/unit, to avoid repeating, which is not described herein again.
Embodiment 4
Fig. 8 is the schematic diagram for the terminal device that one embodiment of the invention provides.As shown in figure 8, the terminal of the embodiment is set
Standby 80 include:Processor 81, memory 82 and it is stored in the computer journey that can be run in memory 82 and on processor 81
Sequence 83.Processor 81 realizes the step in above-mentioned entry modularization implementation method embodiment, example when executing computer program 83
Step S10 to S40 as shown in Figure 1.Alternatively, processor 81 realizes that above-mentioned entry modularization is real when executing computer program 83
The function of each module/unit in existing device embodiment, such as the acquisition module of items component configuring request shown in Fig. 7 10, npm resources
The function of packet acquisition module 20, destination item common component acquisition module 30 and entry component package file acquisition module 40.
Illustratively, computer program 83 can be divided into one or more module/units, one or more mould
Block/unit is stored in memory 82, and is executed by processor 81, to complete the present invention.One or more module/units can
To be the series of computation machine program instruction section that can complete specific function, the instruction segment is for describing computer program 83 at end
Implementation procedure in end equipment 80.For example, computer program 83 can be divided into items component configuring request acquisition module 10,
Npm resource packets acquisition module 20, destination item common component acquisition module 30 and entry component package file acquisition module 40.
Terminal device 80 can be the computing devices such as desktop PC, notebook, palm PC and cloud server.Eventually
End equipment may include, but be not limited only to, processor 81, memory 82.It will be understood by those skilled in the art that Fig. 8 is only eventually
The example of end equipment 80 does not constitute the restriction to terminal device 80, may include components more more or fewer than diagram, or
Combine certain components or different components, for example, terminal device can also include input-output equipment, network access equipment,
Bus etc..
Alleged processor 81 can be central processing unit (Central Processing Unit, CPU), can also be
Other general processors, digital signal processor (Digital Signal Processor, DSP), application-specific integrated circuit
(Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-
Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,
Discrete hardware components etc..General processor can be microprocessor or the processor can also be any conventional processor
Deng.
Memory 82 can be the internal storage unit of terminal device 80, such as the hard disk or memory of terminal device 80.It deposits
Reservoir 82 can also be the plug-in type hard disk being equipped on the External memory equipment of terminal device 80, such as terminal device 80, intelligence
Storage card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card)
Deng.Further, memory 82 can also both include terminal device 80 internal storage unit and also including External memory equipment.It deposits
Reservoir 82 is used to store other programs and the data needed for computer program and terminal device.Memory 82 can be also used for temporarily
When store the data that has exported or will export.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each work(
Can unit, module division progress for example, in practical application, can be as needed and by above-mentioned function distribution by different
Functional unit, module are completed, i.e., the internal structure of described device are divided into different functional units or module, more than completion
The all or part of function of description.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it can also
It is that each unit physically exists alone, it can also be during two or more units be integrated in one unit.Above-mentioned integrated list
The form that hardware had both may be used in member is realized, can also be realized in the form of SFU software functional unit.
If the integrated module/unit be realized in the form of SFU software functional unit and as independent product sale or
In use, can be stored in a computer read/write memory medium.Based on this understanding, the present invention realizes above-mentioned implementation
All or part of flow in example method, can also instruct relevant hardware to complete, the meter by computer program
Calculation machine program can be stored in a computer readable storage medium, the computer program when being executed by processor, it can be achieved that on
The step of stating each embodiment of the method.Wherein, the computer program includes computer program code, the computer program generation
Code can be source code form, object identification code form, executable file or certain intermediate forms etc..The computer-readable medium
May include:Any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic of the computer program code can be carried
Dish, CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM,
Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that described
The content that computer-readable medium includes can carry out increasing appropriate according to legislation in jurisdiction and the requirement of patent practice
Subtract, such as in certain jurisdictions, according to legislation and patent practice, computer-readable medium do not include be electric carrier signal and
Telecommunication signal.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although with reference to aforementioned reality
Applying example, invention is explained in detail, it will be understood by those of ordinary skill in the art that:It still can be to aforementioned each
Technical solution recorded in embodiment is modified or equivalent replacement of some of the technical features;And these are changed
Or replace, the spirit and scope for various embodiments of the present invention technical solution that it does not separate the essence of the corresponding technical solution should all
It is included within protection scope of the present invention.
Claims (10)
1. a kind of entry modularization implementation method, which is characterized in that including:
At least two items component configuring requests are obtained, each items component configuring request includes request title and request version
This number;
From npm management platforms, npm resources packet corresponding with the request title is obtained, the npm resources packet includes extremely
A few original item common component;
From at least one original item common component, it is public to obtain destination item corresponding with the request version number
Component;
Processing is packaged at least two destination item common components, obtains entry component package file.
2. entry modularization implementation method as described in claim 1, which is characterized in that described flat from npm unified managements
In platform, obtain npm resources packet corresponding with the request title the step of before, the entry modularization implementation method packet
It includes:
Original item component is obtained, the original item component includes items component title, version component version number and component property mark
Label;
Based on the original item component that component property label is shared attribute tags, original item common component, the original are obtained
Beginning project common component is associated with the items component title and the version component version number;
The same or analogous original item common component of items component title is packaged into the npm resource packets of a cmd pattern;
The npm resources packet is stored in npm management platforms.
3. entry modularization implementation method as claimed in claim 2, which is characterized in that described by the npm resources packet
Before the step of being stored in npm management platforms, the entry modularization implementation method includes:
Obtain carry share attribute tags renewal item component, the renewal item component include renewal item component Name and
Renewal item version component version number;
Based on the renewal item component Name, determines and whether there is homologous npm resource packets in npm management platforms;
If, will be in the renewal item component package to the homologous npm resource packets there are homologous npm resource packets.
4. entry modularization implementation method as described in claim 1, which is characterized in that described from npm management platforms
In, npm resources packet corresponding with the request title is obtained, including:
Name list corresponding with the request title is obtained from npm management platforms, the name list includes at least
One similar names;
Selection instruction is obtained, the selection instruction includes target designation;
Corresponding npm resources packet is obtained from the npm management platforms based on the target designation.
5. entry modularization implementation method as described in claim 1, which is characterized in that described from least one described original
In project common component, destination item common component corresponding with the request version number is obtained, including:
It, will if there is the version component version number consistent with the request version number at least one original item common component
The corresponding original item common component of the request version number is as the destination item common component;
If the version component version number consistent with the request version number is not present at least one original item common component,
Using the original item common component of newest upload as the destination item common component.
6. entry modularization implementation method as described in claim 1, which is characterized in that described at least two targets
Project common component is packaged processing, obtains entry component package file, including:
Corresponding component core code is pulled respectively from at least two destination item common components;
At least two component core codes are carried out by integration processing using gulp strapping tools, are packaged into components.js shapes
The entry component package file of formula.
7. a kind of entry modularization realization device, which is characterized in that including:
Items component configuring request acquisition module, for obtaining at least two items component configuring requests, each project team
Part configuring request includes request title and request version number;
Npm resource packet acquisition modules, for from npm management platforms, obtaining npm resources corresponding with the request title
Packet, the npm resources packet includes at least one original item common component;
Destination item common component acquisition module, for from least one original item common component, obtain with it is described
The corresponding destination item common component of request version number;
Entry component package file acquisition module, for being packaged place at least two destination item common components
Reason obtains entry component package file.
8. entry modularization realization device as claimed in claim 6, which is characterized in that obtain mould in the npm resources packet
Before block, the entry modularization realization device includes:
Original item component acquiring unit, for obtaining original item component, the original item component includes items component name
Title, version component version number and component property label;
Original item common component acquiring unit, for based on the original item group that component property label is shared attribute tags
Part obtains original item common component, the original item common component and the items component title and the component version
Number association;
Npm resource packet generation units, for the same or analogous original item common component of items component title to be packaged into one
The npm resource packets of a cmd patterns;
Npm resource packet storage units, for the npm resources packet to be stored in npm management platforms.
9. a kind of terminal device, including memory, processor and it is stored in the memory and can be on the processor
The computer program of operation, which is characterized in that the processor realizes such as claim 1 to 6 when executing the computer program
The step of any one entry modularization implementation method.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, feature to exist
In realization entry modularization realization side as described in any one of claim 1 to 6 when the computer program is executed by processor
The step of method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810063108.3A CN108363564A (en) | 2018-01-23 | 2018-01-23 | Entry modularization implementation method, device, terminal device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810063108.3A CN108363564A (en) | 2018-01-23 | 2018-01-23 | Entry modularization implementation method, device, terminal device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108363564A true CN108363564A (en) | 2018-08-03 |
Family
ID=63006665
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810063108.3A Pending CN108363564A (en) | 2018-01-23 | 2018-01-23 | Entry modularization implementation method, device, terminal device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108363564A (en) |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109062551A (en) * | 2018-08-08 | 2018-12-21 | 青岛大快搜索计算技术股份有限公司 | Development Framework based on big data exploitation command set |
CN110297647A (en) * | 2019-05-29 | 2019-10-01 | 福建天泉教育科技有限公司 | A kind of front end engineering updates the method and terminal of npm packet |
CN110377325A (en) * | 2019-06-17 | 2019-10-25 | 中国平安人寿保险股份有限公司 | Interface allocation method, interface call method, device, equipment and storage medium |
CN111026437A (en) * | 2019-12-26 | 2020-04-17 | 珠海金山网络游戏科技有限公司 | Unity-based resource package processing method and device |
CN111158674A (en) * | 2019-12-30 | 2020-05-15 | 广州市百果园信息技术有限公司 | Component management method, system, device and storage medium |
CN111294397A (en) * | 2020-01-21 | 2020-06-16 | 北京乐学帮网络技术有限公司 | npm packet management method, device, electronic equipment and storage medium |
CN111679827A (en) * | 2020-04-28 | 2020-09-18 | 平安国际智慧城市科技股份有限公司 | H5 page generation method, device, equipment and storage medium |
CN111949247A (en) * | 2020-08-17 | 2020-11-17 | 北京一览群智数据科技有限责任公司 | Module packaging method and system |
CN112035160A (en) * | 2020-08-31 | 2020-12-04 | 广州鲁邦通物联网科技有限公司 | Code management system and control method thereof |
CN113238795A (en) * | 2021-05-14 | 2021-08-10 | 北京达佳互联信息技术有限公司 | Component distribution method, device, electronic equipment, storage medium and program product |
CN113254043A (en) * | 2021-06-04 | 2021-08-13 | 京东科技控股股份有限公司 | Web front-end project processing method and device, electronic equipment and storage medium |
CN113312032A (en) * | 2021-06-25 | 2021-08-27 | 深圳集智数字科技有限公司 | Front-end project resource updating method and device, electronic equipment and storage medium |
CN113495730A (en) * | 2020-03-20 | 2021-10-12 | 北京沃东天骏信息技术有限公司 | Resource package generation and analysis method and device |
CN113590213A (en) * | 2021-06-24 | 2021-11-02 | 深圳开源互联网安全技术有限公司 | Component maintenance method, electronic device, and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101944017A (en) * | 2009-07-09 | 2011-01-12 | 华为技术有限公司 | Method and device for producing Widget |
CN104216715A (en) * | 2014-09-02 | 2014-12-17 | 深圳前海诺德咨询服务有限公司 | Web App development framework and method |
CN104572091A (en) * | 2014-12-25 | 2015-04-29 | 百度在线网络技术(北京)有限公司 | Application software realization method and device as well as computer equipment |
CN105487905A (en) * | 2015-11-27 | 2016-04-13 | 东软集团股份有限公司 | Updating method and device of hybrid application |
US20160227107A1 (en) * | 2015-02-02 | 2016-08-04 | Lenovo (Singapore) Pte. Ltd. | Method and device for notification preview dismissal |
CN107577459A (en) * | 2017-08-21 | 2018-01-12 | 杰为软件系统(深圳)有限公司 | A kind of towed cross-platform development system and method based on modularization |
-
2018
- 2018-01-23 CN CN201810063108.3A patent/CN108363564A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101944017A (en) * | 2009-07-09 | 2011-01-12 | 华为技术有限公司 | Method and device for producing Widget |
CN104216715A (en) * | 2014-09-02 | 2014-12-17 | 深圳前海诺德咨询服务有限公司 | Web App development framework and method |
CN104572091A (en) * | 2014-12-25 | 2015-04-29 | 百度在线网络技术(北京)有限公司 | Application software realization method and device as well as computer equipment |
US20160227107A1 (en) * | 2015-02-02 | 2016-08-04 | Lenovo (Singapore) Pte. Ltd. | Method and device for notification preview dismissal |
CN105487905A (en) * | 2015-11-27 | 2016-04-13 | 东软集团股份有限公司 | Updating method and device of hybrid application |
CN107577459A (en) * | 2017-08-21 | 2018-01-12 | 杰为软件系统(深圳)有限公司 | A kind of towed cross-platform development system and method based on modularization |
Non-Patent Citations (1)
Title |
---|
章家二公子: "使用npm管理weex组件及公共模块库", 《HTTPS://BLOG.CSDN.NET/BRLF_GZ/ARTICLE/DETAILS/78527923》 * |
Cited By (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109062551A (en) * | 2018-08-08 | 2018-12-21 | 青岛大快搜索计算技术股份有限公司 | Development Framework based on big data exploitation command set |
CN110297647A (en) * | 2019-05-29 | 2019-10-01 | 福建天泉教育科技有限公司 | A kind of front end engineering updates the method and terminal of npm packet |
CN110297647B (en) * | 2019-05-29 | 2023-12-01 | 福建天泉教育科技有限公司 | Method and terminal for updating npm packet by front-end engineering |
CN110377325A (en) * | 2019-06-17 | 2019-10-25 | 中国平安人寿保险股份有限公司 | Interface allocation method, interface call method, device, equipment and storage medium |
CN110377325B (en) * | 2019-06-17 | 2024-05-17 | 中国平安人寿保险股份有限公司 | Interface configuration method, interface calling method, device, equipment and storage medium |
CN111026437A (en) * | 2019-12-26 | 2020-04-17 | 珠海金山网络游戏科技有限公司 | Unity-based resource package processing method and device |
CN111158674A (en) * | 2019-12-30 | 2020-05-15 | 广州市百果园信息技术有限公司 | Component management method, system, device and storage medium |
CN111294397A (en) * | 2020-01-21 | 2020-06-16 | 北京乐学帮网络技术有限公司 | npm packet management method, device, electronic equipment and storage medium |
CN113495730A (en) * | 2020-03-20 | 2021-10-12 | 北京沃东天骏信息技术有限公司 | Resource package generation and analysis method and device |
CN111679827B (en) * | 2020-04-28 | 2024-04-26 | 深圳赛安特技术服务有限公司 | H5 page generation method, device, equipment and storage medium |
CN111679827A (en) * | 2020-04-28 | 2020-09-18 | 平安国际智慧城市科技股份有限公司 | H5 page generation method, device, equipment and storage medium |
CN111949247A (en) * | 2020-08-17 | 2020-11-17 | 北京一览群智数据科技有限责任公司 | Module packaging method and system |
CN112035160A (en) * | 2020-08-31 | 2020-12-04 | 广州鲁邦通物联网科技有限公司 | Code management system and control method thereof |
CN113238795A (en) * | 2021-05-14 | 2021-08-10 | 北京达佳互联信息技术有限公司 | Component distribution method, device, electronic equipment, storage medium and program product |
CN113254043A (en) * | 2021-06-04 | 2021-08-13 | 京东科技控股股份有限公司 | Web front-end project processing method and device, electronic equipment and storage medium |
CN113590213A (en) * | 2021-06-24 | 2021-11-02 | 深圳开源互联网安全技术有限公司 | Component maintenance method, electronic device, and storage medium |
CN113590213B (en) * | 2021-06-24 | 2023-04-25 | 深圳开源互联网安全技术有限公司 | Component maintenance method, electronic device and storage medium |
CN113312032A (en) * | 2021-06-25 | 2021-08-27 | 深圳集智数字科技有限公司 | Front-end project resource updating method and device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108363564A (en) | Entry modularization implementation method, device, terminal device and storage medium | |
US9811325B2 (en) | Systems and methods for dynamically replacing code objects for code pushdown | |
US11667033B2 (en) | Systems and methods for robotic process automation | |
US9720656B2 (en) | Method and apparatus for enabling agile development of services in cloud computing and traditional environments | |
CN109542445A (en) | A kind of method and apparatus that Android plug-in unit melts hair | |
CN112860260B (en) | Web-based cross-platform application construction tool and method in college scene | |
CN109918435A (en) | A kind of processing method and system of business interface | |
CN108459962A (en) | Code specification detection method, device, terminal device and storage medium | |
US20120095950A1 (en) | Systems and methods for implementing business rules designed with cloud computing | |
US20070033570A1 (en) | Method and system for transforming a process flow | |
CN109636301A (en) | Workflow configuration method, system, terminal and the readable storage medium storing program for executing of financial business | |
CN112926008B (en) | Method, device, electronic equipment and storage medium for generating form page | |
US11366704B2 (en) | Configurable analytics for microservices performance analysis | |
CN111699484A (en) | System and method for data management | |
CN107844519A (en) | Electronic installation, data base querying scenario generation method and storage medium | |
CN112256670A (en) | Data migration method, terminal device and readable storage medium | |
CN117454278A (en) | Method and system for realizing digital rule engine of standard enterprise | |
US8935657B2 (en) | Model-to-model transformation by kind | |
US7434227B2 (en) | Portable business information content and management system | |
CN106990974A (en) | A kind of APP applications update method, device and electronic equipment | |
CN110765610B (en) | PDM integration method, PDM integration device, computer equipment and storage medium | |
US20050273755A1 (en) | Scripting engine for network communication software | |
US9069560B2 (en) | Operational model creation from SOA solution architecture | |
CN115756483A (en) | Compiling method, compiling apparatus, computer device, and storage medium | |
US10908917B1 (en) | System and method for managing cloud-based infrastructure |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180803 |