@donghungfeng/ehea-cli
v1.0.2
Published
Ehealth cli
Maintainers
Keywords
Readme
OneUI CLI
Bộ Command line tools giúp Generate dự án và các thành phần trong Microapp theo đúng chuẩn kiến trúc MicroFrontend
Hệ thống hỗ trợ 3 nhánh lệnh chính
- Init : Khởi tạo dự án
- Generate : Khởi tạo các thành phần trong dự án
- Delete : Xóa các thành phần đã tạo trong dự án
Cài đặt
npm install @vnpt/oneui-cli
oneui init
oneui init
Hỗ trợ khởi tạo 3 loại dự án
- 1 : Dự án cơ sở, chỉ bao gồm các microapp cơ sở. Giúp tạo nhanh 1 hệ thống Admin cơ bản
- 2 : Dự án trắng, chỉ có switching layer, không có microapp
- 3 : Dựa án mẫu, với đầy đủ các microapp cơ sở và các microapp cùng data mẫu
oneui g
oneui g <option>
hệ thống hỗ trợ các option giúp khởi tạo nhanh các thành phần trong 1 dự án
app
: tạo mới 1 microappmodule
: tạo mới 1 module trong microapppage
: tạo mới 1 trang trắng trong microapp hoặc modulemodel
: tạo mới 1 object modelservice
: tạo mới 1 servicepipe
: tạo mới 1 pipe transfomationdirective
: tạo mới 1 directivetemplate
: tạo mới 1 microapp hoặc 1 page hoặc 1 khối chức năng đã được tích hợp sẵn trong OneUI
trong đó
oneui g app
$ oneui g app
Giúp khởi tạo nhanh 1 Microapp, hỗ trợ 2 loại microapp là :
- MicroApp có sử dụng routing và các lazy module
- MicroApp trắng, không có sử dụng các routing, thường để làm các parcel
oneui g module
$ oneui g app
Hỗ trợ khởi tạo 2 loại module
- Lazyload Module
- Module trắng
Các tham số :
--app
: tên microapp chứa module--route
: route dùng để kết nối với module, trong trường hợp đây là lazyload module
oneui g page
$ oneui g page
Hỗ trợ khởi tạo 10 loại page
- Trang trắng (có nút Close)
- Trang trắng (không có nút Close)
- Trang trắng có context action bar
- Trang trắng có left menu
- Trang trắng có top menu
- Trang có form thông thường
- Trang có form lớn, phải chia thành nhiều step
- Trang listing dạng table
- Trang crud all-in-one
- Component mặc định của Angular
Các tham số:
--app
: Tên micro app sẽ chứa page--module
: (Option) Têm module sẽ chứa page, để trắng nếu không muốn tạo page vào module nào
Số lượng các option sẽ còn phát triển theo thời gian
oneui g model, service, pipe,directive
#Tạo mới 1 interface class, dùng để làm model
$ oneui g model
#Tạo mới 1 angular service
$ oneui g service
#Tạo mới 1 transform pipe
$ oneui g pipe
#Tạo mới 1 directive
$ oneui g directive
Dùng để khởi tạo các thành phần hay phải sử dụng trong Angular Các tham số:
--app
: Tên micro app sẽ chứa page--module
: (Option) Têm module sẽ chứa page, để trắng nếu không muốn tạo page vào module nào
oneui g template
$ oneui g template
Đang phát triển... Dùng để khởi tạo các code block phức tạp hoặc các microapp có sẵn trên Repository của OneUI
oneui d
Delete 1 microapp đã được khởi tạo trong hệ thống
$ oneui d app
Dành cho nhà phát triển
Buil thư viện
npm install
npm run build
Cài đặt thư viện tại local
npm install -g ./
# kiểm tra kết quả, gõ lệnh
oneui
publish
Trước khi publish, điều chỉnh cấu hình file .npmrc
về phù hợp với cấu hình của repository cần publish
node-options=--max-old-space-size=14000
@vnpt:registry=PATH_TO_REGISTRY
//crelease.devops.vnpt.vn/repository/IT.KTHT.NPM-hosted/:username=USERNAME_HERE
//crelease.devops.vnpt.vn/repository/IT.KTHT.NPM-hosted/:_password="BASE64_PASSWORD_HERE"
Tiến hành publish
# publish lên npmjs
npm publish
#publish lên registry bất kỳ
npm publish --registry="path-to-registry"