CN118394319A - Method, system, intelligent terminal and storage medium for constructing component demonstration document - Google Patents

Method, system, intelligent terminal and storage medium for constructing component demonstration document Download PDF

Info

Publication number
CN118394319A
CN118394319A CN202410572221.XA CN202410572221A CN118394319A CN 118394319 A CN118394319 A CN 118394319A CN 202410572221 A CN202410572221 A CN 202410572221A CN 118394319 A CN118394319 A CN 118394319A
Authority
CN
China
Prior art keywords
code
component
merging
document
constructing
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
CN202410572221.XA
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.)
Shenzhen Ubtech Technology Co ltd
Original Assignee
Shenzhen Ubtech Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Ubtech Technology Co ltd filed Critical Shenzhen Ubtech Technology Co ltd
Priority to CN202410572221.XA priority Critical patent/CN118394319A/en
Publication of CN118394319A publication Critical patent/CN118394319A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention belongs to the technical field of Web front ends, and discloses a method, a system, an intelligent terminal and a storage medium for constructing a component demonstration document, wherein the method for constructing the component demonstration document comprises the following steps: when a software operating system monitors that a code merging event exists, a document generation command is called to process source codes corresponding to the code merging event so as to judge whether the merging codes corresponding to the code merging event modify a component library; if the merging code has modified the component library, constructing a generated component demonstration document; the component presentation document is transmitted to a web server. And when the code merging event is monitored, a document generation command is called to process the source code corresponding to the code merging event so as to judge whether the merging code corresponding to the code merging event modifies the component library, and a component demonstration document is constructed and generated when the merging code is modified, so that the efficiency of constructing the component demonstration document is improved, and the complexity of constructing the component demonstration document is reduced.

Description

