CN110647320A - Project framework construction method and device, computer equipment and storage medium - Google Patents

Project framework construction method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN110647320A
CN110647320A CN201910748756.7A CN201910748756A CN110647320A CN 110647320 A CN110647320 A CN 110647320A CN 201910748756 A CN201910748756 A CN 201910748756A CN 110647320 A CN110647320 A CN 110647320A
Authority
CN
China
Prior art keywords
project
progressive
webpage application
configuration file
application configuration
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
CN201910748756.7A
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.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN201910748756.7A priority Critical patent/CN110647320A/en
Publication of CN110647320A publication Critical patent/CN110647320A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • 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

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)
  • Information Transfer Between Computers (AREA)

Abstract

The application relates to a project framework construction method and device, computer equipment and a storage medium. The method comprises the following steps: acquiring a progressive webpage application configuration plug-in package, and analyzing and acquiring a progressive webpage application configuration file; after receiving a project construction instruction, generating a project frame by using a React project scaffold tool according to the project construction instruction, and storing a progressive webpage application configuration file into a project catalog of the project frame; determining path information of the progressive webpage application configuration file in the project directory according to the progressive webpage application configuration file storage information; and generating an introduction code corresponding to the progressive webpage application configuration file according to the path information, and writing the introduction code into a preset position of the project entry file to obtain a project frame supporting the progressive webpage application. By adopting the method, developers do not need to manually write codes, the coding burden of the developers is reduced, the code complexity is reduced, and the execution and running performance of the service codes are not influenced.

Description

