CN112732228A - System suitable for realizing quick query of constructed information in production environment - Google Patents

System suitable for realizing quick query of constructed information in production environment Download PDF

Info

Publication number
CN112732228A
CN112732228A CN202011636465.8A CN202011636465A CN112732228A CN 112732228 A CN112732228 A CN 112732228A CN 202011636465 A CN202011636465 A CN 202011636465A CN 112732228 A CN112732228 A CN 112732228A
Authority
CN
China
Prior art keywords
webpack
information
plugin
module
git
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
Application number
CN202011636465.8A
Other languages
Chinese (zh)
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.)
Guotai Junan Securities Co Ltd
Original Assignee
Guotai Junan Securities Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guotai Junan Securities Co Ltd filed Critical Guotai Junan Securities Co Ltd
Priority to CN202011636465.8A priority Critical patent/CN112732228A/en
Publication of CN112732228A publication Critical patent/CN112732228A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • G06F21/554Detecting local intrusion or implementing counter-measures involving event detection and direct action
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

Landscapes

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

Abstract

The invention relates to a system for realizing quick query of construction information in a production environment, which comprises a webpack plugin, wherein the webpack plugin comprises a hot key activation logic module, a git subprocess module, a derived file process module and a webpack event monitor module, the hot key activation logic module, the git subprocess module, the derived file process module and the webpack event monitor module are sequentially connected, the webpack plugin injects relevant information into a generated program package in the construction stage of git branches, a browser developer tool is opened through a shortcut key, and the git information of local build and the current build positioning information are checked according to user-defined configuration. The system for realizing the quick query of the construction information in the production environment solves the problem that a large number of development branches are required to be newly built in the widely used Github flow work flow, and the system is packed and provided for the back end to be jointly debugged and tested and the function is checked and accepted, so that confusion is easy to occur in the process, the development cost is increased, and the development efficiency is reduced.

Description

