Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Commit

Permalink
rewrite js2dt converter + slight api change + fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ForsakenHarmony committed May 16, 2018
1 parent b4e917d commit 73a3eae
Show file tree
Hide file tree
Showing 14 changed files with 580 additions and 535 deletions.
13 changes: 13 additions & 0 deletions bin/dt2js.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env node
'use strict'
const program = require('commander')

const cli = require('../src/dt2js_cli')

program
.arguments('<ramlFile> <ramlTypeName>')
.description('Convert a RAML data type into JSON schema. ' +
'Writes to standard output.')
.action((f, t) => console.log(JSON.stringify(cli(f, t), null, 2)))

program.parse(process.argv)
13 changes: 13 additions & 0 deletions bin/js2dt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env node
'use strict'
const program = require('commander')

const cli = require('../src/js2dt_cli')

program
.arguments('<jsonFile> <ramlTypeName>')
.description('Convert JSON schema to RAML Data Type. ' +
'Writes to standard output.')
.action((f, t) => console.log(cli(f, t)))

program.parse(process.argv)
214 changes: 165 additions & 49 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"url": "https://github.com/raml-org/ramldt2jsonschema/issues"
},
"bin": {
"dt2js": "src/dt2js_cli.js",
"js2dt": "src/js2dt_cli.js"
"dt2js": "bin/dt2js.js",
"js2dt": "bin/js2dt.js"
},
"scripts": {
"lint": "standard",
Expand All @@ -42,7 +42,7 @@
"yaml-ast-parser": "0.0.40"
},
"devDependencies": {
"ajv": "^6.4.0",
"ajv": "^6.5.0",
"chai": "^4.1.2",
"istanbul": "^0.4.5",
"mocha": "^5.1.1",
Expand Down

0 comments on commit 73a3eae

Please sign in to comment.