Project framework construction method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a project framework construction method and apparatus, a computer device, and a storage medium.
Background
At present, when a read project is developed in the industry, a basic read project frame is usually built by a scaffold tool of the read project, but the project frame built by the existing scaffold tool does not support a PWA (Progressive Webapps) offline cache function, if the existing project frame additionally supports the PWA offline cache function, developers need to change the building codes of the read project frame or the project scaffold tool by themselves to add corresponding functional codes, in the process, due to the complexity of bottom codes of the project frame or the scaffold tool, the development difficulty is large, the efficiency is low, the problems that the finally obtained read project has code errors and the like are easily caused, and the development error rate is high.
Disclosure of Invention
In view of the above, it is necessary to provide a project framework construction method, apparatus, computer device and storage medium.
A method of building a project framework, the method comprising:
acquiring a progressive webpage application configuration plug-in package, and analyzing the progressive webpage application configuration plug-in package to acquire a progressive webpage application configuration file;
after receiving a project construction instruction, generating a project frame by using a React project scaffold tool according to the project construction instruction, and storing the progressive webpage application configuration file into a project catalog corresponding to the project frame;
determining path information of the progressive webpage application configuration file in the project directory according to the progressive webpage application configuration file saving information;
and generating an introduction code corresponding to the progressive webpage application configuration file according to the path information, and writing the introduction code into a preset position of a project entry file in the project frame to obtain the project frame supporting the progressive webpage application.
In one embodiment, after the step of writing the import code into the preset location of the project entry file in the project framework, the method further includes:
reading request information in the progressive webpage application configuration file;
loading response data of the request information through an interface corresponding to the request information, and storing the response data into a cache memory;
and when the request information is monitored, searching response data corresponding to the request data from the cache memory, and returning the response data.
In one embodiment, the step of generating an import code corresponding to the progressive web application configuration file according to the path information includes:
and determining the path information as an external reference attribute value and writing the external reference attribute value into a script tag to obtain a reference code of the progressive webpage application configuration file.
In one embodiment, the step of writing the import code into a preset location of a project entry file in the project framework includes:
detecting whether a configuration object of a browser supports the progressive webpage application configuration interface or not;
and if the configuration object supports the progressive webpage application configuration interface, writing the introduction code into the bottom position of the project entry file.
In one embodiment, the step of obtaining the progressive web application profile includes:
displaying a configuration information modification page, and acquiring configuration parameters of each configuration item through the configuration information modification page;
acquiring a file template of a progressive webpage application configuration file, and determining positions to be imported, corresponding to each configuration item, in the file template;
and respectively importing the configuration parameters of each configuration item to the corresponding position to be imported in the file template to obtain a self-defined progressive webpage application configuration file.
In one embodiment, after the step of writing the import code into the preset location of the project entry file in the project framework, the method further includes:
when a configuration file updating instruction is received, traversing the project directory according to the configuration file updating instruction, and determining path information of a newly added progressive webpage application configuration file;
and modifying the introduction code according to the path information of the newly added progressive webpage application configuration file.
An apparatus for building a project framework, the apparatus comprising:
the configuration file acquisition module is used for acquiring a progressive webpage application configuration plug-in package and analyzing the progressive webpage application configuration plug-in package to acquire a progressive webpage application configuration file;
the configuration file loading module is used for generating a project frame by utilizing a React project scaffold tool according to a project construction instruction after receiving the project construction instruction, and storing the progressive webpage application configuration file into a project catalog corresponding to the project frame;
the path information acquisition module is used for determining the path information of the progressive webpage application configuration file in the project directory according to the progressive webpage application configuration file storage information;
and the lead-in code configuration module is used for generating a lead-in code corresponding to the progressive webpage application configuration file according to the path information, and writing the lead-in code into a preset position of a project entry file in the project frame to obtain the project frame supporting the progressive webpage application.
In one embodiment, the apparatus further comprises:
the address information acquisition module is used for reading request information in the progressive webpage application configuration file;
the object data caching module is used for loading response data of the request information through an interface corresponding to the request information and storing the response data into a cache memory;
and the object data acquisition module is used for searching response data corresponding to the request data from the cache memory and returning the response data when the request information is monitored.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
acquiring a progressive webpage application configuration plug-in package, and analyzing the progressive webpage application configuration plug-in package to acquire a progressive webpage application configuration file;
after receiving a project construction instruction, generating a project frame by using a React project scaffold tool according to the project construction instruction, and storing the progressive webpage application configuration file into a project catalog corresponding to the project frame;
determining path information of the progressive webpage application configuration file in the project directory according to the progressive webpage application configuration file saving information;
and generating an introduction code corresponding to the progressive webpage application configuration file according to the path information, and writing the introduction code into a preset position of a project entry file in the project frame to obtain the project frame supporting the progressive webpage application.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring a progressive webpage application configuration plug-in package, and analyzing the progressive webpage application configuration plug-in package to acquire a progressive webpage application configuration file;
after receiving a project construction instruction, generating a project frame by using a React project scaffold tool according to the project construction instruction, and storing the progressive webpage application configuration file into a project catalog corresponding to the project frame;
determining path information of the progressive webpage application configuration file in the project directory according to the progressive webpage application configuration file saving information;
and generating an introduction code corresponding to the progressive webpage application configuration file according to the path information, and writing the introduction code into a preset position of a project entry file in the project frame to obtain the project frame supporting the progressive webpage application.
After receiving an execution instruction sent by a terminal, analyzing a plug-in package to obtain a progressive webpage application configuration file, saving the progressive webpage application configuration file into a project directory, obtaining path information of the progressive webpage application configuration file in the project directory, generating a substitution code, writing the substitution code into a preset position of a project entry file, adding a script code related to a progressive webpage application function into a core code of a React project in an external reference mode, and loading a corresponding progressive webpage application configuration file through a script tag of a project entry file to realize an offline function of the project when a read project is triggered to be used, so that the read project can support the progressive webpage application function, manual code compiling by developers is not needed, the coding burden of the developers is reduced, and the code complexity is reduced, and the execution and the running performance of the service code are not influenced.
Drawings
FIG. 1 is a diagram of an application scenario of a method for building a project framework according to an embodiment;
FIG. 2 is a flowchart illustrating a method for constructing a project framework according to an embodiment;
FIG. 3 is a schematic flow diagram illustrating obtaining a progressive web application configuration file in one embodiment;
FIG. 4 is a flow diagram illustrating an embodiment of writing an import code into a predetermined location in a project entry file;
FIG. 5 is a block diagram showing the construction of a project framework building apparatus according to an embodiment;
FIG. 6 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
FIG. 1 is a diagram of an application environment of a method for building a project framework in one embodiment. The project framework construction method is applied to computer equipment. The computer device may be a server or a terminal. As shown in fig. 1, taking the computer device as a terminal 102 as an example, a user may operate the terminal 102 through an interface, after acquiring a project construction instruction input by the user when the user operates the terminal 102, acquiring a progressive web application configuration file, generating a project frame by using a project scaffold tool, loading the progressive web application configuration file into a project directory corresponding to the project frame, determining path information of the progressive web application configuration file in the project directory, generating an import code corresponding to the progressive web application configuration file according to the path information, and writing the import code into a preset position of a project entry file to obtain the project frame supporting the progressive web application.
In one embodiment, as shown in fig. 2, a method for constructing a project framework is provided, which is described by taking the method as an example for being applied to the server in fig. 1, and includes the following steps:
step S210: and acquiring a progressive webpage application configuration plug-in package, and analyzing the progressive webpage application configuration plug-in package to acquire a progressive webpage application configuration file.
Specifically, the progressive web application configuration file may include a ServiceWorker js file and/or a mailest json file of a ServiceWorker, which may be pre-packaged as a plug-in package in the form of an independent JavaScript language package and stored together with a scaffold tool of a reach project; and when subsequently performing read project development supporting the progressive webpage application, a developer inputs a corresponding command line in a command line input interface of the scaffold tool to trigger a project construction instruction, and after receiving the project construction instruction, the terminal responds to the project construction instruction to analyze a progressive webpage application configuration file from the plug-in package.
In one embodiment, the project name building instruction may be "React-pwa-building"; specifically, the command line input into the command line input interface of the scaffold tool may be "initread-pwa-building".
Step S220: and after receiving the project construction instruction, generating a project frame by using a React project scaffold tool according to the project construction instruction, and storing the progressive webpage application configuration file into a project catalog corresponding to the project frame.
In the step, the project scaffold tool is used for configuring the development environment of the React project and tools used in the development process, after the terminal receives the project construction instruction, the project scaffold tool is used for configuring and creating the React project, a project catalog of the React project is generated, and the progressive webpage application configuration file is stored in the project catalog.
Specifically, the terminal can create a PWA folder in the project directory of the fact project, and after acquiring the progressive webpage application configuration file, store the progressive webpage application configuration file into the PWA folder.
Step S230: and determining path information of the progressive webpage application configuration file in the project directory according to the progressive webpage application configuration file storage information.
In this step, the path information refers to address information of the progressive web application configuration file in the item directory; specifically, if the progressive web application configuration file is in the PWA folder under the project module, the path information may be determined as: js, "/PWA/serviceWorker.
Step S240: and generating an introduction code corresponding to the progressive webpage application configuration file according to the path information, and writing the introduction code into a preset position of a project entry file in the project frame to obtain the project frame supporting the progressive webpage application.
Html, the terminal loads the progressive web application configuration file into the project directory, and the progressive web application configuration file is only valid, so that the project supports PWA offline application. Specifically, the terminal may refer to path information of the progressive web application configuration file by using the script tag "< script > </script >" to generate an import code, so as to add the configuration file to the project entry file.
Taking a project entry file as an index.html and a progressive webpage application configuration file as a serviceworker.js as an example, assuming that the progressive webpage application configuration file is stored in a reach project root directory, a terminal generates an introduction code ' src ═ serviceworker.js ' according to path information of a folder where the progressive webpage application configuration file is located, and then introduces the progressive webpage application configuration file to the bottom of the entry file index.html by using a script tag and the introduction code, namely, the last line of the index.html is written with a ' script ═ text/javascript ' src ═ serviceworker.js > '; assuming that the progressive webpage application configuration file is stored in the PWA folder under the read project root directory, the terminal generates an introduction code "src ═ PWA/serviceworker.js" according to the path information of the folder where the progressive webpage application configuration file is located, and then introduces the progressive webpage application configuration file to the bottom of the entry file index.html by using the script tag and the introduction code, that is, the last line of the index.html is written with "< script ═ text/javascript" src ═ PWA/serviceworker.js ">". Adding scripts related to the progressive webpage application functions into core codes of the project entry files in an external reference mode through < script > </script >' tags, and loading corresponding progressive webpage application configuration files through the script tags of the project entry files when the read project is triggered to be used so as to achieve corresponding functions.
In the construction method of the project frame, after receiving an execution instruction sent by a terminal, the progressive webpage application configuration file is acquired and stored in a project directory, and obtaining the path information of the progressive web application configuration file in the project directory, generating a substitution code and writing the substitution code into a preset position of the project entry file, the method realizes that script codes related to the progressive webpage application functions are added into core codes of the act items in an external reference mode, when the React project is triggered to be used, loading a corresponding progressive webpage application configuration file through a script tag of the project entry file to realize the offline function of the project, the React project can support the progressive webpage application function, developers do not need to manually write codes, the coding burden of the developers is reduced, the code complexity is reduced, and the execution and running performance of the service codes are not affected.
In one embodiment, after the step of writing the import code into the preset location of the project entry file, the method further comprises: reading request information in a progressive webpage application configuration file; loading response data of the request information through an interface corresponding to the request information, and storing the response data into a cache memory; and when the request information is monitored, searching response data corresponding to the request data from the cache memory, and returning the response data.
In this embodiment, the request information may refer to a uniform resource locator of an https request initiated in the fact project, and the response data may refer to corresponding data returned by the website server according to the request information; after the terminal introduces the progressive webpage application configuration file into the project entry file, response data responding to the request is loaded from the website server through an interface corresponding to the request information appointed in the progressive webpage application configuration file, the request information and the response data are stored in a cache memory in a key/value mode, when the triggered request information is monitored by a subsequent terminal, the corresponding response data are searched in the cache memory, and if the response data are not null, the response data can be directly returned, so that the offline function of the React project is realized.
In one embodiment, the step of generating an import code corresponding to the progressive web application configuration file according to the path information includes: and determining the path information as an external reference attribute value, and writing the external reference attribute value into the script tag to obtain a reference code of the progressive webpage application configuration file.
In this embodiment, the progressive web application configuration file is a script file that needs external reference, and the path information of the progressive web application configuration file is determined as an external reference attribute value as a reference address and is written in a value script tag, so as to generate an application code of the progressive web application configuration file.
Html, taking a project entry file as index, and a progressive web application configuration file as serviceworker.js as an example, assuming that the progressive web application configuration file is stored in a reach project root directory, terminal path information is determined as an attribute value of external reference "src", generating an introduction code "src ═ serviceworker.js", and then introducing the progressive web application configuration file to the bottom of the entry file index.html by using a script tag and the introduction code, that is, the last line of index.html is written with "< script type ═ text/javascript ═ src"/serviceworker.js "" "" > ".
Therefore, in an embodiment, as shown in fig. 3, before the step of generating the import code corresponding to the progressive web application configuration file according to the path information, the method further includes:
step S310: detecting whether a configuration object of a browser supports a progressive webpage application configuration interface or not;
step S320: and if the configuration object supports the progressive webpage application configuration interface, writing the introduced code into the bottom position of the project entry file.
In this embodiment, the configuration object may be a navigator object of a browser, and includes related information of the browser; the progressive webpage application configuration interface can be a Service Worker API and provides interface information for a cache mechanism of the Service Worker; specifically, before configuring the introduced code to the entry file of the project, the terminal needs to perform compatibility judgment of a PWA offline cache function on the browser, and by judging whether a Service WorkerrAPI exists in the configuration object of the browser, if the Service Worker API exists in the configuration object of the browser, the browser supports a cache mechanism of the Service Worker, so that the introduced code is added to the entry file of the React project. If the configuration object of the browser does not have the Service Worker API, the browser does not support the caching mechanism of the Service Worker, and the introduced code is not written into the entry file of the read project at the moment, so that the error report of the read project is avoided.
FIG. 4 is a flow diagram that illustrates obtaining a progressive web application profile, according to an embodiment. As shown in fig. 4, in one embodiment, the step of obtaining the progressive web application profile includes:
step S211: displaying a configuration information modification page, and acquiring configuration parameters of each configuration item through the configuration information modification page;
step S212: acquiring a file template of a progressive webpage application configuration file, and determining positions to be imported, corresponding to each configuration item, in the file template;
step S214: and respectively importing the configuration parameters of the configuration items to corresponding positions to be imported in the file template to obtain a self-defined progressive webpage application configuration file.
In this embodiment, the terminal implements user-defined configuration on each category option in the progressive web application configuration file. A user can input configuration parameters of various configuration items in a configuration modification page, for example, which request information in a read project needs to be intercepted; specifically, a default progressive web application configuration file is generated during initialization, a file template is generated according to various configuration data in the default progressive web application configuration file, after a project construction instruction is subsequently acquired, the terminal acquires configuration parameters of various configuration items through a display configuration modification page, the progressive web application configuration file with the self-defined configuration parameters is generated by importing the parameters to be configured into the corresponding position of the file template according to the mapping relation, and the matched progressive web application configuration file is conveniently generated according to a service scene or user requirements, so that the efficiency of reach project construction is further improved, and the development efficiency is improved.
In one embodiment, the step of reading the cache object pair in the progressive web application configuration file is preceded by the steps of: when a configuration file updating instruction is received, traversing the item directory according to the configuration file updating instruction, and determining path information of a newly added progressive webpage application configuration file; and modifying the introduced code according to the path information of the newly added progressive webpage application configuration file.
In this embodiment, the newly added progressive web application configuration file may be a new progressive web application configuration file configured according to actual application requirements; the terminal traverses the project directory according to the configuration file updating instruction to obtain a newly added progressive webpage application configuration file in the project directory, and then generates and determines progressive webpage application configuration path information according to the position of the newly added progressive webpage application configuration file, so that the path information is modified in the introduced code, the new progressive webpage application configuration file is introduced in the React project, and flexible self-defined configuration is carried out on each function option in the Service Worker function.
It should be understood that, although the steps in the flowcharts of fig. 2 to 4 are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-4 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 5, there is provided a project framework construction apparatus including: a configuration file obtaining module 410, a configuration file loading module 420, a path information obtaining module 430 and an introduction code configuring module 440, wherein:
a configuration file obtaining module 410, configured to obtain a progressive web application configuration plug-in package, and parse the progressive web application configuration plug-in package to obtain a progressive web application configuration file;
the configuration file loading module 420 is used for generating a project frame by using a React project scaffold tool according to the project construction instruction after receiving the project construction instruction, and storing the progressive webpage application configuration file into a project catalog corresponding to the project frame;
a path information obtaining module 430, configured to determine path information of the progressive web application configuration file in the project directory according to the progressive web application configuration file saving information;
and the import code configuration module 440 is configured to generate an import code corresponding to the progressive web application configuration file according to the path information, and write the import code into a preset position of an item entry file in the item frame to obtain the item frame supporting the progressive web application.
In one embodiment, the apparatus for constructing a project frame further includes an address information obtaining module, configured to read request information in a progressive web application configuration file; loading response data of the request information through an interface corresponding to the request information, and storing the response data into a cache memory; and when the request information is monitored, searching response data corresponding to the request data from the cache memory, and returning the response data.
In an embodiment, the introducing code configuration module is configured to determine the path information as an external reference attribute value, and write the external reference attribute value into the script tag to obtain a reference code of the progressive web application configuration file.
In one embodiment, a code configuration module is introduced to: detecting whether a configuration object of a browser supports a progressive webpage application configuration interface or not; when the progressive webpage application configuration interface is supported in the configuration object, the introduced code is written into the bottom position of the project entry file.
In one embodiment, the configuration file acquisition module is used for displaying a configuration information modification page; acquiring configuration parameters of each configuration item through a configuration information modification page; acquiring a file template of a progressive webpage application configuration file; determining positions to be imported corresponding to the configuration items in the file template; and respectively importing the configuration parameters of the configuration items to corresponding positions to be imported in the file template to obtain a self-defined progressive webpage application configuration file.
In one embodiment, the configuration file updating module is configured to, when receiving a configuration file updating instruction, traverse the item directory according to the configuration file updating instruction, and determine path information of a newly added progressive web application configuration file; and modifying the introduced code according to the path information of the newly added progressive webpage application configuration file.
For specific limitations of the project framework construction device, reference may be made to the above limitations of the project framework construction method, which are not described herein again. The respective modules in the construction apparatus of the project framework described above may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 6. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of building a project framework. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 6 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, there is provided a computer device comprising a memory storing a computer program and a processor implementing the following steps when the processor executes the computer program:
acquiring a progressive webpage application configuration plug-in package, and analyzing the progressive webpage application configuration plug-in package to acquire a progressive webpage application configuration file;
after receiving a project construction instruction, generating a project frame by using a React project scaffold tool according to the project construction instruction, and storing a progressive webpage application configuration file into a project catalog corresponding to the project frame;
determining path information of the progressive webpage application configuration file in the project directory according to the progressive webpage application configuration file storage information;
and generating an introduction code corresponding to the progressive webpage application configuration file according to the path information, and writing the introduction code into a preset position of a project entry file in the project frame to obtain the project frame supporting the progressive webpage application.
In one embodiment, the processor, when executing the computer program, further performs the steps of: reading request information in a progressive webpage application configuration file; loading response data of the request information through an interface corresponding to the request information, and storing the response data into a cache memory; and when the request information is monitored, searching response data corresponding to the request data from the cache memory, and returning the response data.
In one embodiment, when the processor executes the computer program to implement the step of generating the import code corresponding to the progressive web application configuration file according to the path information, the following steps are specifically implemented: and determining the path information as an external reference attribute value, and writing the external reference attribute value into the script tag to obtain a reference code of the progressive webpage application configuration file.
In one embodiment, when the processor executes the computer program to implement the step of writing the import code into the preset position of the project entry file in the project framework, the following steps are specifically implemented: detecting whether a configuration object of a browser supports a progressive webpage application configuration interface or not; and if the configuration object supports the progressive webpage application configuration interface, writing the introduced code into the bottom position of the project entry file.
In one embodiment, when the processor executes the computer program to implement the step of obtaining the progressive web application profile, the following steps are specifically implemented: displaying a configuration information modification page, and acquiring configuration parameters of each configuration item through the configuration information modification page; acquiring a file template of a progressive webpage application configuration file, and determining positions to be imported, corresponding to each configuration item, in the file template; and respectively importing the configuration parameters of the configuration items to corresponding positions to be imported in the file template to obtain a self-defined progressive webpage application configuration file.
In one embodiment, the processor, when executing the computer program, further performs the steps of: when a configuration file updating instruction is received, traversing the item directory according to the configuration file updating instruction, and determining path information of a newly added progressive webpage application configuration file; and modifying the introduced code according to the path information of the newly added progressive webpage application configuration file.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring a progressive webpage application configuration plug-in package, and analyzing the progressive webpage application configuration plug-in package to acquire a progressive webpage application configuration file;
after receiving a project construction instruction, generating a project frame by using a React project scaffold tool according to the project construction instruction, and storing a progressive webpage application configuration file into a project catalog corresponding to the project frame;
determining path information of the progressive webpage application configuration file in the project directory according to the progressive webpage application configuration file storage information;
and generating an introduction code corresponding to the progressive webpage application configuration file according to the path information, and writing the introduction code into a preset position of a project entry file in the project frame to obtain the project frame supporting the progressive webpage application.
In one embodiment, the computer program when executed by the processor further performs the steps of: reading request information in a progressive webpage application configuration file; loading response data of the request information through an interface corresponding to the request information, and storing the response data into a cache memory; and when the request information is monitored, searching response data corresponding to the request data from the cache memory, and returning the response data.
In one embodiment, when the computer program is executed by the processor to implement the step of generating the import code corresponding to the progressive web application configuration file according to the path information, the following steps are specifically implemented: and determining the path information as an external reference attribute value, and writing the external reference attribute value into the script tag to obtain a reference code of the progressive webpage application configuration file.
In one embodiment, when the computer program is executed by the processor to implement the step of writing the import code into the preset location of the project entry file in the project framework, the following steps are specifically implemented: detecting whether a configuration object of a browser supports a progressive webpage application configuration interface or not; and if the configuration object supports the progressive webpage application configuration interface, writing the introduced code into a preset position of the project entry file.
In one embodiment, the computer program, when executed by the processor, performs the step of obtaining the progressive web application profile by: displaying a configuration information modification page, and acquiring configuration parameters of each configuration item through the configuration information modification page; acquiring a file template of a progressive webpage application configuration file, and determining positions to be imported, corresponding to each configuration item, in the file template; and respectively importing the configuration parameters of the configuration items to corresponding positions to be imported in the file template to obtain a self-defined progressive webpage application configuration file.
In one embodiment, the computer program when executed by the processor further performs the steps of: when a configuration file updating instruction is received, traversing the item directory according to the configuration file updating instruction, and determining path information of a newly added progressive webpage application configuration file; and modifying the introduced code according to the path information of the newly added progressive webpage application configuration file.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method of building a project framework, the method comprising:
acquiring a progressive webpage application configuration plug-in package, and analyzing the progressive webpage application configuration plug-in package to acquire a progressive webpage application configuration file;
after receiving a project construction instruction, generating a project frame by using a React project scaffold tool according to the project construction instruction, and storing the progressive webpage application configuration file into a project catalog corresponding to the project frame;
determining path information of the progressive webpage application configuration file in the project directory according to the progressive webpage application configuration file saving information;
and generating an introduction code corresponding to the progressive webpage application configuration file according to the path information, and writing the introduction code into a preset position of a project entry file in the project frame to obtain the project frame supporting the progressive webpage application.
2. The method of claim 1, wherein after the step of writing the import code into the preset location of the project entry file in the project framework, further comprising:
reading request information in the progressive webpage application configuration file;
loading response data of the request information through an interface corresponding to the request information, and storing the response data into a cache memory;
and when the request information is monitored, searching response data corresponding to the request data from the cache memory, and returning the response data.
3. The method according to claim 1, wherein the step of generating the import code corresponding to the progressive web application profile according to the path information comprises:
and determining the path information as an external reference attribute value and writing the external reference attribute value into a script tag to obtain a reference code of the progressive webpage application configuration file.
4. The method of claim 1, wherein the step of writing the import code into a preset location of an item entry file in the item framework comprises:
detecting whether a configuration object of a browser supports the progressive webpage application configuration interface or not;
and if the configuration object supports the progressive webpage application configuration interface, writing the introduction code into the bottom position of the project entry file.
5. The method of claim 1, wherein the step of obtaining the progressive web application profile comprises:
displaying a configuration information modification page, and acquiring configuration parameters of each configuration item through the configuration information modification page;
acquiring a file template of a progressive webpage application configuration file, and determining positions to be imported, corresponding to each configuration item, in the file template;
and respectively importing the configuration parameters of each configuration item to the corresponding position to be imported in the file template to obtain a self-defined progressive webpage application configuration file.
6. The method of claim 1, wherein after the step of writing the import code into the preset location of the project entry file in the project framework, further comprising:
when a configuration file updating instruction is received, traversing the project directory according to the configuration file updating instruction, and determining path information of a newly added progressive webpage application configuration file;
and modifying the introduction code according to the path information of the newly added progressive webpage application configuration file.
7. An apparatus for building a project framework, the apparatus comprising:
the configuration file acquisition module is used for acquiring a progressive webpage application configuration plug-in package and analyzing the progressive webpage application configuration plug-in package to acquire a progressive webpage application configuration file;
the configuration file loading module is used for generating a project frame by utilizing a React project scaffold tool according to a project construction instruction after receiving the project construction instruction, and storing the progressive webpage application configuration file into a project catalog corresponding to the project frame;
the path information acquisition module is used for determining the path information of the progressive webpage application configuration file in the project directory according to the progressive webpage application configuration file storage information;
and the lead-in code configuration module is used for generating a lead-in code corresponding to the progressive webpage application configuration file according to the path information, and writing the lead-in code into a preset position of a project entry file in the project frame to obtain the project frame supporting the progressive webpage application.
8. The apparatus of claim 7, further comprising:
the address information acquisition module is used for reading request information in the progressive webpage application configuration file;
the object data caching module is used for loading response data of the request information through an interface corresponding to the request information and storing the response data into a cache memory;
and the object data acquisition module is used for searching response data corresponding to the request data from the cache memory and returning the response data when the request information is monitored.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
CN201910748756.7A 2019-08-14 2019-08-14 Project framework construction method and device, computer equipment and storage medium Pending CN110647320A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910748756.7A CN110647320A (en) 2019-08-14 2019-08-14 Project framework construction method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910748756.7A CN110647320A (en) 2019-08-14 2019-08-14 Project framework construction method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110647320A true CN110647320A (en) 2020-01-03

