WO2021135584A1 - 前端项目框架的构建方法、装置、计算机设备及存储介质 - Google Patents

前端项目框架的构建方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2021135584A1
WO2021135584A1 PCT/CN2020/124660 CN2020124660W WO2021135584A1 WO 2021135584 A1 WO2021135584 A1 WO 2021135584A1 CN 2020124660 W CN2020124660 W CN 2020124660W WO 2021135584 A1 WO2021135584 A1 WO 2021135584A1
Authority
WO
WIPO (PCT)
Prior art keywords
end project
preset
project framework
package
framework
Prior art date
Application number
PCT/CN2020/124660
Other languages
English (en)
French (fr)
Inventor
刘洪博
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021135584A1 publication Critical patent/WO2021135584A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Definitions

  • This application belongs to the technical field of front-end framework architecture, and in particular relates to a method, device, computer equipment, and storage medium for constructing a front-end project framework.
  • the embodiments of the present application provide a method, device, computer equipment and storage medium for constructing a front-end project framework, aiming to solve the need to construct corresponding front-end project framework components in the prior art at any time, which is time-consuming, labor-intensive, and has high maintenance costs.
  • the problem is time-consuming, labor-intensive, and has high maintenance costs.
  • an embodiment of the present application provides a method for constructing a front-end project framework, which includes:
  • Import preset account information encode the account information according to preset encoding rules, and add a preset npm package to the packages.json file;
  • a preset release instruction is executed to release the front-end project framework and the released front-end project framework is stored in a preset warehouse to complete the construction of the front-end project framework.
  • an embodiment of the present application provides a device for constructing a front-end project framework, which includes:
  • a folder construction unit configured to create a folder of the front-end project framework according to the construction request if a construction request for constructing a front-end project framework sent by a user is received;
  • the initialization unit is configured to call a preset instruction in the folder of the front-end project framework to initialize the front-end project framework to generate the packages.json file;
  • the first adding unit is used to download a preset dependency package and add the dependency package to the packages.json file;
  • the second adding unit is configured to import preset account information and encode the account information according to preset encoding rules, and add a preset npm package to the packages.json file;
  • the storage unit executes a preset release instruction to release the front-end project framework and stores the released front-end project framework in a preset warehouse to complete the construction of the front-end project framework.
  • an embodiment of the present application further provides a computer device, including a memory, a processor, and a computer program stored on the memory and running on the processor, wherein the processor executes the Perform the following steps in the computer program:
  • Import preset account information encode the account information according to preset encoding rules, and add a preset npm package to the packages.json file;
  • a preset release instruction is executed to release the front-end project framework and the released front-end project framework is stored in a preset warehouse to complete the construction of the front-end project framework.
  • the embodiments of the present application also provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the following steps :
  • Import preset account information encode the account information according to preset encoding rules, and add a preset npm package to the packages.json file;
  • a preset release instruction is executed to release the front-end project framework and the released front-end project framework is stored in a preset warehouse to complete the construction of the front-end project framework.
  • the framework of the front-end project constructed by the above-mentioned method in the embodiment of the present application can facilitate business developers to directly develop without having to spend extra time to configure the development environment, thereby improving development efficiency.
  • Figure 1 is a schematic flow diagram of a method for constructing a front-end project framework provided by an embodiment of the application
  • FIG. 2 is a schematic diagram of an application scenario of a method for constructing a front-end project framework provided by an embodiment of the application;
  • FIG. 3 is a schematic diagram of a sub-process of a method for constructing a front-end project framework provided by an embodiment of the application;
  • FIG. 4 is a schematic diagram of another sub-process of the method for constructing a front-end project framework provided by an embodiment of the application;
  • FIG. 5 is a schematic diagram of another sub-process of the method for constructing a front-end project framework provided by an embodiment of the application;
  • Fig. 6 is a schematic block diagram of a device for constructing a front-end project framework provided by an embodiment of the application;
  • FIG. 7 is a schematic block diagram of subunits of a device for constructing a front-end project framework provided by an embodiment of the application;
  • FIG. 8 is a schematic block diagram of another subunit of the device for constructing a front-end project framework provided by an embodiment of the application;
  • FIG. 9 is a schematic block diagram of a computer device provided by an embodiment of the application.
  • FIG. 1 is a schematic flowchart of a method for constructing a front-end project framework provided by an embodiment of this application
  • FIG. 2 is a schematic diagram of an application scenario of a method for constructing a front-end project framework provided by an embodiment of this application.
  • the method for constructing the front-end project framework is applied to the first development terminal 10.
  • the front-end project framework is a Node.js project and is constructed based on the React framework. After the construction is completed, it is stored in the warehouse 30.
  • the front-end project framework framework can be obtained from the warehouse 30 through the second development terminal 20 for development.
  • Both the first development terminal 10 and the second development terminal 20 can be smart phones, tablets, and laptops. And terminal equipment such as desktop computers. It should be noted that only one second development terminal 20 is shown in FIG. 2. In actual operation, multiple second development terminals 20 can obtain the front-end project framework from the warehouse 30 for development.
  • the method includes steps S110 to S150.
  • a folder of the front-end project framework is created according to the construction request.
  • the construction request is that the user enters the instruction information requesting the construction of the front-end project framework in the first development terminal 10, and the instruction information belongs to the source code in the official github clone, that is, the user inputs the instructions for constructing the front-end project framework.
  • the github website or source directory has been downloaded and a basic scaffolding is formed, and then some necessary npm packages are installed to facilitate the subsequent creation of the front-end project framework folder.
  • the first development terminal 10 creates the front-end project framework folder to respond to the construction request sent by the user.
  • the folder is an empty folder and is used to store relevant codes for subsequent downloads.
  • a preset instruction for example, npm init
  • the preset instruction is used to initialize the front-end project framework in order to generate a packages.json file, where the packages.json file is a modular description file, that is, when a Node.js project is created , Means that a module is created, and the description file of the module is called the package.json file.
  • the package.json file contains the name, version number, project license, and attributes of the tool component package added to the package.json file, as well as a series of npm script instructions, that is, the package.json file records all the required in the front-end project framework Module.
  • node When the npm install command is executed, node will first read all the dependencies information from the package.json file, and then compare it with the modules in node_modules based on the information in the dependencies.
  • the package.json file only records the module information installed through npm install, and the information of other submodules that these modules depend on will not be recorded.
  • npm is the package management tool of Node.js and the largest software registration in the world.
  • npm used to install various Node.js extensions, npm is composed of three different parts: website, registry and command line interface.
  • the website is the main way for developers to find packages, set parameters and manage npm experience ,
  • the registry is a huge database and saves the information of each package, and the command line interface runs through the command line or terminal.
  • the dependency package is a necessary tool component package used by subsequent developers.
  • the dependency package includes a tool dependency package, a front-end dependency package, a back-end dependency package, and a UI component dependency package.
  • the tool dependency package may be webpack. Toolkit or esLint toolkit.
  • the front-end dependency package can be any of React front-end dependency package, React-redux dependency package, React-router front-end dependency package, and axios dependency toolkit.
  • the back-end dependency package can be Mock.js. End dependent package or Express back end dependent package.
  • the dependent package is remotely downloaded to the local warehouse in advance, and then the dependent package can be added to the packages.json file by executing the npm install--save command.
  • the tool dependency package is the esLint toolkit
  • the front-end dependency package is the React front-end dependency package
  • the back-end dependency package is the Express back-end dependency package
  • the UI component dependency package is the DBox-UI component dependency package
  • the component dependency package is a dependency package developed by the enterprise itself.
  • Import preset account information encode the account information according to preset encoding rules, and add a preset npm package to the packages.json file.
  • the preset account information is composed of an account number and an account password, and is a pass for the first development terminal 10 to use the front-end project framework for developers at the second development terminal 20, and the second development terminal 20 Before using the front-end project framework for business development, developers of need to verify through the preset account.
  • the preset encoding rule is the rule information of a pre-set compiling method for the preset account
  • the preset npm package is an npm package formulated by the enterprise itself.
  • the steps of adding a preset npm package to the packages.json file are: use the git clone command to clone the download path of the preset npm package; download the preset according to the download path of the preset npm package And store the npm package in the local warehouse; execute the npm install--save command to add the preset npm package to the packages.json file.
  • the Base64 method is used to encode the preset account information.
  • Base64 is one of the most common encoding methods used to transmit 8Bit bytecodes on the network, and Base64 is based on 64 printable Characters represent the method of binary data.
  • Base64 encoding is the process from binary to character, which can be used to transfer longer identification information in the HTTP environment.
  • before adding the preset npm package to the packages.json file it includes: creating a .npmrc file in the folder of the front-end project framework.
  • the .npmrc file is the configuration file of npm.
  • npm can obtain its configuration settings from the command line, environment variables, and .npmrc file.
  • a preset release instruction is executed to release the front-end project framework and the released front-end project framework is stored in a preset warehouse to complete the construction of the front-end project framework.
  • the release instruction is the instruction information used to request the first development terminal 10 to execute the application for the front-end project framework.
  • the first development terminal 10 responds to the npm publish command.
  • the step of publishing the front-end project framework may be executed. After the front-end project framework is published, it is stored in a preset warehouse and can be used by developers at the second development terminal 20.
  • the preset warehouse may be a remote warehouse shared by the first development terminal 10 and the second development terminal 20, or a local warehouse of the first development terminal 10, when the developer at the second development terminal 20 needs to use the
  • the front-end project framework in the preset warehouse can be downloaded from the local warehouse of the first development terminal 10.
  • the preset warehouse may also be the local warehouse of the second development terminal 20.
  • the developers at the development terminal 20 need to use the front-end project framework in the preset warehouse, they can directly call it from the local warehouse.
  • the preset warehouse is a remote warehouse shared by the first development terminal 10 and the second development terminal 20.
  • the front-end project framework is issued by executing a preset issuing instruction in step S150, including: S151, S152, and S153.
  • the preset cloning instruction is instruction information for cloning the download path of the git command line toolkit
  • the download path of the git command line toolkit is address information stored in the git command line toolkit
  • the developer at the first development terminal 10 can download the git command line toolkit.
  • the git command line toolkit is at the first development terminal 10.
  • the git command-line toolkit developed by the developers themselves is only for developers at the first development terminal 20 or developers at the second development terminal 20 to use.
  • the preset installation command can be either yarn install command or npm install command.
  • the yarn install command is preferably used to install the git command line toolkit into the packages.json file.
  • the front-end project framework is started by executing a preset project start instruction.
  • the preset project start instruction is instruction information used to start the front-end project framework, and the first development terminal 10 can complete it after executing the preset project start instruction to start the front-end project framework. Steps of publishing the front-end project framework.
  • the first development terminal 10 responds to the developer's input of the yarn start command and starts the front-end project framework.
  • steps S160 and S170 are further included after step S150.
  • S160 Receive an update request for updating the front-end project framework, where the update request includes an update instruction and a data packet with a new version number.
  • An update request for updating the front-end project framework is received, where the update request includes an update instruction and a data packet with a new version number.
  • the update request is request information for updating the software package in the front-end project framework
  • the data package of the new version number is a software package that can be added to the front-end project framework, which can be an update.
  • the local software package added in the front-end project framework may also be a global software package that updates the front-end project framework.
  • the first development terminal 10 receives the update of the software package in the front-end project framework, it first determines the type of the data packet with the new version number in the update request, usually according to the data package of the new version number. The suffix is used to determine the type of the data packet of the new version number.
  • the data package of the new version number is added to the front-end project framework and the data package of the new version number is automatically quoted according to the update instruction.
  • the update instruction is the instruction information of the first development terminal 10 in response to the command input by the user on the command interface. After judging the type of the package of the new version number, the data package of the new version number can be automatically quoted according to the corresponding update instruction, and then the data package of the new version number can be added to the warehouse. Update the front-end project framework.
  • the data package of the new version number is the local package added in the update of the front-end project framework
  • the data package of the new version number is the global package for updating the front-end project framework
  • the front-end project framework is updated.
  • the command can update the global package named jshint in the front-end project framework.
  • adding the data package of the new version number to the front-end project framework in step S170 includes sub-steps: S171 and S172.
  • developers tend to overlap with the names of the software packages in the front-end project framework when naming the data packages of the new version number.
  • the The catalog of the front-end project framework is comprehensively scanned to obtain whether there is a data package with the same name as the new version number in the catalog of the front-end project framework.
  • delete the data package with the same name as the data package with the new version number in the front-end project framework If there is a data package with the same name as the data package with the new version number in the front-end project framework, delete the data package with the same name as the data package with the new version number in the front-end project framework. Specifically, deleting the data package with the same name as the data package with the new version number in the front-end project framework is to uninstall the data package with the same name as the data package with the new version number in the front-end project framework.
  • execute the npm uninstall ⁇ package> command to uninstall the front-end project framework with the new version number.
  • the technical methods in this application can be applied to application scenarios that include the construction of front-end project frameworks such as smart government/smart city management/smart community/smart security/smart logistics/smart healthcare/smart education/smart environmental protection/smart transportation to promote The construction of smart cities.
  • front-end project frameworks such as smart government/smart city management/smart community/smart security/smart logistics/smart healthcare/smart education/smart environmental protection/smart transportation to promote The construction of smart cities.
  • the embodiment of the present application also provides a device 100 for constructing a front-end project framework, which is used to execute any embodiment of the aforementioned method for constructing a front-end project framework.
  • FIG. 6 is a schematic block diagram of the device 100 for constructing a front-end project framework provided by an embodiment of the present application.
  • the device 100 for constructing the front-end project framework includes a folder constructing unit 110, an initialization unit 120, a first adding unit 130, a second adding unit 140 and a storage unit 150.
  • the folder construction unit 110 is configured to, if a construction request for constructing a front-end project framework sent by a user is received, create a folder of the front-end project framework according to the construction request.
  • the initialization unit 120 is configured to call a preset instruction in the folder of the front-end project framework to initialize the front-end project framework to generate a packages.json file.
  • the first adding unit 130 is configured to download a preset dependent package and add the dependent package to the packages.json file.
  • the second adding unit 140 is configured to import preset account information, encode the account information according to preset encoding rules, and add a preset npm package to the packages.json file.
  • the device 100 for constructing the front-end project framework further includes: a creating unit 141.
  • the creating unit 141 is used to create a .npmrc file in the folder of the front-end project framework.
  • the storage unit 150 executes a preset release instruction to release the front-end project framework and stores the released front-end project framework in a preset warehouse to complete the construction of the front-end project framework.
  • the storage unit 150 includes: a cloning unit 151, a downloading unit 152 and a starting unit 153.
  • the cloning unit 151 is configured to execute the preset cloning instruction to clone the download path of the preset git command line toolkit.
  • the download unit 152 is configured to download the git command line toolkit according to the download path and add the git command line toolkit to the packages.json file.
  • the activation unit 153 is configured to execute a preset project activation instruction to activate the front-end project framework.
  • the device 100 for constructing the front-end project framework further includes: a receiving unit 160 and an updating unit 170.
  • the receiving unit 160 is configured to receive an update request for updating the front-end project framework, where the update request includes an update instruction and a data packet with a new version number.
  • the update unit 170 is configured to add the data package of the new version number to the front-end project framework and automatically reference the data package of the new version number according to the update instruction.
  • the update unit 170 includes: a judgment unit 171 and a deletion unit 172.
  • the judging unit 171 is configured to judge whether there is a data package with the same name as the data package of the new version number in the front-end project framework.
  • the deleting unit 172 is configured to delete a data package with the same name as the data package with the new version number in the front-end project framework if there is a package with the same name as the data package with the new version number in the front-end project framework.
  • FIG. 9 is a schematic block diagram of a computer device according to an embodiment of the present application.
  • the device 500 includes a processor 502, a memory, and a network interface 505 connected through a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
  • the non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032.
  • the processor 502 can execute the method for constructing the front-end project framework.
  • the processor 502 is used to provide calculation and control capabilities, and support the operation of the entire device 500.
  • the internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503.
  • the processor 502 can execute the method for constructing the front-end project framework.
  • the network interface 505 is used for network communication, such as providing data information transmission.
  • 9 is only a block diagram of part of the structure related to the solution of the present application, and does not constitute a limitation on the device 500 to which the solution of the present application is applied.
  • the specific device 500 may Including more or fewer parts than shown in the figure, or combining some parts, or having a different arrangement of parts.
  • the processor 502 is configured to run a computer program 5032 stored in a memory to implement any embodiment of the method for constructing a front-end project framework described above.
  • the processor 502 may be a central processing unit (Central Processing Unit, CPU), and the processor 502 may also be other general-purpose processors 502, or digital signal processors 502 (Digital Signal Processors, DSPs). ), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor 502 may be a microprocessor 502 or the processor 502 may also be any conventional processor 502 and the like.
  • the computer program may be stored in a storage medium, and the storage medium may be a computer-readable storage medium.
  • the computer program is executed by at least one processor in the computer system to implement the process steps of the foregoing method embodiment.
  • the computer-readable storage medium may be nonvolatile or volatile.
  • the storage medium stores a computer program that, when executed by a processor, implements any embodiment of the method for constructing a front-end project framework.
  • the computer-readable storage medium may be a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a magnetic disk, or an optical disk, and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

