Skip to content

Commit

Permalink
chore: update docusaurus template
Browse files Browse the repository at this point in the history
Signed-off-by: aeneasr <aeneasr@users.noreply.github.com>
  • Loading branch information
aeneasr committed Aug 4, 2021
1 parent 6ea0bf8 commit 23bd2f7
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs/scripts/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,25 @@ const path = require('path')
const fs = require('fs')
const prettier = require('prettier')
const prettierStyles = require('ory-prettier-styles')
const { execSync } = require('child_process')
const fetch = require('node-fetch')

const oryXVersion = execSync(
"cd ..; go list -f '{{.Module.Version}}' -find github.com/ory/x"
)
.toString('utf-8')
.trim()

const refs = {
'ory://tracing-config': `https://raw.githubusercontent.com/ory/x/${oryXVersion}/tracing/config.schema.json`,
'ory://logging-config': `https://raw.githubusercontent.com/ory/x/${oryXVersion}/logrusx/config.schema.json`
}

const oryResolver = {
order: 1,
canRead: /^ory:/i,
read: ({ url }) => fetch(refs[url]).then((res) => res.json())
}

jsf.option({
alwaysFakeOptionals: true,
Expand Down Expand Up @@ -124,6 +143,11 @@ const enhance =
new Promise((resolve, reject) => {
parser.dereference(
require(path.resolve(config.updateConfig.src)),
{
resolve: {
ory: oryResolver
}
},
(err, result) => (err ? reject(err) : resolve(result))
)
})
Expand Down

0 comments on commit 23bd2f7

Please sign in to comment.