Family

ID=69009585

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910748756.7A Pending CN110647320A (en) 2019-08-14 2019-08-14 Project framework construction method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110647320A (en)

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111290749A (en) * 2020-01-17 2020-06-16 深圳震有科技股份有限公司 Data processing method, intelligent terminal and storage medium
CN111367509A (en) * 2020-02-20 2020-07-03 江苏苏宁物流有限公司 Webpage development template generation method and device, computer equipment and storage medium
CN111666100A (en) * 2020-05-13 2020-09-15 深圳思为科技有限公司 Software framework generation method and device, electronic equipment and storage medium
CN111797351A (en) * 2020-06-29 2020-10-20 平安普惠企业管理有限公司 Page data management method and device, electronic equipment and medium
CN111897553A (en) * 2020-08-28 2020-11-06 杭州安恒信息技术股份有限公司 Project system building method, device, equipment and readable storage medium
CN111949262A (en) * 2020-08-14 2020-11-17 曙光信息产业(北京)有限公司 Front-end project construction method and device, computer equipment and storage medium
CN111949251A (en) * 2020-07-21 2020-11-17 广州钢铁侠信息科技有限公司 Method for realizing software development and operation across platforms
CN111966355A (en) * 2020-09-03 2020-11-20 平安国际智慧城市科技股份有限公司 Project operation method, device and equipment and computer storage medium
CN112270623A (en) * 2020-11-17 2021-01-26 广州地铁设计研究院股份有限公司 Progress simulation and comparison implementation method, equipment and medium based on lightweight BIM engine
CN113254040A (en) * 2021-06-01 2021-08-13 康键信息技术(深圳)有限公司 Front-end framework updating method, device, equipment and storage medium
CN113378091A (en) * 2021-06-08 2021-09-10 北京百度网讯科技有限公司 Visual project generation method and device, electronic equipment and storage medium
CN113536180A (en) * 2021-06-28 2021-10-22 北京达佳互联信息技术有限公司 Item processing method, item processing device, electronic equipment, storage medium and program product
CN113835737A (en) * 2021-08-24 2021-12-24 交控科技股份有限公司 Method and system for adding authority to front-end project
CN114048405A (en) * 2021-10-26 2022-02-15 盐城金堤科技有限公司 Method, device and equipment for generating entry template file and storage medium
CN115878923A (en) * 2023-01-30 2023-03-31 北京微吼时代科技有限公司 Method and system for constructing reusable interaction framework of arrangement and configuration
WO2023078053A1 (en) * 2021-11-03 2023-05-11 北京字节跳动网络技术有限公司 Code generation method and apparatus, and computer device and storage medium
CN116595285A (en) * 2023-07-19 2023-08-15 深圳复临科技有限公司 Route generation method, device, computer equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106875014A (en) * 2017-03-02 2017-06-20 上海交通大学 The automation of the soft project knowledge base based on semi-supervised learning builds implementation method
US20190065217A1 (en) * 2017-08-24 2019-02-28 Appy Pie Llc System and method for creating, distributing & rendering progressive web applications
CN109445835A (en) * 2018-09-03 2019-03-08 平安普惠企业管理有限公司 Method, terminal device and the computer readable storage medium of building project frame
CN109739478A (en) * 2018-12-24 2019-05-10 网易(杭州)网络有限公司 Front end project automated construction method, device, storage medium and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106875014A (en) * 2017-03-02 2017-06-20 上海交通大学 The automation of the soft project knowledge base based on semi-supervised learning builds implementation method
US20190065217A1 (en) * 2017-08-24 2019-02-28 Appy Pie Llc System and method for creating, distributing & rendering progressive web applications
CN109445835A (en) * 2018-09-03 2019-03-08 平安普惠企业管理有限公司 Method, terminal device and the computer readable storage medium of building project frame
CN109739478A (en) * 2018-12-24 2019-05-10 网易(杭州)网络有限公司 Front end project automated construction method, device, storage medium and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张怡芳: "渐进式"Web前端设计"与成长型思维训练", 《计算机教育》, no. 3, pages 84 - 87 *

