CN112860278A - Front-end terminal tool relying on nodejs uniform packaging - Google Patents

Front-end terminal tool relying on nodejs uniform packaging Download PDF

Info

Publication number
CN112860278A
CN112860278A CN202110170678.4A CN202110170678A CN112860278A CN 112860278 A CN112860278 A CN 112860278A CN 202110170678 A CN202110170678 A CN 202110170678A CN 112860278 A CN112860278 A CN 112860278A
Authority
CN
China
Prior art keywords
end terminal
nodejs
terminal tool
script
file
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
CN202110170678.4A
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.)
Hangzhou Daishu Technology Co ltd
Original Assignee
Hangzhou Daishu Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Daishu Technology Co ltd filed Critical Hangzhou Daishu Technology Co ltd
Priority to CN202110170678.4A priority Critical patent/CN112860278A/en
Publication of CN112860278A publication Critical patent/CN112860278A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/43Checking; Contextual analysis
    • G06F8/433Dependency analysis; Data or control flow analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Abstract

The invention discloses a front-end terminal tool which depends on nodejs to pack uniformly; the system comprises nodejs software and a ko-script front end terminal tool, wherein a program is programmed in the nodejs software, a programming program body in the nodejs software is input into the interior of the ko-script front end terminal tool, the ko-script front end terminal tool starts the programming program body, so that the ko-script front end terminal tool can download a front end frame scaffold, the ko-script front end terminal tool updates a latest dependent package through npm, and the ko-script front end terminal tool executes an instruction to generate a programmable js or ts interface file; the invention supports multiple different versions and framework packaging; shielding the complex logic at the bottom layer, exposing the service easy to understand, reducing the requirement on professional ability and greatly saving project cost; the method provides a convenient development auxiliary command, greatly improves the development efficiency and reduces the development cost.

Description