Method, system, intelligent terminal and storage medium for constructing component demonstration document
Technical Field
The invention relates to the field of Web front ends, in particular to a method and a system for constructing a component demonstration document, an intelligent terminal and a storage medium.
Background
The software development project generally needs to be developed cooperatively by multiple persons, the component demonstration document generation needs to be constructed, the developer firstly constructs on a computer and then opens a webpage to view the constructed webpage, but the operation is troublesome. The following are two ways of viewing component presentation documents:
1. One web page product is developed and constructed, and another web page is constructed at the same time for viewing the component presentation document, but the computer performance is greatly consumed, so that computer jamming easily occurs in the development process.
2. The code on the developer computer is not necessarily up-to-date, the component demonstration document can be constructed by pulling up the up-to-date code, but if the target component exists in the component library and is required to be quickly checked, the component is required to be pulled down to be constructed, and if the target component does not exist, the component is required to be packaged by itself. This process is cumbersome and time consuming.
There is thus a need for improvements and improvements in the art.
Disclosure of Invention
The invention mainly aims to provide a construction method of a component demonstration document, which aims to solve the problems of low efficiency and complex process in the construction of the component demonstration document in the prior art.
In order to achieve the above purpose, the invention adopts the following technical scheme:
in a first aspect, an embodiment of the present application provides a method for constructing a component presentation document, including:
When a software operating system monitors that a code merging event exists, a document generation command is called to process source codes corresponding to the code merging event so as to judge whether the merging codes corresponding to the code merging event modify a component library;
if the merging code has modified the component library, constructing a generated component demonstration document;
the component presentation document is transmitted to a web server.
In some embodiments, after the software operating system monitors that the code merging event exists, before invoking the document generation command to process the source code corresponding to the code merging event to determine whether the merging code corresponding to the code merging event has modified the component library, the method further includes:
Acquiring a source code, and modifying the source code by utilizing a code management system according to a code modification instruction of a developer to obtain a modified code;
merging the modified codes by using a code management system to obtain merged codes, and transmitting the merged codes to a code warehouse of the code management system;
And setting the software operating system to monitor the code merging event of the modified code.
In some embodiments, after the software operating system monitors that the code merging event exists, invoking a document generation command to process a source code corresponding to the code merging event to determine whether the merging code corresponding to the code merging event has modified a component library, including:
when the code merging event is monitored, the software operating system is utilized to analyze the code merging event to obtain event information, so that whether the content of the component library needs to be modified is judged according to the event information.
In some embodiments, if the merge code has modified the component library, constructing a generate component presentation document includes:
If the content which can modify the component library exists in the combined code, storing the combined code into a construction server of the software operating system, and judging whether the combined code exists in a target file or not by utilizing the construction server; wherein, the target file is a file with a target identifier in a file name;
and when the merging code exists in the target file, carrying out integrity supplement on the merging code, and calling a component demonstration document generation instruction to process the merging code subjected to integrity supplement to obtain the component demonstration document.
In some embodiments, when the merging code exists in the target file, the merging code is subjected to integrity supplement, and a component demonstration document generation instruction is called to process the merging code subjected to integrity supplement, so that the component demonstration document is obtained, and the method comprises the following steps:
If the software operating system judges that the file with the file name containing the target identifier exists in the combined code, an external code library is downloaded into a local source code catalog of the software operating system so as to supplement the integrity of the combined code;
and calling the component demonstration document generation instruction, and constructing and modifying the description document of the component in the integrated code supplemented with the integrity to a target directory to generate the component demonstration document.
In some embodiments, the method for constructing the component presentation document further includes:
And informing the developer of the type, the use mode and the access address of the component demonstration document.
In some embodiments, after determining whether the merging code corresponding to the code merging event has modified the component library, the method further includes:
And when the combined code does not modify the component library, notifying the judgment result to the developer.
In a second aspect, an embodiment of the present application provides a system for constructing a component presentation document, including: a code management system and a software operating system; the code management system is in communication connection with the software operating system;
the code management system is used for modifying the source code according to the code modification instruction of the developer after acquiring the source code to obtain a modified code;
The code management system is also used for merging the modified codes and transmitting the obtained merged codes to a code warehouse of the code management system;
The software operating system is used for monitoring the code merging event of the modified code, and calling a document generation command to process the source code corresponding to the code merging event after the code merging event is monitored to judge whether the merging code corresponding to the code merging event has modified the component library;
The software operating system is further used for constructing and generating a component demonstration document when the combined code has modified the component library;
the software operating system is also used for transmitting the component demonstration document to a web server.
In a third aspect, an embodiment of the present application provides an intelligent terminal, including: a memory, a processor and a computer program stored on the memory and executable on the processor, which when executed by the processor, performs the steps of the method of constructing a component presentation document as described above.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of a method of constructing a component presentation document as described above.
Compared with the prior art, the method, the system, the intelligent terminal and the storage medium for constructing the component demonstration document provided by the invention comprise the following steps: when a software operating system monitors that a code merging event exists, a document generation command is called to process source codes corresponding to the code merging event so as to judge whether the merging codes corresponding to the code merging event modify a component library; if the merging code has modified the component library, constructing a generated component demonstration document; the component presentation document is transmitted to a web server.
By monitoring whether the code merging event exists or not, when the code merging event exists, a document generation command is called to process source codes corresponding to the code merging event, so that whether the merging code corresponding to the code merging event modifies a component library or not is judged, and after a component demonstration document is constructed and generated when the component library is modified, the efficiency of constructing the component demonstration document is effectively improved, the step of constructing the component demonstration document is simplified, and the time and labor cost are saved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and other related 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 preferred embodiment of a method for constructing a component presentation document provided by the present invention;
FIG. 2 is a flowchart before step S100 in a preferred embodiment of a method for constructing a component presentation document according to the present invention;
FIG. 3 is a flow chart illustrating a method for constructing a component presentation document according to a preferred embodiment of the present invention;
FIG. 4 is a flowchart illustrating a method for constructing a component presentation document according to an embodiment of the present invention;
FIG. 5 is a flowchart of step S200 in a preferred embodiment of a method for constructing a component presentation document according to the present invention;
FIG. 6 is a flow chart of a method for constructing a component presentation document according to a preferred embodiment of the present invention;
FIG. 7 is a flowchart of step S230 in a preferred embodiment of the method for constructing a component presentation document provided by the present invention;
FIG. 8 is a diagram of the architectural relationships of the build system of the component presentation document provided by the present invention;
Fig. 9 is a schematic diagram of an operation environment of a preferred embodiment of an intelligent terminal according to the present invention.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments.
The components of the embodiments of the present application generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the application, as presented in the figures, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by a person skilled in the art without making any inventive effort, are intended to be within the scope of the present application.
The terms "comprises," "comprising," "including," or any other variation thereof, are intended to cover a specific feature, number, step, operation, element, component, or combination of the foregoing, which may be used in various embodiments of the present application, and are not intended to first exclude the presence of or increase the likelihood of one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing. Furthermore, the terms "first," "second," "third," and the like are used merely to distinguish between descriptions and should not be construed as indicating or implying relative importance.
Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which various embodiments of the application belong. The terms (such as those defined in commonly used dictionaries) are to be interpreted as having a meaning that is identical to the meaning of the context in the relevant art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein in connection with the various embodiments of the application.
In order to facilitate understanding of the embodiments of the present application, concepts of the background art to which the embodiments of the present application relate are first described herein.
Code multiplexing: a developer usually considers the multiplexing of the UI component codes, such as buttons, drop-down menus, lists, navigation menus, progress bars and the like, extracts the reusable components, such as button components, through abstraction, and can quickly complete code writing in any place where the buttons are needed by only inputting parameters, such as size, color, text and the like, without writing the button codes from scratch each time.
Component presentation document generation tool: over time, code component libraries are increasing. Because of the many component classifications, a developer can quickly find a target component in a component library and use the target component in two ways: firstly, the components are directly checked in the component library one by one, but the mode is very inefficient; and secondly, using a component library preview tool or a component demonstration document generation tool, such as storybook, docz. For example, in a developer computer, the component presentation document is generated by building a command, and then the document page is opened, so that the component can be previewed, and the component effect can be previewed in real time in the process of developing the component.
The code management system (or called version control system (Version Control System, VCS for short) is a piece of software that helps the developers of the software team work together and stores a complete history of their work): deposit code, manage code version systems such as gitlab (gitlab is an open source, highly configurable version control system that provides functions including Git repository, code review, CI/CD, deployment and rights management, etc.), gerrit (gerrit is a version control system developed by Google that provides a centralized code review platform), etc.
Jenkins construction System: jenkins is an open source tool for automating the construction, testing and deployment of items of software.
The invention provides a method for constructing a component demonstration document. According to the invention, whether the code merging event exists or not is monitored, and when the existence is monitored, the document generation command is called to process the source code corresponding to the code merging event, so that whether the merging code corresponding to the code merging event modifies the component library is judged, and after the component library is modified, the component demonstration document is constructed and generated and transmitted to the web server for browsing, so that the efficiency of constructing the component demonstration document is effectively improved, the step of constructing the component demonstration document is simplified, and the time and labor cost are saved.
The following describes a method design scheme for constructing a component demonstration document by using specific exemplary embodiments, and it should be noted that the following embodiments are only used for explaining the technical scheme of the invention, and are not limited in particular:
referring to fig. 1, an embodiment of the present application provides a method for constructing a component presentation document, including:
And step S100, when the software operating system 2 monitors that the code merging event exists, calling a document generation command to process the source code corresponding to the code merging event so as to judge whether the merging code corresponding to the code merging event has modified the component library.
The method for constructing the component demonstration document is applied to a system for constructing the component demonstration document and comprises a code management system 1 (such as gerrit system) and a software operating system 2 (Jenkins construction system); a plug-in to the code management system 1 is installed on the software operating system 2. Wherein, the code management system 1 such as Jenkins and gitlab, gerrit establishes automatic triggering, sets a trigger or webhook (Webhook is a technology for transmitting data through HTTP requests, and can realize message pushing and event triggering between programs), and the like.
Specifically, the gerrit system will send events to the system listening for events according to the developer's operations therein, such as the gerrit-trigger plug-in previously described as installed and configured by the Jenkins system. Then, the trigger on the software operating system 2 listens for code merging events:
When the software operating system 2 monitors that the code merging event exists, a document generation command is called to process source codes corresponding to the code merging event so as to judge whether the merging codes corresponding to the code merging event modify the component library or not, so that corresponding operation is carried out according to a judging result.
Further, step S100, when the software operating system 2 monitors that the code merging event exists, calls the document generation command to process the source code corresponding to the code merging event, so as to determine whether the merging code corresponding to the code merging event has modified the component library, including:
And step S110, when the occurrence of the code merging event is monitored, analyzing the code merging event by using the software operating system 2 to obtain event information, so as to judge whether the content of the component library needs to be modified exists in the merging code according to the event information.
Specifically, the software operating system 2 listens for the code merging event: when the existence of the code merging event is monitored, the software operating system 2 is utilized to analyze the code merging event to obtain event information, namely, the event information is analyzed from the event (the code merging event) sent to the Jenkins system by the code management system 1, and data (event information) needed to be used by a subsequent script is obtained, so that the next program for constructing the script knows which branch of which code library is modified by a developer, and constructs the branch code of the code library.
Then, whether the content of the component library needs to be modified is judged according to the event information, and whether a developer changes a file in a component library catalog (for example, the component library catalog is a component-basic) is generally judged.
Still further, referring to fig. 2, step S100, after the software operating system 2 monitors that the code merging event exists, before invoking the document generation command to process the source code corresponding to the code merging event to determine whether the merging code corresponding to the code merging event has modified the component library, further includes:
Step S10, acquiring a source code, and modifying the source code by utilizing the code management system 1 according to a code modification instruction of a developer to obtain a modified code;
Step S20, merging the modified codes by using the code management system 1 to obtain merged codes, and transmitting the merged codes to a code warehouse of the code management system 1;
and step S30, the software operating system 2 is set to monitor the code merging event of the modified code.
The code review is shown in gerrit system, and the code is manually read and distinguished whether there is error, whether the scheme is reasonable, whether there is error correction, etc.
Specifically, referring to fig. 3 and 4 together, first, after a developer writes business code (source code) on a developer computer using a git programming tool, the developer prepares to submit the code: the gitadd adds the file git commit write specification. The code is then submitted to the code management system 1, and the developer (who may also be a peer) modifies (reviews) the source code on the code management system 1, resulting in modification instructions.
Secondly, after the peer review passes, the modified codes are incorporated into a code warehouse. I.e. the system will write the content temporarily modified by the developer synchronously in the file of the code total repository of the project so that others get his modified content and the code management system 1 automatically sends an event of "merge change" (code merge event).
Furthermore, the event monitor in the software operating system 2 monitors the code merging event, and when the event of merging modification is monitored, the construction server in the software operating system 2 starts to execute the construction script and triggers the construction task so as to further judge whether the merging code corresponding to the code merging event has modified the component library.
Further, referring to fig. 1, in step S200, if the merging code has modified the component library, a generating component presentation document is constructed.
Specifically, when judging whether the merging code corresponding to the code merging event has modified the component library, if the merging code has modified the component library, constructing and generating a component demonstration document, thereby efficiently and simply realizing the construction of the component demonstration document.
If the merging code does not modify the component library, the construction is ended, and then, the result that the component library is not modified is notified, for example, the result that the merging code does not modify the component library is sent to the chat group through the chat tool, etc.
Still further, referring to fig. 5, in step S200, if the merging code has modified the component library, a generated component presentation document is constructed, including:
step S210, if the content of the component library is modified in the combined code, storing the combined code into a construction server of the software operating system 2, and judging whether a target file exists in the combined code by utilizing the construction server;
and step 220, when the merging code has the target file, carrying out integrity supplement on the merging code, and calling a component demonstration document generation instruction to process the integrity-supplemented merging code to obtain a component demonstration document. The target file is a file with a target identifier in a file name.
Among them, the use of git management code in software development is generally multi-branch development. Different branches correspond to different directories and the code content will also be different. Thus, when acquiring parameters, the current code bin name and the current branch name need to be known. Then, the Jenkins system injects information such as a warehouse name, a branch name and the like into the environment variable, and the variable name can be directly used in the "building script" to obtain the current code warehouse name and the current branch name, such as the warehouse name: GERRIT _PROJECT, branch name: GERRIT _BRANCH or BRANCH_NAME.
Specifically, referring to fig. 6 together, when the content of the component library needs to be modified in the merged code, the merged code is saved in the build server of the software operating system 2, that is, the latest code of the designated code repository branch is pulled, that is, the Jenkins system build server needs to copy the code of the code management system 1 into the build server, so as to ensure that the latest code modified by the developer of the code used in the build is ensured.
For example, first pull code: from https: the dem/test repository code is copied to the local. The branch is master: gate clone-b master "https: /(xx. Xx/Demo/test). 2. Non-first pull substitution code: the latest code of the master branch is pulled from the remote origin (existing in code management system 1): git pull origin master.
Secondly, the construction server judges whether the merging code has a target file or not, namely, whether a file (target file) with an identifier of 'storage' in a file name is modified or not in the merging code is searched through a git show command, and the file is a file special for a component demonstration document. If such files are not modified, the automatic construction is skipped directly, ending the task.
The code implementation process for judging whether the merging code has the target file is as follows:
def needSkip(){//
gitMsg=sh(returnStdout:true,script:"cd${PACKAGE_DIR}&&git show",returnStatus:false)
hasStories=gitMsg.indexOf('.stories.')>-1
Is echo "does it modify storybook's file? $ { hasStories } "
Return-! hasStories// do not modify stories file, all skip
}
Then this code is a segment of Jenkins Groovy (Groovy is a dynamic scripting language based on Java platform) script for determining whether the current build step needs to be skipped in Jenkins continuous integration/continuous deployment (CI/CD, which is a method of frequently delivering applications to clients by introducing automation in the application development phase.
And the purpose of this piece of code is to check if the most recent git submission contains a modification to the storybook configuration file (typically ending in. Store.). If not, performing a skip operation; if so, the subsequent CI/CD flow is continued without skipping.
Wherein 1, DEF NEEDSKIP (): a function named needSkip is defined that does not specify a return type because Groovy is a dynamic type language and the type declaration can be omitted.
2. GitMsg = sh (returnStdout: true, script: "cd $ { PACKAGE _dir } & git show", returnStatus: false): this execution executes a shell script command. sh is a built-in function of Jenkins for executing commands in the shell. returnStdout: true indicates that the output of the script will be captured and returned, rather than printed to the console. The script parameter specifies the command to be executed, here "cd $ { PACKAGE _dir } & git show", meaning that the switch is first made to the $ { PACKAGE _dir } directory ($ { PACKAGE _dir } is a Jenkins environment variable, pointing to the directory of the source code package), and then the git show command is executed to display the latest git commit information. returnStatus: false indicates that the status code is not returned even if the command fails to execute.
3. HasStories = gitmsg index of ('.store.') > -1: this line checks whether the string ". Stock", is contained in gitMsg (i.e., the git commit message) acquired in the previous step. The indexOf method is used for searching the first appearance position of the sub-character string in the character string, and if the first appearance position of the sub-character string is not found, returning to-1. Here it is determined by comparing > -1 whether ". Stock". Is found, if found (i.e. hasStories is true), it indicates that there is a modification to the. Stock. File, otherwise false.
4. Is echo "does it modify storybook's file? $ { hasStories } ": this line outputs a message to the console asking if the file of storybook was modified and displaying the value of hasStories, i.e. if a modification of the file is detected.
5. Return-! hasStories: the last line of the function returns a boolean value. If hasStories is false (i.e., no modification to the store. File), then return true, indicating that the current step needs to be skipped; if hasStories is true, then false is returned, indicating that no skip is required.
Still further, referring to fig. 7, in step S230, when the merging code has the object file, the merging code is integrity-supplemented, and the component demonstration document generating instruction is invoked to process the integrity-supplemented merging code, so as to obtain the component demonstration document, which includes:
Step S231, if the software operating system 2 judges that the file with the file name containing the target identifier exists in the combined code, the external code library is downloaded into a local source code catalog of the software operating system 2 so as to supplement the integrity of the combined code;
and S232, calling a component demonstration document generation instruction, and constructing and modifying the description document of the component in the integrated code subjected to the integrity supplement to a target directory so as to generate a component demonstration document.
Wherein the target file is a file of the target identifier. Dependencies refer to the external code library referenced by the current code program. The application uses front end code, uses NPM (NPM (Node package manager) is default package manager of JavaScript runtime Node. Js) to conduct external package management, and has a configuration file in the code catalog called package. Json, records the external code library referenced in the code, and is generally issued to the network by other people, organizations or companies, but not the code written in the source code catalog by the developer.
Specifically, the software operating system 2 is used to determine whether or not there is a file containing the target identifier in the file name in the merged code:
if the merging code contains the file containing the target identifier, the installation code is dependent, namely, an external code library is downloaded into a node-modules directory under a local source code directory from the network so as to supplement the integrity of the merging code. This sample source code is complete and constructable (will not be misplaced by missing code). And if the file containing the target identifier does not exist in the merging code, ending the construction.
Then, the component presentation document generation instructions are invoked to build and modify the description document of the component in the integrity-supplemented merged code to the target directory to generate the component presentation document.
The component presentation document generation command is generally a program provided in a packaged document generation tool, and the component presentation document can be obtained by constructing, sorting and modifying a description document about the UI component in source code to a specified directory (target directory, such as dist, build, etc.). If the component presentation document used is storybook, then the document generation command is typically: "storybook build-docs.
Further, referring to fig. 1, in step S300, the component presentation document is transmitted to the web server.
Specifically, after the component demonstration document is constructed, the component demonstration document is transmitted to a webpage server for browsing the component demonstration document, so that the component demonstration document can be quickly and conveniently browsed.
Further, step S300, after determining whether the merging code corresponding to the code merging event has modified the component library, further includes:
And step S310, notifying a judgment result to a developer when the combined code does not modify the component library.
Specifically, after the component presentation document is constructed, the component presentation document is transmitted to the web server, i.e., the component presentation document is in the dist directory, and then the file of the dist directory is transmitted from the construction server to the web server. In the application, a scp command, such as scp dist/user@xxx.xxx.xx.xxx:/nginx/www, is used to copy the dist directory to the "/nginx/www" directory of the xxx.
Further, the method for constructing the component demonstration document further comprises the following steps:
step S400, notifying the developer of the type, the use mode and the access address of the component demonstration document.
Specifically, when a component presentation document is constructed, since it takes a long time, it is necessary to notify after the construction is completed, and inform the constructor that the task is completed.
Then, after the automatic construction is completed, a notification is sent to the relevant personnel, that is, the type, the usage mode and the access address of the component demonstration document are notified to the relevant personnel, for example, the flyash, the enterprise WeChat API interface is used, and the construction result is sent to the group chat or the personal chat. Finally, the relevant person can obtain the latest access address in the notification.
In the application, the updating condition of the component demonstration document is notified to the developer in real time. When a developer needs to check the type and the use mode of the latest component library, the developer can check quickly only by opening the link in the notification through the browser, and the steps of acquiring codes, constructing, previewing and the like are not needed to be executed on a local computer, so that the development experience and efficiency are effectively improved.
The method comprises the steps of automatically constructing a component library according to codes submitted by developers, deploying a component preview page, and realizing the use scene that the developers can access the latest code UI component library at any time.
Further, referring to fig. 8, an embodiment of the present application provides a system for constructing a component presentation document, including:
A code management system 1 and a software operating system 2; the code management system 1 is in communication connection with the software operating system 2; the code management system 1 is used for modifying the source code according to a code modification instruction of a developer after acquiring the source code to obtain a modified code; the code management system 1 is further configured to combine the modified codes and transmit the resulting combined codes to a code repository of the code management system 1.
The software operating system 2 is used for monitoring the code merging event of the modified code, and calling the document generation command to process the source code corresponding to the code merging event after the code merging event is monitored to judge whether the merging code corresponding to the code merging event has modified the component library; the software operating system 2 is also used for constructing a generated component demonstration document when the component library modified by the combined codes is combined; the software operating system 2 is also used to transmit the component presentation document to the web server.
Specifically, the method for constructing the component demonstration document is suitable for a system for constructing the component demonstration document, and then the system for constructing the component demonstration document is realized as follows:
First, gerrit, according to the developer's operations in it, sends some events to the system listening for events, and the triggers on the software operating system 2 listen for code merging events:
When the existence of the code merging event is monitored, a document generation command is called to process the source code corresponding to the code merging event so as to judge whether the merging code corresponding to the code merging event has modified the component library. However, if the merge code has modified the component library, then the generate component presentation document is constructed. Finally, the component presentation document is transmitted to a web server.
According to the application, the source codes corresponding to the existing code merging events are processed by calling the document generation command, so that whether the merging codes corresponding to the code merging events modify the component library is judged, when the merging codes trigger the modification of the component library, the component demonstration document is constructed and generated, and then the component demonstration document is transmitted to the webpage server for browsing the component demonstration document, thereby realizing the efficient and rapid construction of the component demonstration document, simplifying the construction flow, and saving the time and labor cost.
Further, as shown in fig. 9, based on the above method for constructing a component-based presentation document, the present invention further provides an intelligent terminal, which includes a processor 10 and a memory 20. Fig. 9 shows only some of the components of the intelligent terminal, but it should be understood that not all of the illustrated components are required to be implemented, and more or fewer components may alternatively be implemented.
The memory 20 may in some embodiments be an internal storage unit of the smart terminal, such as a hard disk or a memory of the smart terminal. The memory 20 may also be an external storage device of the smart terminal in other embodiments, such as a plug-in hard disk equipped on the smart terminal, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD), etc. Further, the memory 20 may also include both an internal storage unit and an external storage device of the smart terminal. The memory 20 is used for storing application software installed in the smart terminal and various data, such as program codes for installing the smart terminal. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, the memory 20 has stored thereon a computer-based program 40, the computer-based program 40 being executable by the processor 10 to implement the component-based presentation document construction method of the present application.
The processor 10 may in some embodiments be a central processing unit (Central Processing Unit, CPU), microprocessor or other data processing chip for executing program code or processing data stored in the memory 20, such as for performing component-based presentation document construction methods, etc.
Preferably, the intelligent terminal of the present application further includes a display 30, and the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like in some embodiments. The display 30 is used for displaying information at the intelligent terminal and for displaying a visual user interface. The components 10-30 of the intelligent terminal communicate with each other via a system bus.
In an embodiment, the steps implemented when the processor 10 executes the computer program 40 in the memory 20 may refer to corresponding descriptions in the above method for constructing the component-based presentation document, which are not described herein.
Further, the present invention also provides a computer-readable storage medium storing a computer program 40, which when executed by a processor, implements the steps of the component-based presentation document building method as above; since the above description of the steps of the method for constructing the component-based presentation document is described in detail, the description thereof will not be repeated here. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In summary, the invention provides a method, a system, an intelligent terminal and a storage medium for constructing a component demonstration document. And when the code merging event is monitored, a document generation command is called to process the source code corresponding to the code merging event so as to judge whether the merging code corresponding to the code merging event modifies the component library, and a component demonstration document is constructed and generated when the merging code is modified, so that the efficiency of constructing the component demonstration document is improved, and the complexity of constructing the component demonstration document is reduced.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The apparatus embodiments described above are merely illustrative, for example, of the flow diagrams and block diagrams in the figures, which illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules or units in various embodiments of the application may be integrated together to form a single part, or the modules may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a smart phone, a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application.

