test-hungtq-1
v1.0.1
Published
- efc-protobuf <=== efc-protobuf main .proto - proto - flight-normal - xxx.proto - service-foc - aaa.proto - bbb.proto - service-category - ... - protobuf_js <=== we are here gen code .proto
Downloads
2
Readme
Airways gRPC
Folder structure
- efc-protobuf <=== efc-protobuf main .proto
- proto
- flight-normal
- xxx.proto
- service-foc
- aaa.proto
- bbb.proto
- service-category
- ...
- flight-normal
- protobuf_js <=== we are here gen code .proto to typescript .ts
- proto
working protobuf_js
cd efc-protobuf/protobuf_js
....
Environment
Must install:
- node v.16+
- npm
- yarn
- protoc
- protoc-gen-js
Install packages
yarn
This command line include copy package.json
and README.md
to dist
.
How to generate lib
It will be automatically generated when run two commands above. But only once for each time.
Add more proto folder
Update file vite.config.ts
.
Find these lines and update them:
ProtocTypescriptGenerator({
includes: [
{
input: "../proto/service-category",
output: "service-category/typescript",
},
// Add more here to build and comment them after build
],
}),
How to publish to NPM
Thêm những file chứa các service cần thiết cho frontend thi phải inport vào file index.ts
example
export * as serviceCategoryAirport from "./service-category/typescript/proto/service-category/airport";
export * as serviceCategoryFareCondition from "./service-category/typescript/proto/service-category/fare-condition";
export * as serviceCategoryMasterData from "./service-category/typescript/proto/service-category/master-data";
export * as serviceCategoryRoute from "./service-category/typescript/proto/service-category/route";
update version trong package.json
run : yarn build
Please follow NPM's documentation.
Notice: Publish folder dist
. It's included all files needed.