Front-end terminal tool relying on nodejs uniform packaging
Technical Field
The invention belongs to the technical field of front-end packaging, and particularly relates to a front-end terminal tool relying on nodejs uniform packaging.
Background
The webpack is a popular general front-end packaging tool at present, and can quickly support packaging of a mainstream framework and output static files by providing plug-ins, rules and API interfaces and through simple configuration. And friendly preview can be carried out on the static files in the browser through local starting service, and developers can immediately see the effect while developing to carry out problem positioning through hot starting. The front-end development efficiency and the quality and quantity guarantee completion work can be rapidly provided; at present, in a React framework project, a universal plug-in and a dependency rule are configured, packaging can be carried out quickly, a static file is output, and then the static file is sent to an Vue project or a TypeScript version, reconfiguration is carried out again, different dependencies are installed, if some dependency packages are upgraded, upgrading is needed to be carried out on different projects or scaffolds, maintenance cost is extremely high (including professional ability requirements, time cost and resource cost), so in order to achieve one-time maintenance and multiple-place quick application, a method needs to be provided to achieve the purposes, however, various front-end packaging in the market still has various problems.
Under the conventional condition, the webpack product type project is suitable, because the webpack product type project is stable, the iteration period is long, fixed personnel are responsible for maintenance, but the webpack product type project is not suitable for the ToB type project, because the project period is short, the personnel flow is large, the applicable front-end framework of each project is different, the professional ability of developers is not as good as that of product development, and the cost on technology updating and version maintenance is high. Therefore, packaging a universal mainstream front-end framework unified packaging terminal tool becomes an urgent need for solving problems, but the problem that the existing design cannot realize packaging support under different frameworks and output a specified directory, the packaging efficiency cannot be improved, multithreading is introduced for js and cs packaging, the maintainability of babel cannot be improved, unified packaging is carried out, simple and easy-to-use services cannot be packaged, the technical difficulty of the bottom layer is shielded, and the problem that js/ts versions can not be generated according to a rear-end Swagger interface API (application program interface) to call interface files by commands is not solved.
Disclosure of Invention
The invention aims to provide a front-end terminal tool relying on nodejs uniform packaging, so as to solve the problems in the background technology.
In order to achieve the purpose, the invention provides the following technical scheme: a front end terminal tool depending on unified packaging of nodejs comprises nodejs software and a ko-script front end terminal tool, wherein program programming is carried out in the nodejs software, a programming program body in the nodejs software is input into the ko-script front end terminal tool, the ko-script front end terminal tool starts the programming program body, so that the ko-script front end terminal tool can download a front end frame scaffold, the ko-script front end terminal tool updates a latest dependency package through npm, and the ko-script front end terminal tool executes instructions to generate a programmable js or ts interface file.
Preferably, when the nodejs software is used in operation, a plurality of groups of JS file modules are firstly established in the nodejs software, and a plurality of groups of JS file modules write modules.
Preferably, one set of the JS file modules is referred to in the file by a require keyword when referring to the externally exposed variable in the other set of the JS file modules.
Preferably, the nodejs software, when programmed, builds an fs module that provides an API to interact with the file system in a manner closely related to standard POSIX functionality.
Preferably, the nodejs software uses the fs module and refers to the fs module by a constfs-requirer ('fs'), the asynchronous form always passes the completion callback as the last argument, and the first argument will be null or undefined after the operation is successfully completed.
Preferably, the programming program in the nodejs software and the ko-script front end terminal tool perform data transmission through an API.
Preferably, the ko-script front end tool includes the following execution commands: koinit: initial project template file, kodll: generating a dynamic link library, kodev: starting a local development environment, kobuild: compile project to production environment, kopreview: preview post-compilation project static files, komove: default mobile file, koswagger: generating a swagger interface file, koinstall: installation of published npm package components or blocks, kocreate: creating pages or component directories and files, kolint: item code formatting, ko [ xx ] -h: view related command parameter usage.
Preferably, the koswagger selects interface types when generating the swagger interface file, the interface types include js and ts types, and when the koswagger generates the swagger interface file, a user-defined request is placed in a restful.
Preferably, the ko-script front end tool extracts a single file and exposes interface services for each configuration item of the single function and webpack, then introduces parameters and corresponding parameter-out objects, extracts specific terminal commands for a test and development environment again according to specific development environment dependent items, and introduces parameter identifiers.
Preferably, the ko-script front end terminal tool introduces a directory convention to judge different framework type loading framework dependent items according to specific files under a directory and installs the framework dependent items through an npminstallko-script-g key aiming at the support of different frameworks.
Compared with the prior art, the invention has the beneficial effects that:
the invention supports a plurality of different versions and frame packing, can realize one-time maintenance and multiple rapid applications; shielding the complex logic at the bottom layer, exposing the service easy to understand, reducing the requirement on professional ability and greatly saving project cost; the method provides a convenient development auxiliary command, greatly improves the development efficiency and reduces the development cost.
Drawings
FIG. 1 is a schematic diagram of the system of the present invention;
FIG. 2 is a schematic diagram of a ko-script front end tool instruction according to the present invention;
FIG. 3 is a schematic diagram of a programming procedure according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1-2, the present invention provides a technical solution: a front end terminal tool depending on unified packaging of nodejs comprises nodejs software and a ko-script front end terminal tool, wherein program programming is carried out in the nodejs software, a programming program body in the nodejs software is input into the ko-script front end terminal tool, the ko-script front end terminal tool starts the programming program body, so that the ko-script front end terminal tool can download a front end frame scaffold, the ko-script front end terminal tool updates a latest dependency package through npm, and the ko-script front end terminal tool executes instructions to generate a programmable js or ts interface file.
In this embodiment, preferably, when the nodejs software is used during operation, a plurality of groups of JS file modules are firstly established in the nodejs software, and a plurality of groups of JS file modules write modules.
In this embodiment, preferably, one set of the JS file module is referred to by a require keyword in a file when referring to the externally exposed variable in the other set of the JS file module.
In this embodiment, it is preferable that the nodejs software establishes an fs module during programming, and the fs module provides an API for interacting with the file system in a manner closely related to standard POSIX functions.
In this embodiment, preferably, the nodejs software uses an fs module and refers to the fs module through a constfs-require ('fs'), the asynchronous form always passes a completion callback as the last parameter, and the first parameter after the operation is successfully completed is null or undefined.
In this embodiment, preferably, the programming program in the nodejs software and the ko-script front end terminal tool perform data transmission through an API.
In this embodiment, preferably, the ko-script front end tool includes the following execution commands: koinit: initial project template file, kodll: generating a dynamic link library, kodev: starting a local development environment, kobuild: compile project to production environment, kopreview: preview post-compilation project static files, komove: default mobile file, koswagger: generating a swagger interface file, koinstall: installation of published npm package components or blocks, kocreate: creating pages or component directories and files, kolint: item code formatting, ko [ xx ] -h: view related command parameter usage.
In this embodiment, preferably, the koswagger selects interface types when generating the swagger interface file, where the interface types include js and ts types, and when the koswagger is used, the koswagger puts a custom request in a restful.
In this embodiment, preferably, the ko-script front end tool extracts a single function and each configuration item of webpack from a single file and exposes an interface service, then introduces a parameter and a corresponding parameter-introducing object, extracts a specific terminal command for a test and development environment according to a specific development environment dependent item, and introduces a parameter identifier.
In this embodiment, preferably, the ko-script front end terminal tool introduces a directory convention to determine, according to a specific file under a directory, that different framework types load framework dependent items, and installs the framework dependent items through an npminstallko-script-g key, for support of different frameworks.
The working principle and the using process of the invention are as follows:
firstly, introducing a singleton mode idea, extracting single functions and webpack configuration items from a single file, exposing interface services, weakening the implementation logic of a bottom layer, developing only needing to pay attention to incoming parameters and corresponding outgoing objects, secondly, providing an optimization method and a specific landing scheme aiming at a specific function, achieving low coupling and high cohesion among modules, extracting specific terminal commands aiming at environments such as testing, development and the like according to specific development environment dependent items, introducing parameter identifications for more flexible use of the commands, and finally introducing a directory convention aiming at support of different frames, judging different frame types according to specific files under the directory, loading the frame dependent items, and installing the frame dependent items through a key of minstallko-scirpt-g.
Application scenarios:
1. when a ToB project is made, a plurality of modules and projects can be quickly reused, for quickly constructing scaffolds and templates with different frames, if the investment cost is high from 0 every time, after the ko-script exists, only a dependence package needs to be installed, and the existing projects and scaffolds with different frames can be reused through simple command execution;
2. with the rapid development of the internet technology, the front end is changed day by day, which leads to the continuous update and iteration of the front end technology all the time, in order to adapt to the front end trend and high-efficiency work, the existing ToB project is started, the technology needs to be updated, if the ToB project is updated according to the traditional mode, each project is independently updated, the maintenance cost required to be invested is extremely high, the delivery cost of the project is greatly challenged in the aspects of time, manpower and the like, and the ko-script is provided, so that the latest dependency package is only required to be updated through npm, one-time maintenance is achieved, and multiple places are rapidly used;
3. in the project joint debugging stage, swagger interface documents are provided to the rear end, the front end classmates provide document addresses according to the rear end, one front end joint debugging is performed according to the traditional mode, corresponding addresses and method names can be input into corresponding interface files, programmable js or ts interface files can be generated only by executing one command after ko-script exists, and the front end joint debugging speed is greatly improved.
The code is shown in figure three: firstly, designing the name of a command to enable a developer to quickly understand and quickly and conveniently use, through nodejs environment support, the developer can freely exert own codes and does not disturb packaging, secondly, enabling a self-defined command to be linked with a single function file, needing to link a terminal command with a js file by means of a commander, finally, executing related dependence according to the defined function file, and realizing interaction between a terminal page and the developer through inquirer.
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (10)

