CN113050985B - Front-end engineering dependency automatic registration method and device - Google Patents

Front-end engineering dependency automatic registration method and device Download PDF

Info

Publication number
CN113050985B
CN113050985B CN202110417400.2A CN202110417400A CN113050985B CN 113050985 B CN113050985 B CN 113050985B CN 202110417400 A CN202110417400 A CN 202110417400A CN 113050985 B CN113050985 B CN 113050985B
Authority
CN
China
Prior art keywords
plug
engineering
parameter
dependency
list
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.)
Active
Application number
CN202110417400.2A
Other languages
Chinese (zh)
Other versions
CN113050985A (en
Inventor
刘泱
杨再同
詹娇淑
沈聪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110417400.2A priority Critical patent/CN113050985B/en
Publication of CN113050985A publication Critical patent/CN113050985A/en
Application granted granted Critical
Publication of CN113050985B publication Critical patent/CN113050985B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application provides a front-end engineering dependent automatic registration method and device, which can also be used in the financial field, and the method comprises the following steps: receiving a front-end engineering starting instruction sent by a user, and screening engineering dependency information in an engineering dependency information file according to a set naming rule to obtain a plug-in list; performing plug-in registration operation according to parameter configuration information corresponding to each plug-in the plug-in list and a plug-in calling interface to obtain front-end engineering for completing the plug-in registration operation; according to the method and the device, the fact that a developer adds redundant codes in engineering entrance files when introducing npm package plug-ins can be effectively avoided, the maintainability of the codes is improved, and meanwhile unnecessary errors are avoided being introduced when registering codes are manually added.

Description

Front-end engineering dependency automatic registration method and device
Technical Field
The application relates to the field of front-end development and also can be used in the financial field, in particular to a front-end engineering dependent automatic registration method and device.
Background
In the development process of a large front-end project, some basic functions affecting the global situation are generally extracted and packaged into npm packages (npm is a package management tool installed along with nodejs, npm is generally used as a dependency management tool of the front-end project in the modern front-end field, a package json file exists under a project root path in the front-end project using npm, some basic information of the project is described in the package file, including project names, version numbers, authors, abstract information, execution scripts, dependency package information and the like, and the basic functions are introduced into the project in a plug-in manner, so that the basic functions and service codes can be decoupled, and the multiplexing difficulty of the basic functions among different projects is reduced.
For such npm package inserts in the prior art, the typical introduction is: (1) adding the corresponding dependency of the plugin using npm instruction; (2) The registration code for the plug-in is manually added within the engineering portal file.
The inventor found that when the number of plug-ins introduced into the front-end engineering is large, the registration codes added to the engineering portal file in the above (2) cause the portal file to become more difficult to maintain, because the registration logic of such plug-ins is generally different in size, so that unnecessary redundant codes exist in the registration codes.
Disclosure of Invention
Aiming at the problems in the prior art, the application provides a front-end engineering dependent automatic registration method and device, which can effectively avoid that a developer adds redundant codes in engineering entry files when introducing npm package plug-ins, improve the maintainability of the codes and avoid introducing unnecessary errors when manually adding registration codes.
In order to solve at least one of the above problems, the present application provides the following technical solutions:
in a first aspect, the present application provides a front-end engineering dependent automatic registration method, including:
receiving a front-end engineering starting instruction sent by a user, and screening engineering dependency information in an engineering dependency information file according to a set naming rule to obtain a plug-in list;
and carrying out plug-in registration operation according to the parameter configuration information corresponding to each plug-in the plug-in list and the plug-in calling interface to obtain front-end engineering for completing the plug-in registration operation.
Further, the filtering the engineering dependency information in the engineering dependency information file according to the set naming rule to obtain a plug-in list includes:
reading engineering dependency information in an engineering dependency information file to obtain a dependency object containing an engineering dependency name;
traversing the dependent objects, carrying out regular expression matching on engineering dependent names in the dependent objects according to a set naming rule, and obtaining a plug-in list according to the passing result of the regular expression matching.
Further, the performing the plug-in registration operation according to the parameter configuration information and the plug-in call interface corresponding to each plug-in the plug-in list includes:
packaging the main configuration object interface of the front-end engineering to obtain a plug-in calling interface;
and taking the plug-in calling interface as a first parameter, taking parameter configuration information corresponding to each plug-in the plug-in list as a second parameter, and calling a corresponding plug-in registration method of each plug-in to perform plug-in registration operation according to the first parameter and the second parameter.
Further, the taking the parameter configuration information corresponding to each plug-in the plug-in list as the second parameter further includes:
judging whether the parameter configuration information corresponding to each plug-in the plug-in list contains a custom configuration object or not; if yes, the custom configuration object is used as a second parameter.
In a second aspect, the present application provides a front-end engineering dependent automatic registration apparatus, including:
the plug-in loading module is used for receiving a front-end engineering starting instruction sent by a user, and screening engineering dependency information in the engineering dependency information file according to a set naming rule to obtain a plug-in list;
and the plug-in registration module is used for carrying out plug-in registration operation according to the parameter configuration information corresponding to each plug-in the plug-in list and the plug-in calling interface to obtain front-end engineering for completing the plug-in registration operation.
Further, the plug-in loading module includes:
the dependency reading unit is used for reading the engineering dependency information in the engineering dependency information file to obtain a dependency object containing an engineering dependency name;
the dependency screening unit is used for traversing the dependency objects, carrying out regular expression matching on engineering dependency names in the dependency objects according to a set naming rule, and obtaining a plug-in list according to the passing result of the regular expression matching.
Further, the plug-in registration module includes:
the plug-in calling interface packaging unit is used for packaging the main configuration object interface of the front-end engineering to obtain a plug-in calling interface;
the registration method calling unit is used for taking the plug-in calling interface as a first parameter, taking parameter configuration information corresponding to each plug-in the plug-in list as a second parameter, and calling a plug-in registration method corresponding to each plug-in according to the first parameter and the second parameter to perform plug-in registration operation.
Further, the registration method calling unit includes:
the custom configuration parameter processing subunit is used for judging whether the parameter configuration information corresponding to each plug-in the plug-in list contains a custom configuration object or not; if yes, the custom configuration object is used as a second parameter.
In a third aspect, the present application provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the front-end engineering dependent auto-registration method when the program is executed.
In a fourth aspect, the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the front-end engineering dependent automatic registration method.
According to the technical scheme, the front-end engineering dependency automatic registration method and device are provided, the engineering dependency information in the engineering dependency information file is screened to obtain the plug-in list, and then plug-in registration operation is automatically carried out according to parameter configuration information corresponding to each plug-in the plug-in list and a plug-in calling interface, so that a developer can be effectively prevented from adding redundant codes in the engineering entry file when introducing npm package plug-ins, the maintainability of the codes is improved, and meanwhile unnecessary errors caused when manually adding registration codes can be avoided.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a front end engineering dependent automatic registration method according to an embodiment of the present application;
FIG. 2 is a second flow chart of the front end project dependent automatic registration method according to the embodiment of the present application;
FIG. 3 is a third flow chart of the front end project dependent automatic registration method according to the embodiment of the present application;
FIG. 4 is one of the block diagrams of the front-end engineering dependent automatic registration device in an embodiment of the present application;
FIG. 5 is a second block diagram of a front end engineering dependent auto registration apparatus in an embodiment of the present application;
FIG. 6 is a third block diagram of a front end engineering dependent auto registration apparatus in an embodiment of the present application;
FIG. 7 is a diagram of a front end engineering dependent auto registration apparatus in an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
In consideration of the problem that when the number of plug-ins introduced into front-end engineering is large in the prior art, the entry files become difficult to maintain due to the registration codes added into engineering entry files, the application provides a front-end engineering dependence automatic registration method and device.
In order to effectively avoid adding redundant codes in engineering entry files when a developer introduces npm package plug-ins, improve code maintainability, and avoid introducing unnecessary errors when manually adding registration codes, the application provides an embodiment of a front-end engineering dependent automatic registration method, referring to fig. 1, wherein the front-end engineering dependent automatic registration method specifically comprises the following contents:
step S101: and receiving a front-end engineering starting instruction sent by a user, and screening engineering dependency information in the engineering dependency information file according to a set naming rule to obtain a plug-in list.
It can be understood that the present application can obtain the engineering dependency information of the current engineering from the engineering dependency information file, and because the engineering dependency information includes all the dependency information in the engineering, the present application can further screen the plug-in information to be registered according to the agreed naming rules to obtain the plug-in list.
Step S102: and carrying out plug-in registration operation according to the parameter configuration information corresponding to each plug-in the plug-in list and the plug-in calling interface to obtain front-end engineering for completing the plug-in registration operation.
It can be understood that after the parameter configuration information corresponding to each plug-in the engineering is read, the parameter configuration information can be sequentially used as a parameter to call the registration method of the plug-in, and in order to improve the flexibility of the plug-in, the application can expose the related object in the engineering to the registration method of the plug-in a form of a plug-in call interface.
As can be seen from the above description, the front-end engineering dependent automatic registration method provided by the embodiment of the present application can obtain the plug-in list by screening the engineering dependent information in the engineering dependent information file, and then automatically perform the plug-in registration operation according to the parameter configuration information and the plug-in call interface corresponding to each plug-in the plug-in list, thereby effectively avoiding the developer from adding redundant codes in the engineering entry file when introducing npm package plug-ins, improving the maintainability of the codes, and avoiding unnecessary errors when manually adding the registration codes.
In order to accurately screen the project dependent information in the project dependent information file, in an embodiment of the front end project dependent automatic registration method of the present application, referring to fig. 2, the step S101 may further specifically include the following:
step S201: and reading the engineering dependency information in the engineering dependency information file to obtain a dependency object containing the engineering dependency name.
Step S202: traversing the dependent objects, carrying out regular expression matching on engineering dependent names in the dependent objects according to a set naming rule, and obtaining a plug-in list according to the passing result of the regular expression matching.
Optionally, since the plugin is also part of the npm dependency, the plugin and other engineering dependency information are stored together in the engineering dependency information file, so the plugin can be distinguished from other engineering dependencies by a special naming mode.
Specifically, in order to avoid the repetition of naming other dependent libraries in the community, the application adopts a specific naming mode to name the plug-in, for example, the plug-in is named in the mode of @ icbc-plug in/name or icbc-plug in-name, so that the names of the plug-in can be easily identified in the engineering dependent information file.
For example, first, by reading the project dependent information file, an object containing all the project dependent names and version information is obtained, and the structure is as follows:
it can be seen that each specific dependency information is in the form of a "dependency name: the version number' is stored in the object structure, the object is traversed at the moment, regular expression matching is carried out on the dependency names of each piece of dependency information, and the dependencies meeting naming standards are screened out, wherein the dependencies are plug-ins. An array with the plug-in name as an element is obtained after screening, for example, an array [ "@ icbc-plug in/micro-front" ] can be obtained after screening in the above example.
In order to automatically complete the plug-in registration operation, in an embodiment of the front-end engineering dependent automatic registration method of the present application, referring to fig. 3, the step S102 may specifically further include the following:
step S301: and packaging the main configuration object interface of the front-end engineering to obtain a plug-in calling interface.
Step S302: and taking the plug-in calling interface as a first parameter, taking parameter configuration information corresponding to each plug-in the plug-in list as a second parameter, and calling a corresponding plug-in registration method of each plug-in to perform plug-in registration operation according to the first parameter and the second parameter.
Optionally, in order for the plug-in to be able to modify the configuration in the project, the present application may encapsulate the main configuration object interface of the project (including the route, the interface in the global state) into a plug-in call interface (i.e. a plug-in API), and when the plug-in is registered, transmit the plug-in API to the plug-in as the first parameter. Thus in plug-in code, the relevant configuration within the project may be modified in the execution method using the plug-in API as a parameter.
Optionally, for each plugin, the application may acquire parameter configuration information (including configuration items of the plugin and various parameters required for starting, etc.) stored in the project by the current plugin as a second parameter, and call the parameter configuration information and the packaged plugin API as parameters to complete registration by using the registration method of the plugin. After all the plug-ins in the plug-in list are processed, the automatic registration will end the work.
In order to accurately determine the parameter transmission of the registration method during the plug-in registration, in an embodiment of the front-end engineering dependent automatic registration method of the present application, the step S302 may further specifically include the following:
judging whether the parameter configuration information corresponding to each plug-in the plug-in list contains a custom configuration object or not; if yes, the custom configuration object is used as a second parameter.
Meanwhile, some plug-ins have custom configuration, the information of the part is stored in a parameter configuration file of the project in the form of an object, the structure example of the custom configuration of the plug-ins in the configuration file is as follows, and the plug-in name is key, and the value is the custom configuration of the corresponding plug-ins:
the work done by the plug-in registration is to call the entry method of each plug-in turn, read the custom configuration of all plug-ins through the configuration information before the call starts, and when the entry method of the plug-in is called, the corresponding custom configuration is used as the second afferent, and if the custom configuration does not exist, the null value is transmitted. And after the execution of the plug-in entry method is finished, the registration work of the current plug-in is finished.
In order to effectively avoid adding redundant codes in engineering portal files when a developer introduces npm package plug-ins, improve code maintainability, and avoid introducing unnecessary errors when manually adding registration codes, the application provides an embodiment of a front-end engineering dependent automatic registration device for implementing all or part of the content of the front-end engineering dependent automatic registration method, see fig. 4, where the front-end engineering dependent automatic registration device specifically includes the following contents:
and the plug-in loading module 10 is used for receiving a front-end engineering starting instruction sent by a user, and screening engineering dependency information in the engineering dependency information file according to a set naming rule to obtain a plug-in list.
And the plug-in registration module 20 is used for carrying out plug-in registration operation according to the parameter configuration information and the plug-in calling interface corresponding to each plug-in the plug-in list to obtain front-end engineering for completing the plug-in registration operation.
As can be seen from the above description, the front-end engineering dependency automatic registration device provided by the embodiment of the present application can obtain the plug-in list by screening the engineering dependency information in the engineering dependency information file, and then automatically perform the plug-in registration operation according to the parameter configuration information and the plug-in call interface corresponding to each plug-in the plug-in list, thereby effectively avoiding the developer from adding redundant codes in the engineering entry file when introducing npm package plug-ins, improving the maintainability of the codes, and avoiding unnecessary errors when manually adding the registration codes.
In order to accurately screen the project dependency information in the project dependency information file, in an embodiment of the front-end project dependency automatic registration apparatus of the present application, referring to fig. 5, the plug-in loading module 10 includes:
the dependency reading unit 11 is configured to read the engineering dependency information in the engineering dependency information file, and obtain a dependency object including the engineering dependency name.
The dependency filtering unit 12 is configured to traverse the dependent objects, perform regular expression matching on engineering dependency names in the dependent objects according to a set naming rule, and obtain a plug-in list according to a passing result of the regular expression matching.
To enable automatic completion of the plug-in registration operation, in one embodiment of the front end engineering dependent automatic registration apparatus of the present application, referring to fig. 6, the plug-in registration module 20 includes:
and the plug-in calling interface packaging unit 21 is used for packaging the main configuration object interface of the front-end engineering to obtain a plug-in calling interface.
The registration method calling unit 22 is configured to use the plug-in calling interface as a first parameter, use parameter configuration information corresponding to each plug-in the plug-in list as a second parameter, and call a plug-in registration method corresponding to each plug-in according to the first parameter and the second parameter to perform plug-in registration operation.
In order to accurately determine the parameter transmission of the registration method during the registration of the plug-in, in an embodiment of the front-end engineering dependent automatic registration device of the present application, referring to fig. 7, the registration method calling unit 22 includes:
a custom configuration parameter processing subunit 221, configured to determine whether the parameter configuration information corresponding to each plug-in the plug-in list includes a custom configuration object; if yes, the custom configuration object is used as a second parameter.
In order to effectively avoid adding redundant codes in engineering entry files when a developer introduces npm package plug-ins and improve code maintainability and avoid introducing unnecessary errors when manually adding registration codes, the application provides an embodiment of an electronic device for realizing all or part of contents in a front-end engineering dependent automatic registration method, wherein the electronic device specifically comprises the following contents:
a processor (processor), a memory (memory), a communication interface (Communications Interface), and a bus; the processor, the memory and the communication interface complete communication with each other through the bus; the communication interface is used for realizing information transmission between the front-end engineering dependent automatic registration device and related equipment such as a core service system, a user terminal, a related database and the like; the logic controller may be a desktop computer, a tablet computer, a mobile terminal, etc., and the embodiment is not limited thereto. In this embodiment, the logic controller may refer to the embodiment of the front-end engineering dependent automatic registration method in the embodiment, and the embodiment of the front-end engineering dependent automatic registration device, and the content thereof is incorporated herein, and the repetition is omitted.
It is understood that the user terminal may include a smart phone, a tablet electronic device, a network set top box, a portable computer, a desktop computer, a Personal Digital Assistant (PDA), a vehicle-mounted device, a smart wearable device, etc. Wherein, intelligent wearing equipment can include intelligent glasses, intelligent wrist-watch, intelligent bracelet etc..
In practical applications, the front-end engineering may be performed on the electronic device side as described above, or all operations may be performed in the client device. Specifically, the selection may be made according to the processing capability of the client device, and restrictions of the use scenario of the user. The present application is not limited in this regard. If all operations are performed in the client device, the client device may further include a processor.
The client device may have a communication module (i.e. a communication unit) and may be connected to a remote server in a communication manner, so as to implement data transmission with the server. The server may include a server on the side of the task scheduling center, and in other implementations may include a server of an intermediate platform, such as a server of a third party server platform having a communication link with the task scheduling center server. The server may include a single computer device, a server cluster formed by a plurality of servers, or a server structure of a distributed device.
Fig. 8 is a schematic block diagram of a system configuration of an electronic device 9600 of an embodiment of the present application. As shown in fig. 8, the electronic device 9600 may include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. Notably, this fig. 8 is exemplary; other types of structures may also be used in addition to or in place of the structures to implement telecommunications functions or other functions.
In one embodiment, the front end engineering dependent auto registration method functionality may be integrated into the central processor 9100. The central processor 9100 may be configured to perform the following control:
step S101: and receiving a front-end engineering starting instruction sent by a user, and screening engineering dependency information in the engineering dependency information file according to a set naming rule to obtain a plug-in list.
Step S102: and carrying out plug-in registration operation according to the parameter configuration information corresponding to each plug-in the plug-in list and the plug-in calling interface to obtain front-end engineering for completing the plug-in registration operation.
As can be seen from the above description, in the electronic device provided by the embodiment of the present application, the engineering dependency information in the engineering dependency information file is screened to obtain the plug-in list, and then the plug-in registration operation is automatically performed according to the parameter configuration information and the plug-in call interface corresponding to each plug-in the plug-in list, so that a developer can be effectively prevented from adding a redundant code in the engineering entry file when introducing the npm package plug-in, the maintainability of the code is improved, and meanwhile, unnecessary errors caused when manually adding the registration code can be avoided.
In another embodiment, the front-end engineering dependent automatic registration device may be configured separately from the central processor 9100, for example, the front-end engineering dependent automatic registration device may be configured as a chip connected to the central processor 9100, and the front-end engineering dependent automatic registration method function is implemented by control of the central processor.
As shown in fig. 8, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is noted that the electronic device 9600 need not include all of the components shown in fig. 8; in addition, the electronic device 9600 may further include components not shown in fig. 8, and reference may be made to the related art.
As shown in fig. 8, the central processor 9100, sometimes referred to as a controller or operational control, may include a microprocessor or other processor device and/or logic device, which central processor 9100 receives inputs and controls the operation of the various components of the electronic device 9600.
The memory 9140 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information about failure may be stored, and a program for executing the information may be stored. And the central processor 9100 can execute the program stored in the memory 9140 to realize information storage or processing, and the like.
The input unit 9120 provides input to the central processor 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used for displaying display objects such as images and characters. The display may be, for example, but not limited to, an LCD display.
The memory 9140 may be a solid state memory such as Read Only Memory (ROM), random Access Memory (RAM), SIM card, etc. But also a memory which holds information even when powered down, can be selectively erased and provided with further data, an example of which is sometimes referred to as EPROM or the like. The memory 9140 may also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application/function storage portion 9142, the application/function storage portion 9142 storing application programs and function programs or a flow for executing operations of the electronic device 9600 by the central processor 9100.
The memory 9140 may also include a data store 9143, the data store 9143 for storing data, such as contacts, digital data, pictures, sounds, and/or any other data used by an electronic device. The driver storage portion 9144 of the memory 9140 may include various drivers of the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging applications, address book applications, etc.).
The communication module 9110 is a transmitter/receiver 9110 that transmits and receives signals via an antenna 9111. A communication module (transmitter/receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, as in the case of conventional mobile communication terminals.
Based on different communication technologies, a plurality of communication modules 9110, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, etc., may be provided in the same electronic device. The communication module (transmitter/receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and to receive audio input from the microphone 9132 to implement usual telecommunications functions. The audio processor 9130 can include any suitable buffers, decoders, amplifiers and so forth. In addition, the audio processor 9130 is also coupled to the central processor 9100 so that sound can be recorded locally through the microphone 9132 and sound stored locally can be played through the speaker 9131.
The embodiments of the present application further provide a computer readable storage medium capable of implementing all the steps in the front end engineering dependent automatic registration method in which the execution subject in the above embodiment is a server or a client, and the computer readable storage medium stores a computer program thereon, where the computer program when executed by a processor implements all the steps in the front end engineering dependent automatic registration method in which the execution subject in the above embodiment is a server or a client, for example, the processor implements the following steps when executing the computer program:
step S101: and receiving a front-end engineering starting instruction sent by a user, and screening engineering dependency information in the engineering dependency information file according to a set naming rule to obtain a plug-in list.
Step S102: and carrying out plug-in registration operation according to the parameter configuration information corresponding to each plug-in the plug-in list and the plug-in calling interface to obtain front-end engineering for completing the plug-in registration operation.
As can be seen from the above description, the computer readable storage medium provided in the embodiments of the present application obtains a plug-in list by screening engineering dependency information in an engineering dependency information file, and then automatically performs plug-in registration operation according to parameter configuration information corresponding to each plug-in the plug-in list and a plug-in call interface, thereby effectively avoiding a developer from adding redundant codes in an engineering entry file when introducing npm package plug-ins, improving code maintainability, and avoiding unnecessary errors when manually adding registration codes.
It will be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The principles and embodiments of the present invention have been described in detail with reference to specific examples, which are provided to facilitate understanding of the method and core ideas of the present invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.

Claims (6)

1. A front-end engineering dependent automatic registration method, the method comprising:
receiving a front-end engineering starting instruction sent by a user, and screening engineering dependency information in an engineering dependency information file according to a set naming rule to obtain a plug-in list;
performing plug-in registration operation according to parameter configuration information corresponding to each plug-in the plug-in list and a plug-in calling interface to obtain front-end engineering for completing the plug-in registration operation;
screening the engineering dependency information in the engineering dependency information file according to a set naming rule to obtain a plug-in list, wherein the method comprises the following steps:
reading engineering dependency information in an engineering dependency information file to obtain a dependency object containing an engineering dependency name;
traversing the dependent objects, carrying out regular expression matching on engineering dependent names in each dependent object according to a set naming rule, and obtaining a plug-in list according to the passing result of the regular expression matching;
the operation of plug-in registration according to the parameter configuration information and the plug-in calling interface corresponding to each plug-in the plug-in list comprises the following steps:
packaging the main configuration object interface of the front-end engineering to obtain a plug-in calling interface;
and taking the plug-in calling interface as a first parameter, taking parameter configuration information corresponding to each plug-in the plug-in list as a second parameter, and calling a corresponding plug-in registration method of each plug-in to perform plug-in registration operation according to the first parameter and the second parameter.
2. The front-end engineering dependent automatic registration method according to claim 1, wherein the taking parameter configuration information corresponding to each plug-in the plug-in list as the second parameter further comprises:
judging whether the parameter configuration information corresponding to each plug-in the plug-in list contains a custom configuration object or not; if yes, the custom configuration object is used as a second parameter.
3. A front-end engineering dependent automatic registration device, comprising:
the plug-in loading module is used for receiving a front-end engineering starting instruction sent by a user, and screening engineering dependency information in the engineering dependency information file according to a set naming rule to obtain a plug-in list;
the plug-in registration module is used for carrying out plug-in registration operation according to the parameter configuration information corresponding to each plug-in the plug-in list and the plug-in calling interface to obtain front-end engineering for completing the plug-in registration operation;
the plug-in loading module comprises:
the dependency reading unit is used for reading the engineering dependency information in the engineering dependency information file to obtain a dependency object containing an engineering dependency name;
the dependency screening unit is used for traversing the dependency objects, carrying out regular expression matching on engineering dependency names in the dependency objects according to a set naming rule, and obtaining a plug-in list according to a passing result of the regular expression matching;
the plug-in registration module comprises:
the plug-in calling interface packaging unit is used for packaging the main configuration object interface of the front-end engineering to obtain a plug-in calling interface;
the registration method calling unit is used for taking the plug-in calling interface as a first parameter, taking parameter configuration information corresponding to each plug-in the plug-in list as a second parameter, and calling a plug-in registration method corresponding to each plug-in according to the first parameter and the second parameter to perform plug-in registration operation.
4. The front-end engineering dependent automatic registration apparatus according to claim 3, wherein the registration method calling unit includes:
the custom configuration parameter processing subunit is used for judging whether the parameter configuration information corresponding to each plug-in the plug-in list contains a custom configuration object or not; if yes, the custom configuration object is used as a second parameter.
5. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the front-end engineering-dependent automatic registration method of any one of claims 1 to 2 when the program is executed by the processor.
6. A computer readable storage medium having stored thereon a computer program, characterized in that the computer program when executed by a processor implements the steps of the front-end engineering dependent automatic registration method of any of claims 1 to 2.
CN202110417400.2A 2021-04-19 2021-04-19 Front-end engineering dependency automatic registration method and device Active CN113050985B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110417400.2A CN113050985B (en) 2021-04-19 2021-04-19 Front-end engineering dependency automatic registration method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110417400.2A CN113050985B (en) 2021-04-19 2021-04-19 Front-end engineering dependency automatic registration method and device

Publications (2)

Publication Number Publication Date
CN113050985A CN113050985A (en) 2021-06-29
CN113050985B true CN113050985B (en) 2024-02-06

Family

ID=76519814

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110417400.2A Active CN113050985B (en) 2021-04-19 2021-04-19 Front-end engineering dependency automatic registration method and device

Country Status (1)

Country Link
CN (1) CN113050985B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114489853A (en) * 2022-01-21 2022-05-13 阿里巴巴(中国)有限公司 Plug-in registration method, electronic device and computer-readable storage medium
CN114661373A (en) * 2022-03-10 2022-06-24 无线生活(杭州)信息科技有限公司 Fusion method and device for multiple engineering tools

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110209442A (en) * 2019-05-29 2019-09-06 掌阅科技股份有限公司 Plug-in unit function automatic execution method, electronic equipment, storage medium
CN111290753A (en) * 2020-01-20 2020-06-16 远光软件股份有限公司 Method, device, equipment and storage medium for building front-end development environment
CN111897520A (en) * 2020-07-31 2020-11-06 平安科技(深圳)有限公司 Front-end project framework construction method and device, computer equipment and storage medium
CN111966422A (en) * 2020-07-15 2020-11-20 北京爱知之星科技股份有限公司 Localized plug-in service method and device, electronic equipment and storage medium
CN112214219A (en) * 2019-06-24 2021-01-12 腾讯科技(深圳)有限公司 Component processing method and device, server and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110209442A (en) * 2019-05-29 2019-09-06 掌阅科技股份有限公司 Plug-in unit function automatic execution method, electronic equipment, storage medium
CN112214219A (en) * 2019-06-24 2021-01-12 腾讯科技(深圳)有限公司 Component processing method and device, server and storage medium
CN111290753A (en) * 2020-01-20 2020-06-16 远光软件股份有限公司 Method, device, equipment and storage medium for building front-end development environment
CN111966422A (en) * 2020-07-15 2020-11-20 北京爱知之星科技股份有限公司 Localized plug-in service method and device, electronic equipment and storage medium
CN111897520A (en) * 2020-07-31 2020-11-06 平安科技(深圳)有限公司 Front-end project framework construction method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN113050985A (en) 2021-06-29

Similar Documents

Publication Publication Date Title
CN111031058A (en) Websocket-based distributed server cluster interaction method and device
CN113050985B (en) Front-end engineering dependency automatic registration method and device
CN112463634B (en) Software testing method and device under micro-service architecture
CN110781373B (en) List updating method and device, readable medium and electronic equipment
CN111679790A (en) Remote software development storage space distribution method and device
CN110597602B (en) Transaction processing method and device, computer equipment and storage medium
CN114257532B (en) Method and device for detecting state of server
CN110336592B (en) Data transmission method suitable for Bluetooth card reader, electronic equipment and storage medium
CN111767558B (en) Data access monitoring method, device and system
CN111367561B (en) Remote development method and device for software program
CN113791984B (en) Automatic interface testing method and device
CN114285657B (en) Firewall security policy change verification method and device
CN115562898A (en) Distributed payment system exception handling method and device
CN113050936B (en) Front-end data processing method and device based on integrated development environment
CN112734545B (en) Block chain data sharing method, device and system
CN114637531A (en) Method and device for dynamically generating application program interface
CN114490402A (en) Method and device for checking validity of message field
CN114374614A (en) Network topology configuration method and device
CN111782366A (en) Distributed task scheduling method and device
CN111818144B (en) Message transmission method, device and system under remote service calling framework
CN113050937A (en) Front-end data processing method and device based on command line
CN114244830B (en) File gateway application nonfunctional testing method and system
CN114255581B (en) Spacecraft remote control instruction comparison method and device
CN115936652A (en) To-do work data processing method and device
CN109451152B (en) Information transmission method and system based on mobile terminal

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
GR01 Patent grant
GR01 Patent grant