System suitable for realizing quick query of constructed information in production environment
Technical Field
The invention relates to the field of program development, in particular to the field of front-end development, and specifically relates to a system for realizing quick query of construction information in a production environment.
Background
More and more front-end development teams follow the Github flow workflow in the development process, namely, newly-built branch- > submit modification- > create PR- > code review- > deploy merging. It is a common development scenario for a front-end engineer to create multiple branches on git for developing different functions, and the front end may need to pack multiple branches including different functions respectively and provide them to a back end for front-end and back-end joint debugging, or provide them to a test for function acceptance. One consequence of this is that the back end and the test have a plurality of packed results provided by the front end, which are often confused in the joint debugging and the test, which greatly increases the joint debugging cost and the communication cost, reduces the work efficiency, and affects the development progress.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a system which has clear configuration information, is simple to implement and has a wide application range and is suitable for realizing quick query of construction information in a production environment.
In order to achieve the above object, the system for implementing quick query of construction information in a production environment of the present invention is as follows:
the system is mainly characterized by comprising a webpack plugin, wherein the webpack plugin comprises a hot key activation logic module, a git subprocess module, a derived file process module and a webpack event monitor module, the hot key activation logic module, the git subprocess module, the derived file process module and the webpack event monitor module are sequentially connected, the webpack plugin injects relevant information into a generated program package in the git branch construction stage, a browser developer tool is opened through a shortcut key, and the git information of a local build and the current build positioning information are checked according to user-defined configuration.
Preferably, the webpack plugin is internally provided with default configuration attributes and provides custom configuration options.
Preferably, the system further comprises a builder object and a building object, wherein the builder object is used for the complete webpack environment configuration, and the building object is used for constructing the resource version.
Preferably, the compiler object is built once when the webpack plugin is started, and all operable settings are configured, and the webpack plugin receives a reference of the compiler object and is used for accessing the main environment of the webpack.
Preferably, the compilation object is created when the webpack development environment middleware is operated and a file change is detected, and a set of new compilation resources are generated; the compilation object contains current module resources, compilation generation resources and changed files, and tracked dependency state information.
Preferably, the webpack plugin detects the security of a git command configured by a user before executing a process, if the user configuration command contains invasive operation, an exception is thrown, and the webpack plugin terminates execution; if the command detection passes, the git sub-process module continues execution.
Preferably, when the system displays the construction information by triggering the hotkey, the webpack plugin continues to monitor the relevant events, and the logic activated by the hotkey is injected into the index.
Preferably, when the system exports the construction information, the webpack plug-in starts a new node sub-process and exports the construction information to a file designated by a user.
The invention is suitable for realizing the system for quickly inquiring the construction information in the production environment, solves the problem that a large number of development branches are required to be newly built in the widely used Github flow work flow, packs the development branches respectively and provides the development branches for joint debugging and function acceptance check of the back end and the test, and is easy to be confused in the process, thereby increasing the development cost and reducing the development efficiency.
Drawings
FIG. 1 is a diagram of a plug-in component of a system for implementing a build information rapid query in a production environment according to the present invention.
FIG. 2 is a schematic diagram of the operation of the system for implementing the quick query of the build information in the production environment according to the present invention.
Detailed Description
In order to more clearly describe the technical contents of the present invention, the following further description is given in conjunction with specific embodiments.
The system for realizing the quick query of the constructed information in the production environment comprises a webpack plugin, wherein the webpack plugin comprises a hot key activation logic module, a git subprocess module, a derived file progress module and a webpack event monitor module, the hot key activation logic module, the git subprocess module, the derived file progress module and the webpack event monitor module are sequentially connected, the webpack plugin injects relevant information into a generated program package in the construction stage of git branches, a browser developer tool is opened through a shortcut key, and the git information of the local build and the current build positioning information are checked according to user-defined configuration.
As a preferred embodiment of the invention, the webpack plug-in is internally provided with default configuration attributes and provides custom configuration options.
As a preferred embodiment of the present invention, the system further includes a compiler object and a composition object, where the compiler object is used for a complete webpack environment configuration, and the composition object is used for constructing a resource version.
As a preferred embodiment of the present invention, the compiler object is built once when the webpack plugin is started, and all the operable settings are configured, and the webpack plugin receives a reference of the compiler object and is used to access the main environment of the webpack.
As a preferred embodiment of the invention, the compilation object is created when the webpack development environment middleware is operated and a file change is detected, and a set of new compilation resources are generated; the compilation object contains current module resources, compilation generation resources and changed files, and tracked dependency state information.
As a preferred embodiment of the present invention, the webpack plugin detects the security of a git command configured by a user before executing a process, if the user configuration command includes an invasive operation, an exception is thrown, and the webpack plugin terminates execution; if the command detection passes, the git sub-process module continues execution.
As a preferred embodiment of the present invention, when the system displays the build information by triggering the hotkey, the webpack plugin continues to monitor the relevant events, and the logic of hotkey activation is injected into the index.
In the system, when the building information is exported, the webpack plug-in starts a new node sub-process and exports the building information to a file specified by a user.
In the specific embodiment of the invention, based on the fact that the static module packager webpack4 which has become a front-end development and construction standard configuration, the construction process is expanded in the form of a webpack plugin (plugin), so as to quickly view git information of the local build and quickly locate which submission the current build is based on. Meanwhile, abundant configuration options are provided, so that a user can select different display modes to construct information according to the conditions of the project of the user.
A method for quickly inquiring and constructing information in a production environment is characterized in that a construction process is expanded in a webpack plug-in (plugin) mode, and the method is used for quickly checking git information of local build in a safe mode and quickly positioning which submission is based on the current build. Meanwhile, abundant configuration options are provided, so that a user can select different display modes to construct information according to the conditions of the project of the user.
The Webpack plug-ins are used for expanding the Webpack function, and can take effect in the whole construction process and execute related tasks. The insert is composed of the following parts: a. hotkey activation logic b.git subprocess c.process to export files d.webpack event listener.
The plug-in selects the initial stage of the lifecycle in the webpack construction process, instantiates the plug-in to inject the user-defined configuration, and then shows the user in a file or hot key mode by calling up the node subprocess and according to the user-defined configuration in the compilation stage of the lifecycle.
In order to increase the usability of the plug-in, default configuration attributes are built in according to the use habits of front-end developers. The main default configurations include: and showing the latest piece of submission information and the construction time in the browser console interface by using a hot key Ctrl + Shift + Enter. In addition, the user can select custom configuration to obtain information meeting the special requirements of the project. Such as custom hotkeys or outputting richer git information in file form.
For project security, operation class git commands will not be allowed, such as pull, push, merge, commit, add, etc.
The invention mainly solves the problems that: in the widely used Github flow work flow, a large number of development branches need to be newly built, are respectively packaged and provided for the back end to be jointly adjusted with the test and the function acceptance, and are very easy to be confused in the process, so that the development cost is increased, and the development efficiency is reduced.
The solution proposed by the invention is to provide a webpack plug-in, and to inject the branch related information into the finally generated package during the construction phase of the git branch. After the building is completed, the webpage is opened, a shortcut key (default ctrl + shift + Enter) is input, a browser developer tool is opened, and the latest git commit id or more detailed content of the current build can be seen in the console.
The functions provided by the invention are provided in a configuration form, and the configuration items comprise the following:
hotKeyDelimiter:‘+’
the shortcut separator is default to ' + ', and the user can set itself to ' - ', ' and so on.
hotKey:'ctrl+shift+13'
By setting the hot key, the user can define the shortcut key to avoid the conflict with the existing shortcut key of the project. The shortcuts currently supported are any combination of Ctrl or Shift or Alt plus the keyCode of the keyboard, such as 13 for the Enter key (Enter).
info:'id'||'branch'||'detail'
With info configuration, a user can select info information presented in an item. Currently, three forms of id, branch and detail are supported.
show:'console'||'file'||'both'
Default to console, i.e. git information is only displayed by using shortcut keys through console in the developer tool.
If set as file, git information will be exported to the file gitInfo.md and cannot be displayed in the console by using the shortcut key.
If the booth is set, the container mode and the file mode are simultaneously opened.
command:”
By default no value is assigned, only the options in the info option provided by the plug-in are used. The info configuration item will fail after the user can configure the custom git command through the command.
Warning: not to use an operational command, such as 'pull', 'add', 'delete', 'reverse', 'merge', etc., otherwise the compilation process will throw an error.
filename:'gitInfo'
The user can customize the file name of the export git information, the default value is ' gitInfo ', and the export file is ' gitInfo.
The invention expands the webpack function in a plug-in mode. The insert is made up of the following parts (see fig. 1):
A. hotkey activation logic
B. Process to invoke git
C. Process for exporting files
D. Webpack event listener
The invention relies on the builder and the composition objects in webpack.
The compiler object represents the complete webpack environment configuration. The object is built once when webpack is started and all operational settings are configured, including the plug-in described in the invention. The webpack plug-in will receive a reference to this compiler object. It can be used to access the webpack's main environment.
The composition object represents a one-time resource version build. When webpack development environment middleware is run, whenever a file change is detected, a new compilation is created, generating a new set of compiled resources. A composition object represents current module resources, compilation generation resources, changed files, and state information of tracked dependencies. The composition object also provides a plurality of callback time critical occasions for the webpack plug-in to choose to use when the webpack plug-in performs custom processing.
As shown in an operation schematic diagram of a webpack plugin in fig. 2, when a webpack object is constructed, a 'compatibility' event is sent out, at this time, a gitride sub-process in the webpack plugin is called, and relevant information constructed by a user at this time is generated by combining the configuration of the user in the webpack plugin.
Before the sub-process is run, the security of the git command configured by the user is detected. If the user configuration command contains the intrusive operations of pull, merge, fetch and the like, an exception is thrown, and the webpack plug-in terminates execution. If the command detection passes, the git sub-process continues execution.
If the user selects to display the construction information by triggering the hot key, the webpack plugin continues to monitor the related events of the html webpack plugin depended on, and the logic activated by the hot key is injected into the index.
If the user chooses to export the build information, the webpack plugin will launch a new node sub-process, exporting the build information to the file specified by the user.
The invention has the characteristics of clear configuration information and simple implementation. Specific uses can be seen as follows:
Figure BDA0002878580000000051
Figure BDA0002878580000000061
the invention is suitable for realizing the system for quickly inquiring the construction information in the production environment, solves the problem that a large number of development branches are required to be newly built in the widely used Github flow work flow, packs the development branches respectively and provides the development branches for joint debugging and function acceptance check of the back end and the test, and is easy to be confused in the process, thereby increasing the development cost and reducing the development efficiency.
In this specification, the invention has been described with reference to specific embodiments thereof. It will, however, be evident that various modifications and changes may be made thereto without departing from the broader spirit and scope of the invention. The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense.

