docsify-ts-api
Advanced tools
Comparing version 1.0.4 to 1.1.0
@@ -1,20 +0,20 @@ | ||
const readPkgUp = require("read-pkg-up"); | ||
const readPkgUp = require('read-pkg-up'); | ||
const SYMBOL_TYPES = { | ||
"@": { value: "decorator", label: "Decorator" }, | ||
"T": { value: "type", label: "Type alias" }, | ||
"C": { value: "class", label: "Class" }, | ||
"S": { value: "service", label: "Service" }, | ||
"I": { value: "interface", label: "Interface" }, | ||
"K": { value: "const", label: "Constant" }, | ||
"E": { value: "enum", label: "Enum" }, | ||
"F": { value: "function", label: "Function" } | ||
'@': { value: 'decorator', label: 'Decorator' }, | ||
'T': { value: 'type', label: 'Type alias' }, | ||
'C': { value: 'class', label: 'Class' }, | ||
'S': { value: 'service', label: 'Service' }, | ||
'I': { value: 'interface', label: 'Interface' }, | ||
'K': { value: 'const', label: 'Constant' }, | ||
'E': { value: 'enum', label: 'Enum' }, | ||
'F': { value: 'function', label: 'Function' } | ||
}; | ||
const SYMBOL_STATUS = { | ||
"S": { value: "stable", label: "Stable" }, | ||
"D": { value: "deprecated", label: "Deprecated" }, | ||
"E": { value: "experimental", label: "Experimental" }, | ||
"P": { value: "private", label: "Private" }, | ||
"O": { value: "public", label: "Public" } | ||
'S': { value: 'stable', label: 'Stable' }, | ||
'D': { value: 'deprecated', label: 'Deprecated' }, | ||
'E': { value: 'experimental', label: 'Experimental' }, | ||
'P': { value: 'private', label: 'Private' }, | ||
'O': { value: 'public', label: 'Public' } | ||
}; | ||
@@ -38,13 +38,17 @@ | ||
readPkg() { | ||
return readPkgUp().then((result) => { | ||
const { name, repository, version, docsifyApi } = result.pkg; | ||
this.github = repository.url.replace(".git", "").replace("git+", ""); | ||
this.version = version; | ||
this.projectName = name; | ||
this.host = `${this.github}/blob/v${version}/src/`; | ||
this.modules = docsifyApi.modules; | ||
return result.pkg; | ||
}); | ||
return readPkgUp() | ||
.then((result) => { | ||
module.exports.importPkg(result.pkg); | ||
return result.pkg; | ||
}); | ||
}, | ||
importPkg(pkg) { | ||
const { name, repository, version, docsifyApi } = pkg; | ||
this.github = repository.url.replace('.git', '').replace('git+', ''); | ||
this.version = version; | ||
this.projectName = name; | ||
this.host = `${this.github}/blob/v${version}/src/`; | ||
this.modules = docsifyApi.modules; | ||
} | ||
}; | ||
@@ -1,14 +0,14 @@ | ||
"use strict"; | ||
'use strict'; | ||
const { context } = require("../context"); | ||
const { writeSymbol, writeTemplate } = require("../write/write"); | ||
const { scanFiles, scanComponents } = require("../scan/scan"); | ||
const path = require("path"); | ||
const { context } = require('../context'); | ||
const { writeSymbol, writeTemplate } = require('../write/write'); | ||
const { scanFiles, scanComponents } = require('../scan/scan'); | ||
const path = require('path'); | ||
const { $log } = require("ts-log-debug"); | ||
const { $log } = require('ts-log-debug'); | ||
$log.name = "DOC"; | ||
$log.name = 'DOC'; | ||
const options = { | ||
components: path.join(__dirname, "..", "..", "components") | ||
components: path.join(__dirname, '..', '..', 'components') | ||
}; | ||
@@ -20,3 +20,3 @@ | ||
*/ | ||
buildApi(config) { | ||
buildApi(config, pkg) { | ||
context.root = config.root; | ||
@@ -28,6 +28,6 @@ context.apiDir = config.apiDir; | ||
return context | ||
.readPkg() | ||
return Promise.resolve() | ||
.then(() => pkg ? context.importPkg(pkg) : context.readPkg()) | ||
.then(() => scanComponents(options.components)) | ||
.then(() => scanFiles(context.libDir + "/**/*.ts")) | ||
.then(() => scanFiles(context.libDir + '/**/*.ts')) | ||
.then(() => { | ||
@@ -40,7 +40,7 @@ context.symbols.forEach((symbol) => { | ||
.then(() => { | ||
writeTemplate(context.docsDir + "/**/*.{ejs,emd}"); | ||
writeTemplate(context.docsDir + '/**/*.{ejs,emd}'); | ||
}) | ||
.then(() => $log.info("done")) | ||
.then(() => $log.info('done')) | ||
.catch(err => console.error(err)); | ||
} | ||
}; |
{ | ||
"name": "docsify-ts-api", | ||
"version": "1.0.4", | ||
"version": "1.1.0", | ||
"description": "Generate documentation on TypeScript API for docsify tool", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35466
1045