Socket
Socket
Sign inDemoInstall

api-docs-gen

Package Overview
Dependencies
91
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.6 to 0.3.0

14

CHANGELOG.md
## v0.3.0 (2021-05-21)
#### :star: Features
* [#71](https://github.com/kazupon/api-docs-gen/pull/71) feat: generics parameter docs ([@kazupon](https://github.com/kazupon))
* [#70](https://github.com/kazupon/api-docs-gen/pull/70) feat: call signature for interfaces ([@kazupon](https://github.com/kazupon))
#### :boom: Breaking Change
* [#69](https://github.com/kazupon/api-docs-gen/pull/69) breaking: change to caml from kebab ([@kazupon](https://github.com/kazupon))
* [#68](https://github.com/kazupon/api-docs-gen/pull/68) fix: drop Node v10 ([@kazupon](https://github.com/kazupon))
#### Committers: 1
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
## v0.2.6 (2020-11-30)

@@ -3,0 +17,0 @@

12

lib/cli.js

@@ -26,3 +26,3 @@ "use strict";

},
'generate-style': {
generateStyle: {
type: 'string',

@@ -32,3 +32,3 @@ alias: 'g',

},
'tsdoc-config': {
tsdocConfig: {
type: 'string',

@@ -46,7 +46,7 @@ alias: 't',

--output, -o output dierectory that is markdown contents
--generate-style, -g document generating style, default 'prefix'
--generateStyle, -g document generating style, default 'prefix'
'prefix': be able to separated with each package name
'noprefix': not separated with each package name
'directory': be able to separated with each package directory
--tsdoc-config, -t tsdoc configration file
--tsdocConfig, -t tsdoc configration file

@@ -57,4 +57,4 @@ Examples

$ api-docs-gen package1.api.json --config docsgen.config.js
$ api-docs-gen package1.api.json package2.api.json --generate-style directory
$ api-docs-gen package1.api.json --tsdoc-config ./tsdoc.json
$ api-docs-gen package1.api.json package2.api.json --generateStyle directory
$ api-docs-gen package1.api.json --tsdocConfig ./tsdoc.json
`, {

@@ -61,0 +61,0 @@ flags: exports.flags

@@ -30,2 +30,17 @@ "use strict";

}
// type params
if (docs.typeParams && docs.typeParams.count > 0) {
builder.pushline(`**Type parameters**`);
builder.newline();
builder.pushline(`| Parameter | Description |`);
builder.pushline(`| --- | --- |`);
for (const p of docs.typeParams.blocks) {
builder.pushline(`| ${p.parameterName} | ${p.content
? getDocSectionContent(model, pkg,
// @ts-ignore TODO:
p.content, item, style, resolver, customTags)
: ''} |`);
}
builder.newline();
}
// parameters

@@ -187,5 +202,21 @@ const itemParam = item;

}
// type params
if (docs.typeParams && docs.typeParams.count > 0) {
builder.pushline(`**Type parameters**`);
builder.newline();
builder.pushline(`| Parameter | Description |`);
builder.pushline(`| --- | --- |`);
for (const p of docs.typeParams.blocks) {
builder.pushline(`| ${p.parameterName} | ${p.content
? getDocSectionContent(model, pkg,
// @ts-ignore TODO:
p.content, item, style, resolver, customTags)
: ''} |`);
}
builder.newline();
}
// parameters
const itemParam = item;
if ((type === 'constrcutor' || type === 'method') && itemParam.parameters) {
if ((type === 'constructor' || type === 'method' || type === 'function') &&
itemParam.parameters) {
builder.pushline(`*Parameters*`);

@@ -205,3 +236,3 @@ builder.newline();

// returns
if (type === 'method' && docs.returnsBlock) {
if ((type === 'method' || type === 'function') && docs.returnsBlock) {
builder.pushline(`${'#'.repeat(base)} Returns`);

@@ -217,3 +248,4 @@ builder.newline();

const throws = findCustomTags(docs.customBlocks, '@throws');
if ((type === 'constructor' || type === 'method') && throws.length > 0) {
if ((type === 'constructor' || type === 'method' || type === 'function') &&
throws.length > 0) {
builder.pushline(`${'#'.repeat(base)} Throws`);

@@ -261,20 +293,39 @@ builder.newline();

builder.newline();
const functions = item.members.filter(m => m.kind === 'CallSignature');
if (functions.length) {
builder.pushline(`${'#'.repeat(base + 1)} Functions`);
builder.newline();
for (const func of functions) {
const itemDeclared = func;
const display = itemDeclared.excerptTokens
.map(token => token.text)
.join('');
builder.pushline(`${'#'.repeat(base + 2)} ${utils_1.escapeTextForTable(display)}`);
builder.newline();
buildContentForClassinizable(style, model, pkg, resolver, builder, func, 'function', customTags, base + 1);
}
builder.newline();
}
const methods = item.members.filter(m => m.kind === 'MethodSignature');
builder.pushline(`${'#'.repeat(base + 1)} Methods`);
builder.newline();
for (const method of methods) {
builder.pushline(`${'#'.repeat(base + 2)} ${method.displayName}`);
if (methods.length) {
builder.pushline(`${'#'.repeat(base + 1)} Methods`);
builder.newline();
buildContentForClassinizable(style, model, pkg, resolver, builder, method, 'method', customTags, base + 1);
for (const method of methods) {
builder.pushline(`${'#'.repeat(base + 2)} ${method.displayName}`);
builder.newline();
buildContentForClassinizable(style, model, pkg, resolver, builder, method, 'method', customTags, base + 1);
}
builder.newline();
}
builder.newline();
const properties = item.members.filter(m => m.kind === 'PropertySignature');
builder.pushline(`${'#'.repeat(base + 1)} Properties`);
builder.newline();
for (const property of properties) {
builder.pushline(`${'#'.repeat(base + 2)} ${property.displayName}`);
if (properties.length) {
builder.pushline(`${'#'.repeat(base + 1)} Properties`);
builder.newline();
buildContentForClassinizable(style, model, pkg, resolver, builder, property, 'property', customTags, base + 1);
for (const property of properties) {
builder.pushline(`${'#'.repeat(base + 2)} ${property.displayName}`);
builder.newline();
buildContentForClassinizable(style, model, pkg, resolver, builder, property, 'property', customTags, base + 1);
}
builder.newline();
}
builder.newline();
}

@@ -293,19 +344,23 @@ exports.buildInterfaceContent = buildInterfaceContent;

const methods = item.members.filter(m => m.kind === 'Method');
builder.pushline(`${'#'.repeat(base + 1)} Methods`);
builder.newline();
for (const method of methods) {
builder.pushline(`${'#'.repeat(base + 2)} ${method.displayName}`);
if (methods.length) {
builder.pushline(`${'#'.repeat(base + 1)} Methods`);
builder.newline();
buildContentForClassinizable(style, model, pkg, resolver, builder, method, 'method', customTags, base + 1);
for (const method of methods) {
builder.pushline(`${'#'.repeat(base + 2)} ${method.displayName}`);
builder.newline();
buildContentForClassinizable(style, model, pkg, resolver, builder, method, 'method', customTags, base + 1);
}
builder.newline();
}
builder.newline();
const properties = item.members.filter(m => m.kind === 'Property');
builder.pushline(`${'#'.repeat(base + 1)} Properties`);
builder.newline();
for (const property of properties) {
builder.pushline(`${'#'.repeat(base + 2)} ${property.displayName}`);
if (properties.length) {
builder.pushline(`${'#'.repeat(base + 1)} Properties`);
builder.newline();
buildContentForClassinizable(style, model, pkg, resolver, builder, property, 'property', customTags, base + 1);
for (const property of properties) {
builder.pushline(`${'#'.repeat(base + 2)} ${property.displayName}`);
builder.newline();
buildContentForClassinizable(style, model, pkg, resolver, builder, property, 'property', customTags, base + 1);
}
builder.newline();
}
builder.newline();
}

@@ -336,2 +391,17 @@ exports.buildClassContent = buildClassContent;

}
// type params
if (docs.typeParams && docs.typeParams.count > 0) {
builder.pushline(`**Type parameters**`);
builder.newline();
builder.pushline(`| Parameter | Description |`);
builder.pushline(`| --- | --- |`);
for (const p of docs.typeParams.blocks) {
builder.pushline(`| ${p.parameterName} | ${p.content
? getDocSectionContent(model, pkg,
// @ts-ignore TODO:
p.content, item, style, resolver, customTags)
: ''} |`);
}
builder.newline();
}
// remarks

@@ -338,0 +408,0 @@ if (docs.remarksBlock) {

{
"name": "api-docs-gen",
"description": "API Documentation generator from `api-extractor` doc model",
"version": "0.2.6",
"version": "0.3.0",
"author": {

@@ -31,7 +31,7 @@ "name": "kazuya kawaguchi",

"@microsoft/api-extractor-model": "^7.12.0",
"@microsoft/tsdoc": "^0.12.21",
"@microsoft/tsdoc-config": "^0.13.6",
"chalk": "^4.1.0",
"@microsoft/tsdoc": "^0.13.0",
"@microsoft/tsdoc-config": "^0.15.0",
"chalk": "^4.1.1",
"debug": "^4.3.1",
"meow": "^8.0.0"
"meow": "^9.0.0"
},

@@ -41,26 +41,26 @@ "devDependencies": {

"@types/debug": "^4.1.5",
"@types/jest": "^26.0.15",
"@types/meow": "^5.0.0",
"@types/node": "^14.14.9",
"@typescript-eslint/eslint-plugin": "^4.8.1",
"@typescript-eslint/parser": "^4.8.1",
"eslint": "^7.14.0",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-prettier": "^3.1.4",
"@types/jest": "^26.0.23",
"@types/meow": "^6.0.0",
"@types/node": "^15.3.1",
"@typescript-eslint/eslint-plugin": "^4.24.0",
"@typescript-eslint/parser": "^4.24.0",
"eslint": "^7.26.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-vue-libs": "^4.0.0",
"jest": "^26.6.0",
"jest-watch-typeahead": "^0.6.0",
"lerna": "^3.22.1",
"jest": "^26.6.3",
"jest-watch-typeahead": "^0.6.3",
"lerna": "^4.0.0",
"lerna-changelog": "^1.0.1",
"npm-run-all": "^4.1.5",
"opener": "^1.5.1",
"prettier": "^2.2.0",
"shipjs": "^0.23.0",
"ts-jest": "^26.4.4",
"typescript": "^4.1.0",
"typescript-eslint-language-service": "^4.1.2",
"vuepress": "^1.7.1"
"opener": "^1.5.2",
"prettier": "^2.3.0",
"shipjs": "^0.23.2",
"ts-jest": "^26.5.6",
"typescript": "^4.2.4",
"typescript-eslint-language-service": "^4.1.4",
"vuepress": "^1.8.2"
},
"engines": {
"node": ">= 10"
"node": ">= 12"
},

@@ -67,0 +67,0 @@ "files": [

@@ -38,6 +38,6 @@ # :book: api-docs-gen

--output, -o output dierectory that is markdown contents
--generate-style, -g document generating style, default 'prefix'
--generateStyle, -g document generating style, default 'prefix'
'prefix': be able to separated with each package name
'directory': be able to separated with each package directory
--tsdoc-config, -t tsdoc configration file
--tsdocConfig, -t tsdoc configration file
```

@@ -44,0 +44,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc