Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/json-schema-static-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ JsonSchemaStaticDocs.prototype.generate = async function () {
const inputPathPattern = fastGlob.convertPathToPattern(
this._options.inputPath
);
const inputPathGlob = path.join(
const inputPathGlob = path.posix.join(
inputPathPattern,
this._options.inputFileGlob
);

// clean up path (strip leading ./ etc)
const cleanInputPath = path.join(this._options.inputPath);
const cleanInputPath = path.posix.join(this._options.inputPath);

const unresolvedSchemas = await Loader.loadFiles(inputPathGlob);
console.log(
Expand Down
8 changes: 4 additions & 4 deletions lib/writer.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const fs = require('fs');
const makeDir = require('make-dir');
const path = require('path');

var Writer = function(){}

Writer.writeFile = async function(filename, data) {
let parts = filename.split('/');
let parts = filename.split(path.sep);
let dirName = parts.splice(0, parts.length-1).join('/');
if (!fs.existsSync(dirName)) {
await makeDir(dirName);
if (dirName && !fs.existsSync(dirName)) {
fs.mkdirSync(dirName, {recursive:true})
}
fs.writeFileSync(filename, data);
};
Expand Down
40 changes: 11 additions & 29 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"node": ">=14"
},
"dependencies": {
"@apidevtools/json-schema-ref-parser": "^10.1.0",
"@apidevtools/json-schema-ref-parser": "^12.0.2",
"ajv": "^8.17.1",
"ajv-formats": "^3.0.1",
"extend": "^3.0.2",
Expand Down