Claims (10)

1. A method of constructing a component presentation document, comprising:
When a software operating system monitors that a code merging event exists, a document generation command is called to process source codes corresponding to the code merging event so as to judge whether the merging codes corresponding to the code merging event modify a component library;
if the merging code has modified the component library, constructing a generated component demonstration document;
the component presentation document is transmitted to a web server.
2. The method for constructing a component presentation document according to claim 1, wherein after the software operating system monitors that a code merging event exists, before invoking a document generation command to process a source code corresponding to the code merging event to determine whether a merging code corresponding to the code merging event has modified a component library, the method further comprises:
Acquiring a source code, and modifying the source code by utilizing a code management system according to a code modification instruction of a developer to obtain a modified code;
merging the modified codes by using a code management system to obtain merged codes, and transmitting the merged codes to a code warehouse of the code management system;
And setting the software operating system to monitor the code merging event of the modified code.
3. The method for constructing a component presentation document according to claim 2, wherein when the software operating system monitors that a code merging event exists, invoking a document generation command to process a source code corresponding to the code merging event to determine whether a merging code corresponding to the code merging event has modified a component library, includes:
when the code merging event is monitored, the software operating system is utilized to analyze the code merging event to obtain event information, so that whether the content of the component library needs to be modified is judged according to the event information.
4. The method for constructing a component presentation document according to claim 2, wherein if the merging code has modified the component library, constructing a generated component presentation document comprises:
If the content of the component library needs to be modified in the combined code, storing the combined code into a construction server of the software operating system, and judging whether the combined code has a target file or not by utilizing the construction server; wherein, the target file is a file with a target identifier in a file name;
And when the merging code exists in the target file, carrying out integrity supplement on the merging code, and calling a component demonstration document generation instruction to process the merging code subjected to integrity supplement to obtain a component demonstration document.
5. The method for constructing a component presentation document according to claim 4, wherein when the merging code exists in the target file, the merging code is integrity-supplemented, and a component presentation document generation instruction is called to process the integrity-supplemented merging code, so as to obtain the component presentation document, and the method comprises the steps of:
If the software operating system judges that the file with the file name containing the target identifier exists in the combined code, downloading a required external code library into a local source code catalog of the software operating system so as to supplement the integrity of the combined code;
and calling the component demonstration document generation instruction, and constructing and modifying the description document of the component in the integrated code supplemented with the integrity to a target directory to generate the component demonstration document.
6. The method of constructing a component presentation document of claim 2, further comprising:
And informing the developer of the type, the use mode and the access address of the component demonstration document.
7. The method for constructing a component presentation document according to claim 2, wherein after determining whether the merging code corresponding to the code merging event has modified the component library, further comprising:
And when the combined code does not modify the component library, notifying the judgment result to the developer.
8. A system for building a component presentation document, the system comprising: a code management system and a software operating system;
the code management system is used for acquiring a source code and modifying the source code according to a code modification instruction of a developer to obtain a modified code;
The code management system is also used for merging the modified codes and transmitting the obtained merged codes to a code warehouse of the code management system;
The software operating system is used for monitoring the code merging event of the modified code, and calling a document generation command to process the source code corresponding to the code merging event after the code merging event is monitored to judge whether the merging code corresponding to the code merging event has modified the component library;
The software operating system is further used for constructing and generating a component demonstration document when the combined code has modified the component library;
the software operating system is also used for transmitting the component demonstration document to a web server.
9. An intelligent terminal, characterized in that, the intelligent terminal includes: a memory, a processor and a computer program stored on the memory and executable on the processor, which when executed by the processor performs the steps of the method of constructing a component presentation document according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the steps of the method of constructing a component presentation document according to any one of claims 1-7.
CN202410572221.XA 2024-05-07 2024-05-07 Method, system, intelligent terminal and storage medium for constructing component demonstration document Pending CN118394319A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410572221.XA CN118394319A (en) 2024-05-07 2024-05-07 Method, system, intelligent terminal and storage medium for constructing component demonstration document

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410572221.XA CN118394319A (en) 2024-05-07 2024-05-07 Method, system, intelligent terminal and storage medium for constructing component demonstration document