1. A front end terminal tool depending on nodejs uniform packaging comprises nodejs software and a ko-script front end terminal tool, and is characterized in that: and programming in the nodejs software, inputting a programming program body in the nodejs software into the ko-script front end terminal tool, starting the programming program body by the ko-script front end terminal tool, so that the ko-script front end terminal tool can download the front end frame scaffold, upgrading the latest dependent package by the ko-script front end terminal tool through npm, and executing an instruction by the ko-script front end terminal tool to generate a programmable js or ts interface file.
2. The front-end terminal tool relying on nodejs uniform packaging according to claim 1, wherein: when the nodejs software is used in operation, firstly, a plurality of groups of JS file modules are established in the nodejs software, and a plurality of groups of JS file modules externally expose variables to write modules.
3. The front-end terminal tool relying on nodejs uniform packaging according to claim 2, wherein: and one set of the JS file modules is referred by a require keyword in the file when referring to the externally exposed variable in the other set of the JS file modules.
4. The front-end terminal tool relying on nodejs uniform packaging according to claim 1, wherein: the nodejs software builds an fs module during programming that provides an API to interact with the file system in a manner closely related to standard POSIX functions.
5. The front-end terminal tool relying on nodejs uniform packaging according to claim 4, wherein: the nodejs software uses the fs module and refers through constfs-require ('fs'), the asynchronous form always passes the completion callback as the last parameter, and the first parameter is null or undefined after the operation is successfully completed.
6. The front-end terminal tool relying on nodejs uniform packaging according to claim 4, wherein: and the programming program in the nodejs software and the ko-script front end terminal tool carry out data transmission through an API.
7. The front-end terminal tool relying on nodejs uniform packaging according to claim 1, wherein: the ko-script front end terminal tool comprises the following execution commands: koinit: initial project template file, kodll: generating a dynamic link library, kodev: starting a local development environment, kobuild: compile project to production environment, kopreview: preview post-compilation project static files, komove: default mobile file, koswagger: generating a swagger interface file, koinstall: installation of published npm package components or blocks, kocreate: creating pages or component directories and files, kolint: item code formatting, ko [ xx ] -h: view related command parameter usage.
8. The front-end terminal tool relying on nodejs uniform packaging according to claim 7, wherein: the koswagger selects interface types when generating the swagger interface file, wherein the interface types comprise js and ts types, and a user-defined request is placed in a restful.
9. The front-end terminal tool relying on nodejs uniform packaging according to claim 1, wherein: the ko-script front end terminal tool extracts a single function and each configuration item of webpack from a single file and exposes interface service, then transmits parameters and corresponding parameter output objects, extracts specific terminal commands aiming at testing and developing environments according to specific development environment dependent items and introduces parameter identification.
10. The front-end terminal tool relying on nodejs uniform packaging according to claim 7, wherein: aiming at the support of different frames, the ko-script front end terminal tool introduces a directory convention to judge different frame type loading frame dependent items according to specific files under the directory and installs the frame dependent items through an npminstallko-scirpt-g one key.
CN202110170678.4A 2021-02-08 2021-02-08 Front-end terminal tool relying on nodejs uniform packaging Pending CN112860278A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110170678.4A CN112860278A (en) 2021-02-08 2021-02-08 Front-end terminal tool relying on nodejs uniform packaging

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110170678.4A CN112860278A (en) 2021-02-08 2021-02-08 Front-end terminal tool relying on nodejs uniform packaging

