Create a FamixTypeScript model in JSON of TypeScript files.
npm install -g ts2famix
- Version 2.x.x is for Moose 11+
- Version <= 1.x.x is for Moose 10, but lacks support for several elements of TypeScript (arrow functions, full generics).
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
- Copy the "
JSONModels/projectName.json
" into your "Pharo/images/[imageName]
" directory. - In a Moose Playground, load the FamixTypeScript metamodel:
Load the model into Moose:
Metacello new githubUser: 'fuhrmanator' project: 'FamixTypeScript' commitish: 'master' path: 'src'; baseline: 'FamixTypeScript'; load.
Note: Windows 10/11 users can drag-and-drop the'projectName.json' asFileReference readStreamDo: [ :stream | model := FamixTypeScriptModel new importFromJSONStream: stream. model install ].
projectName.json
model file onto the Pharo window (once the TypeScript metamodel has been loaded) for an easier way to load.
To run tests:
npm test
To build ts2famix
locally:
npx tsc
To run the locally built version (not the globally installed one with npm).:
npx ts2famix [options]
The following was generated by CI using tplant, in a similar fashion described here.