Publications (1)

Publication Number Publication Date
CN118394319A true CN118394319A (en) 2024-07-26

Family

ID=91997609

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410572221.XA Pending CN118394319A (en) 2024-05-07 2024-05-07 Method, system, intelligent terminal and storage medium for constructing component demonstration document

Country Status (1)

Country Link
CN (1) CN118394319A (en)

Similar Documents

Publication Publication Date Title
US10303581B2 (en) Graphical transaction model
CN110235122B (en) System and method for converting web content into reusable templates and components
Xanthopoulos et al. A comparative analysis of cross-platform development approaches for mobile applications
US6523134B2 (en) Selective undo
US8898285B2 (en) Service oriented architecture version and dependency control
KR101913780B1 (en) Apparatus and method for scrapping web data
CN110955428A (en) Page display method and device, electronic equipment and medium
CN110928763A (en) Test method, test device, storage medium and computer equipment
US8589858B1 (en) Requirement manager for UML and SysML application
CN112352214A (en) Display control device, display control method, and display control program
CN103617055A (en) Browser and method and device of starting applications in browser
CN117875288A (en) Form page generation method and device and electronic equipment
US20200371757A1 (en) Automatic view generation based on annotations
US8700374B1 (en) System and method of using an active link in a state programming environment to locate an element in a graphical programming environment
CN118394319A (en) Method, system, intelligent terminal and storage medium for constructing component demonstration document
CN114936152A (en) Application testing method and device
CN117707917A (en) Service testing method, device, medium and product
CN115017429A (en) Method, device and system for cutting and storing link object and storage medium
CN113535037A (en) Interactive display method and device for command line terminal, computer readable medium and equipment
CN114168875A (en) Page program generation method and device, computer equipment and storage medium
KR102191458B1 (en) Apparatus and method for scrapping web data
US20150277723A1 (en) Exporting a component of a currently displayed user interface to a development system
CN113806327A (en) Database design method and device and related equipment
CN110851133A (en) Front-end component library, and webpage response method and device based on front-end component library
CN113821202B (en) Method, device and equipment for generating management software file and readable storage medium

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