Publications (1)

Publication Number Publication Date
CN112860278A true CN112860278A (en) 2021-05-28

Family

ID=75989059

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110170678.4A Pending CN112860278A (en) 2021-02-08 2021-02-08 Front-end terminal tool relying on nodejs uniform packaging

Country Status (1)

Country Link
CN (1) CN112860278A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114610409A (en) * 2022-03-14 2022-06-10 中原银行股份有限公司 Webpack-based calling system and method and electronic device
CN115202630A (en) * 2022-09-08 2022-10-18 杭州阿启视科技有限公司 Scaffold construction method based on web front-end engineering

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106293827A (en) * 2016-08-08 2017-01-04 杭州玳数科技有限公司 A kind of method and system being controlled web front-end issue by configuration file
CN106843869A (en) * 2017-01-16 2017-06-13 百融(北京)金融信息服务股份有限公司 A kind of front end Development Engineering system and method
CN109284096A (en) * 2018-08-22 2019-01-29 深圳点猫科技有限公司 A kind of automated construction method and electronic equipment of programming project

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106293827A (en) * 2016-08-08 2017-01-04 杭州玳数科技有限公司 A kind of method and system being controlled web front-end issue by configuration file
CN106843869A (en) * 2017-01-16 2017-06-13 百融(北京)金融信息服务股份有限公司 A kind of front end Development Engineering system and method
CN109284096A (en) * 2018-08-22 2019-01-29 深圳点猫科技有限公司 A kind of automated construction method and electronic equipment of programming project

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
YANG CHARLES: "袋鼠云数据应用前端ko团队高效开发工具 ko-script", pages 1 - 3, Retrieved from the Internet <URL:https://zhuanlan.zhihu.com/p/65611389> *
YANG CHARLES: "高频NPM包", pages 1 - 3, Retrieved from the Internet <URL:https://zhuanlan.zhihu.com/p/55487668> *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114610409A (en) * 2022-03-14 2022-06-10 中原银行股份有限公司 Webpack-based calling system and method and electronic device
CN115202630A (en) * 2022-09-08 2022-10-18 杭州阿启视科技有限公司 Scaffold construction method based on web front-end engineering

