The file collector will read from a topo diagram from a json file and call the correct mutations in TOPO to create the diagram.
To run locally with node-ts (basically compiling typescript on the fly).
- Install all the dependecies with
yarn install
. - Run
yarn start
.
- Install all the dependencies with
yarn install
. - Run unit tests with
yarn test
.
To build the TypeScript into javascript that you can run with node
. Follow the following steps.
- Install all the dependencies with
yarn install
. - Build with
yarn build
. All the compiled javascript will be in thelib
directory.
To package into binaries. Run yarn package
and the packaged binaries will be in the packaged
directory.
Depending on whether your running with yarn start of with one of the packaged binaries, the start of your command will be different. The examples below assume that you're using the osx binary.
To run a demo file on a locally running topo instance you would run the following.
./packaged/file-collector-macos -f examples/demo.json --host 'http://localhost:4000'
This should give you output similar to
[cli] TOPO File Collector
[topoInterface] Deleted existing data
[topoInterface] Created technology: React
[topoInterface] Created technology: Ruby on Rails
[topoInterface] Created technology: Elixir
[topoInterface] Created box: ThoughtWorks
[topoInterface] Created box: Staffing
[topoInterface] Created box: Finance
[topoInterface] Created box: People
[topoInterface] Created box: Professional Services
[topoInterface] Created box: Demand
[topoInterface] Created box: Selling Work
[topoInterface] Created System: Sales Funnel
A couple of things to note:
- This will try to make as much as possible. It wont cancel out after an error
- It always starts by deleting all the nodes in topo. The assumption is that the JSON file is the source of truth.