From bc85f65efb65a18f265ee7ca63c61f4ebdac51b5 Mon Sep 17 00:00:00 2001 From: afragapane Date: Tue, 4 Dec 2018 13:22:47 -0700 Subject: [PATCH] docs(Reference): Use dgeni to generate docs from code Use dgeni to generate json files from code. Scrape these json files for ingestion into the neo-one-website. re #702 --- packages/neo-one-website/package.json | 2 + .../neo-one-website/src/utils/dgeniSetup.ts | 98 +++++++ .../src/utils/getReferences.ts | 176 ++++++++++++ .../src/utils/processors/index.ts | 1 + .../src/utils/processors/textProcessor.ts | 48 ++++ .../src/utils/templates/template.txt | 56 ++++ .../src/utils/tokenizeDocText.ts | 48 ++++ yarn.lock | 250 +++++++++++++++++- 8 files changed, 667 insertions(+), 12 deletions(-) create mode 100644 packages/neo-one-website/src/utils/dgeniSetup.ts create mode 100644 packages/neo-one-website/src/utils/getReferences.ts create mode 100644 packages/neo-one-website/src/utils/processors/index.ts create mode 100644 packages/neo-one-website/src/utils/processors/textProcessor.ts create mode 100644 packages/neo-one-website/src/utils/templates/template.txt create mode 100644 packages/neo-one-website/src/utils/tokenizeDocText.ts diff --git a/packages/neo-one-website/package.json b/packages/neo-one-website/package.json index 59d226f59e..b6ec825e35 100644 --- a/packages/neo-one-website/package.json +++ b/packages/neo-one-website/package.json @@ -26,6 +26,8 @@ "@types/styled-components": "^4.1.0", "@types/webpack": "^4.4.18", "clipboard": "^2.0.3", + "dgeni": "^0.4.10", + "dgeni-packages": "^0.26.12", "fs-extra": "^7.0.1", "gray-matter": "^4.0.1", "html-to-react": "^1.3.3", diff --git a/packages/neo-one-website/src/utils/dgeniSetup.ts b/packages/neo-one-website/src/utils/dgeniSetup.ts new file mode 100644 index 0000000000..1faedc51b2 --- /dev/null +++ b/packages/neo-one-website/src/utils/dgeniSetup.ts @@ -0,0 +1,98 @@ +// tslint:disable only-arrow-functions no-object-mutation no-submodule-imports no-any no-invalid-template-strings +import { Package } from 'dgeni'; +// @ts-ignore +import nunjucks from 'dgeni-packages/nunjucks'; +import typescript from 'dgeni-packages/typescript'; +import * as path from 'path'; +import { textProcessor } from './processors'; + +const docFiles: ReadonlyArray = [ + 'neo-one-client-core/src/types.ts', + 'neo-one-client-core/src/Client.ts', + 'neo-one-client-core/src/DeveloperClient.ts', + 'neo-one-client-core/src/Hash256.ts', + 'neo-one-client-core/src/user/LocalUserAccountProvider.ts', + 'neo-one-client-core/src/user/LocalKeyStore.ts', + 'neo-one-client-core/src/user/LocalMemoryStore.ts', + 'neo-one-client-core/src/user/LocalStringStore.ts', + 'neo-one-client-core/src/provider/JSONRPCProvider.ts', + 'neo-one-client-core/src/provider/NEOONEDataProvider.ts', + 'neo-one-client-core/src/provider/NEOONEOneDataProvider.ts', + 'neo-one-client-core/src/provider/NEOONEProvider.ts', + 'neo-one-client-common/src/types.ts', + 'neo-one-client-common/src/helpers.ts', + 'neo-one-smart-contract/src/index.d.ts', +]; + +// Configuration of the typescript processor +(typescript as any) + // Configure additional jsdoc style tags to be recognized by the processor + .config(function(parseTagsProcessor: any) { + const tagDefs = parseTagsProcessor.tagDefinitions; + // Register '@example' tags with the processor. Multiple instances allowed. + tagDefs.push({ name: 'example', multi: true }); + // Register '@param' tags with the processor. Multiple instances allowed. + tagDefs.push({ name: 'param', multi: true }); + // Register '@internal' tags with the processor. + tagDefs.push({ name: 'internal' }); + }) + // Configure output paths for additional doc types + .config(function(computeIdsProcessor: any, computePathsProcessor: any) { + // Configure ID for "getters". Must be manually configured to avoid potential conflict with a property. + computeIdsProcessor.idTemplates.push({ + docTypes: ['get-accessor-info'], + // Template for constructing "getter" id. If we had same-named properties, we would need to use a different ID. + idTemplate: '${containerDoc.id}.${name}', + getAliases(doc: any) { + return doc.containerDoc.aliases.map((alias: string) => `${alias}.${doc.name}`); + }, + }); + + // Configure output path for "getters". Must be manually configured to avoid potential conflict. + computePathsProcessor.pathTemplates.push({ + docTypes: ['get-accessor-info'], + // Template for constructing "getter" path. If we had same-named properties, we would need to use a different path. + pathTemplate: '${containerDoc.path}#${name}', + getOutputPath() { + // These docs are not written to their own file, instead they are part of their class doc + }, + }); + + // Configure output path for overloaded functions. Each overload needs a unique output file to avoid conflict. + computePathsProcessor.pathTemplates.push({ + docTypes: ['function-overload'], + outputPathTemplate: 'partials/modules/${path}/index.html', + // Template to generate unique path for each overload of a function. + pathTemplate: '${moduleDoc.path}/${name}${parameterDocs.length}', + }); + }); + +// Create a dgeni Package which defines how the code and comments are parsed into docs. +export const dgeniSetup = new Package('neo-one-docs', [ + // The typescript processor from dgeni-packages is used to parse typescript files. + typescript, + // The nunjucks processor from dgeni-packages is used to output docs to a template. + nunjucks, +]) + // Register our custom processor for our specific use case. + .processor(textProcessor) + // Configure subprocessors from typescript and nunjucks + .config(function(readFilesProcessor: any, readTypeScriptModules: any, templateFinder: any, writeFilesProcessor: any) { + // Register basePath used for resolving paths to typescript files to parse. + readTypeScriptModules.basePath = path.resolve(__dirname, '../../..'); + // Register basePath used for resolving paths to javascript files to parse. Unused in our case, but needs to exist. + readFilesProcessor.basePath = ''; + + // Register typescript files to parse. Paths relative to basePath. + readTypeScriptModules.sourceFiles = docFiles; + // Register javascript files to parse. None needed. + readFilesProcessor.sourceFiles = []; + + // Directory where output template can be found. + templateFinder.templateFolders.unshift(path.resolve(__dirname, 'templates')); + // File name of the output template in the registered directory. + templateFinder.templatePatterns.unshift('template.txt'); + + // Directory to output generated files. + writeFilesProcessor.outputFolder = path.resolve(__dirname, '../../../neo-one-website/src/utils/build'); + }); diff --git a/packages/neo-one-website/src/utils/getReferences.ts b/packages/neo-one-website/src/utils/getReferences.ts new file mode 100644 index 0000000000..44a0efe063 --- /dev/null +++ b/packages/neo-one-website/src/utils/getReferences.ts @@ -0,0 +1,176 @@ +import { Dgeni } from 'dgeni'; +import * as fs from 'fs-extra'; +import _ from 'lodash'; +import * as path from 'path'; +import { dgeniSetup } from './dgeniSetup'; +import { ModuleLinks, ModuleLinksPaths, tokenizeDocText } from './tokenizeDocText'; + +interface Parameter { + readonly name: string; + readonly type: ReadonlyArray; + readonly description: ReadonlyArray; +} + +interface Property extends Parameter {} + +interface MethodBase { + readonly name: string; + readonly text: ReadonlyArray; + readonly parameters: ReadonlyArray; +} + +interface Method extends MethodBase { + readonly description: ReadonlyArray; + readonly returns?: ReadonlyArray; + readonly internal?: boolean; +} + +const BASE_PATH = path.resolve(__dirname, 'build', 'partials', 'modules'); + +const dgenerate = async () => { + const dgeni = new Dgeni([dgeniSetup]); + + await fs.emptyDir(path.resolve(__dirname, 'build')); + await dgeni.generate(); +}; + +const mapModule = (moduleName: string) => { + switch (moduleName) { + case 'neo-one-client-common': + return '@neo-one/client'; + case 'neo-one-client-core': + return '@neo-one/client'; + case 'neo-one-smart-contract': + return '@neo-one/smart-contract'; + default: + return ''; + } +}; + +const getLinksFromModule = async (currentPath: string, dirName: string): Promise => { + const modulePath = path.resolve(currentPath, dirName); + const dirsFiles = await fs.readdir(modulePath); + const dirs = dirsFiles.filter((name) => name !== 'index.json'); + + if (_.isEmpty(dirs)) { + return { + links: [dirName], + paths: [path.resolve(modulePath, 'index.json')], + }; + } + + const links = await Promise.all(dirs.map(async (dir) => getLinksFromModule(path.resolve(currentPath, dirName), dir))); + + return { + links: _.flatten(links.map((link) => link.links)), + paths: _.flatten(links.map((link) => link.paths)), + }; +}; + +const getLinks = async (): Promise<{ readonly [moduleName: string]: ModuleLinksPaths }> => { + const moduleNames = await fs.readdir(BASE_PATH); + + return moduleNames.reduce(async (acc, moduleName) => { + const moduleLinks = await getLinksFromModule(BASE_PATH, moduleName); + const accRes = await acc; + + if (Object.keys(accRes).includes(mapModule(moduleName))) { + const accModuleLinks = Object.entries(accRes).find(([name]) => name === mapModule(moduleName)); + + return { + ...accRes, + [mapModule(moduleName)]: { + links: + accModuleLinks === undefined + ? moduleLinks.links + : (accModuleLinks[1] as ModuleLinksPaths).links.concat(moduleLinks.links), + paths: + accModuleLinks === undefined + ? moduleLinks.paths + : (accModuleLinks[1] as ModuleLinksPaths).paths.concat(moduleLinks.paths), + }, + }; + } + + return { + ...accRes, + [mapModule(moduleName)]: moduleLinks, + }; + }, Promise.resolve({})); +}; + +const extractParametersProperties = (values: ReadonlyArray, links: ModuleLinks) => + values + .filter((param) => !_.isEmpty(param)) + .map((param) => ({ + name: param.name, + type: tokenizeDocText(param.type, links), + description: tokenizeDocText(param.description, links), + })); + +const extractConstructor = (constructorDoc: MethodBase, links: ModuleLinks) => ({ + name: constructorDoc.name, + text: tokenizeDocText(constructorDoc.text, links), + parameters: extractParametersProperties(constructorDoc.parameters, links), +}); + +const extractMethods = (methods: ReadonlyArray, links: ModuleLinks) => + methods + .filter((method) => !_.isEmpty(method)) + .filter((method) => !method.internal) + .map((method) => ({ + name: method.name, + text: tokenizeDocText(method.text, links), + parameters: extractParametersProperties(method.parameters, links), + description: tokenizeDocText(method.description, links), + returns: method.returns === undefined ? undefined : tokenizeDocText(method.returns, links), + })); + +const getReference = async (refPath: string, links: ModuleLinks) => { + const contents = await fs.readJSON(refPath); + + return { + name: contents.name, + docType: contents.docType, + text: tokenizeDocText(contents.text, links), + description: tokenizeDocText(contents.description, links), + parameters: contents.parameters === undefined ? undefined : extractParametersProperties(contents.parameters, links), + constructorDoc: + contents.constructorDoc === undefined ? undefined : extractConstructor(contents.constructorDoc, links), + properties: contents.properties === undefined ? undefined : extractParametersProperties(contents.properties, links), + methods: contents.methods === undefined ? undefined : extractMethods(contents.methods, links), + returns: contents.returns === undefined ? undefined : tokenizeDocText(contents.returns, links), + examples: + contents.examples === undefined + ? undefined + : contents.examples.map((example: ReadonlyArray) => tokenizeDocText(example, links)), + }; +}; + +const getSidebar = (links: ModuleLinks) => ({ + title: 'Packages', + subsections: Object.keys(links).map((subsection) => ({ + slug: subsection, + title: subsection, + })), +}); + +export const getReferences = async () => { + await dgenerate(); + const links = await getLinks(); + + return Object.entries(links).map(async ([moduleName, moduleLinksPaths]) => { + const refItems = await Promise.all(moduleLinksPaths.paths.map(async (refPath) => getReference(refPath, links))); + + return { + title: moduleName, + type: 'All', + content: { + type: 'referenceItems', + value: refItems, + }, + current: '@neo-one/client', + sidebar: getSidebar(links), + }; + }); +}; diff --git a/packages/neo-one-website/src/utils/processors/index.ts b/packages/neo-one-website/src/utils/processors/index.ts new file mode 100644 index 0000000000..3465950ff5 --- /dev/null +++ b/packages/neo-one-website/src/utils/processors/index.ts @@ -0,0 +1 @@ +export * from './textProcessor'; diff --git a/packages/neo-one-website/src/utils/processors/textProcessor.ts b/packages/neo-one-website/src/utils/processors/textProcessor.ts new file mode 100644 index 0000000000..2dfb4787c4 --- /dev/null +++ b/packages/neo-one-website/src/utils/processors/textProcessor.ts @@ -0,0 +1,48 @@ +// tslint:disable only-arrow-functions no-object-mutation no-any + +const extractTextWithoutComments = (declaration: ts.Declaration) => + declaration + .getText(declaration.getSourceFile()) + .split('\n') + .filter((line: string) => { + const trimmedLine = line.trim(); + + return trimmedLine !== '/**' && trimmedLine.charAt(0) !== '*' && trimmedLine.charAt(0) !== '/'; + }) + .join('\n'); + +const extractBasicText = (text: string) => text.substr(0, text.indexOf(' {')); + +const separateLines = (text: string) => text.split('\n').filter((line: string) => line !== ''); + +export function textProcessor() { + return { + $runAfter: ['paths-computed'], + $runBefore: ['rendering-docs'], + $process(docs: ReadonlyArray) { + docs.forEach((doc: any) => { + const text = extractTextWithoutComments(doc.declaration); + + doc.text = + doc.docType === 'class' || doc.parameterDocs !== undefined + ? extractBasicText(text).split('\n') + : text.split('\n'); + + doc.description = separateLines(doc.description); + if (doc.returns) { + doc.returns.description = separateLines(doc.returns.description); + } + if (doc.type) { + doc.type = separateLines(doc.type); + } + if (doc.example) { + doc.example = doc.example.map(separateLines); + } + + if (doc.outputPath) { + doc.outputPath = doc.outputPath.replace('.html', '.json'); + } + }); + }, + }; +} diff --git a/packages/neo-one-website/src/utils/templates/template.txt b/packages/neo-one-website/src/utils/templates/template.txt new file mode 100644 index 0000000000..bfedeb5d5a --- /dev/null +++ b/packages/neo-one-website/src/utils/templates/template.txt @@ -0,0 +1,56 @@ +{ + "description": [{% for line in doc.description %} "{{line}}", {% endfor %} ""], {% if doc.constructorDoc %} + "constructorDoc": { + "name": "{{doc.constructorDoc.name}}", + "text": [{% for line in doc.constructorDoc.text %} "{{line}}", {% endfor %} ""], + "parameters": [{% for param in doc.constructorDoc.parameterDocs %} + { + "name": "{{ param.name }}", + "type": [{% for line in param.type %} "{{line}}", {% endfor %} ""], + "description": [{% for line in param.content %} "{{line}}", {% endfor %} ""] + }, {% endfor %} + {} + ] + }, {% endif %} + "text": [{% for line in doc.text %} "{{line}}", {% endfor %} ""], {% if doc.parameterDocs %} + "parameters": [ {% for param in doc.parameterDocs %} + { + "name": "{{ param.name }}", + "type": [{% for line in param.type %} "{{line}}", {% endfor %} ""], + "description": [{% for line in param.description %} "{{line}}", {% endfor %} ""] + }, {% endfor %} + {} + ], {% endif %} {% if doc.docType in ['interface', 'class', 'enum'] %} + "properties": [{% for member in doc.members %} {% if member.parameterDocs === undefined %} + { + "name": "{{member.name}}", + "type": [{% for line in member.type %} "{{line}}", {% endfor %} ""], + "description": [{% for line in member.description %} "{{line}}", {% endfor %} ""] + }, {% endif %} {% endfor %} + {} + ], {% endif %} {% if doc.docType in ['interface', 'class'] %} + "methods": [{% for member in doc.members %} {% if member.parameterDocs %} + { + "text": [{% for line in member.text %} "{{line}}", {% endfor %} ""], + "description": [{% for line in member.description %} "{{line}}", {% endfor %} ""], {% if member.returns %} + "returns": [{% for line in member.returns.description %} "{{line}}", {% endfor %} ""], {% endif %} + "parameters": [{% for param in member.parameterDocs %} + { + "name": "{{ param.name }}", + "type": [{% for line in param.type %} "{{line}}", {% endfor %} ""], + "description": [{% for line in param.content %} "{{line}}", {% endfor %} ""] + }, {% endfor %} + {} + ], {% if member.internal !== undefined %} + "internal": true, {% endif %} + "name": "{{member.name}}", + "type": [{% for line in member.type %} "{{line}}", {% endfor %} ""] + },{% endif %} {% endfor %} + {} + ], + {% endif %} {% if doc.returns %} + "returns": [{% for line in doc.returns.description %} "{{line}}", {% endfor %} ""], {% endif %} {% if doc.example %} + "examples": [{% for example in doc.example %} [{% for line in example %} "{{line}}", {% endfor %} ""], {% endfor %} []], {% endif %} + "name": "{{ doc.name }}", + "docType": "{{ doc.docType }}" +} diff --git a/packages/neo-one-website/src/utils/tokenizeDocText.ts b/packages/neo-one-website/src/utils/tokenizeDocText.ts new file mode 100644 index 0000000000..489734a69b --- /dev/null +++ b/packages/neo-one-website/src/utils/tokenizeDocText.ts @@ -0,0 +1,48 @@ +const PUNCTUATION: ReadonlyArray<[RegExp, string]> = [ + [/\./g, '.'], + [/,/g, ','], + [/\(/g, '('], + [/\)/g, ')'], + [/\[/g, '['], + [/]/g, ']'], + [/{/g, '{'], + [/}/g, '}'], + [//g, '>'], +]; + +export interface ModuleLinksPaths { + readonly links: ReadonlyArray; + readonly paths: ReadonlyArray; +} + +export interface ModuleLinks { + readonly [moduleName: string]: ModuleLinksPaths; +} + +const findLink = (word: string, links: ModuleLinks): string | undefined => { + const foundLink = Object.entries(links).find((moduleLinks) => moduleLinks[1].links.includes(word)); + + return foundLink === undefined ? undefined : foundLink[0]; +}; + +const removeQuotes = (word: string) => (word.charAt(0) === '`' ? word.replace('`', '').replace('`', '') : word); + +const tokenizeText = (text: string, links: ModuleLinks) => { + const puncText = PUNCTUATION.reduce( + (acc, [markRegExp, markString]) => acc.replace(markRegExp, ` ${markString} `), + text, + ); + + return puncText.split(' ').map((word) => { + const rawWord = removeQuotes(word); + const foundModule = findLink(rawWord, links); + + return foundModule === undefined + ? { value: rawWord } + : { slug: `reference/${foundModule}/${rawWord.toLowerCase()}`, value: rawWord }; + }); +}; + +export const tokenizeDocText = (textArray: ReadonlyArray, links: ModuleLinks) => + textArray.map((line) => tokenizeText(line, links)); diff --git a/yarn.lock b/yarn.lock index f69e1a62d0..082832d81c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2980,6 +2980,11 @@ JSONStream@^1.0.4, JSONStream@^1.3.4: jsonparse "^1.2.0" through ">=2.2.7 <3" +a-sync-waterfall@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/a-sync-waterfall/-/a-sync-waterfall-1.0.1.tgz#75b6b6aa72598b497a125e7a2770f14f4c8a1fa7" + integrity sha512-RYTOHHdWipFUliRFMCS4X2Yn2X8M87V/OpSqWzKKOGhzqyUxzyVmhHDH9sAvG+ZuQf/TAOFsLCpMw09I1ufUnA== + abab@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.0.tgz#aba0ab4c5eee2d4c79d3487d85450fb2376ebb0f" @@ -3474,7 +3479,7 @@ arrify@^1.0.0, arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" -asap@^2.0.0, asap@~2.0.3, asap@~2.0.6: +asap@^2.0.0, asap@^2.0.3, asap@~2.0.3, asap@~2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" @@ -3577,6 +3582,11 @@ async@^2.0.0-rc.1, async@^2.0.1, async@^2.1.4, async@^2.3.0, async@^2.5.0, async dependencies: lodash "^4.17.10" +async@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/async/-/async-1.0.0.tgz#f8fc04ca3a13784ade9e1641af98578cfbd647a9" + integrity sha1-+PwEyjoTeErenhZBr5hXjPvWR6k= + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -4773,6 +4783,11 @@ caniuse-lite@^1.0.30000912: version "1.0.30000913" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000913.tgz#560311ecf242eaf12159b720e64b11ebd759b5e4" +canonical-path@0.0.2, canonical-path@~0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/canonical-path/-/canonical-path-0.0.2.tgz#e31eb937a8c93ee2a01df1839794721902874574" + integrity sha1-4x65N6jJPuKgHfGDl5RyGQKHRXQ= + capture-exit@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-1.2.0.tgz#1c5fcc489fd0ab00d4f1ac7ae1072e3173fbab6f" @@ -4791,6 +4806,13 @@ caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" +catharsis@^0.8.1: + version "0.8.9" + resolved "https://registry.yarnpkg.com/catharsis/-/catharsis-0.8.9.tgz#98cc890ca652dd2ef0e70b37925310ff9e90fc8b" + integrity sha1-mMyJDKZS3S7w5ws3klMQ/56Q/Is= + dependencies: + underscore-contrib "~0.3.0" + caw@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/caw/-/caw-2.0.1.tgz#6c3ca071fc194720883c2dc5da9b074bfc7e9e95" @@ -4830,6 +4852,30 @@ chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" +change-case@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/change-case/-/change-case-3.0.0.tgz#6c9c8e35f8790870a82b6b0745be8c3cbef9b081" + integrity sha1-bJyONfh5CHCoK2sHRb6MPL75sIE= + dependencies: + camel-case "^3.0.0" + constant-case "^2.0.0" + dot-case "^2.1.0" + header-case "^1.0.0" + is-lower-case "^1.1.0" + is-upper-case "^1.1.0" + lower-case "^1.1.1" + lower-case-first "^1.0.0" + no-case "^2.2.0" + param-case "^2.1.0" + pascal-case "^2.0.0" + path-case "^2.1.0" + sentence-case "^2.1.0" + snake-case "^2.1.0" + swap-case "^1.1.0" + title-case "^2.1.0" + upper-case "^1.1.1" + upper-case-first "^1.1.0" + change-case@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/change-case/-/change-case-3.0.2.tgz#fd48746cce02f03f0a672577d1d3a8dc2eceb037" @@ -5187,6 +5233,11 @@ colornames@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/colornames/-/colornames-1.1.1.tgz#f8889030685c7c4ff9e2a559f5077eb76a816f96" +colors@1.0.x: + version "1.0.3" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" + integrity sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs= + colors@^1.1.2, colors@^1.2.1: version "1.3.2" resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.2.tgz#2df8ff573dfbf255af562f8ce7181d6b971a359b" @@ -5957,6 +6008,11 @@ currently-unhandled@^0.4.1: dependencies: array-find-index "^1.0.1" +cycle@1.0.x: + version "1.0.3" + resolved "https://registry.yarnpkg.com/cycle/-/cycle-1.0.3.tgz#21e80b2be8580f98b468f379430662b046c34ad2" + integrity sha1-IegLK+hYD5i0aPN5QwZisEbDStI= + cyclist@~0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640" @@ -6322,6 +6378,11 @@ depd@1.1.2, depd@^1.1.2, depd@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" +dependency-graph@^0.7.0: + version "0.7.2" + resolved "https://registry.yarnpkg.com/dependency-graph/-/dependency-graph-0.7.2.tgz#91db9de6eb72699209d88aea4c1fd5221cac1c49" + integrity sha512-KqtH4/EZdtdfWX0p6MGP9jljvxSY6msy/pRUD4jgNwVpv3v1QmNLlsB3LDSSUg79BRVSn7jI1QPRtArGABovAQ== + deprecated-decorator@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/deprecated-decorator/-/deprecated-decorator-0.1.6.tgz#00966317b7a12fe92f3cc831f7583af329b86c37" @@ -6391,6 +6452,54 @@ dezalgo@^1.0.0: asap "^2.0.0" wrappy "1" +dgeni-packages@^0.26.12: + version "0.26.12" + resolved "https://registry.yarnpkg.com/dgeni-packages/-/dgeni-packages-0.26.12.tgz#6b8329b59a17213d30137b53a689d579cd6a9fb1" + integrity sha512-dYuRYnw+sURD82F6JJ+2erOKOlaReBymR9g2bjpws3GSIpBbX1p1kE9VYwmAaBoZRE2h+woK8RyDktZvkzETfg== + dependencies: + canonical-path "0.0.2" + catharsis "^0.8.1" + change-case "3.0.0" + dgeni "^0.4.9" + espree "^2.2.3" + estraverse "^4.1.0" + glob "^7.0.5" + htmlparser2 "^3.7.3" + lodash "^4.13.1" + marked "^0.3.2" + minimatch "^3.0.2" + mkdirp "^0.5.1" + mkdirp-promise "^5.0.0" + node-html-encoder "0.0.2" + nunjucks "^3.0.1" + semver "^5.2.0" + shelljs "^0.7.0" + source-map-support "^0.4.15" + spdx-license-list "^2.1.0" + stringmap "^0.2.2" + typescript "~2.7.1" + urlencode "^1.1.0" + +dgeni@^0.4.10, dgeni@^0.4.9: + version "0.4.10" + resolved "https://registry.yarnpkg.com/dgeni/-/dgeni-0.4.10.tgz#5f68ed1033192e672494de0d4e39954fd5cfe8f8" + integrity sha512-In8huU+6W+Rd7MdfzhQoRbntF4AsJgtbwRUTyfPgvhaC3RGJX/YOEkMnn7vLLk3zaCrEkIQGW6eADoudpnBceg== + dependencies: + canonical-path "~0.0.2" + dependency-graph "^0.7.0" + di "0.0.1" + lodash "^4.17.10" + objectdiff "^1.1.0" + optimist "~0.6.1" + q "^1.5.1" + validate.js "^0.12.0" + winston "^2.1.1" + +di@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c" + integrity sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw= + diacritic@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/diacritic/-/diacritic-0.0.2.tgz#fc2a887b5a5bc0a0a854fb614c7c2f209061ee04" @@ -7037,6 +7146,11 @@ eslint@^4.19.1: table "4.0.2" text-table "~0.2.0" +espree@^2.2.3: + version "2.2.5" + resolved "https://registry.yarnpkg.com/espree/-/espree-2.2.5.tgz#df691b9310889402aeb29cc066708c56690b854b" + integrity sha1-32kbkxCIlAKuspzAZnCMVmkLhUs= + espree@^3.5.4: version "3.5.4" resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7" @@ -7374,6 +7488,11 @@ extsprintf@^1.2.0: version "1.4.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" +eyes@0.1.x: + version "0.1.8" + resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" + integrity sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A= + fancy-log@^1.1.0, fancy-log@^1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.2.tgz#f41125e3d84f2e7d89a43d06d958c8f78be16be1" @@ -8833,7 +8952,7 @@ html-webpack-plugin@^3.2.0: toposort "^1.0.0" util.promisify "1.0.0" -htmlparser2@^3.8.3, htmlparser2@^3.9.2: +htmlparser2@^3.7.3, htmlparser2@^3.8.3, htmlparser2@^3.9.2: version "3.10.0" resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.0.tgz#5f5e422dcf6119c0d983ed36260ce9ded0bee464" dependencies: @@ -8965,7 +9084,7 @@ iconv-lite@0.4.23: dependencies: safer-buffer ">= 2.1.2 < 3" -iconv-lite@0.4.24, iconv-lite@^0.4.17, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: +iconv-lite@0.4.24, iconv-lite@^0.4.17, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.11, iconv-lite@~0.4.13: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" dependencies: @@ -9778,7 +9897,7 @@ isomorphic-fetch@^2.1.1: node-fetch "^1.0.1" whatwg-fetch ">=0.10.0" -isstream@~0.1.2: +isstream@0.1.x, isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" @@ -11670,6 +11789,11 @@ markdown-table@^1.1.0: version "1.1.2" resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-1.1.2.tgz#c78db948fa879903a41bce522e3b96f801c63786" +marked@^0.3.2: + version "0.3.19" + resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.19.tgz#5d47f709c4c9fc3c216b6d46127280f40b39d790" + integrity sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg== + match-sorter@^2.2.3: version "2.3.0" resolved "https://registry.yarnpkg.com/match-sorter/-/match-sorter-2.3.0.tgz#99eaf386689f75bf976f6bbf7f49afb9a7ffecc8" @@ -12058,18 +12182,26 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" -mkdirp@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.0.tgz#1d73076a6df986cd9344e15e71fcc05a4c9abf12" +mkdirp-promise@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz#e9b8f68e552c68a9c1713b84883f7a1dd039b8a1" + integrity sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE= dependencies: - minimist "0.0.8" + mkdirp "*" -mkdirp@0.5.1, mkdirp@0.5.x, mkdirp@0.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: +mkdirp@*, mkdirp@0.5.1, mkdirp@0.5.x, mkdirp@0.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: minimist "0.0.8" +mkdirp@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.0.tgz#1d73076a6df986cd9344e15e71fcc05a4c9abf12" + integrity sha1-HXMHam35hs2TROFecfzAWkyavxI= + dependencies: + minimist "0.0.8" + mocha-junit-reporter@1.18.0: version "1.18.0" resolved "https://registry.yarnpkg.com/mocha-junit-reporter/-/mocha-junit-reporter-1.18.0.tgz#9209a3fba30025ae3ae5e6bfe7f9c5bc3c2e8ee2" @@ -12358,6 +12490,11 @@ node-hid@^0.7.2: nan "^2.10.0" prebuild-install "^4.0.0" +node-html-encoder@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/node-html-encoder/-/node-html-encoder-0.0.2.tgz#8973618d727da5526a830b47d07c0d803e0a15c6" + integrity sha1-iXNhjXJ9pVJqgwtH0HwNgD4KFcY= + node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" @@ -12667,6 +12804,18 @@ number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" +nunjucks@^3.0.1: + version "3.1.4" + resolved "https://registry.yarnpkg.com/nunjucks/-/nunjucks-3.1.4.tgz#d15d7b6c4215d2525f991b948335e16502fa1bfa" + integrity sha512-OIbdsl7jAZpw5V6GIa6wJc2AKCC/JSwuVdNKuVpFZ+eB3kYugoGF6OVN/jKNFe52782Uj89n0pT0DiSS1KPbxA== + dependencies: + a-sync-waterfall "^1.0.0" + asap "^2.0.3" + postinstall-build "^5.0.1" + yargs "^3.32.0" + optionalDependencies: + chokidar "^2.0.0" + nwsapi@^2.0.7: version "2.0.9" resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.0.9.tgz#77ac0cdfdcad52b6a1151a84e73254edc33ed016" @@ -12800,6 +12949,11 @@ object.values@^1.0.4: function-bind "^1.1.0" has "^1.0.1" +objectdiff@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/objectdiff/-/objectdiff-1.1.0.tgz#8d7a15be6cb8670df8a490cc6be12a4f05ea82f4" + integrity sha1-jXoVvmy4Zw34pJDMa+EqTwXqgvQ= + objection@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/objection/-/objection-1.4.0.tgz#18ddcdc121ae9b5d1e8e88b10fd0a6c96134f422" @@ -12880,7 +13034,7 @@ optimism@^0.6.6: dependencies: immutable-tuple "^0.4.9" -optimist@^0.6.1: +optimist@^0.6.1, optimist@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" dependencies: @@ -13884,6 +14038,11 @@ postgres-interval@^1.1.0: dependencies: xtend "^4.0.0" +postinstall-build@^5.0.1: + version "5.0.3" + resolved "https://registry.yarnpkg.com/postinstall-build/-/postinstall-build-5.0.3.tgz#238692f712a481d8f5bc8960e94786036241efc7" + integrity sha512-vPvPe8TKgp4FLgY3+DfxCE5PIfoXBK2lyLfNCxsRbDsV6vS4oU5RG/IWxrblMn6heagbnMED3MemUQllQ2bQUg== + pouchdb-binary-utils@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pouchdb-binary-utils/-/pouchdb-binary-utils-7.0.0.tgz#cb71a288b09572a231f6bab1b4aed201c4d219a7" @@ -15663,7 +15822,7 @@ semver-greatest-satisfied-range@^1.1.0: dependencies: sver-compat "^1.5.0" -"semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", semver@^5.0.1, semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0: +"semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", semver@^5.0.1, semver@^5.0.3, semver@^5.1.0, semver@^5.2.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0: version "5.6.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" @@ -15826,6 +15985,15 @@ shelljs@0.7.6: interpret "^1.0.0" rechoir "^0.6.2" +shelljs@^0.7.0: + version "0.7.8" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3" + integrity sha1-3svPh0sNHl+3LhSxZKloMEjprLM= + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + shelljs@~0.5.3: version "0.5.3" resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.5.3.tgz#c54982b996c76ef0c1e6b59fbdc5825f5b713113" @@ -16060,6 +16228,13 @@ source-map-resolve@^0.5.0, source-map-resolve@^0.5.2: source-map-url "^0.4.0" urix "^0.1.0" +source-map-support@^0.4.15: + version "0.4.18" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + integrity sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA== + dependencies: + source-map "^0.5.6" + source-map-support@^0.5.6, source-map-support@^0.5.9, source-map-support@~0.5.6: version "0.5.9" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" @@ -16124,6 +16299,11 @@ spdx-license-ids@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.2.tgz#a59efc09784c2a5bada13cfeaf5c75dd214044d2" +spdx-license-list@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/spdx-license-list/-/spdx-license-list-2.1.0.tgz#3788ffb5c80b24afbe8283934e9e6684ea6a218d" + integrity sha1-N4j/tcgLJK++goOTTp5mhOpqIY0= + spdy-transport@^2.0.18: version "2.1.1" resolved "https://registry.yarnpkg.com/spdy-transport/-/spdy-transport-2.1.1.tgz#c54815d73858aadd06ce63001e7d25fa6441623b" @@ -16393,6 +16573,11 @@ stringify-object@^3.2.2: is-obj "^1.0.1" is-regexp "^1.0.0" +stringmap@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/stringmap/-/stringmap-0.2.2.tgz#556c137b258f942b8776f5b2ef582aa069d7d1b1" + integrity sha1-VWwTeyWPlCuHdvWy71gqoGnX0bE= + strip-ansi@4.0.0, strip-ansi@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" @@ -17337,6 +17522,11 @@ typescript@3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.2.1.tgz#0b7a04b8cf3868188de914d9568bd030f0c56192" +typescript@~2.7.1: + version "2.7.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.2.tgz#2d615a1ef4aee4f574425cdff7026edf81919836" + integrity sha512-p5TCYZDAO0m4G344hD+wx/LATebLWZNkkh2asWUFqSsD2OrDNhbAHuSjobrmsUmdzjJjEeZVU9g1h3O6vpstnw== + typewise-core@^1.2, typewise-core@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/typewise-core/-/typewise-core-1.2.0.tgz#97eb91805c7f55d2f941748fa50d315d991ef195" @@ -17412,6 +17602,13 @@ undefsafe@^2.0.2: dependencies: debug "^2.2.0" +underscore-contrib@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/underscore-contrib/-/underscore-contrib-0.3.0.tgz#665b66c24783f8fa2b18c9f8cbb0e2c7d48c26c7" + integrity sha1-ZltmwkeD+PorGMn4y7Dix9SMJsc= + dependencies: + underscore "1.6.0" + underscore.string.fp@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/underscore.string.fp/-/underscore.string.fp-1.0.4.tgz#054b3f1843bcae561286c87de5e8879b4fc98364" @@ -17429,6 +17626,11 @@ underscore.template@~0.1.2: version "0.1.7" resolved "https://registry.yarnpkg.com/underscore.template/-/underscore.template-0.1.7.tgz#3013e0ea181756306f1609e959cafbc722adb3e9" +underscore@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.6.0.tgz#8b38b10cacdef63337b8b24e4ff86d45aea529a8" + integrity sha1-izixDKze9jM3uLJOT/htRa6lKag= + undertaker-registry@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/undertaker-registry/-/undertaker-registry-1.0.1.tgz#5e4bda308e4a8a2ae584f9b9a4359a499825cc50" @@ -17667,6 +17869,13 @@ url@0.11.0, url@^0.11.0: punycode "1.3.2" querystring "0.2.0" +urlencode@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/urlencode/-/urlencode-1.1.0.tgz#1f2ba26f013c85f0133f7a3ad6ff2730adf7cbb7" + integrity sha1-HyuibwE8hfATP3o61v8nMK33y7c= + dependencies: + iconv-lite "~0.4.11" + urlgrey@^0.4.4: version "0.4.4" resolved "https://registry.yarnpkg.com/urlgrey/-/urlgrey-0.4.4.tgz#892fe95960805e85519f1cd4389f2cb4cbb7652f" @@ -17744,6 +17953,11 @@ validate-npm-package-name@^3.0.0: dependencies: builtins "^1.0.3" +validate.js@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/validate.js/-/validate.js-0.12.0.tgz#17f989e37c192ea2f826bbf19bf4e97e6e4be68f" + integrity sha512-/x2RJSvbqEyxKj0RPN4xaRquK+EggjeVXiDDEyrJzsJogjtiZ9ov7lj/svVb4DM5Q5braQF4cooAryQbUwOxlA== + validator@10.4.0: version "10.4.0" resolved "https://registry.yarnpkg.com/validator/-/validator-10.4.0.tgz#ee99a44afb3bb5ed350a159f056ca72a204cfc3c" @@ -18226,6 +18440,18 @@ winston-transport@^4.2.0: readable-stream "^2.3.6" triple-beam "^1.2.0" +winston@^2.1.1: + version "2.4.4" + resolved "https://registry.yarnpkg.com/winston/-/winston-2.4.4.tgz#a01e4d1d0a103cf4eada6fc1f886b3110d71c34b" + integrity sha512-NBo2Pepn4hK4V01UfcWcDlmiVTs7VTB1h7bgnB0rgP146bYhMxX0ypCz3lBOfNxCO4Zuek7yeT+y/zM1OfMw4Q== + dependencies: + async "~1.0.0" + colors "1.0.x" + cycle "1.0.x" + eyes "0.1.x" + isstream "0.1.x" + stack-trace "0.0.x" + winston@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/winston/-/winston-3.1.0.tgz#80724376aef164e024f316100d5b178d78ac5331" @@ -18626,7 +18852,7 @@ yargs@^10.0.3: y18n "^3.2.1" yargs-parser "^8.1.0" -yargs@^3.10.0: +yargs@^3.10.0, yargs@^3.32.0: version "3.32.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" dependencies: