Skip to content

Commit

Permalink
fix: Updating test SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
jlacivita committed Jun 6, 2024
1 parent 3e0b584 commit 6a90892
Show file tree
Hide file tree
Showing 8 changed files with 976 additions and 961 deletions.
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --config=jest.config.json --detectOpenHandles",
"build": "npm run validate && npm run build:docs && npm run build:sdk",
"validate": "node ./src/cli.mjs validate --input ./test/openrpc --schemas test/schemas --transformations && npm run build:openrpc && node ./src/cli.mjs validate --input ./build/sdk-open-rpc.json",
"build:openrpc": "node ./src/cli.mjs openrpc --input ./test --template ./src/openrpc-template.json --output ./build/sdk-open-rpc.json --schemas test/schemas",
"build:sdk": "node ./src/cli.mjs sdk --input ./build/sdk-open-rpc.json --template ./test/sdk --output ./build/sdk/javascript/src --schemas test/schemas",
"build:d": "node ./src/cli.mjs declarations --input ./build/sdk-open-rpc.json --output ./dist/lib/sdk.d.ts --schemas src/schemas",
"build:docs": "node ./src/cli.mjs docs --input ./build/sdk-open-rpc.json --output ./build/docs/markdown --schemas test/schemas --as-path",
"build:wiki": "node ./src/cli.mjs docs --input ./build/sdk-open-rpc.json --output ./build/docs/wiki --schemas test/schemas",
"build:openrpc": "node ./src/cli.mjs openrpc --input ./test --template ./src/openrpc-template.json --server ./build/sdk-open-rpc.json --schemas test/schemas",
"build:sdk": "node ./src/cli.mjs sdk --server ./build/sdk-open-rpc.json --template ./test/sdk --output ./build/sdk/javascript/src --schemas test/schemas",
"build:docs": "node ./src/cli.mjs docs --server ./build/sdk-open-rpc.json --output ./build/docs/markdown --schemas test/schemas --as-path",
"build:wiki": "node ./src/cli.mjs docs --server ./build/sdk-open-rpc.json --output ./build/docs/wiki --schemas test/schemas",
"dist": "npm run validate && npm run build:sdk && npm run build:docs && npm run test",
"prepare": "husky install"
},
Expand Down
3 changes: 2 additions & 1 deletion src/cli.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const knownOpts = {
'copy-schemas': [Boolean],
'language': [path],
'examples': [path, Array],
'as-path': [Boolean]
'as-path': [Boolean],
'bidirectional': [Boolean]
}

const shortHands = {
Expand Down
5 changes: 3 additions & 2 deletions src/validate/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
const run = async ({
input: input,
schemas: schemas,
transformations = false
transformations = false,
bidirectional = false
}) => {

logHeader(`Validating ${path.relative('.', input)} with${transformations ? '' : 'out'} Firebolt transformations.`)
Expand Down Expand Up @@ -177,7 +178,7 @@ const run = async ({

if (transformations) {
// Do the firebolt API magic
json = fireboltize(json, true)
json = fireboltize(json, bidirectional)

// pull in external markdown files for descriptions
json = addExternalMarkdown(json, markdown)
Expand Down
Loading

0 comments on commit 6a90892

Please sign in to comment.