https://w3c-ccg.github.io/traceability-vocab/
npm update && npm run build
npm i @mavennet/traceability-dto
npm i Mavennet/traceability-dto#branch-name
- Node.js 16+
- Npm 6+
After using npm to install the package, import the DTO at the top of the file that is to use it.
import { RandomDTO } from '@mavennet/traceability-dto'
Some common issues faced are:
There are two parts to the package: src and lib.
src
Is what is being editing. When making changes, creating new DTOs, adding constants, etc., all this must be done here.
lib
Is where the DTOs are being exported from when when any file imports them. Editing the files here is pointless as when the package is built, it gets over written.The problem arises when changes are made to src but package is not built. Although the src contains updates files, the files are going to be imported form lib, which still has the outdates version. Make sure to build the package before pushing the changes to any branch:
npm run build
Each folder and sub-folder contains a file called index.ts. This is the file where DTOs and folders are being exported from. Without a file being exported, it will not be accesible in another program and will likley result in the "does not exist" error in the import statement. To solve this, add an export statement into the index file contained within the folder where the DTO file is located.
export * from './random.dto'
Some DTOs are abstract classes, and probably for good reason. But if there is ever the need to create an instance of one, just create another class which extends the abstract one and export that.
Reference: The abstract class and the resolved implementation
master - branch that is published as a package version (changes to this will initiate a package version bump)
others - feature branch
Below is a brief overview of the current code base structure.
src
├── analytics
│ ├── consts
│ └── dto
├── auth
│ ├── consts
│ └── dto
├── contracts
│ ├── consts
│ └── dto
├── credentials
│ └── dto
├── documents
│ ├── consts
│ └── dto
├── events
│ └── consts
├── general
│ ├── consts
│ └── dto
├── notifications
│ ├── consts
│ └── dto
├── organizations
│ ├── consts
│ └── dto
├── presentations
│ └── dto
├── products
│ ├── consts
│ └── dto
│ ├── releasing
│ └── sharing
├── users
│ ├── consts
│ └── dto
└── index.ts
- Both Metaltrail-DTO and Neoflow-DTO import DTOs from here. Any changes here for an issue regarding Neoflow for example, may affect Metaltrail.
- This is a private repository, only Mavennet dev team may access it