一种前端项目框架的构建方法、装置、计算机设备及存储介质,该方法包括:若接收到用户发送的构建前端项目框架的构建请求,根据构建请求创建前端项目框架的文件夹(S110);在前端项目框架的文件夹中调用预设的指令初始化前端项目框架以生成packages.json文件(S120);下载预置的依赖包并将依赖包添加到packages.json文件中(S130);导入预设的账号并根据预设的编码规则对账号进行编码并在packages.json文件中添加预置的npm包(S140);执行预设的发布指令发布前端项目框架并将发布后的前端项目框架存储在预设的仓库中以完成前端项目框架的构建(S150)。所述方法基于研发框架技术,通过上述方法构建得到的前端项目框架可方便业务开发人员直接进行开发,无需重新花费额外时间去配置开发环境,提高了开发效率。

Description

前端项目框架的构建方法、装置、计算机设备及存储介质
本申请要求于2020年07月31日提交中国专利局、申请号为202010763059.1,发明名称为“前端项目框架的构建方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请属于前端框架构架技术领域,尤其涉及一种前端项目框架的构建方法、装置、计算机设备及存储介质。
背景技术
在传统的前端开发模式中构建一个项目往往只需要几个页面jq插件便可完成,但是发明人意识到目前随着web业务日益复杂化和多元化,使得项目的逐渐庞大,而传统的项目构建方式已经无法满足业务庞大的增长,开发人员需随时构建相应的前端项目的框架组件,耗时费力,且维护成本较高。
发明内容
本申请实施例提供了一种前端项目框架的构建方法、装置、计算机设备及存储介质,旨在解决现有技术中需随时构建相应的前端项目的框架组件,耗时费力,且维护成本较高的问题。
第一方面,本申请实施例提供了一种前端项目框架的构建方法,其包括:
若接收到用户发送的构建前端项目框架的构建请求,根据所述构建请求创建所述前端项目框架的文件夹;
在所述前端项目框架的文件夹中调用预设的指令初始化所述前端项目框架以生成packages.json文件;
下载预置的依赖包并将所述依赖包添加到所述packages.json文件中;
导入预设的账号信息并根据预设的编码规则对所述账号信息进行编码并在所述packages.json文件中添加预置的npm包;
执行预设的发布指令发布所述前端项目框架并将发布后的所述前端项目框架存储在预设的仓库中以完成所述前端项目框架的构建。
第二方面,本申请实施例提供了一种前端项目框架的构建装置,其包括:
文件夹构建单元,用于若接收到用户发送的构建前端项目框架的构建请求,根据所述构建请求创建所述前端项目框架的文件夹;
初始化单元,用于在所述前端项目框架的文件夹中调用预设的指令初始化所述前端项目框架以生成packages.json文件;
第一添加单元,用于下载预置的依赖包并将所述依赖包添加到所述packages.json文件中;
第二添加单元,用于导入预设的账号信息并根据预设的编码规则对所述账号信息进行编码并在所述packages.json文件中添加预置的npm包;
存储单元,执行预设的发布指令发布所述前端项目框架并将发布后的所述前端项目框架存储在预设的仓库中以完成所述前端项目框架的构建。
第三方面,本申请实施例又提供了一种计算机设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时执行以下步骤:
若接收到用户发送的构建前端项目框架的构建请求,根据所述构建请求创建所述前端项目框架的文件夹;
在所述前端项目框架的文件夹中调用预设的指令初始化所述前端项目框架以生成packages.json文件;
下载预置的依赖包并将所述依赖包添加到所述packages.json文件中;
导入预设的账号信息并根据预设的编码规则对所述账号信息进行编码并在所述packages.json文件中添加预置的npm包;
执行预设的发布指令发布所述前端项目框架并将发布后的所述前端项目框架存储在预设的仓库中以完成所述前端项目框架的构建。
第四方面,本申请实施例还提供了一种计算机可读存储介质,其中所述计算机可读存储介质存储有计算机程序,所述计算机程序当被处理器执行时使所述处理器执行以下步骤:
若接收到用户发送的构建前端项目框架的构建请求,根据所述构建请求创建所述前端项目框架的文件夹;
在所述前端项目框架的文件夹中调用预设的指令初始化所述前端项目框架以生成packages.json文件;
下载预置的依赖包并将所述依赖包添加到所述packages.json文件中;
导入预设的账号信息并根据预设的编码规则对所述账号信息进行编码并在所述packages.json文件中添加预置的npm包;
执行预设的发布指令发布所述前端项目框架并将发布后的所述前端项目框架存储在预设的仓库中以完成所述前端项目框架的构建。
本申请实施例通过上述方法构建得到的前端项目的框架可方便业务开发人员直接进行开发,无需重新花费额外时间去配置开发环境,提高了开发效率。
附图说明
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的前端项目框架的构建方法的流程示意图;
图2为本申请实施例提供的前端项目框架的构建方法的应用场景示意图;
图3为本申请实施例提供的前端项目框架的构建方法的子流程示意图;
图4为本申请实施例提供的前端项目框架的构建方法的另一子流程示意图;
图5为本申请实施例提供的前端项目框架的构建方法的另一子流程示意图;
图6为本申请实施例提供的前端项目框架的构建装置的示意性框图;
图7为本申请实施例提供的前端项目框架的构建装置的子单元示意性框图;
图8为本申请实施例提供的前端项目框架的构建装置的另一子单元示意性框图;
图9为本申请实施例提供的计算机设备的示意性框图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”和“包含”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。
还应当理解,在此本申请说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本申请。如在本申请说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。
还应当进一步理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。
请参阅图1和图2,图1为本申请实施例提供的前端项目框架的构建方法的流程示意图;图2为本申请实施例提供的前端项目框架的构建方法的应用场景示意图。所述的前端项目框架的构建方法应用于第一开发终端10中,所述前端项目框架为Node.js项目并基于React框架来进行构建,构建完成后存储于仓库30中,当开发人员需要使用所述前端项目框架框架时,可通过第二开发终端20从仓库30中获取所述前端项目框架框架进行开发,第一开发终端10、第二开发终端20均可以为智能手机、平板电脑、笔记本以及台式电脑等终端设备。需要说明的是,图2中仅仅示意出了一台第二开发终端20,在实际操作过程中,多台第二开发终端20均可从仓库30中获取所述前端项目框架进行开发。
如图1所示,该方法包括步骤S110~S150。
S110、若接收到用户发送的构建前端项目框架的构建请求,根据所述构建请求创建所述前端项目框架的文件夹。
若接收到用户发送的构建前端项目框架的构建请求,根据所述构建请求创建所述前端项目框架的文件夹。具体的,所述构建请求为用户在第一开发终端10中输入请求构建所述前端项目框架的指令信息,该指令信息属于官方github clone中的源码,即用户在输入构建所述前端项目框架的构建请求之前,就已下载了github网站或源码目录并形成一个基本的脚手架,然后安装一些必要的npm包以便于后续创建所述前端项目框架的文件夹。第一开发终端10在接收到所述构建请求后,在创建所述前端项目框架的文件夹来响应用户发送的构建请求。所述文件夹为一个空文件夹并用于存放后续下载的相关代码。
S120、在所述前端项目框架的文件夹中调用预设的指令初始化所述前端项目框架以生成packages.json文件。
在所述前端项目框架的文件夹中调用预设的指令(例如npm init)初始化所述前端项目 框架以生成packages.json文件。具体的,所述预设的指令为用于初始化所述前端项目框架以便于生成packages.json文件,其中,所述packages.json文件为一个模块化描述文件,即当创建了一个Node.js项目,意味着创建了一个模块,该模块的描述文件便被被称为package.json文件。package.json文件中包含着添加到package.json文件中的工具组件包的名称、版本号、项目许可以及申明一系列npm脚本指令等属性,即package.json文件记录前端项目框架中所需要的所有模块。当执行npm install命令的时候,node会先从package.json文件中读取所有dependencies信息,然后根据dependencies中的信息与node_modules中的模块进行对比。另外,package.json文件只记录通过npm install方式安装的模块信息,而这些模块所依赖的其他子模块的信息不会记录,其中npm是Node.js的包管理工具,也是世界上最大的软件注册表,用来安装各种Node.js的扩展,npm由网站、注册表以及命令行界面三个不同的部分组成,网站是开发者查找包(package)、设置参数以及管理npm使用体验的主要途径,注册表是一个巨大的数据库并保存了每个包的信息,命令行界面通过命令行或终端运行。
S130、下载预置的依赖包并将所述依赖包添加到所述packages.json文件中。
下载预置的依赖包并将所述依赖包添加到所述packages.json文件中。具体的,所述依赖包为后续开发人员用到的必要工具组件包,所述依赖包包括工具依赖包、前端依赖包、后端依赖包以及UI组件依赖包,其中,工具依赖包可以为webpack工具包或esLint工具包,前端依赖包可以为React前端依赖包、React-redux依赖包、React-router前端依赖包、axios依赖工具包中的任意一种,后端依赖包可以为Mock.js后端依赖包或Express后端依赖包。所述依赖包预先远程下载到本地仓库中,然后执行npm install--save命令便可将所述依赖包添加到所述packages.json文件中。在本申请实施例中,工具依赖包为esLint工具包,前端依赖包为React前端依赖包,后端依赖包为Express后端依赖包,UI组件依赖包为DBox-UI组件依赖包,DBox-UI组件依赖包为企业自行研制的依赖包。
S140、导入预设的账号信息并根据预设的编码规则对所述账号信息进行编码并在所述packages.json文件中添加预置的npm包。
导入预设的账号信息并根据预设的编码规则对所述账号信息进行编码并在所述packages.json文件中添加预置的npm包。具体的,所述预设的账号信息由账号和账号密码组成,为第一开发终端10为第二开发终端20处的开发人员制定的使用所述前端项目框架的通行证,第二开发终端20处的开发人员在使用所述前端项目框架进行业务开发的前,需通过所述预设的账号进行验证。所述预设的编码规则为对所述预设的账号进行预先设定的编译方式的规则信息,所述预置的npm包为企业自行制定的npm包。在所述packages.json文件中添加预置的npm包的步骤为:使用git clone命令克隆所述预置的npm包的下载路径;根据所述预置的npm包的下载路径下载所述预置的npm包并存储至本地仓库中;执行npm install--save命令便将所述预置的npm包添加到所述packages.json文件中。在本申请实施例中,采用Base64方法对所述预设的账号信息进行编码,Base64是网络上最常见的用于传输8Bit字节码的编码方式之一,Base64就是一种基于64个可打印字符来表示二进制数据的方法,Base64编码是从二进制到字符的过程,可用于在HTTP环境下传递较长的标识信息。
在其他申请实施例中,所述在所述packages.json文件中添加预置的npm包之前,包括:在所述前端项目框架的文件夹中创建.npmrc文件。
在所述前端项目框架的文件夹中创建.npmrc文件。具体的,所述.npmrc文件即为npm的配置文件,npm可从命令行,环境变量和.npmrc文件获取其配置设置,当在执行npm install-g cordova ionic命令出现错误时,可以通过.npmrc文件来修改npm源。
S150、执行预设的发布指令发布所述前端项目框架并将发布后的所述前端项目框架存储在预设的仓库中以完成所述前端项目框架的构建。
执行预设的发布指令发布所述前端项目框架并将发布后的所述前端项目框架存储在预设的仓库中以完成所述前端项目框架的构建。具体的,所述发布指令为用于请求第一开发终端10执行申请所述前端项目框架的指令信息,通常在命令工具界面中输入Npm publish命令后,第一开发终端10为响应npm publish命令便可执行发布所述前端项目框架的步骤,所述前端项目框架发布完成后存储在预设的仓库中便可供第二开发终端20处的开发人员使用。所述预设的仓库可以为第一开发终端10和第二开发终端20共用的远程仓库,也可以为第一开发终端10的本地仓库,当第二开发终端20处的开发人员需要使用所述预设的仓库中的所述前端项目框架时,可从第一开发终端10的本地仓库中进行下载,同时,所述预设的仓库还可以为第二开发终端20的本地仓库,当第二开发终端20处的开发人员需要使用所述预设的仓库中的所述前端项目框架时,可直接从本地仓库调用。在本申请实施例中,所述预设的仓库为第一开发终端10和第二开发终端20共用的远程仓库。
在其他申请实施例中,如图3所示,步骤S150中执行预设的发布指令发布所述前端项目框架,包括:S151、S152和S153。
S151、执行预设的克隆指令克隆预置的git命令行工具包的下载路径。
执行预设的克隆指令克隆预置的git命令行工具包的下载路径。具体的,所述预设的克隆指令为用于克隆所述git命令行工具包的下载路径的指令信息,所述git命令行工具包的下载路径为所述git命令行工具包存储的地址信息,第一开发终端10处的开发人员在获取到所述git命令行工具包的下载路径后,便可下载所述git命令行工具包,所述git命令行工具包为第一开发终端10处的开发人员自行制定的git命令行工具包并只供第一开发终端20处的开发人员或第二开发终端20处的开发人员进行使用。
S152、根据所述下载路径下载所述git命令行工具包并将所述git命令行工具包添加到所述packages.json文件中。
根据所述下载路径下载所述git命令行工具包并将所述git命令行工具包添加到所述packages.json文件中。具体的,第一开发终端10通过所述下载路径下载所述git命令行工具包后,执行预设的安装指令便可将所述git命令行工具包安装到packages.json文件中,其中,所述预设的安装指令既可以为yarn install指令,也可以为npm install指令。在本申请实施例中,优先采用yarn install指令将所述git命令行工具包安装到packages.json文件中。
S153、执行预设的项目启动指令启动所述前端项目框架。
执行预设的项目启动指令启动所述前端项目框架。具体的,所述预设的项目启动指令为 用于启动所述前端项目框架的指令信息,第一开发终端10在执行所述预设的项目启动指令以启动所述前端项目框架后便可完成发布所述前端项目框架的步骤。在本申请实施例中,第一开发终端10处的开发人员在输入yarn start命令后,第一开发终端10响应开发人员在输入yarn start命令并启动所述前端项目框架。
在其他申请实施例中,如图4所示,步骤S150之后还包括步骤S160和S170。
S160、接收更新所述前端项目框架的更新请求,其中,所述更新请求包括更新指令以及新版本号的数据包。
接收更新所述前端项目框架的更新请求,其中,所述更新请求包括更新指令以及新版本号的数据包。具体的,所述更新请求为用于更新所述前端项目框架中的软件包的请求信息,所述新版本号的数据包为可添加到所述前端项目框架中的软件包,既可以为更新所述前端项目框架中的添加的本地软件包,也可以为更新所述前端项目框架的全局软件包。当第一开发终端10在接收到更新所述前端项目框架中的软件包后,首先判断所述更新请求中的新版本号的数据包的类型,通常可根据所述新版本号的数据包的后缀来进行判断以得出所述新版本号的数据包的类型。
S170、将所述新版本号的数据包添加到所述前端项目框架中并根据所述更新指令自动引用所述新版本号的数据包。
将所述新版本号的数据包添加到所述前端项目框架中并根据所述更新指令自动引用所述新版本号的数据包。具体的,所述更新指令为第一开发终端10为响应用户在命令界面输入的命令的指令信息。在判断出所述新版号的包的类型后,便可根据相应的更新指令来自动引用所述新版本号的数据包,进而完成将所述新版本号的数据包添加到所述仓库中以更新所述前端项目框架。当所述新版本号的数据包为更新所述前端项目框架中添加的本地包时,首先在所述package.json文件所在的目录中执行npm update命令,然后执行npm outdated命令便可将所述新版本号的数据包添加到所述前端项目框架中;当所述新版本号的数据包为更新所述前端项目框架的全局包时,输入npm update-g<package>命令便可完成所述前端项目框架的更新。具体的,当要更新所述前端项目框架中名为jshint全局包时,输入npm outdated-g--depth=0.命令找出所述前端项目框架中名为jshint全局包,然后输入npm update-g.命令便可更新所述前端项目框架中名为jshint全局包。
在其他申请实施例中,如图5所示,步骤S170中所述将所述新版本号的数据包添加到所述前端项目框架中,包括子步骤:S171和S172。
S171、判断所述前端项目框架中是否存在与所述新版本号的数据包相同名称的数据包。
判断所述前端项目框架中是否存在与所述新版本号的数据包相同名称的数据包。具体的,由于所述前端项目框架中的软件包数量繁多,开发人员在对所述新版本号的数据包进行命名时容易出现与所述前端项目框架中的软件包的名称相重叠,导致在将所述新版本号的数据包添加到所述前端项目框架中时出现添加错误的问题,因此,在将所述新版本号的数据包添加到所述前端项目框架中之前,需对所述前端项目框架的目录进行全面扫描以得到所述前端项目框架的目录是否存在与所述新版本号相同名称的数据包。
S172、若所述前端项目框架中存在与所述新版本号的数据包相同名称的数据包,删除所述前端项目框架中与所述新版本号的数据包相同名称的数据包。
若所述前端项目框架中存在与所述新版本号的数据包相同名称的数据包,删除所述前端项目框架中与所述新版本号的数据包相同名称的数据包。具体的,所述删除所述前端项目框架中与所述新版本号的数据包相同名称的数据包即为卸载所述前端项目框架中与所述新版本号的数据包相同名称的数据包。当所述前端项目框架中与所述新版本号的数据包相同名称的包为本地软件包时,执行npm uninstall<package>:命令便可卸载所述前端项目框架中与所述新版本号的数据包相同名称的数据包;当所述前端项目框架中与所述新版本号的数据包相同名称的数据包为所述前端项目框架中的软件包时,执行npm uninstall-g<package>:命令便可卸载所述前端项目框架中与所述新版本号的数据包相同名称的数据包。
本申请中的技术方法可应用于智慧政务/智慧城管/智慧社区/智慧安防/智慧物流/智慧医疗/智慧教育/智慧环保/智慧交通等包含进行前端项目框架的构建的应用场景中,从而推动智慧城市的建设。
本申请实施例还提供了一种前端项目框架的构建装置100,该装置用于执行前述前端项目框架的构建方法的任一实施例。具体地,请参阅图6,图6是本申请实施例提供的前端项目框架的构建装置100的示意性框图。
如图6所示,所述的前端项目框架的构建装置100,该装置包括文件夹构建单元110、初始化单元120、第一添加单元130、第二添加单元140和存储单元150。
文件夹构建单元110,用于若接收到用户发送的构建前端项目框架的构建请求,根据所述构建请求创建所述前端项目框架的文件夹。
初始化单元120,用于在所述前端项目框架的文件夹中调用预设的指令初始化所述前端项目框架以生成packages.json文件。
第一添加单元130,用于下载预置的依赖包并将所述依赖包添加到所述packages.json文件中。
第二添加单元140,用于导入预设的账号信息并根据预设的编码规则对所述账号信息进行编码并在所述packages.json文件中添加预置的npm包。
在其他申请实施例中,所述的前端项目框架的构建装置100还包括:创建单元141。
创建单元141,用于在所述前端项目框架的文件夹中创建.npmrc文件。
存储单元150,执行预设的发布指令发布所述前端项目框架并将发布后的所述前端项目框架存储在预设的仓库中以完成所述前端项目框架的构建。
在其他申请实施例中,如图7所示,所述存储单元150包括:克隆单元151、下载单元152和启动单元153。
克隆单元151,用于执行预设的克隆指令克隆预置的git命令行工具包的下载路径。
下载单元152,用于根据所述下载路径下载所述git命令行工具包并将所述git命令行工具包添加到所述packages.json文件中。
启动单元153,用于执行预设的项目启动指令启动所述前端项目框架。
在其他申请实施例中,所述的前端项目框架的构建装置100还包括:接收单元160和更新单元170。
接收单元160,用于接收更新所述前端项目框架的更新请求,其中,所述更新请求包括更新指令以及新版本号的数据包。
更新单元170,用于将所述新版本号的数据包添加到所述前端项目框架中并根据所述更新指令自动引用所述新版本号的数据包。
在其他申请实施例中,如图8所示,所述更新单元170包括:判断单元171和删除单元172。
判断单元171,用于判断所述前端项目框架中是否存在与所述新版本号的数据包相同名称的数据包。
删除单元172,用于若所述前端项目框架中存在与所述新版本号的数据包相同名称的包,删除所述前端项目框架中与所述新版本号的数据包相同名称的数据包。
请参阅图9,图9是本申请实施例提供的计算机设备的示意性框图。
参阅图9,该设备500包括通过系统总线501连接的处理器502、存储器和网络接口505,其中,存储器可以包括非易失性存储介质503和内存储器504。
该非易失性存储介质503可存储操作系统5031和计算机程序5032。该计算机程序5032被执行时,可使得处理器502执行前端项目框架的构建方法。该处理器502用于提供计算和控制能力,支撑整个设备500的运行。该内存储器504为非易失性存储介质503中的计算机程序5032的运行提供环境,该计算机程序5032被处理器502执行时,可使得处理器502执行前端项目框架的构建方法。该网络接口505用于进行网络通信,如提供数据信息的传输等。本领域技术人员可以理解,图9中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的设备500的限定,具体的设备500可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
其中,所述处理器502用于运行存储在存储器中的计算机程序5032,以实现上述前端项目框架的构建方法的任一实施例。
应当理解,在本申请实施例中,处理器502可以是中央处理单元(Central Processing Unit,CPU),该处理器502还可以是其他通用处理器502、数字信号处理器502(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器502可以是微处理器502或者该处理器502也可以是任何常规的处理器502等。
本领域普通技术人员可以理解的是实现上述实施例的方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成。该计算机程序可存储于一存储介质中,该存储介质可以为计算机可读存储介质。该计算机程序被该计算机系统中的至少一个处理器执行,以实现上述方法的实施例的流程步骤。
因此,本申请还提供了一种计算机可读存储介质。该计算机可读存储介质可以是非易失 性,也可以是易失性。该存储介质存储有计算机程序,该计算机程序当被处理器执行时实现上述前端项目框架的构建方法的任一实施例。
该计算机可读存储介质可以是U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置、设备和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的装置、设备和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (20)

  1. 一种前端项目框架的构建方法,其中,包括以下步骤:
    若接收到用户发送的构建前端项目框架的构建请求,根据所述构建请求创建所述前端项目框架的文件夹;
    在所述前端项目框架的文件夹中调用预设的指令初始化所述前端项目框架以生成packages.json文件;
    下载预置的依赖包并将所述依赖包添加到所述packages.json文件中;
    导入预设的账号信息并根据预设的编码规则对所述账号信息进行编码并在所述packages.json文件中添加预置的npm包;
    执行预设的发布指令发布所述前端项目框架并将发布后的所述前端项目框架存储在预设的仓库中以完成所述前端项目框架的构建。
  2. 根据权利要求1所述的前端项目框架的构建方法,其中,所述在所述packages.json文件中添加预置的npm包之前,还包括:
    在所述前端项目框架的文件夹中创建.npmrc文件。
  3. 根据权利要求2所述的前端项目框架的构建方法,其中,所述.npmrc文件为npm的配置文件。
  4. 根据权利要求1所述的前端项目框架的构建方法,其中,所述执行预设的发布指令发布所述前端项目框架,包括:
    执行预设的克隆指令克隆预置的git命令行工具包的下载路径;
    根据所述下载路径下载所述git命令行工具包并将所述git命令行工具包添加到所述packages.json文件中;
    执行预设的项目启动指令启动所述前端项目框架。
  5. 根据权利要求1所述的前端项目框架的构建方法,其中,所述将发布后的所述前端项目框架存储在预设的仓库中以完成所述前端项目框架的构建之后,还包括:
    接收更新所述前端项目框架的更新请求,其中,所述更新请求包括更新指令以及新版本号的数据包;
    将所述新版本号的数据包添加到所述前端项目框架中并根据所述更新指令自动引用所述新版本号的数据包。
  6. 根据权利要求1所述的前端项目框架的构建方法,其中,所述将所述新版本号的数据包添加到所述前端项目框架中之前,包括:
    判断所述前端项目框架中是否存在与所述新版本号的数据包相同名称的数据包;
    若所述前端项目框架中存在与所述新版本号的数据包相同名称的数据包,删除所述前端项目框架中与所述新版本号的数据包相同名称的数据包。
  7. 根据权利要求1所述的前端项目框架的构建方法,其中,所述packages.json文件为模块化描述文件,所述package.json文件包括添加到package.json文件中的工具组件包的名称、版本号、项目许可以及申明一系列npm脚本指令。
  8. 一种前端项目框架的构建装置,其中,包括:
    文件夹构建单元,用于若接收到用户发送的构建前端项目框架的构建请求,根据所述构建请求创建所述前端项目框架的文件夹;
    初始化单元,用于在所述前端项目框架的文件夹中调用预设的指令初始化所述前端项目框架以生成packages.json文件;
    第一添加单元,用于下载预置的依赖包并将所述依赖包添加到所述packages.json文件中;
    第二添加单元,用于导入预设的账号信息并根据预设的编码规则对所述账号信息进行编码并在所述packages.json文件中添加预置的npm包;
    存储单元,执行预设的发布指令发布所述前端项目框架并将发布后的所述前端项目框架存储在预设的仓库中以完成所述前端项目框架的构建。
  9. 一种计算机设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时执行以下步骤:
    若接收到用户发送的构建前端项目框架的构建请求,根据所述构建请求创建所述前端项目框架的文件夹;
    在所述前端项目框架的文件夹中调用预设的指令初始化所述前端项目框架以生成packages.json文件;
    下载预置的依赖包并将所述依赖包添加到所述packages.json文件中;
    导入预设的账号信息并根据预设的编码规则对所述账号信息进行编码并在所述packages.json文件中添加预置的npm包;
    执行预设的发布指令发布所述前端项目框架并将发布后的所述前端项目框架存储在预设的仓库中以完成所述前端项目框架的构建。
  10. 根据权利要求9所述的计算机设备,其中,所述在所述packages.json文件中添加预置的npm包之前,还包括:
    在所述前端项目框架的文件夹中创建.npmrc文件。
  11. 根据权利要求10所述的计算机设备,其中,所述.npmrc文件为npm的配置文件。
  12. 根据权利要求9所述的计算机设备,其中,所述执行预设的发布指令发布所述前端项目框架,包括:
    执行预设的克隆指令克隆预置的git命令行工具包的下载路径;
    根据所述下载路径下载所述git命令行工具包并将所述git命令行工具包添加到所述packages.json文件中;
    执行预设的项目启动指令启动所述前端项目框架。
  13. 根据权利要求9所述的计算机设备,其中,所述将发布后的所述前端项目框架存储在预设的仓库中以完成所述前端项目框架的构建之后,还包括:
    接收更新所述前端项目框架的更新请求,其中,所述更新请求包括更新指令以及新版本号的数据包;
    将所述新版本号的数据包添加到所述前端项目框架中并根据所述更新指令自动引用所述新版本号的数据包。
  14. 根据权利要求9所述的计算机设备,其中,所述将所述新版本号的数据包添加到所述前端项目框架中之前,包括:
    判断所述前端项目框架中是否存在与所述新版本号的数据包相同名称的数据包;
    若所述前端项目框架中存在与所述新版本号的数据包相同名称的数据包,删除所述前端项目框架中与所述新版本号的数据包相同名称的数据包。
  15. 根据权利要求9所述的计算机设备,其中,所述packages.json文件为模块化描述文件,所述package.json文件包括添加到package.json文件中的工具组件包的名称、版本号、项目许可以及申明一系列npm脚本指令。
  16. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机程序,所述计算机程序当被处理器执行以下步骤:
    若接收到用户发送的构建前端项目框架的构建请求,根据所述构建请求创建所述前端项目框架的文件夹;
    在所述前端项目框架的文件夹中调用预设的指令初始化所述前端项目框架以生成packages.json文件;
    下载预置的依赖包并将所述依赖包添加到所述packages.json文件中;
    导入预设的账号信息并根据预设的编码规则对所述账号信息进行编码并在所述packages.json文件中添加预置的npm包;
    执行预设的发布指令发布所述前端项目框架并将发布后的所述前端项目框架存储在预设的仓库中以完成所述前端项目框架的构建。
  17. 根据权利要求16所述的计算机可读存储介质,其中,所述在所述packages.json文件中添加预置的npm包之前,还包括:
    在所述前端项目框架的文件夹中创建.npmrc文件。
  18. 根据权利要求17所述的计算机可读存储介质,其中,所述.npmrc文件为npm的配置文件。
  19. 根据权利要求16所述的计算机可读存储介质,其中,所述执行预设的发布指令发布所述前端项目框架,包括:
    执行预设的克隆指令克隆预置的git命令行工具包的下载路径;
    根据所述下载路径下载所述git命令行工具包并将所述git命令行工具包添加到所述packages.json文件中;
    执行预设的项目启动指令启动所述前端项目框架。
  20. 根据权利要求16所述的计算机可读存储介质,其中,所述将发布后的所述前端项目框架存储在预设的仓库中以完成所述前端项目框架的构建之后,还包括:
    接收更新所述前端项目框架的更新请求,其中,所述更新请求包括更新指令以及新版本号的数据包;
    将所述新版本号的数据包添加到所述前端项目框架中并根据所述更新指令自动引用所述新版本号的数据包。
PCT/CN2020/124660 2020-07-31 2020-10-29 前端项目框架的构建方法、装置、计算机设备及存储介质 WO2021135584A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010763059.1A CN111897520A (zh) 2020-07-31 2020-07-31 前端项目框架的构建方法、装置、计算机设备及存储介质
CN202010763059.1 2020-07-31

Publications (1)

Publication Number Publication Date
WO2021135584A1 true WO2021135584A1 (zh) 2021-07-08

Family

ID=73183155

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/124660 WO2021135584A1 (zh) 2020-07-31 2020-10-29 前端项目框架的构建方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN111897520A (zh)
WO (1) WO2021135584A1 (zh)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113791778A (zh) * 2020-11-18 2021-12-14 北京沃东天骏信息技术有限公司 软件项目生成方法及装置、电子设备和存储介质
CN112685035B (zh) * 2020-12-25 2024-05-17 京东科技控股股份有限公司 项目开发方法及装置、计算机可读存储介质、电子设备
CN113050985B (zh) * 2021-04-19 2024-02-06 中国工商银行股份有限公司 前端工程依赖自动注册方法及装置
CN113254040B (zh) * 2021-06-01 2023-10-20 康键信息技术(深圳)有限公司 前端框架更新方法、装置、设备及存储介质
CN113253997B (zh) * 2021-06-23 2021-10-08 南京铉盈网络科技有限公司 一种图形化前端工程化框架构建方法
CN113360139A (zh) * 2021-06-29 2021-09-07 深圳壹账通智能科技有限公司 前端框架的集成方法、装置、电子设备及存储介质
CN113835737A (zh) * 2021-08-24 2021-12-24 交控科技股份有限公司 一种前端项目添加权限的方法及系统
CN113703822B (zh) * 2021-08-31 2022-11-01 三一专用汽车有限责任公司 一种差分升级方法、装置和作业机械
CN115129333B (zh) * 2022-09-02 2022-11-25 城云科技(中国)有限公司 适用于微前端框架的npm资源包管理方法、装置及系统
CN115202630B (zh) * 2022-09-08 2022-12-02 杭州阿启视科技有限公司 一种基于web前端工程的脚手架构建方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090125874A1 (en) * 2007-11-12 2009-05-14 Abdelhadi Sanaa F Method and system for creating projects in a rational application developer workspace
CN105760159A (zh) * 2016-02-01 2016-07-13 四川长虹电器股份有限公司 网站开发方法及其系统
CN105893014A (zh) * 2015-12-08 2016-08-24 乐视云计算有限公司 用于前端的项目开发方法及系统
CN110134396A (zh) * 2019-07-09 2019-08-16 南京唯实科技有限公司 一种基于Nodejs开发界面组件的开发框架及方法

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7305653B2 (en) * 2004-03-11 2007-12-04 International Business Machines Corporation Standard application development framework
US20070162845A1 (en) * 2006-01-09 2007-07-12 Apple Computer, Inc. User interface for webpage creation/editing
CN106502663A (zh) * 2016-10-17 2017-03-15 成都知道创宇信息技术有限公司 一种前端项目框架生成方法
CN106843869B (zh) * 2017-01-16 2020-04-14 百融云创科技股份有限公司 一种前端开发工程化系统和方法
CN110580152B (zh) * 2018-06-07 2023-05-12 北京怡合春天科技有限公司 一种前端自动化脚手架
CN110647320A (zh) * 2019-08-14 2020-01-03 平安普惠企业管理有限公司 项目框架的构建方法、装置、计算机设备和存储介质
CN110795088B (zh) * 2019-10-29 2021-05-04 京东数字科技控股有限公司 前端工程项目构建方法和工具、计算机可读存储介质
CN111290753B (zh) * 2020-01-20 2023-05-30 远光软件股份有限公司 前端开发环境的搭建方法、装置、设备及存储介质
CN111273898B (zh) * 2020-02-25 2024-03-19 安徽以萨数据技术有限公司 web前端代码自动化构建方法、系统及存储介质
CN111427558A (zh) * 2020-04-10 2020-07-17 创盛视联数码科技(北京)有限公司 基于webpack定制前端自动化开发环境的方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090125874A1 (en) * 2007-11-12 2009-05-14 Abdelhadi Sanaa F Method and system for creating projects in a rational application developer workspace
CN105893014A (zh) * 2015-12-08 2016-08-24 乐视云计算有限公司 用于前端的项目开发方法及系统
CN105760159A (zh) * 2016-02-01 2016-07-13 四川长虹电器股份有限公司 网站开发方法及其系统
CN110134396A (zh) * 2019-07-09 2019-08-16 南京唯实科技有限公司 一种基于Nodejs开发界面组件的开发框架及方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ANONYMOUS: "Step by Step: Developing and Publishing TypeScript Package to NPM", CSDN, 13 February 2020 (2020-02-13), XP055828215, Retrieved from the Internet <URL:https://blog.csdn.net/qq_40588413/article/details/104297861> *

Also Published As

Publication number Publication date
CN111897520A (zh) 2020-11-06

Similar Documents

Publication Publication Date Title
WO2021135584A1 (zh) 前端项目框架的构建方法、装置、计算机设备及存储介质
US11307906B1 (en) Solver for cluster management system
US10379846B1 (en) Systems and methods for real time version control for integrating updated web-based components with a native application
US9286040B2 (en) Software builder
US20170115977A1 (en) Apparatus and method for automating the installation and configuration of infrastructure
US10296298B1 (en) Systems and methods for cross platform information exchange mechanism for integrating web-based components with a native application
US9848277B2 (en) High-speed application for installation on mobile devices for permitting remote configuration of such mobile devices
WO2017034789A1 (en) Application service architecture
BR112017000110B1 (pt) Método implementado por computador, sistema de computador e dispositivo de memória para nuvem autoexpansível
US20150169386A1 (en) Automating software availability management based on api versioning
CN105630488A (zh) 一种基于docker容器技术的持续集成实现方法
US10296309B1 (en) Systems and methods for automatic API generation for bi-directional communication between native and web-based components of a mobile application
CN106569880B (zh) 一种Android应用间动态共享资源的方法及系统
US20170048331A1 (en) Platform runtime abstraction
US20200274758A1 (en) Provisioning hybrid cloud resources in an operating environment
CN117170803A (zh) 生成信创操作系统流水线的方法、电子设备及存储介质
CN117008934A (zh) 自动制作信创操作系统镜像的方法、装置、设备及介质
KR20150123879A (ko) 고급 운영 시스템(hlos) 부팅 전에 스마트폰에 연결된 주변기기 디바이스들을 위한 디바이스 드라이버들을 프리페칭하기 위한 방법 및 장치
US11757976B2 (en) Unified application management for heterogeneous application delivery
CN114860202A (zh) 项目运行方法、装置、服务器及存储介质
CN116225624B (zh) 基于kubernets的裸机管理方法、系统和装置
Oh et al. Practical Ansible 2: Automate infrastructure, manage configuration, and deploy applications with Ansible 2.9
RU2786200C1 (ru) Система и способ установки персонализированного приложения на мобильное устройство
KR102586649B1 (ko) 분산형 파일 시스템을 이용한 펌웨어 관리 시스템 및 펌웨어 관리 방법
WO2023238302A1 (ja) 生成装置、生成方法及び生成プログラム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20908478

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20908478

Country of ref document: EP

Kind code of ref document: A1