Claims (8)

1. The system is characterized by comprising a webpack plugin, wherein the webpack plugin comprises a hot key activation logic module, a git subprocess module, a derived file process module and a webpack event monitor module which are sequentially connected, the webpack plugin injects relevant information into a generated program package at the construction stage of git branches, a browser developer tool is opened through a shortcut key, and git information of local build and current build positioning information are checked according to user-defined configuration.
2. The system of claim 1, wherein the webpack plugin embeds default configuration properties and provides custom configuration options.
3. The system for implementing the build information fast query in the production environment as claimed in claim 1, wherein said system further comprises a compiler object and a composition object, said compiler object is used for the complete webpack environment configuration, and said composition object is used for building the resource version.
4. The system for implementing build information quick query in production environment as claimed in claim 3, wherein said compiler object is built once when starting webpack plugin, and configures all operational settings, and said webpack plugin receives reference of the compiler object for accessing webpack main environment.
5. The system for implementing the build information fast query in the production environment as claimed in claim 3, wherein the compilation object is created when the webpack development environment middleware is run and a file change is detected, and a new set of compilation resources is generated; the compilation object contains current module resources, compilation generation resources and changed files, and tracked dependency state information.
6. The system for realizing the rapid query of the build information in the production environment according to claim 1, wherein the webpack plugin detects the security of the git command configured by the user before executing the process, if the user configuration command contains invasive operation, an exception is thrown, and the webpack plugin terminates the execution; if the command detection passes, the git sub-process module continues execution.
7. The system for realizing the rapid query of the construction information in the production environment according to claim 1, wherein when the system displays the construction information by triggering the hotkey, the webpack plugin continues to monitor the relevant events, and the logic of hotkey activation is injected into the index.
8. The system for implementing quick query of build information in production environment as claimed in claim 1, wherein when the system exports build information, the webpack plug-in starts a new node sub-process to export the build information to a file specified by a user.
CN202011636465.8A 2020-12-31 2020-12-31 System suitable for realizing quick query of constructed information in production environment Pending CN112732228A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011636465.8A CN112732228A (en) 2020-12-31 2020-12-31 System suitable for realizing quick query of constructed information in production environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011636465.8A CN112732228A (en) 2020-12-31 2020-12-31 System suitable for realizing quick query of constructed information in production environment

