Skip to content

metadatacenter/cedar-model-typescript-library

Repository files navigation

CEDAR Model Typescript Library

A library to work with CEDAR templates and instances - implemented in TypeScript

Build

npm install
npm run build

Run the tests

npm test

To regenerate reference file outputs

# Using CEDAR Artifact Library
npx ts-node ./itest/scripts/regenerate-json-files-with-java-lib.ts
npx ts-node ./itest/scripts/regenerate-yaml-files-with-java-lib.ts

# Using CEDAR Model TypeScript Library
npx ts-node ./itest/scripts/regenerate-json-files-with-ts-lib.ts
npx ts-node ./itest/scripts/regenerate-yaml-files-with-ts-lib.ts

# All files
npx ts-node ./itest/scripts/regenerate-all-files.ts

Compare generated files

npx ts-node ./itest/scripts/compare-verbatim-ts-java-yaml-files.ts
npx ts-node ./itest/scripts/compare-verbatim-ref-java-yaml-files.ts
npx ts-node ./itest/scripts/compare-verbatim-ref-ts-yaml-files.ts

npx ts-node ./itest/scripts/compare-content-ref-ts-json-files.ts
npx ts-node ./itest/scripts/compare-content-ref-java-json-files.ts

Development

During development, you might want to use this library in a client project. To do so, execute this:

npm run build
npm run link 

To check the globally installed packages, and check if this library is linked properly, execute:

npm ls -g --depth=0

You should see something similar:

/opt/homebrew/lib
├── @angular/[email protected]
├── [email protected] -> ./../../../Users/egyedia/CEDAR/cedar-model-typescript-library/dist
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

See it in action

Check out the README at the companion demo repo