Create a FamixTypeScript model in JSON of TypeScript files.
npm install ts2famix
Instructions for using the command-line importer:
ts2famix --help
ts2famix -i ../path/to/project/tsconfig.json -o JSONModels/projectName.json
or
ts2famix -i "../path/to/project/**/*.ts" -o JSONModels/projectName.json
You need to copy the "JSONModels/projectName.json
" into your "Pharo/images/[imageName]
" directory.
For a Moose Suite 10 (stable) user with the Pharo directory in the root directory, do :
cp JSONModels/projectName.json ~/Pharo/images/Moose\ Suite\ 10\ \(stable\)/.
Then, in a Moose Playground, do :
Metacello new
githubUser: 'fuhrmanator' project: 'FamixTypeScript' commitish: 'master' path: 'src';
baseline: 'FamixTypeScript';
load
This command installs the TypeScript metamodel into Moose.
Then, generate the metamodel with :
Library > Famix > Manage metamodels > Regenerate all metamodels
Then, in a Moose Playground, do :
'projectName.json' asFileReference readStreamDo:
[ :stream | model := FamixTypeScriptModel new
importFromJSONStream: stream. model install ].
This command imports the JSON model into Moose.
Run tests :
npm test
Generate coverage :
npm run coverage
Then, open "coverage/lcov-report/index.html
" with your favorite browser :
firefox coverage/lcov-report/index.html &
Generate documentation :
npm run doc
Then, open "docs/index.html
" with your favorite browser :
firefox docs/index.html &
Generate plantuml and svg of the metamodel :
npm run uml
Then, open "doc-uml/metamodel.svg
" with your favorite image viewer :
eog doc-uml/metamodel.svg &
ts-node src/famix2puml.ts -i JSONModels/projectName.json -o PUMLModels/projectName.puml
The following was generated by CI using tplant, in a similar fashion described here.