-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.js
30 lines (21 loc) · 757 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env node
const { program } = require('graph2app-core')
const { VueApp, VueFile } = require('graph2app-vue-core')
const { DrawIoGraphBuilder } = require('graph2app-drawio-graph-builder')
const drawIoGraphBuilder = new DrawIoGraphBuilder()
program
.option('-x, --xml <n>', 'xmlPath')
.description('scaffold Vuejs app from Draw.io')
.parse(process.argv)
try {
if (program.xml == undefined || program.dist == undefined) {
throw new Error("options xml and dist must be provided, use --help")
}
const app = new VueApp()
const root = drawIoGraphBuilder.build(program.xml, VueFile, (root) => {
app.create(program.dist, root)
})
} catch (e) {
console.log(e.message)
console.log("use --help for more information");
}