Similar Documents

Publication Publication Date Title
US7370318B1 (en) System and methodology for asynchronous code refactoring with symbol injection
CN106933609B (en) Android application program installation package generation method and device
US8429619B2 (en) Executable high-level trace file generation system
CN112860278A (en) Front-end terminal tool relying on nodejs uniform packaging
CN108897547B (en) Software automation deployment method and device
CN105022630A (en) Component management system and component management method
CN107577609B (en) Embedded system dynamic module debugging system based on host end dynamic link
WO2020063252A1 (en) Method and device for isolating multiple version dependency
CN113805882A (en) Method and device for developing application program, electronic equipment and storage medium
CN105468428A (en) Android source code compiling method and system
CN104657142A (en) CCFD (China Computational Fluid Dynamics) system based on OSGi (Open Service Gateway Initiative) technology
CN115185539B (en) Method, device and storage medium for generating executable dynamic link library file
CN111209001A (en) Method, system, equipment and medium for batch generation of APKs of android channels
CN105824616A (en) Development method and frame for equipment control system program
KR20130037995A (en) Method for configuring business logic of multi-tenant application
CN110109671B (en) Webpack label size and style conversion method and device
EP2626784A1 (en) Method and apparatus for automated MATLAB interfacing
CN104750482A (en) Method for constructing dynamic script execution engine based on MapReduce
CN110647349B (en) Method for realizing continuous delivery of iOS APP
CN115098158A (en) SDK packaging method and device, computer equipment and storage medium
EP4204960A1 (en) Thread-local return structure for asynchronous state machine
CN102521133A (en) TCL (tool command language)-based white-box testing automation method and TCL-based white-box testing automation system
US6948159B2 (en) Automatic compilation of electronic telecommunications system message generation code
Kyriakou et al. Enhancing C/C++ based OSS development and discoverability with CBRJS: A Rust/Node. js/WebAssembly framework for repackaging legacy codebases
CN110134405B (en) Method and device for flexibly uploading data to manufacturing execution system

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
CB02 Change of applicant information

Address after: 311121 room 102-1 / F, room 102-2 / F, building 6, Haizhi center, 2301 yuhangtang Road, Cangqian street, Yuhang District, Hangzhou, Zhejiang Province

Applicant after: HANGZHOU DAISHU TECHNOLOGY Co.,Ltd.

Address before: 310030 8F, building 2, Hangzhou Internet innovation and entrepreneurship Park, 176 Zixia street, Xihu District, Hangzhou City, Zhejiang Province

Applicant before: HANGZHOU DAISHU TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information