@mikaello/avrodoc-plus
Advanced tools
Comparing version 1.4.0 to 1.4.1
{ | ||
"name": "@mikaello/avrodoc-plus", | ||
"description": "Documentation tool for Avro schemas. Forked from https://github.com/leosilvadev/avrodoc-plus.", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"author": "mikaello https://github.com/mikaello", | ||
@@ -18,19 +18,19 @@ "type": "module", | ||
"dependencies": { | ||
"arg": "^5.0.0", | ||
"debug": "^4.0.1", | ||
"dustjs-helpers": "^1.7.4", | ||
"dustjs-linkedin": "^2.7.5", | ||
"esbuild": "^0.11.14", | ||
"less": "^1" | ||
"arg": "5.0.2", | ||
"debug": "4.3.4", | ||
"dustjs-helpers": "1.7.4", | ||
"dustjs-linkedin": "2.7.5", | ||
"esbuild": "0.19.5", | ||
"less": "1.7.5" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^7.25.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-jest": "^24.3.5", | ||
"express": "^4.17.1", | ||
"glob": "^7.1.6", | ||
"jest": "^26.6.3", | ||
"less-middleware": "^2", | ||
"morgan": "^1.10.0", | ||
"prettier": "2.2.1" | ||
"eslint": "8.51.0", | ||
"eslint-config-prettier": "9.0.0", | ||
"eslint-plugin-jest": "27.4.2", | ||
"express": "4.18.2", | ||
"glob": "8.1.0", | ||
"jest": "29.7.0", | ||
"less-middleware": "2.2.1", | ||
"morgan": "1.10.0", | ||
"prettier": "3.0.3" | ||
}, | ||
@@ -37,0 +37,0 @@ "prettier": {}, |
@@ -9,4 +9,4 @@ /* global dust:false, markdown:false, Sammy:false */ | ||
// eslint-disable-next-line | ||
function AvroDoc(input_schemata) { | ||
var _public = {}; | ||
function AvroDoc(page_title, input_schemata) { | ||
var _public = { page_title: page_title }; | ||
var list_pane = $("#list-pane"), | ||
@@ -144,3 +144,3 @@ content_pane = $("#content-pane"); | ||
const protocols = Object.values(_public.by_qualified_name).filter( | ||
(shared_type) => shared_type.is_protocol | ||
(shared_type) => shared_type.is_protocol, | ||
); | ||
@@ -202,3 +202,3 @@ | ||
json, | ||
filename | ||
filename, | ||
); | ||
@@ -229,3 +229,3 @@ } | ||
schemata_to_load + | ||
" schemata..." | ||
" schemata...", | ||
); | ||
@@ -232,0 +232,0 @@ } |
@@ -152,3 +152,3 @@ /* global AvroDoc:false */ | ||
ignore_attributes = ignore_attributes.concat( | ||
built_in_type_fields[schema.type] | ||
built_in_type_fields[schema.type], | ||
); | ||
@@ -172,3 +172,3 @@ } | ||
undefined, | ||
3 | ||
3, | ||
); | ||
@@ -257,3 +257,3 @@ } else if (named_types[annotation_value]) { | ||
const sharedType = shared_types[qualifiedNameStr].find( | ||
(sharedSchema) => sharedSchema.qualified_name === name | ||
(sharedSchema) => sharedSchema.qualified_name === qualifiedNameStr, | ||
); | ||
@@ -267,3 +267,3 @@ | ||
throw `Shared schema ${qualifiedNameStr} does not have type ${JSON.stringify( | ||
name | ||
name, | ||
)}, referred to at ${path}`; | ||
@@ -371,3 +371,3 @@ } | ||
essence.errors = (schema.errors || []).map((error) => | ||
extractTypeName(error, schema.namespace) | ||
extractTypeName(error, schema.namespace), | ||
); | ||
@@ -381,3 +381,3 @@ } else if (schema.type === "protocol") { | ||
typeEssence(message), | ||
]) | ||
]), | ||
); | ||
@@ -474,3 +474,3 @@ } else { | ||
shared_schema = shared_types[qualified_name].find((shared_schema) => | ||
isEqual(new_type, typeEssence(shared_schema)) | ||
isEqual(new_type, typeEssence(shared_schema)), | ||
); | ||
@@ -537,3 +537,3 @@ } else { | ||
schema.namespace, | ||
joinPath(path, field.name) | ||
joinPath(path, field.name), | ||
); | ||
@@ -571,3 +571,3 @@ field.default_str = JSON.stringify(field["default"], null, " "); | ||
namespace, | ||
joinPath(path, "items") | ||
joinPath(path, "items"), | ||
); | ||
@@ -579,3 +579,3 @@ return decorate(schema); | ||
namespace, | ||
joinPath(path, "values") | ||
joinPath(path, "values"), | ||
); | ||
@@ -618,7 +618,7 @@ return decorate(schema); | ||
protocol.types = (protocol.types ?? []).map((type) => | ||
parseSchema(type, protocol.namespace, "types") | ||
parseSchema(type, protocol.namespace, "types"), | ||
); | ||
for (const [messageName, message] of Object.entries( | ||
protocol.messages ?? {} | ||
protocol.messages ?? {}, | ||
)) { | ||
@@ -635,3 +635,3 @@ var path = "messages." + messageName; | ||
protocol.namespace, | ||
joinPath(path, "request." + param.name) | ||
joinPath(path, "request." + param.name), | ||
); | ||
@@ -643,3 +643,3 @@ param.default_str = JSON.stringify(param["default"], null, " "); | ||
protocol.namespace, | ||
joinPath(path, "response") | ||
joinPath(path, "response"), | ||
); | ||
@@ -653,3 +653,3 @@ | ||
message.errors = (message.errors ?? []).map((error) => | ||
parseSchema(error, protocol.namespace, joinPath(path, "errors")) | ||
parseSchema(error, protocol.namespace, joinPath(path, "errors")), | ||
); | ||
@@ -662,3 +662,3 @@ | ||
protocol.sorted_messages = Object.values(protocol.messages ?? {}).sort( | ||
stringCompareByS("name") | ||
stringCompareByS("name"), | ||
); | ||
@@ -684,3 +684,3 @@ defineNamedType(protocol); | ||
_public.sorted_types = Object.values(named_types).sort( | ||
stringCompareByS("name") | ||
stringCompareByS("name"), | ||
); | ||
@@ -687,0 +687,0 @@ |
# avrodoc-plus | ||
[![npm](https://img.shields.io/npm/v/@mikaello/avrodoc-plus.svg?style=flat-square)](https://www.npmjs.com/package/@mikaello/avrodoc-plus) | ||
[![travis](https://app.travis-ci.com/mikaello/avrodoc-plus.svg?branch=master)](https://travis-ci.com/github/mikaello/avrodoc-plus) | ||
avrodoc-plus is a documentation tool for [Apache Avro](http://avro.apache.org/) schemas. | ||
@@ -11,2 +14,3 @@ | ||
npm install --global @mikaello/avrodoc-plus | yarn add global @mikaello/avrodoc-plus | ||
avrodoc-plus -i source -o out.html | ||
@@ -25,3 +29,3 @@ ``` | ||
USAGE: | ||
avrodoc [FLAGS] [OPTIONS] [AVRO FILES...] | ||
avrodoc-plus [FLAGS] [OPTIONS] [AVRO FILES...] | ||
@@ -50,1 +54,2 @@ FLAGS: | ||
- support of schema/type search (search by namespace and/or schema/type) | ||
- support for custom page title |
@@ -25,3 +25,3 @@ /** | ||
outputfile, | ||
ignoreInvalid | ||
ignoreInvalid, | ||
) { | ||
@@ -49,3 +49,3 @@ avrodocDebug(`Creating ${outputfile} from `, inputfiles); | ||
process.cwd(), | ||
output.substring(0, output.lastIndexOf("/")) | ||
output.substring(0, output.lastIndexOf("/")), | ||
); | ||
@@ -52,0 +52,0 @@ if (!fs.existsSync(outFolder)) { |
@@ -14,9 +14,9 @@ import { createAvroDoc } from "./avrodoc.js"; | ||
await expect( | ||
createAvroDoc("Test: Avrodoc", [], ["./schemata/example.avsc"], testFile) | ||
createAvroDoc("Test: Avrodoc", [], ["./schemata/example.avsc"], testFile), | ||
).resolves.toBeUndefined(); | ||
expect(readFileSync(testFile, "utf-8")).toContain( | ||
'<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Avrodoc</title>' | ||
'<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Test: Avrodoc</title>', | ||
); | ||
}); | ||
}); |
@@ -38,3 +38,3 @@ /** | ||
const usage = `USAGE: | ||
avrodoc [FLAGS] [OPTIONS] [AVRO FILES...] | ||
avrodoc-plus [FLAGS] [OPTIONS] [AVRO FILES...] | ||
@@ -87,3 +87,3 @@ FLAGS: | ||
console.error( | ||
'Missing input schemata, either specify a folder with "--input" or individual AVRO files. Specify "--help" to see usage.' | ||
'Missing input schemata, either specify a folder with "--input" or individual AVRO files. Specify "--help" to see usage.', | ||
); | ||
@@ -93,3 +93,3 @@ process.exit(1); | ||
console.error( | ||
'Missing output file, specify with "--output" where the resulting HTML should go. Specify "--help" to see usage.' | ||
'Missing output file, specify with "--output" where the resulting HTML should go. Specify "--help" to see usage.', | ||
); | ||
@@ -104,3 +104,3 @@ process.exit(1); | ||
outputFile, | ||
ignoreInvalidSchemas | ||
ignoreInvalidSchemas, | ||
); | ||
@@ -107,0 +107,0 @@ |
@@ -35,4 +35,4 @@ import fs from "fs"; | ||
dust.compileFn( | ||
fs.readFileSync(path.join(__dirname, "top_level.dust"), "utf-8") | ||
) | ||
fs.readFileSync(path.join(__dirname, "top_level.dust"), "utf-8"), | ||
), | ||
); | ||
@@ -55,3 +55,3 @@ | ||
console.error( | ||
`Could not minify file ${filename} with ESBuild:\n` + result.error | ||
`Could not minify file ${filename} with ESBuild:\n` + result.error, | ||
); | ||
@@ -141,3 +141,3 @@ return ""; | ||
html.push( | ||
'<link rel="stylesheet" type="text/css" href="/' + css_file + '"/>' | ||
'<link rel="stylesheet" type="text/css" href="/' + css_file + '"/>', | ||
); | ||
@@ -149,3 +149,3 @@ }); | ||
html.push( | ||
'<script type="text/javascript" src="/dust-templates.js"></script>' | ||
'<script type="text/javascript" src="/dust-templates.js"></script>', | ||
); | ||
@@ -202,3 +202,3 @@ callback(null, html.join("\n")); | ||
const context = { | ||
title: title ?? "Avrodoc", | ||
page_title: title ?? "Avrodoc", | ||
content: content, | ||
@@ -215,3 +215,3 @@ schemata: "[]", | ||
.catch((err) => reject(err)); | ||
} | ||
}, | ||
); | ||
@@ -218,0 +218,0 @@ }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
647282
57
15620
53
+ Added@esbuild/android-arm@0.19.5(transitive)
+ Added@esbuild/android-arm64@0.19.5(transitive)
+ Added@esbuild/android-x64@0.19.5(transitive)
+ Added@esbuild/darwin-arm64@0.19.5(transitive)
+ Added@esbuild/darwin-x64@0.19.5(transitive)
+ Added@esbuild/freebsd-arm64@0.19.5(transitive)
+ Added@esbuild/freebsd-x64@0.19.5(transitive)
+ Added@esbuild/linux-arm@0.19.5(transitive)
+ Added@esbuild/linux-arm64@0.19.5(transitive)
+ Added@esbuild/linux-ia32@0.19.5(transitive)
+ Added@esbuild/linux-loong64@0.19.5(transitive)
+ Added@esbuild/linux-mips64el@0.19.5(transitive)
+ Added@esbuild/linux-ppc64@0.19.5(transitive)
+ Added@esbuild/linux-riscv64@0.19.5(transitive)
+ Added@esbuild/linux-s390x@0.19.5(transitive)
+ Added@esbuild/linux-x64@0.19.5(transitive)
+ Added@esbuild/netbsd-x64@0.19.5(transitive)
+ Added@esbuild/openbsd-x64@0.19.5(transitive)
+ Added@esbuild/sunos-x64@0.19.5(transitive)
+ Added@esbuild/win32-arm64@0.19.5(transitive)
+ Added@esbuild/win32-ia32@0.19.5(transitive)
+ Added@esbuild/win32-x64@0.19.5(transitive)
+ Addeddebug@4.3.4(transitive)
+ Addedesbuild@0.19.5(transitive)
+ Addedms@2.1.2(transitive)
- Removeddebug@4.4.0(transitive)
- Removedesbuild@0.11.23(transitive)
- Removedms@2.1.3(transitive)
Updatedarg@5.0.2
Updateddebug@4.3.4
Updateddustjs-helpers@1.7.4
Updateddustjs-linkedin@2.7.5
Updatedesbuild@0.19.5
Updatedless@1.7.5