payos-trust
v0.0.2
Published
`payos-trust` is a reusable Angular library that packages the existing PayosTrust UI screens (admin + merchant flows) for use in other projects.
Downloads
22
Readme
payos-trust
payos-trust is a reusable Angular library that packages the existing PayosTrust UI screens (admin + merchant flows) for use in other projects.
Note: Angular workspace project key is payos-trust, so build command is ng build payos-trust.
Development Model
- Source of truth for UI/features is
angular/projects/payos-trust/src/lib. - New screens, components, services, and styles should be developed in the library first.
- Consumer apps should import routes from the package, not copy-paste page files.
angular/src/appcan be used as a local host/demo app, but final reusable work belongs in the library.
What this package exports
PAYOS_TRUST_ROUTES(primary)
Exported from projects/payos-trust/src/lib/payos-trust.routes.ts.
Step-by-step: Build and publish
- Go to Angular root:
cd angular- Build library:
npm run ng -- build payos-trust- Go to build output:
cd dist/payos-trust- Publish:
npm publishStep-by-step: Use in Project B
- Install package in Project B:
npm i payos-trust- Add library routes to Project B router:
// app.routes.ts
import { Routes } from '@angular/router';
export const APP_ROUTES: Routes = [
{
path: 'payos-trust',
loadChildren: () => import('payos-trust').then(m => m.PAYOS_TRUST_ROUTES),
},
];- Add a side menu item (if ABP menu is used):
{
path: '/payos-trust/admin/dashboard',
name: 'Payos Trust',
iconClass: 'fas fa-shield-alt',
order: 100,
}- Open:
/payos-trust/admin/dashboardLocal development inside this monorepo
Use the local path alias during development:
// in host app routes
{
path: 'payos-trust',
loadChildren: () => import('payos-trust').then(m => m.PAYOS_TRUST_ROUTES),
}This alias resolves to:
angular/projects/payos-trust/src/public-api.tsStep-by-step: Update Project B when this library changes
- Make code changes here.
- Increase version in
projects/payos-trust/package.json. - Rebuild and publish again.
- In Project B:
npm update payos-trustor install a specific version:
npm i [email protected]