Cited By (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111290749A (en) * 2020-01-17 2020-06-16 深圳震有科技股份有限公司 Data processing method, intelligent terminal and storage medium
CN111290749B (en) * 2020-01-17 2023-03-14 深圳震有科技股份有限公司 Data processing method, intelligent terminal and storage medium
CN111367509A (en) * 2020-02-20 2020-07-03 江苏苏宁物流有限公司 Webpage development template generation method and device, computer equipment and storage medium
CN111367509B (en) * 2020-02-20 2022-09-09 江苏苏宁物流有限公司 Webpage development template generation method and device, computer equipment and storage medium
CN111666100A (en) * 2020-05-13 2020-09-15 深圳思为科技有限公司 Software framework generation method and device, electronic equipment and storage medium
CN111666100B (en) * 2020-05-13 2023-12-15 深圳思为科技有限公司 Software framework generation method and device, electronic equipment and storage medium
CN111797351A (en) * 2020-06-29 2020-10-20 平安普惠企业管理有限公司 Page data management method and device, electronic equipment and medium
CN111949251A (en) * 2020-07-21 2020-11-17 广州钢铁侠信息科技有限公司 Method for realizing software development and operation across platforms
CN111949262A (en) * 2020-08-14 2020-11-17 曙光信息产业(北京)有限公司 Front-end project construction method and device, computer equipment and storage medium
CN111897553B (en) * 2020-08-28 2024-02-27 杭州安恒信息技术股份有限公司 Project system building method, device, equipment and readable storage medium
CN111897553A (en) * 2020-08-28 2020-11-06 杭州安恒信息技术股份有限公司 Project system building method, device, equipment and readable storage medium
CN111966355A (en) * 2020-09-03 2020-11-20 平安国际智慧城市科技股份有限公司 Project operation method, device and equipment and computer storage medium
CN111966355B (en) * 2020-09-03 2023-12-12 深圳赛安特技术服务有限公司 Project operation method, device, equipment and computer storage medium
CN112270623A (en) * 2020-11-17 2021-01-26 广州地铁设计研究院股份有限公司 Progress simulation and comparison implementation method, equipment and medium based on lightweight BIM engine
CN112270623B (en) * 2020-11-17 2022-08-12 广州地铁设计研究院股份有限公司 Progress simulation and comparison realization method, equipment and medium based on light BIM (building information modeling) engine
CN113254040A (en) * 2021-06-01 2021-08-13 康键信息技术(深圳)有限公司 Front-end framework updating method, device, equipment and storage medium
CN113254040B (en) * 2021-06-01 2023-10-20 康键信息技术(深圳)有限公司 Front-end framework updating method, device, equipment and storage medium
CN113378091A (en) * 2021-06-08 2021-09-10 北京百度网讯科技有限公司 Visual project generation method and device, electronic equipment and storage medium
CN113378091B (en) * 2021-06-08 2024-05-14 北京百度网讯科技有限公司 Visualized item generation method and device, electronic equipment and storage medium
CN113536180A (en) * 2021-06-28 2021-10-22 北京达佳互联信息技术有限公司 Item processing method, item processing device, electronic equipment, storage medium and program product
CN113835737A (en) * 2021-08-24 2021-12-24 交控科技股份有限公司 Method and system for adding authority to front-end project
CN114048405B (en) * 2021-10-26 2024-04-09 盐城天眼察微科技有限公司 Inlet template file generation method, device, equipment and storage medium
CN114048405A (en) * 2021-10-26 2022-02-15 盐城金堤科技有限公司 Method, device and equipment for generating entry template file and storage medium
WO2023078053A1 (en) * 2021-11-03 2023-05-11 北京字节跳动网络技术有限公司 Code generation method and apparatus, and computer device and storage medium
CN115878923A (en) * 2023-01-30 2023-03-31 北京微吼时代科技有限公司 Method and system for constructing reusable interaction framework of arrangement and configuration
CN116595285A (en) * 2023-07-19 2023-08-15 深圳复临科技有限公司 Route generation method, device, computer equipment and storage medium
CN116595285B (en) * 2023-07-19 2024-04-16 深圳复临科技有限公司 Route generation method, device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110647320A (en) Project framework construction method and device, computer equipment and storage medium
CN109901834B (en) Document page generation method, device, computer equipment and storage medium
CN108804159B (en) Javascript module loading method and preprocessing method and device thereof, and computer equipment
CN109614469A (en) A kind of log analysis method and device
CN108108219B (en) Application program running method and device, computer equipment and storage medium
CN111680253B (en) Page application data packet generation method and device, computer equipment and storage medium
CN110825619A (en) Automatic generation method and device of interface test case and storage medium
CN110659092A (en) Webpage screenshot method and device, computer equipment and storage medium
CN110888709A (en) Intelligent operation method and device of monitoring screen, computer equipment and storage medium
CN111078568A (en) Code specification method and device, computer equipment and storage medium
CN111797026A (en) Test case generation method and device, computer equipment and storage medium
CN110750443A (en) Webpage testing method and device, computer equipment and storage medium
CN108197024B (en) Embedded browser debugging method, debugging terminal and computer readable storage medium
CN108399125B (en) Automatic testing method and device, computer equipment and storage medium
CN111431767B (en) Multi-browser resource synchronization method and device, computer equipment and storage medium
CN110362341B (en) Business management method, device, equipment and storage medium based on micro-service architecture
CN109542501B (en) Browser table compatibility method and device, computer equipment and storage medium
CN107918587B (en) Debugging method and system for application program
KR20150096478A (en) Programmable controller, programmable controller system, and execute error information creation method
CN112613275A (en) Receipt generation method and device, computer equipment and storage medium
CN109492144B (en) Association relation analysis method, device and storage medium for software system
CN110598142A (en) Webpage calibration method and device, computer equipment and storage medium
CN110865943A (en) Interface testing method and device, computer equipment and storage medium
CN115934129A (en) Software project updating method and device, computer equipment and storage medium
CN111177624B (en) Website front-end and back-end communication method, device, computer equipment and 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