Publications (1)

Publication Number Publication Date
CN112732228A true CN112732228A (en) 2021-04-30

Family

ID=75608685

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011636465.8A Pending CN112732228A (en) 2020-12-31 2020-12-31 System suitable for realizing quick query of constructed information in production environment

Country Status (1)

Country Link
CN (1) CN112732228A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106843869A (en) * 2017-01-16 2017-06-13 百融(北京)金融信息服务股份有限公司 A kind of front end Development Engineering system and method
CN111427558A (en) * 2020-04-10 2020-07-17 创盛视联数码科技(北京)有限公司 Method for customizing front-end automatic development environment based on webpack

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106843869A (en) * 2017-01-16 2017-06-13 百融(北京)金融信息服务股份有限公司 A kind of front end Development Engineering system and method
CN111427558A (en) * 2020-04-10 2020-07-17 创盛视联数码科技(北京)有限公司 Method for customizing front-end automatic development environment based on webpack

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
匿名: "webpack-插件机制杂记", pages 1 - 10, Retrieved from the Internet <URL:https://cloud.tencent.com/developer/article/1403829> *
匿名: "自制土枪-Webpack4 GitInfoPlugin_webpack git history plugin-CSDN博客", pages 1 - 2, Retrieved from the Internet <URL:https://blog.csdn.net/Napoleonxxx/article/details/82187008> *

Similar Documents

Publication Publication Date Title
CN108027722B (en) Dynamically updating applications in compilation and deployment
US6633888B1 (en) Method and apparatus for visually creating and testing object oriented components
EP1552385B1 (en) Providing dynamic model-code associativity
Burnette Eclipse IDE Pocket Guide: Using the Full-Featured IDE
US20140359569A1 (en) Graphical function specialization
US8726233B1 (en) System and method of using an active link in a state programming environment to locate an element
US7761859B2 (en) Application development environment with features for aiding a user in writing function calls
JP2003208330A (en) Electronic test system and method for creating its software program
CN111782513B (en) Satellite ground universal automatic test method based on DLL
WO2017087801A1 (en) Dynamic update of an application in compilation and deployment
Wielenga Beginning netbeans ide: For java developers
CN108614699A (en) A kind of method and system of the continuous integrating Android projects in windows systems
CN112732228A (en) System suitable for realizing quick query of constructed information in production environment
Budinsky et al. Websphere studio overview
CN114253531A (en) Micro-service publishing system
Myatt Pro NetBeans IDE 5.5 enterprise edition
Lenherr et al. ReSet-Entwicklung einer integrierten Settingsanwendung für Linux
Sharan et al. Java Shell
Pipero Redesign and improvement of a test system configuration tool
JP5071251B2 (en) System and method for building a graphical user interface
McCaffrey Reflection-based UI testing
USH2272H1 (en) Code framework for generic data extraction, analysis and reduction
Bussey 1. Object-Oriented Design 2. Software Engineering 3. Eclipse Plug-in
van Breugel Java PathFinder: a tool to detect bugs in Java code
Baar et al. Key quicktour for jml

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