New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mattetti/custom-api-documenter

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mattetti/custom-api-documenter - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

2

CHANGELOG.md
# Change Log - @mattetti/custom-api-documenter
## 0.2.0 Supports passing the path to a config file using --config + turning off YAML generation
## 0.1.0 New markdown rendering with new file structures and HTML snippets

@@ -4,0 +6,0 @@

4

lib/cli/ApiDocumenterCommandLine.js

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

const MarkdownAction_1 = require("./MarkdownAction");
const YamlAction_1 = require("./YamlAction");
//import { YamlAction } from './YamlAction';
const GenerateAction_1 = require("./GenerateAction");

@@ -25,3 +25,3 @@ class ApiDocumenterCommandLine extends ts_command_line_1.CommandLineParser {

this.addAction(new MarkdownAction_1.MarkdownAction(this));
this.addAction(new YamlAction_1.YamlAction(this));
//this.addAction(new YamlAction(this));
this.addAction(new GenerateAction_1.GenerateAction(this));

@@ -28,0 +28,0 @@ }

@@ -6,5 +6,8 @@ import { CommandLineAction } from '@rushstack/ts-command-line';

protected outputFolder: string;
protected configPath: string;
private _inputFolderParameter;
private _outputFolderParameter;
private _configPathParameter;
protected onDefineParameters(): void;
protected setConfigPath(): void;
protected buildApiModel(): ApiModel;

@@ -11,0 +14,0 @@ private _applyInheritDoc;

@@ -10,2 +10,3 @@ "use strict";

const api_extractor_model_1 = require("@microsoft/api-extractor-model");
const DocumenterConfig_1 = require("../documenters/DocumenterConfig");
class BaseAction extends ts_command_line_1.CommandLineAction {

@@ -29,3 +30,13 @@ onDefineParameters() {

});
this._configPathParameter = this.defineStringParameter({
parameterLongName: '--config',
parameterShortName: '-c',
argumentName: 'CONFIG',
description: `Specifies the the path to the config file used by the generator.` +
` If omitted, the default is "${DocumenterConfig_1.DocumenterConfig.FILENAME}"`
});
}
setConfigPath() {
this.configPath = this._configPathParameter.value || DocumenterConfig_1.DocumenterConfig.FILENAME;
}
buildApiModel() {

@@ -39,2 +50,3 @@ const apiModel = new api_extractor_model_1.ApiModel();

node_core_library_1.FileSystem.ensureFolder(this.outputFolder);
this.setConfigPath();
for (const filename of node_core_library_1.FileSystem.readFolder(this.inputFolder)) {

@@ -41,0 +53,0 @@ if (filename.match(/\.api\.json$/i)) {

@@ -15,5 +15,5 @@ "use strict";

actionName: 'generate',
summary: 'EXPERIMENTAL',
documentation: 'EXPERIMENTAL - This action is a prototype of a new config file driven mode of operation for' +
' API Documenter. It is not ready for general usage yet. Its design may change in the future.'
summary: 'generate markdown documentation based on a config file',
documentation: 'Config file driven mode of operation for API Documenter' +
' Set --config --input-folder and --output-folder.'
});

@@ -24,3 +24,4 @@ }

// Look for the config file under the current folder
let configFilePath = path.join(process.cwd(), DocumenterConfig_1.DocumenterConfig.FILENAME);
this.setConfigPath();
let configFilePath = path.join(process.cwd(), this.configPath);
// First try the current folder

@@ -27,0 +28,0 @@ if (!node_core_library_1.FileSystem.exists(configFilePath)) {

{
"name": "@mattetti/custom-api-documenter",
"version": "0.1.0",
"version": "0.2.0",
"description": "Read JSON files from api-extractor, generate documentation pages",

@@ -5,0 +5,0 @@ "repository": {

@@ -6,3 +6,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.

import { MarkdownAction } from './MarkdownAction';
import { YamlAction } from './YamlAction';
//import { YamlAction } from './YamlAction';
import { GenerateAction } from './GenerateAction';

@@ -28,5 +28,5 @@

this.addAction(new MarkdownAction(this));
this.addAction(new YamlAction(this));
//this.addAction(new YamlAction(this));
this.addAction(new GenerateAction(this));
}
}

@@ -17,2 +17,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.

} from '@microsoft/api-extractor-model';
import { DocumenterConfig } from '../documenters/DocumenterConfig';

@@ -22,5 +23,7 @@ export abstract class BaseAction extends CommandLineAction {

protected outputFolder: string;
protected configPath: string;
private _inputFolderParameter: CommandLineStringParameter;
private _outputFolderParameter: CommandLineStringParameter;
private _configPathParameter: CommandLineStringParameter;

@@ -47,4 +50,17 @@ protected onDefineParameters(): void {

});
this._configPathParameter = this.defineStringParameter({
parameterLongName: '--config',
parameterShortName: '-c',
argumentName: 'CONFIG',
description:
`Specifies the the path to the config file used by the generator.` +
` If omitted, the default is "${DocumenterConfig.FILENAME}"`
});
}
protected setConfigPath(): void {
this.configPath = this._configPathParameter.value || DocumenterConfig.FILENAME;
}
protected buildApiModel(): ApiModel {

@@ -61,2 +77,4 @@ const apiModel: ApiModel = new ApiModel();

this.setConfigPath();
for (const filename of FileSystem.readFolder(this.inputFolder)) {

@@ -63,0 +81,0 @@ if (filename.match(/\.api\.json$/i)) {

@@ -19,6 +19,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.

actionName: 'generate',
summary: 'EXPERIMENTAL',
summary: 'generate markdown documentation based on a config file',
documentation:
'EXPERIMENTAL - This action is a prototype of a new config file driven mode of operation for' +
' API Documenter. It is not ready for general usage yet. Its design may change in the future.'
'Config file driven mode of operation for API Documenter' +
' Set --config --input-folder and --output-folder.'
});

@@ -29,6 +29,5 @@ }

// override
// Look for the config file under the current folder
this.setConfigPath();
let configFilePath: string = path.join(process.cwd(), this.configPath);
let configFilePath: string = path.join(process.cwd(), DocumenterConfig.FILENAME);
// First try the current folder

@@ -35,0 +34,0 @@ if (!FileSystem.exists(configFilePath)) {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc