From 01511287cc9d9601e026235e0e05462df795dad7 Mon Sep 17 00:00:00 2001 From: jkhsjdhjs Date: Sun, 21 Oct 2018 18:17:28 +0200 Subject: [PATCH 01/77] launch puppeteer without sandbox if sandboxed launch fails add missing break to platform switch case --- src/MarkdownConverter/ConvertCommand.ts | 3 ++- src/MarkdownConverter/Converter.ts | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/MarkdownConverter/ConvertCommand.ts b/src/MarkdownConverter/ConvertCommand.ts index 95941451..1ace88e7 100644 --- a/src/MarkdownConverter/ConvertCommand.ts +++ b/src/MarkdownConverter/ConvertCommand.ts @@ -378,6 +378,7 @@ export class ConvertCommand extends Command break; case "linux": ChildProcess.exec(`bash -c 'xdg-open "${destination}"'`); + break; default: window.showWarningMessage(ResourceManager.Resources.Get("UnsupportedPlatformException")); break; @@ -462,4 +463,4 @@ export class ConvertCommand extends Command window.showErrorMessage(message); } } -} \ No newline at end of file +} diff --git a/src/MarkdownConverter/Converter.ts b/src/MarkdownConverter/Converter.ts index 65e79cef..168f663a 100644 --- a/src/MarkdownConverter/Converter.ts +++ b/src/MarkdownConverter/Converter.ts @@ -81,7 +81,8 @@ export class Converter try { - let browser = await Puppeteer.launch({ args: ["--disable-web-security"] }); + const launchPuppeteer = sandbox => Puppeteer.launch({ args: ["--disable-web-security", ...(sandbox ? [] : ["--no-sandbox"])] }); + let browser = await launchPuppeteer(true).catch(_ => launchPuppeteer(false)); let page = await browser.newPage(); let url = URL.resolve( "http://localhost:8980/", @@ -170,4 +171,4 @@ export class Converter await FS.writeFile(path, htmlCode); } } -} \ No newline at end of file +} From 1526fb4145402480e702c1de168c512557163bad Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 22 Oct 2018 14:04:56 +0200 Subject: [PATCH 02/77] Remove nlc's at the end of files --- src/MarkdownConverter/ConvertCommand.ts | 2 +- src/MarkdownConverter/Converter.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MarkdownConverter/ConvertCommand.ts b/src/MarkdownConverter/ConvertCommand.ts index 1ace88e7..8371d641 100644 --- a/src/MarkdownConverter/ConvertCommand.ts +++ b/src/MarkdownConverter/ConvertCommand.ts @@ -463,4 +463,4 @@ export class ConvertCommand extends Command window.showErrorMessage(message); } } -} +} \ No newline at end of file diff --git a/src/MarkdownConverter/Converter.ts b/src/MarkdownConverter/Converter.ts index 168f663a..9274a3d4 100644 --- a/src/MarkdownConverter/Converter.ts +++ b/src/MarkdownConverter/Converter.ts @@ -171,4 +171,4 @@ export class Converter await FS.writeFile(path, htmlCode); } } -} +} \ No newline at end of file From e1d396bd4e90376f9e03599df6400f55f5cdff50 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 22 Oct 2018 14:25:24 +0200 Subject: [PATCH 03/77] Try starting puppeteer without sandboxes as fall-back --- src/MarkdownConverter/Converter.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/MarkdownConverter/Converter.ts b/src/MarkdownConverter/Converter.ts index 9274a3d4..da8d4845 100644 --- a/src/MarkdownConverter/Converter.ts +++ b/src/MarkdownConverter/Converter.ts @@ -81,13 +81,23 @@ export class Converter try { - const launchPuppeteer = sandbox => Puppeteer.launch({ args: ["--disable-web-security", ...(sandbox ? [] : ["--no-sandbox"])] }); - let browser = await launchPuppeteer(true).catch(_ => launchPuppeteer(false)); + let browser: Puppeteer.Browser; + let browserArguments = ["--disable-web-security"]; + + try + { + browser = await Puppeteer.launch({ args: browserArguments }); + } + catch + { + browser = await Puppeteer.launch({ args: browserArguments.concat(["--no-sandbox"]) }); + } + let page = await browser.newPage(); let url = URL.resolve( "http://localhost:8980/", ((!isNullOrUndefined(this.Document.FileName) && (!isNullOrUndefined(this.DocumentRoot))) ? - Path.relative(this.DocumentRoot, this.Document.FileName) : "index") + ".html"); + Path.relative(this.DocumentRoot, this.Document.FileName) : "index") + ".html"); page.setRequestInterception(true); page.on( From 5c3e47cf8e8258cfcb3ac6cbce3ec280d5154081 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 22 Oct 2018 14:25:50 +0200 Subject: [PATCH 04/77] Improve the "unknown exception"-handling --- src/MarkdownConverter/Converter.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/MarkdownConverter/Converter.ts b/src/MarkdownConverter/Converter.ts index da8d4845..07aa3960 100644 --- a/src/MarkdownConverter/Converter.ts +++ b/src/MarkdownConverter/Converter.ts @@ -170,6 +170,10 @@ export class Converter { throw new FileException(null, exception["path"]); } + else + { + throw exception; + } } finally { From d2418bb9b5ecb9d00c8a962bf3a4348ee3a982fa Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 29 Oct 2018 12:39:41 +0100 Subject: [PATCH 05/77] Add a class for representing puppeteer-commands --- src/MarkdownConverter/ConvertCommand.ts | 297 ++++++++-------------- src/MarkdownConverter/PuppeteerCommand.ts | 118 +++++++++ src/extension.ts | 9 + 3 files changed, 236 insertions(+), 188 deletions(-) create mode 100644 src/MarkdownConverter/PuppeteerCommand.ts diff --git a/src/MarkdownConverter/ConvertCommand.ts b/src/MarkdownConverter/ConvertCommand.ts index 8371d641..614d9480 100644 --- a/src/MarkdownConverter/ConvertCommand.ts +++ b/src/MarkdownConverter/ConvertCommand.ts @@ -9,12 +9,11 @@ import * as Checkbox from "markdown-it-checkbox"; import * as MarkdownItEmoji from "markdown-it-emoji"; import * as MarkdownItToc from "markdown-it-table-of-contents"; import * as Path from "path"; -import * as Puppeteer from "puppeteer"; import * as Format from "string-template"; import * as Transliteration from "transliteration"; import * as TwEmoji from "twemoji"; import { isNullOrUndefined } from "util"; -import { ProgressLocation, TextDocument, window, workspace, WorkspaceFolder } from "vscode"; +import { TextDocument, window, workspace, WorkspaceFolder } from "vscode"; import { Extension } from "../extension"; import { ResourceManager } from "../Properties/ResourceManager"; import { Settings } from "../Properties/Settings"; @@ -22,20 +21,19 @@ import { Document } from "../System/Drawing/Document"; import { EmojiType } from "../System/Drawing/EmojiType"; import { ListType } from "../System/Drawing/ListType"; import { Slugifier } from "../System/Drawing/Slugifier"; -import { Exception } from "../System/Exception"; import { FileException } from "../System/IO/FileException"; import { StringUtils } from "../System/Text/StringUtils"; -import { Command } from "./Command"; import { ConversionType } from "./ConversionType"; import { Converter } from "./Converter"; import { DestinationOrigin } from "./DestinationOrigin"; import { getMarkdownExtensionContributions } from "./MarkdownExtensions"; import { MarkdownFileNotFoundException } from "./MarkdownFileNotFoundException"; +import { PuppeteerCommand } from "./PuppeteerCommand"; /** * Provides a command for converting a markdown-document. */ -export class ConvertCommand extends Command +export class ConvertCommand extends PuppeteerCommand { /** * Initializes a new instance of the `ConvertCommand` class. @@ -257,210 +255,133 @@ export class ConvertCommand extends Command throw new MarkdownFileNotFoundException(); } - public async Execute() + public async ExecuteCommand() { - try + let destinationPath: string; + let textDocument = this.GetMarkdownDocument(); + let documentFolder = textDocument.isUntitled ? null : Path.dirname(textDocument.fileName); + let currentWorkspace: WorkspaceFolder; + + if (textDocument.isUntitled) { - if (await FileSystem.pathExists(Puppeteer.executablePath())) + if ((workspace.workspaceFolders || []).length === 1) { - let destinationPath: string; - let textDocument = this.GetMarkdownDocument(); - let documentFolder = textDocument.isUntitled ? null : Path.dirname(textDocument.fileName); - let currentWorkspace: WorkspaceFolder; - - if (textDocument.isUntitled) - { - if ((workspace.workspaceFolders || []).length === 1) - { - currentWorkspace = workspace.workspaceFolders[0]; - } - else - { - currentWorkspace = null; - } - } - else + currentWorkspace = workspace.workspaceFolders[0]; + } + else + { + currentWorkspace = null; + } + } + else + { + currentWorkspace = (workspace.workspaceFolders || []).find( + (workspaceFolder) => { - currentWorkspace = (workspace.workspaceFolders || []).find( - (workspaceFolder) => - { - let workspaceParts = workspaceFolder.uri.fsPath.split(Path.sep); - let documentParts = textDocument.uri.fsPath.split(Path.sep); + let workspaceParts = workspaceFolder.uri.fsPath.split(Path.sep); + let documentParts = textDocument.uri.fsPath.split(Path.sep); - return workspaceParts.every( - (value, index) => - { - return value === documentParts[index]; - }); + return workspaceParts.every( + (value, index) => + { + return value === documentParts[index]; }); - } - - let workspaceRoot = !isNullOrUndefined(currentWorkspace) ? currentWorkspace.uri.fsPath : null; - let documentRoot = workspaceRoot || documentFolder; - - if (!Path.isAbsolute(Settings.Default.DestinationPath)) - { - let origin: string = null; + }); + } - if (Settings.Default.DestinationOrigin === DestinationOrigin.WorkspaceRoot) - { - origin = workspaceRoot || documentFolder; - } - else if (Settings.Default.DestinationOrigin === DestinationOrigin.DocumentFile) - { - origin = documentFolder || workspaceRoot; - } + let workspaceRoot = !isNullOrUndefined(currentWorkspace) ? currentWorkspace.uri.fsPath : null; + let documentRoot = workspaceRoot || documentFolder; - while (isNullOrUndefined(origin)) - { - origin = await window.showInputBox({ - ignoreFocusOut: true, - prompt: ResourceManager.Resources.Get("DestinationPath"), - placeHolder: ResourceManager.Resources.Get("DestinationPathExample") - }); - } + if (!Path.isAbsolute(Settings.Default.DestinationPath)) + { + let origin: string = null; - destinationPath = Path.resolve(origin, Settings.Default.DestinationPath); - } - else - { - destinationPath = Settings.Default.DestinationPath; - } + if (Settings.Default.DestinationOrigin === DestinationOrigin.WorkspaceRoot) + { + origin = workspaceRoot || documentFolder; + } + else if (Settings.Default.DestinationOrigin === DestinationOrigin.DocumentFile) + { + origin = documentFolder || workspaceRoot; + } - let fileName = Path.parse(textDocument.fileName).name; - let converter = await this.LoadConverter(documentRoot, textDocument); - let prompts = []; + while (isNullOrUndefined(origin)) + { + origin = await window.showInputBox({ + ignoreFocusOut: true, + prompt: ResourceManager.Resources.Get("DestinationPath"), + placeHolder: ResourceManager.Resources.Get("DestinationPathExample") + }); + } - await FileSystem.ensureDir(destinationPath); + destinationPath = Path.resolve(origin, Settings.Default.DestinationPath); + } + else + { + destinationPath = Settings.Default.DestinationPath; + } - for (let type of Settings.Default.ConversionType) - { - let extension: string; + let fileName = Path.parse(textDocument.fileName).name; + let converter = await this.LoadConverter(documentRoot, textDocument); + let prompts = []; - switch (type) - { - case ConversionType.HTML: - extension = "html"; - break; - case ConversionType.JPEG: - extension = "jpg"; - break; - case ConversionType.PNG: - extension = "png"; - break; - default: - case ConversionType.PDF: - extension = "pdf"; - break; - } + await FileSystem.ensureDir(destinationPath); - let destination = Path.join(destinationPath, `${fileName}.${extension}`); - await converter.Start(type, destination); - - prompts.push( - ( - async () => - { - await window.showInformationMessage( - Format(ResourceManager.Resources.Get("SuccessMessage"), ConversionType[type], destination), - ResourceManager.Resources.Get("OpenFileLabel")).then( - (label) => - { - if (label === ResourceManager.Resources.Get("OpenFileLabel")) - { - switch (process.platform) - { - case "win32": - ChildProcess.exec(`"${destination}"`); - break; - case "darwin": - ChildProcess.exec(`bash -c 'open "${destination}"'`); - break; - case "linux": - ChildProcess.exec(`bash -c 'xdg-open "${destination}"'`); - break; - default: - window.showWarningMessage(ResourceManager.Resources.Get("UnsupportedPlatformException")); - break; - } - } - }); - })()); - } + for (let type of Settings.Default.ConversionType) + { + let extension: string; - await Promise.all(prompts); - } - else if ( - await window.showInformationMessage( - ResourceManager.Resources.Get("UpdateMessage"), - ResourceManager.Resources.Get("Yes"), - ResourceManager.Resources.Get("No")) === ResourceManager.Resources.Get("Yes")) + switch (type) { - let revision = require(Path.join("..", "..", "node_modules", "puppeteer", "package.json"))["puppeteer"]["chromium_revision"]; - let success = false; + case ConversionType.HTML: + extension = "html"; + break; + case ConversionType.JPEG: + extension = "jpg"; + break; + case ConversionType.PNG: + extension = "png"; + break; + default: + case ConversionType.PDF: + extension = "pdf"; + break; + } - do - { - await window.withProgress( - { - location: ProgressLocation.Notification, - title: Format(ResourceManager.Resources.Get("UpdateRunning"), revision) - }, - async (reporter) => - { - try - { - let progress = 0; - let browserFetcher = (Puppeteer as any).createBrowserFetcher(); - - await browserFetcher.download( - revision, - (downloadBytes, totalBytes) => - { - let newProgress = Math.floor((downloadBytes / totalBytes) * 100); + let destination = Path.join(destinationPath, `${fileName}.${extension}`); + await converter.Start(type, destination); - if (newProgress > progress) + prompts.push( + ( + async () => + { + await window.showInformationMessage( + Format(ResourceManager.Resources.Get("SuccessMessage"), ConversionType[type], destination), + ResourceManager.Resources.Get("OpenFileLabel")).then( + (label) => + { + if (label === ResourceManager.Resources.Get("OpenFileLabel")) + { + switch (process.platform) { - reporter.report({ - increment: newProgress - progress - }); - - progress = newProgress; + case "win32": + ChildProcess.exec(`"${destination}"`); + break; + case "darwin": + ChildProcess.exec(`bash -c 'open "${destination}"'`); + break; + case "linux": + ChildProcess.exec(`bash -c 'xdg-open "${destination}"'`); + break; + default: + window.showWarningMessage(ResourceManager.Resources.Get("UnsupportedPlatformException")); + break; } - }); - - window.showInformationMessage(ResourceManager.Resources.Get("UpdateSuccess")); - success = true; - } - catch - { - success = false; - } - }); - } - while ( - !await FileSystem.pathExists(Puppeteer.executablePath()) && - !success && - await window.showWarningMessage( - ResourceManager.Resources.Get("UpdateFailed"), - ResourceManager.Resources.Get("Yes"), - ResourceManager.Resources.Get("No")) === ResourceManager.Resources.Get("Yes")); - } + } + }); + })()); } - catch (exception) - { - let message: string; - if (exception instanceof Exception) - { - message = exception.Message; - } - else - { - throw exception; - } - - window.showErrorMessage(message); - } + await Promise.all(prompts); } } \ No newline at end of file diff --git a/src/MarkdownConverter/PuppeteerCommand.ts b/src/MarkdownConverter/PuppeteerCommand.ts new file mode 100644 index 00000000..8ba9c24b --- /dev/null +++ b/src/MarkdownConverter/PuppeteerCommand.ts @@ -0,0 +1,118 @@ +import * as FileSystem from "fs-extra"; +import * as Puppeteer from "puppeteer"; +import * as Format from "string-template"; +import { ProgressLocation, window } from "vscode"; +import { Extension } from "../extension"; +import { ResourceManager } from "../Properties/ResourceManager"; +import { Exception } from "../System/Exception"; +import { Command } from "./Command"; + +/** + * Represents a command which depends on Puppeteer. + */ +export abstract class PuppeteerCommand extends Command +{ + /** + * Initializes a new instance of the `PuppeteerCommand` class. + * + * @param extension + * The extension this command belongs to. + */ + public constructor(extension: Extension) + { + super(extension); + } + + /** + * Executes the command. + */ + public async Execute() + { + try + { + if (await FileSystem.pathExists(Puppeteer.executablePath())) + { + await this.ExecuteCommand(); + } + else if ( + await window.showInformationMessage( + ResourceManager.Resources.Get("UpdateMessage"), + ResourceManager.Resources.Get("No")) === ResourceManager.Resources.Get("Yes")) + { + let revision = this.Extension.ChromiumRevision; + let success = false; + + do + { + await window.withProgress( + { + location: ProgressLocation.Notification, + title: Format(ResourceManager.Resources.Get("UpdateRunning"), revision) + }, + async (reporter) => + { + try + { + let progress = 0; + let browserFetcher = (Puppeteer as any).createBrowserFetcher(); + + await browserFetcher.download( + revision, + (downloadBytes, totalBytes) => + { + let newProgress = Math.floor((downloadBytes / totalBytes) * 100); + + if (newProgress > progress) + { + reporter.report({ + increment: newProgress - progress + }); + + progress = newProgress; + } + }); + + window.showInformationMessage(ResourceManager.Resources.Get("UpdateSuccess")); + success = true; + } + catch + { + success = false; + } + }); + } + while ( + !await FileSystem.pathExists(Puppeteer.executablePath()) && + !success && + await window.showWarningMessage( + ResourceManager.Resources.Get("UpdateFailed"), + ResourceManager.Resources.Get("Yes"), + ResourceManager.Resources.Get("No")) === ResourceManager.Resources.Get("Yes")); + } + } + catch (exception) + { + let message: string; + + if (exception instanceof Exception) + { + message = exception.Message; + } + else if (exception instanceof Error) + { + message = Format(ResourceManager.Resources.Get("UnknownException"), exception.name, exception.message); + } + else + { + message = "" + exception; + } + + window.showErrorMessage(message); + } + } + + /** + * Executes the command. + */ + protected abstract async ExecuteCommand(); +} \ No newline at end of file diff --git a/src/extension.ts b/src/extension.ts index 4e637e12..bfaeab6d 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -2,6 +2,7 @@ // Import the module and reference it with the alias vscode in your code below import CultureInfo from "culture-info"; import { MarkdownIt } from "markdown-it"; +import * as Path from "path"; import { commands, env, ExtensionContext } from "vscode"; import { ConvertCommand } from "./MarkdownConverter/ConvertCommand"; import { ResourceManager } from "./Properties/ResourceManager"; @@ -45,6 +46,14 @@ export class Extension return this.vsCodeParser; } + /** + * Gets the chromium-revision of the extension. + */ + public get ChromiumRevision(): string + { + return require(Path.join("..", "node_modules", "puppeteer", "package.json"))["puppeteer"]["chromium_revision"]; + } + /** * Activates the extension. * From 1d6f2f9450a21bc6a400c59806f7b5759fda6d87 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 30 Oct 2018 00:14:52 +0100 Subject: [PATCH 06/77] Add a class for representing conversion-commands --- src/MarkdownConverter/ConversionCommand.ts | 370 +++++++++++++++++++++ src/MarkdownConverter/ConvertCommand.ts | 349 +------------------ 2 files changed, 375 insertions(+), 344 deletions(-) create mode 100644 src/MarkdownConverter/ConversionCommand.ts diff --git a/src/MarkdownConverter/ConversionCommand.ts b/src/MarkdownConverter/ConversionCommand.ts new file mode 100644 index 00000000..2e00c162 --- /dev/null +++ b/src/MarkdownConverter/ConversionCommand.ts @@ -0,0 +1,370 @@ +import * as ChildProcess from "child_process"; +import clone = require("clone"); +import CultureInfo from "culture-info"; +import * as FileSystem from "fs-extra"; +import * as HighlightJs from "highlight.js"; +import * as MarkdownIt from "markdown-it"; +import * as Anchor from "markdown-it-anchor"; +import * as Checkbox from "markdown-it-checkbox"; +import * as MarkdownItEmoji from "markdown-it-emoji"; +import * as MarkdownItToc from "markdown-it-table-of-contents"; +import * as Path from "path"; +import * as Format from "string-template"; +import * as Transliteration from "transliteration"; +import * as TwEmoji from "twemoji"; +import { isNullOrUndefined } from "util"; +import { TextDocument, window, workspace, WorkspaceFolder } from "vscode"; +import { Extension } from "../extension"; +import { ResourceManager } from "../Properties/ResourceManager"; +import { Settings } from "../Properties/Settings"; +import { Document } from "../System/Drawing/Document"; +import { EmojiType } from "../System/Drawing/EmojiType"; +import { ListType } from "../System/Drawing/ListType"; +import { Slugifier } from "../System/Drawing/Slugifier"; +import { FileException } from "../System/IO/FileException"; +import { StringUtils } from "../System/Text/StringUtils"; +import { ConversionType } from "./ConversionType"; +import { Converter } from "./Converter"; +import { DestinationOrigin } from "./DestinationOrigin"; +import { getMarkdownExtensionContributions } from "./MarkdownExtensions"; +import { PuppeteerCommand } from "./PuppeteerCommand"; + +/** + * Represents a command which is able to convert markdown-files. + */ +export abstract class ConversionCommand extends PuppeteerCommand +{ + /** + * Initializes a new instance of the `ConvertCommand` class. + * + * @param extension + * The extension the command belongs to. + */ + public constructor(extension: Extension) + { + super(extension); + } + + /** + * Converts a document. + * + * @param document + * The document to convert. + */ + protected async Convert(document: TextDocument) + { + let destinationPath: string; + let documentFolder = document.isUntitled ? null : Path.dirname(document.fileName); + let currentWorkspace: WorkspaceFolder; + + if (document.isUntitled) + { + if ((workspace.workspaceFolders || []).length === 1) + { + currentWorkspace = workspace.workspaceFolders[0]; + } + else + { + currentWorkspace = null; + } + } + else + { + currentWorkspace = (workspace.workspaceFolders || []).find( + (workspaceFolder) => + { + let workspaceParts = workspaceFolder.uri.fsPath.split(Path.sep); + let documentParts = document.uri.fsPath.split(Path.sep); + + return workspaceParts.every( + (part, index) => + { + return part === documentParts[index]; + }); + }); + } + + let workspaceRoot = !isNullOrUndefined(currentWorkspace) ? currentWorkspace.uri.fsPath : null; + let documentRoot = workspaceRoot || documentFolder; + + if (!Path.isAbsolute(Settings.Default.DestinationPath)) + { + let origin: string = null; + + if (Settings.Default.DestinationOrigin === DestinationOrigin.WorkspaceRoot) + { + origin = workspaceRoot || documentFolder; + } + else if (Settings.Default.DestinationOrigin === DestinationOrigin.DocumentFile) + { + origin = documentFolder || workspaceRoot; + } + + while (isNullOrUndefined(origin)) + { + origin = await window.showInputBox({ + ignoreFocusOut: true, + prompt: ResourceManager.Resources.Get("DestinationPath"), + placeHolder: ResourceManager.Resources.Get("DestinationPathExample") + }); + } + + destinationPath = Path.resolve(origin, Settings.Default.DestinationPath); + } + else + { + destinationPath = Settings.Default.DestinationPath; + } + + let tasks: Promise[] = []; + let fileName = Path.parse(document.fileName).name; + let converter = await this.LoadConverter(documentRoot, document); + + await FileSystem.ensureDir(destinationPath); + + for (let type of Settings.Default.ConversionType) + { + let extension: string; + + switch (type) + { + case ConversionType.HTML: + extension = "html"; + break; + case ConversionType.JPEG: + extension = "jpg"; + break; + case ConversionType.PNG: + extension = "png"; + break; + case ConversionType.PDF: + extension = "pdf"; + break; + } + + let destination = Path.join(destinationPath, `${fileName}.${extension}`); + + tasks.push( + (async () => + { + await converter.Start(type, destination); + + (async () => + { + let result = await window.showInformationMessage( + Format(ResourceManager.Resources.Get("SuccessMessage"), ConversionType[type], destination), + ResourceManager.Resources.Get("OpenFileLabel")); + + if (result === ResourceManager.Resources.Get("OpenFileLabel")) + { + switch (process.platform) + { + case "win32": + ChildProcess.exec(`"${destination}"`); + break; + case "darwin": + ChildProcess.exec(`bash -c 'open "${destination}"'`); + break; + case "linux": + ChildProcess.exec(`bash -c 'xdg-open "${destination}"'`); + break; + default: + window.showWarningMessage(ResourceManager.Resources.Get("UnsupportedPlatformException")); + break; + } + } + })(); + })()); + } + + await Promise.all(tasks); + } + + /** + * Loads a converter according to the settings. + * + * @param documentRoot + * The path to the root of the document. + * + * @param textDocument + * The document to convert. + * + * @returns + * A converter generated by the settings. + */ + protected async LoadConverter(documentRoot: string, textDocument: TextDocument): Promise + { + let converter = new Converter(documentRoot, new Document(textDocument, await this.LoadParser())); + converter.Document.Quality = Settings.Default.ConversionQuality; + + Object.assign(converter.Document.Attributes, Settings.Default.Attributes); + + converter.Document.Locale = new CultureInfo(Settings.Default.Locale); + converter.Document.DateFormat = Settings.Default.DateFormat; + + converter.Document.Paper = Settings.Default.PaperFormat; + + converter.Document.HeaderFooterEnabled = Settings.Default.HeaderFooterEnabled; + converter.Document.Header.Content = Settings.Default.HeaderTemplate; + converter.Document.Footer.Content = Settings.Default.FooterTemplate; + + try + { + if (Settings.Default.Template) + { + converter.Document.Template = (await FileSystem.readFile(Path.resolve(documentRoot || ".", Settings.Default.Template))).toString(); + } + else if (Settings.Default.SystemParserEnabled) + { + converter.Document.Template = (await FileSystem.readFile(ResourceManager.Files.Get("SystemTemplate"))).toString(); + } + } + catch (exception) + { + if ( + exception instanceof Error && + "path" in exception) + { + throw new FileException(null, exception["path"]); + } + else + { + throw exception; + } + } + + if (Settings.Default.SystemParserEnabled) + { + let mdExtensions = getMarkdownExtensionContributions(this.Extension.Context); + + for (let styleSheet of mdExtensions.previewStyles) + { + converter.Document.StyleSheets.push(styleSheet.fsPath); + } + + for (let script of mdExtensions.previewScripts) + { + converter.Document.Scripts.push(script.fsPath); + } + } + + if (Settings.Default.HighlightStyle !== "None") + { + if (Settings.Default.HighlightStyle === "Default") + { + if (!Settings.Default.SystemParserEnabled) + { + converter.Document.StyleSheets.push(ResourceManager.Files.Get("DefaultHighlight")); + } + } + else + { + converter.Document.StyleSheets.push(Path.join(ResourceManager.Files.Get("HighlightJSStylesDir"), Settings.Default.HighlightStyle + ".css")); + } + } + + for (let styleSheet of Settings.Default.StyleSheets) + { + if (!Path.isAbsolute(styleSheet)) + { + styleSheet = Path.resolve(documentRoot || ".", styleSheet); + } + + converter.Document.StyleSheets.push(styleSheet); + } + + return converter; + } + + /** + * Loads a parser according to the settings. + */ + protected async LoadParser(): Promise + { + let parser: MarkdownIt.MarkdownIt; + let slugify = text => + Transliteration.slugify( + text, + { + lowercase: true, + separator: "-", + ignore: [] + }); + + if (Settings.Default.SystemParserEnabled) + { + parser = clone(this.Extension.VSCodeParser); + parser.normalizeLink = (link: string) => link; + parser.normalizeLinkText = (link: string) => link; + } + else + { + parser = new MarkdownIt({ + html: true, + highlight: (subject, language) => + { + if (Settings.Default.HighlightStyle !== "None") + { + subject = HighlightJs.highlight(language, subject, true).value; + } + else + { + subject = parser.utils.escapeHtml(subject); + } + + return `
${subject}
`; + } + }); + } + + parser.validateLink = () => true; + + Anchor( + parser, + { + slugify + }); + + if (Settings.Default.TocSettings) + { + let slugifier = new Slugifier(); + parser.use( + MarkdownItToc, + { + includeLevel: Settings.Default.TocSettings.Levels.toArray(), + containerClass: Settings.Default.TocSettings.Class, + markerPattern: Settings.Default.TocSettings.Indicator, + listType: Settings.Default.TocSettings.ListType === ListType.Ordered ? "ol" : "ul", + slugify: heading => slugifier.CreateSlug(heading) + }); + } + + parser.use(Checkbox); + + if (Settings.Default.EmojiType) + { + parser.use(MarkdownItEmoji); + parser.renderer.rules["emoji"] = (token, id) => + { + switch (Settings.Default.EmojiType) + { + case EmojiType.None: + return token[id].markup; + case EmojiType.Native: + return token[id].content; + case EmojiType.Twitter: + return TwEmoji.parse(token[id].content); + case EmojiType.GitHub: + return "'; + } + }; + } + + return parser; + } +} \ No newline at end of file diff --git a/src/MarkdownConverter/ConvertCommand.ts b/src/MarkdownConverter/ConvertCommand.ts index 614d9480..e140405c 100644 --- a/src/MarkdownConverter/ConvertCommand.ts +++ b/src/MarkdownConverter/ConvertCommand.ts @@ -1,39 +1,13 @@ -import * as ChildProcess from "child_process"; -import clone = require("clone"); -import CultureInfo from "culture-info"; -import * as FileSystem from "fs-extra"; -import * as HighlightJs from "highlight.js"; -import * as MarkdownIt from "markdown-it"; -import * as Anchor from "markdown-it-anchor"; -import * as Checkbox from "markdown-it-checkbox"; -import * as MarkdownItEmoji from "markdown-it-emoji"; -import * as MarkdownItToc from "markdown-it-table-of-contents"; -import * as Path from "path"; -import * as Format from "string-template"; -import * as Transliteration from "transliteration"; -import * as TwEmoji from "twemoji"; -import { isNullOrUndefined } from "util"; -import { TextDocument, window, workspace, WorkspaceFolder } from "vscode"; +import { TextDocument, window } from "vscode"; import { Extension } from "../extension"; -import { ResourceManager } from "../Properties/ResourceManager"; import { Settings } from "../Properties/Settings"; -import { Document } from "../System/Drawing/Document"; -import { EmojiType } from "../System/Drawing/EmojiType"; -import { ListType } from "../System/Drawing/ListType"; -import { Slugifier } from "../System/Drawing/Slugifier"; -import { FileException } from "../System/IO/FileException"; -import { StringUtils } from "../System/Text/StringUtils"; -import { ConversionType } from "./ConversionType"; -import { Converter } from "./Converter"; -import { DestinationOrigin } from "./DestinationOrigin"; -import { getMarkdownExtensionContributions } from "./MarkdownExtensions"; +import { ConversionCommand } from "./ConversionCommand"; import { MarkdownFileNotFoundException } from "./MarkdownFileNotFoundException"; -import { PuppeteerCommand } from "./PuppeteerCommand"; /** - * Provides a command for converting a markdown-document. + * Represens a command for converting a markdown-document. */ -export class ConvertCommand extends PuppeteerCommand +export class ConvertCommand extends ConversionCommand { /** * Initializes a new instance of the `ConvertCommand` class. @@ -46,194 +20,6 @@ export class ConvertCommand extends PuppeteerCommand super(extension); } - /** - * Loads a converter according to the settings. - * - * @param documentRoot - * The path to the root of the document. - * - * @param textDocument - * The document to convert. - * - * @returns - * A converter generated by the settings. - */ - protected async LoadConverter(documentRoot: string, textDocument: TextDocument): Promise - { - let converter = new Converter(documentRoot, new Document(textDocument, await this.LoadParser())); - converter.Document.Quality = Settings.Default.ConversionQuality; - - Object.assign(converter.Document.Attributes, Settings.Default.Attributes); - - converter.Document.Locale = new CultureInfo(Settings.Default.Locale); - converter.Document.DateFormat = Settings.Default.DateFormat; - - converter.Document.Paper = Settings.Default.PaperFormat; - - converter.Document.HeaderFooterEnabled = Settings.Default.HeaderFooterEnabled; - converter.Document.Header.Content = Settings.Default.HeaderTemplate; - converter.Document.Footer.Content = Settings.Default.FooterTemplate; - - try - { - if (Settings.Default.Template) - { - converter.Document.Template = (await FileSystem.readFile(Path.resolve(documentRoot || ".", Settings.Default.Template))).toString(); - } - else if (Settings.Default.SystemParserEnabled) - { - converter.Document.Template = (await FileSystem.readFile(ResourceManager.Files.Get("SystemTemplate"))).toString(); - } - } - catch (exception) - { - if ( - exception instanceof Error && - "path" in exception) - { - throw new FileException(null, exception["path"]); - } - else - { - throw exception; - } - } - - if (Settings.Default.SystemParserEnabled) - { - let mdExtensions = getMarkdownExtensionContributions(this.Extension.Context); - - for (let styleSheet of mdExtensions.previewStyles) - { - converter.Document.StyleSheets.push(styleSheet.fsPath); - } - - for (let script of mdExtensions.previewScripts) - { - converter.Document.Scripts.push(script.fsPath); - } - } - - if (Settings.Default.HighlightStyle !== "None") - { - if (Settings.Default.HighlightStyle === "Default") - { - if (!Settings.Default.SystemParserEnabled) - { - converter.Document.StyleSheets.push(ResourceManager.Files.Get("DefaultHighlight")); - } - } - else - { - converter.Document.StyleSheets.push(Path.join(ResourceManager.Files.Get("HighlightJSStylesDir"), Settings.Default.HighlightStyle + ".css")); - } - } - - for (let styleSheet of Settings.Default.StyleSheets) - { - if (!Path.isAbsolute(styleSheet)) - { - styleSheet = Path.resolve(documentRoot || ".", styleSheet); - } - - converter.Document.StyleSheets.push(styleSheet); - } - - return converter; - } - - /** - * Loads a parser according to the settings. - */ - protected async LoadParser(): Promise - { - let parser: MarkdownIt.MarkdownIt; - let slugify = text => - Transliteration.slugify( - text, - { - lowercase: true, - separator: "-", - ignore: [] - }); - - if (Settings.Default.SystemParserEnabled) - { - parser = clone(this.Extension.VSCodeParser); - parser.normalizeLink = (link: string) => link; - parser.normalizeLinkText = (link: string) => link; - } - else - { - parser = new MarkdownIt({ - html: true, - highlight: (subject, language) => - { - if (Settings.Default.HighlightStyle !== "None") - { - subject = HighlightJs.highlight(language, subject, true).value; - } - else - { - subject = parser.utils.escapeHtml(subject); - } - - return `
${subject}
`; - } - }); - } - - parser.validateLink = () => true; - - Anchor( - parser, - { - slugify - }); - - if (Settings.Default.TocSettings) - { - let slugifier = new Slugifier(); - parser.use( - MarkdownItToc, - { - includeLevel: Settings.Default.TocSettings.Levels.toArray(), - containerClass: Settings.Default.TocSettings.Class, - markerPattern: Settings.Default.TocSettings.Indicator, - listType: Settings.Default.TocSettings.ListType === ListType.Ordered ? "ol" : "ul", - slugify: heading => slugifier.CreateSlug(heading) - }); - } - - parser.use(Checkbox); - - if (Settings.Default.EmojiType) - { - parser.use(MarkdownItEmoji); - parser.renderer.rules["emoji"] = (token, id) => - { - switch (Settings.Default.EmojiType) - { - case EmojiType.None: - return token[id].markup; - case EmojiType.Native: - return token[id].content; - case EmojiType.Twitter: - return TwEmoji.parse(token[id].content); - case EmojiType.GitHub: - return "'; - } - }; - } - - return parser; - } - /** * Tries to find a markdown-file. */ @@ -257,131 +43,6 @@ export class ConvertCommand extends PuppeteerCommand public async ExecuteCommand() { - let destinationPath: string; - let textDocument = this.GetMarkdownDocument(); - let documentFolder = textDocument.isUntitled ? null : Path.dirname(textDocument.fileName); - let currentWorkspace: WorkspaceFolder; - - if (textDocument.isUntitled) - { - if ((workspace.workspaceFolders || []).length === 1) - { - currentWorkspace = workspace.workspaceFolders[0]; - } - else - { - currentWorkspace = null; - } - } - else - { - currentWorkspace = (workspace.workspaceFolders || []).find( - (workspaceFolder) => - { - let workspaceParts = workspaceFolder.uri.fsPath.split(Path.sep); - let documentParts = textDocument.uri.fsPath.split(Path.sep); - - return workspaceParts.every( - (value, index) => - { - return value === documentParts[index]; - }); - }); - } - - let workspaceRoot = !isNullOrUndefined(currentWorkspace) ? currentWorkspace.uri.fsPath : null; - let documentRoot = workspaceRoot || documentFolder; - - if (!Path.isAbsolute(Settings.Default.DestinationPath)) - { - let origin: string = null; - - if (Settings.Default.DestinationOrigin === DestinationOrigin.WorkspaceRoot) - { - origin = workspaceRoot || documentFolder; - } - else if (Settings.Default.DestinationOrigin === DestinationOrigin.DocumentFile) - { - origin = documentFolder || workspaceRoot; - } - - while (isNullOrUndefined(origin)) - { - origin = await window.showInputBox({ - ignoreFocusOut: true, - prompt: ResourceManager.Resources.Get("DestinationPath"), - placeHolder: ResourceManager.Resources.Get("DestinationPathExample") - }); - } - - destinationPath = Path.resolve(origin, Settings.Default.DestinationPath); - } - else - { - destinationPath = Settings.Default.DestinationPath; - } - - let fileName = Path.parse(textDocument.fileName).name; - let converter = await this.LoadConverter(documentRoot, textDocument); - let prompts = []; - - await FileSystem.ensureDir(destinationPath); - - for (let type of Settings.Default.ConversionType) - { - let extension: string; - - switch (type) - { - case ConversionType.HTML: - extension = "html"; - break; - case ConversionType.JPEG: - extension = "jpg"; - break; - case ConversionType.PNG: - extension = "png"; - break; - default: - case ConversionType.PDF: - extension = "pdf"; - break; - } - - let destination = Path.join(destinationPath, `${fileName}.${extension}`); - await converter.Start(type, destination); - - prompts.push( - ( - async () => - { - await window.showInformationMessage( - Format(ResourceManager.Resources.Get("SuccessMessage"), ConversionType[type], destination), - ResourceManager.Resources.Get("OpenFileLabel")).then( - (label) => - { - if (label === ResourceManager.Resources.Get("OpenFileLabel")) - { - switch (process.platform) - { - case "win32": - ChildProcess.exec(`"${destination}"`); - break; - case "darwin": - ChildProcess.exec(`bash -c 'open "${destination}"'`); - break; - case "linux": - ChildProcess.exec(`bash -c 'xdg-open "${destination}"'`); - break; - default: - window.showWarningMessage(ResourceManager.Resources.Get("UnsupportedPlatformException")); - break; - } - } - }); - })()); - } - - await Promise.all(prompts); + this.Convert(this.GetMarkdownDocument()); } } \ No newline at end of file From d94ce9f9537cf143ae007856613a25e6a72182d6 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 30 Oct 2018 00:17:01 +0100 Subject: [PATCH 07/77] Make the converter using ports dynamically --- CHANGELOG.md | 4 ++++ package-lock.json | 17 ++++++++++++++--- package.json | 2 ++ src/MarkdownConverter/Converter.ts | 6 ++++-- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16b320a4..2fe62467 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [MarkdownConverter Unreleased] +### Changes + - Prevented port-collisions when converting multiple files at once + ## [MarkdownConverter v1.1.2] ### Changes - Implemented a clean way to handle files outside of the current workspace diff --git a/package-lock.json b/package-lock.json index d743c8f4..4b879f4f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -55,6 +55,12 @@ "@types/node": "*" } }, + "@types/get-port": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/get-port/-/get-port-4.0.0.tgz", + "integrity": "sha512-Zp1GxOt3GNbIQqz2hSHSH7LALpTPvPHMA/aYut3VeitDgGwqcXEVvDQWWP3kPABsh3CGSHPSt67DN6jnc7oJMA==", + "dev": true + }, "@types/glob": { "version": "5.0.35", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-5.0.35.tgz", @@ -1036,6 +1042,11 @@ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" }, + "get-port": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-4.0.0.tgz", + "integrity": "sha512-Yy3yNI2oShgbaWg4cmPhWjkZfktEvpKI09aDX4PZzNtlU9obuYrX7x2mumQsrNxlF+Ls7OtMQW/u+X4s896bOQ==" + }, "get-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", @@ -2333,9 +2344,9 @@ } }, "portfinder": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.13.tgz", - "integrity": "sha1-uzLs2HwnEErm7kS1o8y/Drsa7ek=", + "version": "1.0.19", + "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.19.tgz", + "integrity": "sha512-23aeQKW9KgHe6citUrG3r9HjeX6vls0h713TAa+CwTKZwNIr/pD2ApaxYF4Um3ZZyq4ar+Siv3+fhoHaIwSOSw==", "requires": { "async": "^1.5.2", "debug": "^2.2.0", diff --git a/package.json b/package.json index bfe61918..48c59f99 100644 --- a/package.json +++ b/package.json @@ -357,6 +357,7 @@ "@types/clone": "^0.1.30", "@types/dedent": "^0.7.0", "@types/fs-extra": "^5.0.4", + "@types/get-port": "^4.0.0", "@types/highlight.js": "^9.12.3", "@types/http-server": "^0.10.0", "@types/lodash": "^4.14.117", @@ -382,6 +383,7 @@ "dedent": "^0.7.0", "front-matter": "^2.3.0", "fs-extra": "^6.0.1", + "get-port": "^4.0.0", "highlight.js": "^9.13.1", "highlightjs": "^9.12.0", "http-server": "^0.11.1", diff --git a/src/MarkdownConverter/Converter.ts b/src/MarkdownConverter/Converter.ts index 07aa3960..1508bbc6 100644 --- a/src/MarkdownConverter/Converter.ts +++ b/src/MarkdownConverter/Converter.ts @@ -1,4 +1,5 @@ import * as FS from "fs-extra"; +import * as PortFinder from "get-port"; import * as http from "http"; import * as Server from "http-server"; import * as Path from "path"; @@ -68,6 +69,7 @@ export class Converter */ public async Start(conversionType: ConversionType, path: string): Promise { + let port = await PortFinder(); let htmlCode = await this.Document.Render(); if (conversionType !== ConversionType.HTML) @@ -77,7 +79,7 @@ export class Converter cors: true }) as any).server as http.Server; - server.listen(8980, "localhost"); + server.listen(port, "localhost"); try { @@ -95,7 +97,7 @@ export class Converter let page = await browser.newPage(); let url = URL.resolve( - "http://localhost:8980/", + `http://localhost:${port}/`, ((!isNullOrUndefined(this.Document.FileName) && (!isNullOrUndefined(this.DocumentRoot))) ? Path.relative(this.DocumentRoot, this.Document.FileName) : "index") + ".html"); From 250b6e5148926e499f3c6a395ec07d241c3aca57 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 30 Oct 2018 09:32:50 +0100 Subject: [PATCH 08/77] Rework the ConversionCommand class --- src/MarkdownConverter/ConversionCommand.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/MarkdownConverter/ConversionCommand.ts b/src/MarkdownConverter/ConversionCommand.ts index 2e00c162..688dc61f 100644 --- a/src/MarkdownConverter/ConversionCommand.ts +++ b/src/MarkdownConverter/ConversionCommand.ts @@ -35,7 +35,7 @@ import { PuppeteerCommand } from "./PuppeteerCommand"; export abstract class ConversionCommand extends PuppeteerCommand { /** - * Initializes a new instance of the `ConvertCommand` class. + * Initializes a new instance of the `ConversionCommand` class. * * @param extension * The extension the command belongs to. @@ -186,15 +186,15 @@ export abstract class ConversionCommand extends PuppeteerCommand * @param documentRoot * The path to the root of the document. * - * @param textDocument + * @param document * The document to convert. * * @returns * A converter generated by the settings. */ - protected async LoadConverter(documentRoot: string, textDocument: TextDocument): Promise + protected async LoadConverter(documentRoot: string, document: TextDocument): Promise { - let converter = new Converter(documentRoot, new Document(textDocument, await this.LoadParser())); + let converter = new Converter(documentRoot, new Document(document, await this.LoadParser())); converter.Document.Quality = Settings.Default.ConversionQuality; Object.assign(converter.Document.Attributes, Settings.Default.Attributes); From 3df6d48d76006cd0d3925d5fbffd6e94bb01ab23 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 30 Oct 2018 10:45:44 +0100 Subject: [PATCH 09/77] Improve the naming of the classes --- ...{ConversionCommand.ts => ConversionTask.ts} | 10 +++++----- .../{ConvertCommand.ts => ConvertTask.ts} | 12 ++++++------ .../{PuppeteerCommand.ts => PuppeteerTask.ts} | 18 +++++++++--------- src/MarkdownConverter/{Command.ts => Task.ts} | 14 +++++++------- src/extension.ts | 8 +++++--- 5 files changed, 32 insertions(+), 30 deletions(-) rename src/MarkdownConverter/{ConversionCommand.ts => ConversionTask.ts} (97%) rename src/MarkdownConverter/{ConvertCommand.ts => ConvertTask.ts} (76%) rename src/MarkdownConverter/{PuppeteerCommand.ts => PuppeteerTask.ts} (90%) rename src/MarkdownConverter/{Command.ts => Task.ts} (61%) diff --git a/src/MarkdownConverter/ConversionCommand.ts b/src/MarkdownConverter/ConversionTask.ts similarity index 97% rename from src/MarkdownConverter/ConversionCommand.ts rename to src/MarkdownConverter/ConversionTask.ts index 688dc61f..bbea1565 100644 --- a/src/MarkdownConverter/ConversionCommand.ts +++ b/src/MarkdownConverter/ConversionTask.ts @@ -27,18 +27,18 @@ import { ConversionType } from "./ConversionType"; import { Converter } from "./Converter"; import { DestinationOrigin } from "./DestinationOrigin"; import { getMarkdownExtensionContributions } from "./MarkdownExtensions"; -import { PuppeteerCommand } from "./PuppeteerCommand"; +import { PuppeteerTask } from "./PuppeteerTask"; /** - * Represents a command which is able to convert markdown-files. + * Represents a task which is able to convert markdown-files. */ -export abstract class ConversionCommand extends PuppeteerCommand +export abstract class ConversionTask extends PuppeteerTask { /** - * Initializes a new instance of the `ConversionCommand` class. + * Initializes a new instance of the `ConversionTask` class. * * @param extension - * The extension the command belongs to. + * The extension the task belongs to. */ public constructor(extension: Extension) { diff --git a/src/MarkdownConverter/ConvertCommand.ts b/src/MarkdownConverter/ConvertTask.ts similarity index 76% rename from src/MarkdownConverter/ConvertCommand.ts rename to src/MarkdownConverter/ConvertTask.ts index e140405c..a843dd58 100644 --- a/src/MarkdownConverter/ConvertCommand.ts +++ b/src/MarkdownConverter/ConvertTask.ts @@ -1,19 +1,19 @@ import { TextDocument, window } from "vscode"; import { Extension } from "../extension"; import { Settings } from "../Properties/Settings"; -import { ConversionCommand } from "./ConversionCommand"; +import { ConversionTask } from "./ConversionTask"; import { MarkdownFileNotFoundException } from "./MarkdownFileNotFoundException"; /** - * Represens a command for converting a markdown-document. + * Represens a task for converting a markdown-document. */ -export class ConvertCommand extends ConversionCommand +export class ConvertTask extends ConversionTask { /** - * Initializes a new instance of the `ConvertCommand` class. + * Initializes a new instance of the `ConvertTask` class. * * @param extension - * The extension the command belongs to. + * The extension the task belongs to. */ public constructor(extension: Extension) { @@ -41,7 +41,7 @@ export class ConvertCommand extends ConversionCommand throw new MarkdownFileNotFoundException(); } - public async ExecuteCommand() + public async ExecuteTask() { this.Convert(this.GetMarkdownDocument()); } diff --git a/src/MarkdownConverter/PuppeteerCommand.ts b/src/MarkdownConverter/PuppeteerTask.ts similarity index 90% rename from src/MarkdownConverter/PuppeteerCommand.ts rename to src/MarkdownConverter/PuppeteerTask.ts index 8ba9c24b..7aed1686 100644 --- a/src/MarkdownConverter/PuppeteerCommand.ts +++ b/src/MarkdownConverter/PuppeteerTask.ts @@ -5,18 +5,18 @@ import { ProgressLocation, window } from "vscode"; import { Extension } from "../extension"; import { ResourceManager } from "../Properties/ResourceManager"; import { Exception } from "../System/Exception"; -import { Command } from "./Command"; +import { Task } from "./Task"; /** - * Represents a command which depends on Puppeteer. + * Represents a task which depends on Puppeteer. */ -export abstract class PuppeteerCommand extends Command +export abstract class PuppeteerTask extends Task { /** - * Initializes a new instance of the `PuppeteerCommand` class. + * Initializes a new instance of the `PuppeteerTask` class. * * @param extension - * The extension this command belongs to. + * The extension this task belongs to. */ public constructor(extension: Extension) { @@ -24,7 +24,7 @@ export abstract class PuppeteerCommand extends Command } /** - * Executes the command. + * Executes the task. */ public async Execute() { @@ -32,7 +32,7 @@ export abstract class PuppeteerCommand extends Command { if (await FileSystem.pathExists(Puppeteer.executablePath())) { - await this.ExecuteCommand(); + await this.ExecuteTask(); } else if ( await window.showInformationMessage( @@ -112,7 +112,7 @@ export abstract class PuppeteerCommand extends Command } /** - * Executes the command. + * Executes the task. */ - protected abstract async ExecuteCommand(); + protected abstract async ExecuteTask(); } \ No newline at end of file diff --git a/src/MarkdownConverter/Command.ts b/src/MarkdownConverter/Task.ts similarity index 61% rename from src/MarkdownConverter/Command.ts rename to src/MarkdownConverter/Task.ts index 97aaacf7..564134e7 100644 --- a/src/MarkdownConverter/Command.ts +++ b/src/MarkdownConverter/Task.ts @@ -1,20 +1,20 @@ import { Extension } from "../extension"; /** - * Represents a command. + * Represents a task. */ -export abstract class Command +export abstract class Task { /** - * The extension this command belongs to. + * The extension this task belongs to. */ private extension: Extension; /** - * Initializes a new instance of the `Command` class. + * Initializes a new instance of the `Task` class. * * @param extension - * The extension this command belongs to. + * The extension this task belongs to. */ public constructor(extension: Extension) { @@ -22,7 +22,7 @@ export abstract class Command } /** - * Gets or sets the extension this command belongs to. + * Gets or sets the extension this task belongs to. */ public get Extension() { @@ -35,7 +35,7 @@ export abstract class Command } /** - * Executes the command. + * Executes the task. */ public abstract async Execute(); } \ No newline at end of file diff --git a/src/extension.ts b/src/extension.ts index bfaeab6d..c1dd0518 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -4,7 +4,7 @@ import CultureInfo from "culture-info"; import { MarkdownIt } from "markdown-it"; import * as Path from "path"; import { commands, env, ExtensionContext } from "vscode"; -import { ConvertCommand } from "./MarkdownConverter/ConvertCommand"; +import { ConvertTask } from "./MarkdownConverter/ConvertTask"; import { ResourceManager } from "./Properties/ResourceManager"; /** @@ -39,7 +39,7 @@ export class Extension } /** - * Gets the parser provided by + * Gets the parser provided by Visual Studio Code. */ public get VSCodeParser() { @@ -81,7 +81,7 @@ export class Extension */ protected async Convert() { - await new ConvertCommand(this).Execute(); + await new ConvertTask(this).Execute(); } /** @@ -93,5 +93,7 @@ export class Extension } let extension = new Extension(); + export let activate = async (context: ExtensionContext) => await extension.Activate(context); + export let deactivate = async () => await extension.Dispose(); \ No newline at end of file From 85eab18555766d3ad941c9e9e31496c56c3fe049 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 30 Oct 2018 10:47:32 +0100 Subject: [PATCH 10/77] Improve the ts-docs --- src/MarkdownConverter/ConvertTask.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MarkdownConverter/ConvertTask.ts b/src/MarkdownConverter/ConvertTask.ts index a843dd58..87a42c49 100644 --- a/src/MarkdownConverter/ConvertTask.ts +++ b/src/MarkdownConverter/ConvertTask.ts @@ -5,7 +5,7 @@ import { ConversionTask } from "./ConversionTask"; import { MarkdownFileNotFoundException } from "./MarkdownFileNotFoundException"; /** - * Represens a task for converting a markdown-document. + * Represens a task for converting the currently opened document. */ export class ConvertTask extends ConversionTask { From 05b07b47b74d93fc4ea657d69ffe41d8f35245bd Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 30 Oct 2018 23:31:24 +0100 Subject: [PATCH 11/77] Add a new command for converting all documents This commit closes #8 --- package.json | 5 ++ package.nls.de-CH.json | 3 +- package.nls.de.json | 3 +- package.nls.json | 1 + src/MarkdownConverter/ConvertAllTask.ts | 83 +++++++++++++++++++++++++ src/extension.ts | 12 +++- 6 files changed, 104 insertions(+), 3 deletions(-) create mode 100644 src/MarkdownConverter/ConvertAllTask.ts diff --git a/package.json b/package.json index 48c59f99..306e9da0 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,11 @@ "command": "markdownConverter.Convert", "category": "Markdown", "title": "%Command.Convert%" + }, + { + "command": "markdownConverter.ConvertAll", + "category": "Markdown", + "title": "%Command.ConvertAll%" } ], "markdown.markdownItPlugins": true, diff --git a/package.nls.de-CH.json b/package.nls.de-CH.json index dfc3eec8..da24dd8d 100644 --- a/package.nls.de-CH.json +++ b/package.nls.de-CH.json @@ -1,5 +1,6 @@ { - "Command.Convert": "Dokument Konvertieren", + "Command.Convert": "Dokument konvertieren", + "Command.ConvertAll": "Alle Dokumente konvertieren", "Config": "MarkdownConverter-Einstellungen", "Config.DestinationOrigin": "Ziel-Ort", "Config.DestinationOrigin.Description": "Der Ort zu dem der `#markdownConverter.DestinationPath#` relativ ist.", diff --git a/package.nls.de.json b/package.nls.de.json index 4dc8172f..889f51ff 100644 --- a/package.nls.de.json +++ b/package.nls.de.json @@ -1,5 +1,6 @@ { - "Command.Convert": "Dokument Konvertieren", + "Command.Convert": "Dokument konvertieren", + "Command.ConvertAll": "Alle Dokumente konvertieren", "Config": "MarkdownConverter-Einstellungen", "Config.DestinationOrigin": "Ziel-Ort", "Config.DestinationOrigin.Description": "Der Ort zu dem der `#markdownConverter.DestinationPath#` relativ ist.", diff --git a/package.nls.json b/package.nls.json index 066ce1bd..a647593a 100644 --- a/package.nls.json +++ b/package.nls.json @@ -1,5 +1,6 @@ { "Command.Convert": "Convert Document", + "Command.ConvertAll": "Convert all Documents", "Config": "MarkdownConverter-Options", "Config.DestinationOrigin": "Destination-Origin", "Config.DestinationOrigin.Description": "The location the `#markdownConverter.DestinationPath#` may be relative to.", diff --git a/src/MarkdownConverter/ConvertAllTask.ts b/src/MarkdownConverter/ConvertAllTask.ts new file mode 100644 index 00000000..9e052c13 --- /dev/null +++ b/src/MarkdownConverter/ConvertAllTask.ts @@ -0,0 +1,83 @@ +import { extensions, TextDocument, workspace } from "vscode"; +import { Extension } from "../extension"; +import { ConversionTask } from "./ConversionTask"; + +/** + * Represents a task for converting all documents in the workspace. + */ +export class ConvertAllTask extends ConversionTask +{ + /** + * Initializes a new instance of the `ConvertAllTask` class. + * + * @param extension + * The extension the task belongs to. + */ + public constructor(extension: Extension) + { + super(extension); + } + + protected async ExecuteTask() + { + for (let document of await this.GetDocuments()) + { + await this.Convert(document); + } + } + + /** + * Gets all markdown-documents of the workspace. + */ + protected async GetDocuments(): Promise + { + let documents: TextDocument[] = []; + let filePatterns: string[] = []; + + for (let extension of extensions.all) + { + if ( + extension.packageJSON.contributes && + extension.packageJSON.contributes.languages) + { + for (let language of extension.packageJSON.contributes.languages) + { + if (language.id === "markdown") + { + for (let fileExtension of language.extensions) + { + filePatterns.push(`**/*${fileExtension}`); + } + } + } + } + } + + { + let fileAssociations = workspace.getConfiguration().get<{ [key: string]: string }>("files.associations"); + + for (let fileAssociation in fileAssociations) + { + if (fileAssociations[fileAssociation] === "markdown") + { + filePatterns.push(`**/${fileAssociation}`); + } + } + } + + for (let filePattern of filePatterns) + { + for (let file of await workspace.findFiles(filePattern)) + { + let document = await workspace.openTextDocument(file); + + if (document.languageId === "markdown") + { + documents.push(document); + } + } + } + + return documents; + } +} \ No newline at end of file diff --git a/src/extension.ts b/src/extension.ts index c1dd0518..02d0b443 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -4,6 +4,7 @@ import CultureInfo from "culture-info"; import { MarkdownIt } from "markdown-it"; import * as Path from "path"; import { commands, env, ExtensionContext } from "vscode"; +import { ConvertAllTask } from "./MarkdownConverter/ConvertAllTask"; import { ConvertTask } from "./MarkdownConverter/ConvertTask"; import { ResourceManager } from "./Properties/ResourceManager"; @@ -65,7 +66,8 @@ export class Extension this.context = context; context.subscriptions.push( - commands.registerCommand("markdownConverter.Convert", async () => await this.Convert())); + commands.registerCommand("markdownConverter.Convert", async () => await this.Convert()), + commands.registerCommand("markdownConverter.ConvertAll", async () => await this.ConvertAll())); return { extendMarkdownIt: (md: any) => @@ -84,6 +86,14 @@ export class Extension await new ConvertTask(this).Execute(); } + /** + * Converts all documents in the workspace. + */ + protected async ConvertAll() + { + await new ConvertAllTask(this).Execute(); + } + /** * Disposes the extension. */ From a1c3a1156d73ca2443212bd67621c68d8076623b Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 31 Oct 2018 10:03:42 +0100 Subject: [PATCH 12/77] Remove unused code --- package-lock.json | 200 ++++++++++------------------- package.json | 7 - src/MarkdownConverter/Utilities.ts | 31 ----- src/extension.ts | 2 +- src/test/extension.test.ts | 26 ---- 5 files changed, 72 insertions(+), 194 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4b879f4f..62498041 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,12 +4,6 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "@types/caseless": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.1.tgz", - "integrity": "sha512-FhlMa34NHp9K5MY1Uz8yb+ZvuX0pnvn3jScRSNAb75KHGB8d3rEU6hqMs3Z2vjuytcMfRg6c5CHMc3wtYyD2/A==", - "dev": true - }, "@types/clone": { "version": "0.1.30", "resolved": "http://registry.npmjs.org/@types/clone/-/clone-0.1.30.tgz", @@ -37,15 +31,6 @@ "integrity": "sha512-KEIlhXnIutzKwRbQkGWb/I4HFqBuUykAdHgDED6xqwXJfONCjF5VoE0cXEiurh3XauygxzeDzgtXUqvLkxFzzA==", "dev": true }, - "@types/form-data": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-2.2.1.tgz", - "integrity": "sha512-JAMFhOaHIciYVh8fb5/83nmuO/AHwmto+Hq7a9y8FzLDcC1KCU344XDOMEmahnrTFlHjgh4L0WJFczNIX2GxnQ==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, "@types/fs-extra": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-5.0.4.tgz", @@ -87,12 +72,6 @@ "@types/connect": "*" } }, - "@types/lodash": { - "version": "4.14.117", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.117.tgz", - "integrity": "sha512-xyf2m6tRbz8qQKcxYZa7PA4SllYcay+eh25DN3jmNYY6gSTL7Htc/bttVdkqj2wfJGbeWlQiX8pIyJpKU+tubw==", - "dev": true - }, "@types/markdown-it": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-0.0.3.tgz", @@ -141,27 +120,6 @@ "@types/node": "*" } }, - "@types/request": { - "version": "2.47.1", - "resolved": "https://registry.npmjs.org/@types/request/-/request-2.47.1.tgz", - "integrity": "sha512-TV3XLvDjQbIeVxJ1Z3oCTDk/KuYwwcNKVwz2YaT0F5u86Prgc4syDAp6P96rkTQQ4bIdh+VswQIC9zS6NjY7/g==", - "dev": true, - "requires": { - "@types/caseless": "*", - "@types/form-data": "*", - "@types/node": "*", - "@types/tough-cookie": "*" - } - }, - "@types/request-promise-native": { - "version": "1.0.15", - "resolved": "https://registry.npmjs.org/@types/request-promise-native/-/request-promise-native-1.0.15.tgz", - "integrity": "sha512-uYPjTChD9TpjlvbBjNpZfNc64TBejBS52u7pbxhQLnlxw+5Em7wLb6DU2wdJVhJ2Mou7v50N0qgL4Gia5mmRYg==", - "dev": true, - "requires": { - "@types/request": "*" - } - }, "@types/shelljs": { "version": "0.7.9", "resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.7.9.tgz", @@ -178,18 +136,6 @@ "integrity": "sha1-NjsnPJtFZwXjER41cekkj2R066Q=", "dev": true }, - "@types/tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/@types/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha1-EHPEvIJHVK49EM+riKsCN7qWTk0=", - "dev": true - }, - "@types/tough-cookie": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-2.3.3.tgz", - "integrity": "sha512-MDQLxNFRLasqS4UlkWMSACMKeSm1x4Q3TxzUC7KQUsh6RK1ZrQ0VEyE3yzXcBu+K8ejVj4wuX32eUG02yNp+YQ==", - "dev": true - }, "@types/transliteration": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@types/transliteration/-/transliteration-1.6.0.tgz", @@ -214,6 +160,7 @@ "version": "5.5.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, "requires": { "co": "^4.6.0", "fast-deep-equal": "^1.0.0", @@ -336,6 +283,7 @@ "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, "requires": { "safer-buffer": "~2.1.0" } @@ -343,7 +291,8 @@ "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true }, "async": { "version": "1.5.2", @@ -358,17 +307,20 @@ "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true }, "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true }, "aws4": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "dev": true }, "babel-code-frame": { "version": "6.26.0", @@ -420,6 +372,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, "optional": true, "requires": { "tweetnacl": "^0.14.3" @@ -485,7 +438,8 @@ "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true }, "chalk": { "version": "2.4.1", @@ -559,7 +513,8 @@ "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true }, "code-point-at": { "version": "1.1.0", @@ -590,6 +545,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "dev": true, "requires": { "delayed-stream": "~1.0.0" } @@ -651,6 +607,7 @@ "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, "requires": { "assert-plus": "^1.0.0" } @@ -700,7 +657,8 @@ "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true }, "diff": { "version": "3.5.0", @@ -730,6 +688,7 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, "optional": true, "requires": { "jsbn": "~0.1.0", @@ -853,7 +812,8 @@ "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true }, "extend-shallow": { "version": "1.1.4", @@ -905,17 +865,20 @@ "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true }, "fast-deep-equal": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "dev": true }, "fast-json-stable-stringify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true }, "fd-slicer": { "version": "1.0.1", @@ -984,12 +947,14 @@ "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true }, "form-data": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "dev": true, "requires": { "asynckit": "^0.4.0", "combined-stream": "1.0.6", @@ -1056,6 +1021,7 @@ "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, "requires": { "assert-plus": "^1.0.0" } @@ -1447,12 +1413,14 @@ "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true }, "har-validator": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz", "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", + "dev": true, "requires": { "ajv": "^5.3.0", "har-schema": "^2.0.0" @@ -1525,6 +1493,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, "requires": { "assert-plus": "^1.0.0", "jsprim": "^1.2.2", @@ -1668,7 +1637,8 @@ "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true }, "is-utf8": { "version": "0.2.1", @@ -1704,7 +1674,8 @@ "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true }, "js-tokens": { "version": "3.0.2", @@ -1725,17 +1696,20 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true, "optional": true }, "json-schema": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true }, "json-schema-traverse": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true }, "json-stable-stringify": { "version": "1.0.1", @@ -1749,7 +1723,8 @@ "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true }, "jsonfile": { "version": "4.0.0", @@ -1769,6 +1744,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, "requires": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -1847,11 +1823,6 @@ "path-exists": "^3.0.0" } }, - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" - }, "lodash.isequal": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", @@ -2007,12 +1978,14 @@ "mime-db": { "version": "1.36.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.36.0.tgz", - "integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw==" + "integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw==", + "dev": true }, "mime-types": { "version": "2.1.20", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.20.tgz", "integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==", + "dev": true, "requires": { "mime-db": "~1.36.0" } @@ -2158,7 +2131,8 @@ "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true }, "object-assign": { "version": "4.1.1", @@ -2225,11 +2199,6 @@ "mem": "^1.1.0" } }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" - }, "p-finally": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", @@ -2328,7 +2297,8 @@ "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true }, "plugin-error": { "version": "0.1.2", @@ -2392,12 +2362,14 @@ "psl": { "version": "1.1.29", "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", - "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==" + "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==", + "dev": true }, "punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true }, "puppeteer": { "version": "1.9.0", @@ -2417,7 +2389,8 @@ "qs": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true }, "querystringify": { "version": "2.0.0", @@ -2529,6 +2502,7 @@ "version": "2.88.0", "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "dev": true, "requires": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -2556,6 +2530,7 @@ "version": "2.4.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "dev": true, "requires": { "psl": "^1.1.24", "punycode": "^1.4.1" @@ -2563,24 +2538,6 @@ } } }, - "request-promise-core": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.1.tgz", - "integrity": "sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=", - "requires": { - "lodash": "^4.13.1" - } - }, - "request-promise-native": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.5.tgz", - "integrity": "sha1-UoF3D2jgyXGeUWP9P6tIIhX0/aU=", - "requires": { - "request-promise-core": "1.1.1", - "stealthy-require": "^1.1.0", - "tough-cookie": ">=2.3.3" - } - }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -2620,7 +2577,8 @@ "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true }, "semver": { "version": "5.5.1", @@ -2690,6 +2648,7 @@ "version": "1.14.2", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", + "dev": true, "requires": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -2708,11 +2667,6 @@ "integrity": "sha1-5sgLYjEj19gM8TLOU480YokHJQI=", "dev": true }, - "stealthy-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", - "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=" - }, "stream-combiner": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", @@ -2845,14 +2799,6 @@ "xtend": "~4.0.0" } }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "requires": { - "os-tmpdir": "~1.0.2" - } - }, "to-absolute-glob": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-0.1.1.tgz", @@ -2873,14 +2819,6 @@ } } }, - "tough-cookie": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", - "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", - "requires": { - "punycode": "^1.4.1" - } - }, "transliteration": { "version": "1.6.6", "resolved": "https://registry.npmjs.org/transliteration/-/transliteration-1.6.6.tgz", @@ -2928,6 +2866,7 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, "requires": { "safe-buffer": "^5.0.1" } @@ -2936,6 +2875,7 @@ "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true, "optional": true }, "twemoji": { @@ -3012,7 +2952,8 @@ "uuid": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true }, "vali-date": { "version": "1.0.0", @@ -3024,6 +2965,7 @@ "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, "requires": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", diff --git a/package.json b/package.json index 306e9da0..c0e96755 100644 --- a/package.json +++ b/package.json @@ -365,17 +365,14 @@ "@types/get-port": "^4.0.0", "@types/highlight.js": "^9.12.3", "@types/http-server": "^0.10.0", - "@types/lodash": "^4.14.117", "@types/markdown-it": "0.0.3", "@types/markdown-it-anchor": "^4.0.2", "@types/mocha": "^2.2.48", "@types/mustache": "^0.8.31", "@types/node": "^10.12.0", "@types/puppeteer": "^1.9.0", - "@types/request-promise-native": "^1.0.15", "@types/shelljs": "^0.7.9", "@types/string-template": "^1.0.2", - "@types/tmp": "0.0.33", "@types/transliteration": "^1.6.0", "@types/yamljs": "^0.2.30", "tslint": "^5.11.0", @@ -393,7 +390,6 @@ "highlightjs": "^9.12.0", "http-server": "^0.11.1", "localizable-resources": "^1.0.6", - "lodash": "^4.17.11", "markdown-it": "^8.4.2", "markdown-it-anchor": "^5.0.2", "markdown-it-checkbox": "^1.1.0", @@ -403,11 +399,8 @@ "mustache": "^2.3.2", "puppeteer": "^1.9.0", "rc": "^1.2.8", - "request": "^2.88.0", - "request-promise-native": "^1.0.5", "shelljs": "^0.8.2", "string-template": "^1.0.0", - "tmp": "0.0.33", "transliteration": "^1.6.6", "twemoji": "^2.5.1", "yamljs": "^0.3.0" diff --git a/src/MarkdownConverter/Utilities.ts b/src/MarkdownConverter/Utilities.ts index c3ed419e..0b589e0d 100644 --- a/src/MarkdownConverter/Utilities.ts +++ b/src/MarkdownConverter/Utilities.ts @@ -1,5 +1,3 @@ -import * as lodash from "lodash"; -import * as MarkdownIt from "markdown-it"; import * as shell from "shelljs"; /** @@ -17,11 +15,6 @@ export class Utilities "C9_USER" // Cloud9 ]; - /** - * The markdown-parser provided by `Visual Studio Code`. - */ - private static vscodeParser: MarkdownIt.MarkdownIt; - /** * Gets the full name of the current user. */ @@ -44,19 +37,6 @@ export class Utilities return result; } - /** - * Gets the markdown-parser provided by `Visual Studio Code`. - */ - public static get VSCodeParser(): MarkdownIt.MarkdownIt - { - return this.Clone(this.vscodeParser); - } - - public static set VSCodeParser(value) - { - this.vscodeParser = value; - } - /** * Tries to figure out the username using wmic. */ @@ -121,15 +101,4 @@ export class Utilities } return this.CheckGit(); } - - /** - * Clones an object. - * - * @param object - * The object to clone. - */ - public static Clone(object: T): T - { - return lodash.cloneDeep(object); - } } \ No newline at end of file diff --git a/src/extension.ts b/src/extension.ts index 02d0b443..0f6ed06a 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -102,7 +102,7 @@ export class Extension } } -let extension = new Extension(); +export let extension = new Extension(); export let activate = async (context: ExtensionContext) => await extension.Activate(context); diff --git a/src/test/extension.test.ts b/src/test/extension.test.ts index ed8dba13..4b2fcc44 100644 --- a/src/test/extension.test.ts +++ b/src/test/extension.test.ts @@ -1,30 +1,4 @@ -import * as assert from "assert"; -import * as Dedent from "dedent"; -import * as MarkdownIt from "markdown-it"; -import { Utilities } from "../MarkdownConverter/Utilities"; - // Defines a Mocha test suite to group tests of similar kind together suite("MarkdownConverter", () => { - /** - * Clones the parser provided by VSCode and verifies whether mutations affect VSCode's parser. - */ - test("Clone VSCodeParser", () => - { - let text = "Hello World"; - let code = Dedent(` - \`\`\`cs - Console.WriteLine("Hello World"); - \`\`\``); - let codeResult = "
cs
"; - Utilities.VSCodeParser = new MarkdownIt({ highlight: (subjectr, language) => `
${language}
` }); - let parser1 = Utilities.VSCodeParser; - parser1.set({ html: false }); - - let parser2 = Utilities.VSCodeParser; - parser2.set({ html: true }); - assert.equal(parser1.render(code).trim(), codeResult); - assert.equal(parser2.render(code).trim(), codeResult); - assert.notEqual(parser1.render(text), parser2.render(text)); - }); }); \ No newline at end of file From ccbc1d68c1b00ffb59a217d545add56066f90c50 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 31 Oct 2018 12:17:56 +0100 Subject: [PATCH 13/77] Optimize the way to query the username --- package-lock.json | 28 ++++--- package.json | 3 +- src/MarkdownConverter/ConversionTask.ts | 2 + src/MarkdownConverter/ConvertTask.ts | 2 +- src/MarkdownConverter/Utilities.ts | 104 ++++++++++++++---------- src/System/Drawing/Document.ts | 8 +- src/extension.ts | 3 +- tsconfig.json | 4 +- 8 files changed, 86 insertions(+), 68 deletions(-) diff --git a/package-lock.json b/package-lock.json index 62498041..019a40be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,9 +27,8 @@ }, "@types/events": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@types/events/-/events-1.2.0.tgz", - "integrity": "sha512-KEIlhXnIutzKwRbQkGWb/I4HFqBuUykAdHgDED6xqwXJfONCjF5VoE0cXEiurh3XauygxzeDzgtXUqvLkxFzzA==", - "dev": true + "resolved": "http://registry.npmjs.org/@types/events/-/events-1.2.0.tgz", + "integrity": "sha512-KEIlhXnIutzKwRbQkGWb/I4HFqBuUykAdHgDED6xqwXJfONCjF5VoE0cXEiurh3XauygxzeDzgtXUqvLkxFzzA==" }, "@types/fs-extra": { "version": "5.0.4", @@ -47,10 +46,9 @@ "dev": true }, "@types/glob": { - "version": "5.0.35", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-5.0.35.tgz", - "integrity": "sha512-wc+VveszMLyMWFvXLkloixT4n0harUIVZjnpzztaZ0nKLuul7Z32iMt2fUFGAaZ4y1XWjFRMtCI5ewvyh4aIeg==", - "dev": true, + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", + "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", "requires": { "@types/events": "*", "@types/minimatch": "*", @@ -90,8 +88,7 @@ "@types/minimatch": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", - "dev": true + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==" }, "@types/mocha": { "version": "2.2.48", @@ -108,8 +105,7 @@ "@types/node": { "version": "10.12.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.0.tgz", - "integrity": "sha512-3TUHC3jsBAB7qVRGxT6lWyYo2v96BMmD2PTcl47H25Lu7UXtFH/2qqmKiVrnel6Ne//0TFYf6uvNX+HW2FRkLQ==", - "dev": true + "integrity": "sha512-3TUHC3jsBAB7qVRGxT6lWyYo2v96BMmD2PTcl47H25Lu7UXtFH/2qqmKiVrnel6Ne//0TFYf6uvNX+HW2FRkLQ==" }, "@types/puppeteer": { "version": "1.9.0", @@ -124,7 +120,6 @@ "version": "0.7.9", "resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.7.9.tgz", "integrity": "sha512-GwfXBWx+JgH+mrf35NnNFPFl6kQZgDQqZBUdWrHB1phulBbVpOwedZun7hZRyfTOxlicwo4ftsC1fpUZZIiN5w==", - "dev": true, "requires": { "@types/glob": "*", "@types/node": "*" @@ -304,6 +299,15 @@ "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==" }, + "async-shelljs": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/async-shelljs/-/async-shelljs-0.1.2.tgz", + "integrity": "sha512-dk7WMFhb1dRfexI/2voIUDpmWX3XfPRyTWeafGUtdHqlcQgIZPk0St6+d9Ns3Eantq6MB+Lk4GwMCaSS8MkMRg==", + "requires": { + "@types/shelljs": "^0.7.7", + "shelljs": "^0.8.1" + } + }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", diff --git a/package.json b/package.json index c0e96755..37167d12 100644 --- a/package.json +++ b/package.json @@ -371,7 +371,6 @@ "@types/mustache": "^0.8.31", "@types/node": "^10.12.0", "@types/puppeteer": "^1.9.0", - "@types/shelljs": "^0.7.9", "@types/string-template": "^1.0.2", "@types/transliteration": "^1.6.0", "@types/yamljs": "^0.2.30", @@ -380,6 +379,7 @@ "vscode": "^1.1.21" }, "dependencies": { + "async-shelljs": "^0.1.2", "clone": "^2.1.2", "culture-info": "0.0.4", "dedent": "^0.7.0", @@ -399,7 +399,6 @@ "mustache": "^2.3.2", "puppeteer": "^1.9.0", "rc": "^1.2.8", - "shelljs": "^0.8.2", "string-template": "^1.0.0", "transliteration": "^1.6.6", "twemoji": "^2.5.1", diff --git a/src/MarkdownConverter/ConversionTask.ts b/src/MarkdownConverter/ConversionTask.ts index bbea1565..6d3bef53 100644 --- a/src/MarkdownConverter/ConversionTask.ts +++ b/src/MarkdownConverter/ConversionTask.ts @@ -28,6 +28,7 @@ import { Converter } from "./Converter"; import { DestinationOrigin } from "./DestinationOrigin"; import { getMarkdownExtensionContributions } from "./MarkdownExtensions"; import { PuppeteerTask } from "./PuppeteerTask"; +import { Utilities } from "./Utilities"; /** * Represents a task which is able to convert markdown-files. @@ -198,6 +199,7 @@ export abstract class ConversionTask extends PuppeteerTask converter.Document.Quality = Settings.Default.ConversionQuality; Object.assign(converter.Document.Attributes, Settings.Default.Attributes); + converter.Document.Attributes.Author = converter.Document.Attributes.Author || await Utilities.GetFullName(); converter.Document.Locale = new CultureInfo(Settings.Default.Locale); converter.Document.DateFormat = Settings.Default.DateFormat; diff --git a/src/MarkdownConverter/ConvertTask.ts b/src/MarkdownConverter/ConvertTask.ts index 87a42c49..4886d3b4 100644 --- a/src/MarkdownConverter/ConvertTask.ts +++ b/src/MarkdownConverter/ConvertTask.ts @@ -43,6 +43,6 @@ export class ConvertTask extends ConversionTask public async ExecuteTask() { - this.Convert(this.GetMarkdownDocument()); + await this.Convert(this.GetMarkdownDocument()); } } \ No newline at end of file diff --git a/src/MarkdownConverter/Utilities.ts b/src/MarkdownConverter/Utilities.ts index 0b589e0d..f5f1e465 100644 --- a/src/MarkdownConverter/Utilities.ts +++ b/src/MarkdownConverter/Utilities.ts @@ -1,4 +1,4 @@ -import * as shell from "shelljs"; +import * as shell from "async-shelljs"; /** * Provides static methods. @@ -11,39 +11,30 @@ export class Utilities private static envVars: string[] = [ "GIT_AUTHOR_NAME", "GIT_COMMITTER_NAME", - "HGUSER", // Mercurial - "C9_USER" // Cloud9 + "HGUSER", + "C9_USER" ]; /** * Gets the full name of the current user. */ - public static get FullName(): string + public static async GetFullName(): Promise { - let result: string; let current: IteratorResult; - let functionArray = this.functions(); + let iterator = this.TryGetUsername(); + do { - try + current = await iterator.next(); + + if (current.value !== null) { - current = functionArray.next(); - result = current.value.trim(); + return current.value.trim(); } - catch (e) { } } - while (!(current.done || result)); - - return result; - } + while (!current.done); - /** - * Tries to figure out the username using wmic. - */ - private static CheckWmic(): string - { - let fullname = shell.exec('wmic useraccount where name="%username%" get fullname').stdout.replace("FullName", ""); - return fullname; + return ""; } /** @@ -51,54 +42,77 @@ export class Utilities */ private static CheckEnv(): string { - let env = process.env; - let varName = this.envVars.find(x => x in env); - let fullname = varName && env[varName]; + let environment = process.env; + let variableNames = this.envVars.filter(x => x in environment); + + for (let variableName of variableNames) + { + if (environment[variableName] !== null) + { + return environment[variableName]; + } + } - return fullname; + return null; } /** - * Tries to figure out the username using the npm-configuration + * Tries to figure out the username using git's global settings */ - private static CheckAuthorName(): string + private static async CheckGit() { - let fullname = require("rc")("npm")["init-author-name"]; - return fullname; + return await shell.asyncExec("git config --global user.name"); } /** - * Tries to figure out the username using git's global settings + * Tries to figure out the username using wmic. */ - private static CheckGit(): string + private static async CheckWmic() { - return shell.exec("git config --global user.name").stdout; + return (await shell.asyncExec('wmic useraccount where name="%username%" get fullname')).replace("FullName", "").trim(); } /** * Tries to figure out the username using osascript. */ - private static CheckOsaScript(): string + private static async CheckOsaScript() { - return shell.exec("osascript -e long user name of (system info)").stdout; + return await shell.asyncExec("osascript -e long user name of (system info)"); } /** * A set of functions to figure out the user-name. */ - private static * functions() + private static async* TryGetUsername() { - yield this.CheckEnv(); - yield this.CheckAuthorName(); - if (process.platform === "win32") - { - yield this.CheckWmic(); - } + yield Utilities.CheckEnv(); - if (process.platform === "darwin") + yield* (async function*() { - yield this.CheckOsaScript(); - } - return this.CheckGit(); + let methods: (() => Promise)[] = []; + methods.push(Utilities.CheckGit); + + if (process.platform === "win32") + { + methods.push(Utilities.CheckWmic); + } + + if (process.platform === "darwin") + { + methods.push(Utilities.CheckOsaScript); + } + + for (let method of methods) + { + try + { + yield await method(); + } + catch + { + yield null; + } + } + })(); } } \ No newline at end of file diff --git a/src/System/Drawing/Document.ts b/src/System/Drawing/Document.ts index 1d86a244..78e750a9 100644 --- a/src/System/Drawing/Document.ts +++ b/src/System/Drawing/Document.ts @@ -8,7 +8,6 @@ import * as OS from "os"; import * as Path from "path"; import { TextDocument } from "vscode"; import * as YAML from "yamljs"; -import { Utilities } from "../../MarkdownConverter/Utilities"; import { ResourceManager } from "../../Properties/ResourceManager"; import { DateTimeFormatter } from "../Globalization/DateTimeFormatter"; import { FileException } from "../IO/FileException"; @@ -35,10 +34,7 @@ export class Document extends Renderable /** * The attributes of the document. */ - private attributes: any = { - Author: Utilities.FullName, - CreationDate: new Date() - }; + private attributes: { [key: string]: any } = {}; /** * The format to print the date. @@ -174,7 +170,7 @@ export class Document extends Renderable { return this.quality; } - + public set Quality(value: number) { this.quality = value; diff --git a/src/extension.ts b/src/extension.ts index 0f6ed06a..b654932a 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -106,4 +106,5 @@ export let extension = new Extension(); export let activate = async (context: ExtensionContext) => await extension.Activate(context); -export let deactivate = async () => await extension.Dispose(); \ No newline at end of file +export let deactivate = async () => await extension.Dispose(); +(Symbol as any).asyncIterator = Symbol.asyncIterator || Symbol.for("Symbol.asyncIterator"); \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 2c7ff754..769ecd07 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,8 +8,10 @@ "declaration": true, "lib": [ "es7", + "esnext", "dom" ], - "noUnusedLocals": true + "noUnusedLocals": true, + "downlevelIteration": true } } \ No newline at end of file From d6212e6713d9e212dca48f524f54435cc1f61d75 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 31 Oct 2018 13:17:03 +0100 Subject: [PATCH 14/77] Improve the workflow of the converter --- package-lock.json | 2 +- src/MarkdownConverter/ConversionTask.ts | 3 +- src/MarkdownConverter/Converter.ts | 317 ++++++++++++++++-------- 3 files changed, 217 insertions(+), 105 deletions(-) diff --git a/package-lock.json b/package-lock.json index 019a40be..28814a73 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,7 @@ }, "@types/events": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/@types/events/-/events-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/@types/events/-/events-1.2.0.tgz", "integrity": "sha512-KEIlhXnIutzKwRbQkGWb/I4HFqBuUykAdHgDED6xqwXJfONCjF5VoE0cXEiurh3XauygxzeDzgtXUqvLkxFzzA==" }, "@types/fs-extra": { diff --git a/src/MarkdownConverter/ConversionTask.ts b/src/MarkdownConverter/ConversionTask.ts index 6d3bef53..3046bc51 100644 --- a/src/MarkdownConverter/ConversionTask.ts +++ b/src/MarkdownConverter/ConversionTask.ts @@ -120,7 +120,7 @@ export abstract class ConversionTask extends PuppeteerTask let tasks: Promise[] = []; let fileName = Path.parse(document.fileName).name; let converter = await this.LoadConverter(documentRoot, document); - + await converter.Initialize(); await FileSystem.ensureDir(destinationPath); for (let type of Settings.Default.ConversionType) @@ -179,6 +179,7 @@ export abstract class ConversionTask extends PuppeteerTask } await Promise.all(tasks); + await converter.Dispose(); } /** diff --git a/src/MarkdownConverter/Converter.ts b/src/MarkdownConverter/Converter.ts index 1508bbc6..72b44710 100644 --- a/src/MarkdownConverter/Converter.ts +++ b/src/MarkdownConverter/Converter.ts @@ -25,6 +25,31 @@ export class Converter */ private document: Document; + /** + * The web-server of the converter. + */ + private webServer: http.Server; + + /** + * The port-number the web-server runs on. + */ + private portNumber: number; + + /** + * The browser which is used to perform the conversion. + */ + private browser: Puppeteer.Browser; + + /** + * A value indicating whether the converter has been initialized. + */ + private initialized: boolean = false; + + /** + * A value indicating whether the converter has been disposed. + */ + private disposed: boolean = false; + /** * Initializes a new instance of the Constructor class with a filepath. * @@ -45,11 +70,6 @@ export class Converter return this.documentRoot; } - public set DocumentRoot(value: string) - { - this.documentRoot = value; - } - /** * Gets the document which is converted by this `Converter`. */ @@ -59,132 +79,223 @@ export class Converter } /** - * Starts the conversion. - * - * @param conversionType - * The type to convert the document to. - * - * @param path - * The path to save the converted file to. + * Gets a value indicating whether the converter has been initialized. */ - public async Start(conversionType: ConversionType, path: string): Promise + public get Initialized(): boolean + { + return this.initialized; + } + + /** + * Gets a value indicating whether the converter has been disposed. + */ + public get Disposed(): boolean + { + return this.disposed; + } + + /** + * Gets the link to the document to convert. + */ + public get URL(): string + { + return this.Initialized ? (URL.resolve( + `http://localhost:${this.PortNumber}/`, + ((!isNullOrUndefined(this.Document.FileName) && !isNullOrUndefined(this.DocumentRoot)) ? + Path.relative(this.DocumentRoot, this.Document.FileName) : "index") + ".html")) : null; + } + + /** + * Gets or sets the port-number the web-server runs on. + */ + public get PortNumber(): number + { + return this.Initialized ? this.portNumber : null; + } + + /** + * Gets or sets the web-server of the converter. + */ + protected get WebServer(): http.Server + { + return this.Initialized ? this.webServer : null; + } + + /** + * Gets the browser which is used to perform the conversion. + */ + protected get Browser() { - let port = await PortFinder(); - let htmlCode = await this.Document.Render(); + return this.Initialized ? this.browser : null; + } - if (conversionType !== ConversionType.HTML) + /** + * Initializes the converter. + */ + public async Initialize() + { + if (this.Initialized || this.Disposed) { - let server = (Server.createServer({ + throw new Error("The converter cannot be re-initialized."); + } + else + { + this.portNumber = await PortFinder(); + this.webServer = (Server.createServer({ root: this.DocumentRoot, cors: true }) as any).server as http.Server; - server.listen(port, "localhost"); + this.webServer.listen(this.portNumber, "localhost"); + + let browserArguments = ["--disable-web-security"]; try { - let browser: Puppeteer.Browser; - let browserArguments = ["--disable-web-security"]; + this.browser = await Puppeteer.launch({ + args: browserArguments + }); + } + catch + { + this.browser = await Puppeteer.launch({ + args: browserArguments.concat(["--no-sandbox"]) + }); + } - try + this.initialized = true; + } + } + + /** + * Disposes the converter. + */ + public async Dispose() + { + if (!this.Initialized) + { + throw new Error("The converter must be initialized in order to be disposed."); + } + else + { + await this.browser.close(); + await new Promise( + (resolve) => { - browser = await Puppeteer.launch({ args: browserArguments }); - } - catch + this.WebServer.close(() => resolve()); + }); + + this.initialized = false; + this.disposed = true; + } + } + + /** + * Starts the conversion. + * + * @param conversionType + * The type to convert the document to. + * + * @param path + * The path to save the converted file to. + */ + public async Start(conversionType: ConversionType, path: string): Promise + { + if (!this.Initialized) + { + throw new Error("The converter must be initialized in order to use it."); + } + else + { + if (conversionType !== ConversionType.HTML) + { + try { - browser = await Puppeteer.launch({ args: browserArguments.concat(["--no-sandbox"]) }); - } + let page = await this.Browser.newPage(); - let page = await browser.newPage(); - let url = URL.resolve( - `http://localhost:${port}/`, - ((!isNullOrUndefined(this.Document.FileName) && (!isNullOrUndefined(this.DocumentRoot))) ? - Path.relative(this.DocumentRoot, this.Document.FileName) : "index") + ".html"); + page.on( + "request", + async request => + { + if (request.url() === this.URL) + { + await request.respond( + { + body: await this.Document.Render() + }); + } + else + { + await request.continue(); + } + }); + + await page.setRequestInterception(true); + await page.goto(this.URL, { waitUntil: "networkidle0", timeout: 0 }); - page.setRequestInterception(true); - page.on( - "request", - request => + switch (conversionType) { - if (request.url() === url) - { - request.respond({ - body: htmlCode - }); - } else - { - request.continue(); - } - }); + case ConversionType.PDF: + let styles = ` + `; + let pdfOptions: Puppeteer.PDFOptions = { + margin: { + top: this.Document.Paper.Margin.Top, + right: this.Document.Paper.Margin.Right, + bottom: this.Document.Paper.Margin.Bottom, + left: this.Document.Paper.Margin.Left + }, + printBackground: true, + path + }; - await page.goto(url, { waitUntil: "networkidle0", timeout: 0 }); + Object.assign(pdfOptions, this.Document.Paper.Format.PDFOptions); - switch (conversionType) - { - case ConversionType.PDF: - let styles = ` - `; - let pdfOptions: Partial = { - margin: { - top: this.Document.Paper.Margin.Top, - right: this.Document.Paper.Margin.Right, - bottom: this.Document.Paper.Margin.Bottom, - left: this.Document.Paper.Margin.Left - }, - printBackground: true, - path - }; - - Object.assign(pdfOptions, this.Document.Paper.Format.PDFOptions); - - if (this.Document.HeaderFooterEnabled) - { - pdfOptions.displayHeaderFooter = true; - pdfOptions.headerTemplate = styles + await this.Document.Header.Render(); - pdfOptions.footerTemplate = styles + await this.Document.Footer.Render(); - } - - await page.pdf(pdfOptions); - break; - default: - let screenshotOptions: Partial = { - fullPage: true, - path - }; - - if (conversionType !== ConversionType.PNG) - { - screenshotOptions.quality = this.Document.Quality; - } - await page.screenshot(screenshotOptions); - break; - } - } - catch (exception) - { - if ("path" in exception) - { - throw new FileException(null, exception["path"]); + await page.pdf(pdfOptions); + break; + default: + let screenshotOptions: Puppeteer.ScreenshotOptions = { + fullPage: true, + path + }; + + if (conversionType !== ConversionType.PNG) + { + screenshotOptions.quality = this.Document.Quality; + } + + await page.screenshot(screenshotOptions); + break; + } } - else + catch (exception) { - throw exception; + if ("path" in exception) + { + throw new FileException(null, exception["path"]); + } + else + { + throw exception; + } } } - finally + else { - server.close(); + await FS.writeFile(path, await this.Document.Render()); } } - else - { - await FS.writeFile(path, htmlCode); - } } } \ No newline at end of file From ac81dac3c004dcfd81d12bf6cd459026c483d2f9 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 31 Oct 2018 15:43:37 +0100 Subject: [PATCH 15/77] Rework the lint-rules --- tslint.json | 46 +++++++++++----------------------------------- 1 file changed, 11 insertions(+), 35 deletions(-) diff --git a/tslint.json b/tslint.json index 57c9d8d6..788b16b7 100644 --- a/tslint.json +++ b/tslint.json @@ -3,53 +3,29 @@ "extends": [ "tslint:recommended" ], - "jsRules": { + "rules": { + "array-type": false, + "arrow-parens": false, "eofline": false, "forin": false, - "one-line": false, - "trailing-comma": false, - "no-empty-interface": false, - "no-empty": false, - "no-trailing-whitespace": false, - "prefer-const": false, - "object-literal-sort-keys": false, - "ordered-imports": false, + "max-classes-per-file": false, "max-line-length": false, - "arrow-parens": false, - "array-type": false, "member-ordering": false, "no-bitwise": false, "no-console": false, - "no-unused-variable": { - "severity": "warn" - } - }, - "rules": { - "eofline": false, - "forin": false, - "one-line": false, - "trailing-comma": false, + "no-default-export": true, "no-empty-interface": false, "no-empty": false, - "no-trailing-whitespace": false, - "prefer-const": false, - "object-literal-sort-keys": false, - "ordered-imports": { - "options": { - "import-sources-order": "case-insensitive", - "named-imports-order": "case-insensitive" - } - }, - "max-line-length": false, - "arrow-parens": false, - "array-type": false, - "member-ordering": false, - "no-bitwise": false, - "no-console": false, "no-string-literal": false, + "no-trailing-whitespace": false, "no-unused-expression": { "severity": "warning" }, + "object-literal-sort-keys": false, + "one-line": false, + "ordered-imports": true, + "prefer-const": false, + "trailing-comma": false, "unified-signatures": false } } \ No newline at end of file From 459f69197c4c6a125a032f5f69bf797d0678b01c Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 14 Jan 2019 13:04:41 +0100 Subject: [PATCH 16/77] Rework the ignore-files --- .gitignore | 280 +++++++++-------------------------------------------- .npmignore | 81 ++++++++++++++++ 2 files changed, 125 insertions(+), 236 deletions(-) create mode 100644 .npmignore diff --git a/.gitignore b/.gitignore index 32a0fe05..9679e6ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,259 +1,67 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - # Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -bld/ [Oo]ut/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ - -# Visual Studio 2015 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# DNX -project.lock.json -artifacts/ -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj +# Logs +logs *.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode +npm-debug.log* +yarn-debug.log* +yarn-error.log* -# TeamCity is a build add-in -_TeamCity* +# Runtime data +pids +*.pid +*.seed +*.pid.lock -# DotCover is a Code Coverage Tool -*.dotCover +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* +# Coverage directory used by tools like istanbul +coverage -# MightyMoose -*.mm.* -AutoTest.Net/ +# nyc test coverage +.nyc_output -# Web workbench (sass) -.sass-cache/ +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt -# Installshield output folder -[Ee]xpress/ +# Bower dependency directory (https://bower.io/) +bower_components -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html +# node-waf configuration +.lock-wscript -# Click-Once directory -publish/ +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config -# NuGet v3's project.json files produces more ignoreable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.pfx -*.publishsettings +# Dependency directories node_modules/ -orleans.codegen.cs - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml +jspm_packages/ -# Node.js Tools for Visual Studio -.ntvs_analysis.dat +# TypeScript v1 declaration files +typings/ -# Visual Studio 6 build log -*.plg +# Optional npm cache directory +.npm -# Visual Studio 6 workspace options file -*.opt +# Optional eslint cache +.eslintcache -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions +# Optional REPL history +.node_repl_history -# Paket dependency manager -.paket/paket.exe -paket-files/ +# Output of 'npm pack' +*.tgz -# FAKE - F# Make -.fake/ +# Yarn Integrity file +.yarn-integrity -# JetBrains Rider -.idea/ -*.sln.iml +# dotenv environment variables file +.env -# Compiled TypeScript-Files -[Ll]ib/ +# next.js build output +.next -# Visual Studio Code Test cache/options directory -.vscode-test \ No newline at end of file +# Visual Studio Code Experimental Instance +.vscode-test/ diff --git a/.npmignore b/.npmignore new file mode 100644 index 00000000..e104c3ac --- /dev/null +++ b/.npmignore @@ -0,0 +1,81 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# next.js build output +.next + +# Source-files +[Ss]rc/ + +# TypeScript config-files +tsconfig.json +tslint.json + +# Source-maps +[Oo]ut/**/*.js.map + +# Unit-Tests +test/ +[Oo]ut/tests/ + +# Visual Studio Code-Environment +.vscode/ + +# Visual Studio Code Experimental Instance +.vscode-test/ From d0a728da7ebb105d1e7617c4064e9230880f9c0a Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 14 Jan 2019 13:05:06 +0100 Subject: [PATCH 17/77] Create a more memorable description --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e5124cd8..9d76a420 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # MarkdownConverter -Provides the functionallity to convert MarkDown-files to html, png, or pdf using [Visual Studio Code][VSCode]. +A markdown-converter for [Visual Studio Code][VSCode] ## What's `MarkdownConverter`? > MarkdownConverter is a Visual Studio Code-extension which allows you to export your Markdown-file as PDF-, HTML or Image-files. From c2dadea77e1097a81bba986baf9e651a5f033a0f Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 14 Jan 2019 13:22:06 +0100 Subject: [PATCH 18/77] Rework the tslint and ts-configuration --- tsconfig.json | 25 +++++-- tslint.json | 184 +++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 186 insertions(+), 23 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 769ecd07..de1bbffc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,17 +1,28 @@ { + "compileOnSave": true, "compilerOptions": { - "target": "es6", + "rootDir": "./src", "module": "commonjs", - "sourceRoot": "src", - "outDir": "out", - "sourceMap": true, - "declaration": true, "lib": [ "es7", - "esnext", "dom" ], - "noUnusedLocals": true, + "plugins": [ + { + "name": "typescript-tslint-plugin" + } + ], + "target": "es6", + "outDir": "./out", + "declaration": true, + "sourceMap": true, + "resolveJsonModule": true, + "forceConsistentCasingInFileNames": true, + "alwaysStrict": true, + "strictFunctionTypes": true, + "noImplicitAny": true, + "noImplicitReturns": true, + "noImplicitThis": true, "downlevelIteration": true } } \ No newline at end of file diff --git a/tslint.json b/tslint.json index 788b16b7..8a0ffbfc 100644 --- a/tslint.json +++ b/tslint.json @@ -1,31 +1,183 @@ { "defaultSeverity": "warning", - "extends": [ - "tslint:recommended" - ], + "extends": "tslint:recommended", "rules": { - "array-type": false, - "arrow-parens": false, - "eofline": false, + // General + "member-ordering": { + "options": { + "order": [ + "public-static-field", + "public-instance-field", + "protected-static-field", + "protected-instance-field", + "private-static-field", + "private-instance-field", + "public-constructor", + "protected-constructor", + "private-constructor", + "public-static-method", + "public-instance-method", + "protected-static-method", + "protected-instance-method", + "private-static-method", + "private-instance-method" + ] + } + }, + "no-empty-interface": false, + "no-inferrable-types": true, + // Functionality + "await-promise": true, + "ban-comma-operator": true, "forin": false, + "no-bitwise": false, + "no-console": false, + "no-duplicate-switch-case": true, + "no-dynamic-delete": true, + "no-empty": false, + "no-floating-promises": false, + "no-for-in-array": false, + "no-return-await": true, + "no-shadowed-variable": false, + "no-string-literal": false, + "no-sparse-arrays": true, + "restrict-plus-operands": true, + "triple-equals": true, + // Maintainability + "eofline": false, "max-classes-per-file": false, "max-line-length": false, - "member-ordering": false, + "no-default-export": true, + "no-duplicate-imports": true, + "no-trailing-whitespace": true, + "object-literal-sort-keys": false, + "prefer-const": false, + "trailing-comma": false, + // Style + "array-type": false, + "arrow-parens": false, + "comment-format": { + "options": [ + "check-space", + "check-uppercase" + ] + }, + "completed-docs": { + "options": [ + "classes", + "enum-members", + "enums", + "functions", + "interfaces", + "methods", + "properties", + "types", + "variables" + ] + }, + "match-default-export-name": true, + "no-boolean-literal-compare": true, + "no-parameter-properties": true, + "no-redundant-jsdoc": true, + "no-reference-import": true, + "no-unnecessary-qualifier": true, + "no-unnecessary-type-assertion": true, + "one-line": false, + "number-literal-format": true, + "prefer-object-spread": true, + "return-undefined": true, + "space-before-function-paren": { + "options": { + "anonymous": "always", + "asyncArrow": "always", + "constructor": "never", + "method": "never", + "named": "never" + } + } + }, + "jsRules": { + // General + "member-ordering": { + "options": { + "order": [ + "public-static-field", + "protected-static-field", + "private-static-field", + "public-instance-field", + "protected-instance-field", + "private-instance-field", + "public-constructor", + "protected-constructor", + "private-constructor", + "public-static-method", + "protected-static-method", + "private-static-method", + "public-instance-method", + "protected-instance-method", + "private-instance-method" + ] + } + }, + "await-promise": true, + // Functionality + "ban-comma-operator": true, + "forin": false, "no-bitwise": false, "no-console": false, - "no-default-export": true, - "no-empty-interface": false, + "no-duplicate-switch-case": true, + "no-dynamic-delete": true, "no-empty": false, + "no-for-in-array": false, + "no-return-await": true, + "no-shadowed-variable": false, "no-string-literal": false, - "no-trailing-whitespace": false, - "no-unused-expression": { - "severity": "warning" - }, + "no-sparse-arrays": true, + "restrict-plus-operands": true, + "triple-equals": true, + // Maintainability + "eofline": false, + "max-classes-per-file": false, + "max-line-length": false, + "no-default-export": true, + "no-duplicate-imports": true, + "no-trailing-whitespace": true, "object-literal-sort-keys": false, - "one-line": false, - "ordered-imports": true, "prefer-const": false, "trailing-comma": false, - "unified-signatures": false + // Style + "arrow-parens": false, + "comment-format": { + "options": [ + "check-space", + "check-uppercase" + ] + }, + "completed-docs": { + "options": [ + "classes", + "enum-members", + "enums", + "functions", + "interfaces", + "methods", + "properties", + "types", + "variables" + ] + }, + "one-line": false, + "number-literal-format": true, + "prefer-method-signature": true, + "return-undefined": true, + "space-before-function-paren": { + "options": { + "anonymous": "always", + "asyncArrow": "always", + "constructor": "never", + "method": "never", + "named": "never" + } + } } } \ No newline at end of file From 0e1eda583a1052dfc208a0bc4f54d0e6593dc8b9 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 14 Jan 2019 14:51:16 +0100 Subject: [PATCH 19/77] Adjust the code according to the new config --- src/MarkdownConverter/ConversionTask.ts | 22 +-- src/MarkdownConverter/PuppeteerTask.ts | 20 +-- src/MarkdownConverter/Task.ts | 4 +- src/MarkdownConverter/Utilities.ts | 10 +- src/Properties/Settings.ts | 18 +-- src/System/Drawing/Document.ts | 67 ++++---- src/System/Globalization/DateTimeFormatter.ts | 128 +++++++-------- src/markdown-it-checkbox.d.ts | 5 + src/markdown-it-emoji.d.ts | 5 + src/markdown-it-table-of-contents.d.ts | 5 + src/twemoji.d.ts | 153 ++++++++++++++++++ tsconfig.json | 1 + 12 files changed, 307 insertions(+), 131 deletions(-) create mode 100644 src/markdown-it-checkbox.d.ts create mode 100644 src/markdown-it-emoji.d.ts create mode 100644 src/markdown-it-table-of-contents.d.ts create mode 100644 src/twemoji.d.ts diff --git a/src/MarkdownConverter/ConversionTask.ts b/src/MarkdownConverter/ConversionTask.ts index 3046bc51..8dee8eba 100644 --- a/src/MarkdownConverter/ConversionTask.ts +++ b/src/MarkdownConverter/ConversionTask.ts @@ -37,7 +37,7 @@ export abstract class ConversionTask extends PuppeteerTask { /** * Initializes a new instance of the `ConversionTask` class. - * + * * @param extension * The extension the task belongs to. */ @@ -103,11 +103,11 @@ export abstract class ConversionTask extends PuppeteerTask while (isNullOrUndefined(origin)) { - origin = await window.showInputBox({ + origin = await (window.showInputBox({ ignoreFocusOut: true, prompt: ResourceManager.Resources.Get("DestinationPath"), placeHolder: ResourceManager.Resources.Get("DestinationPathExample") - }); + }) as Promise); } destinationPath = Path.resolve(origin, Settings.Default.DestinationPath); @@ -152,9 +152,9 @@ export abstract class ConversionTask extends PuppeteerTask (async () => { - let result = await window.showInformationMessage( + let result = await (window.showInformationMessage( Format(ResourceManager.Resources.Get("SuccessMessage"), ConversionType[type], destination), - ResourceManager.Resources.Get("OpenFileLabel")); + ResourceManager.Resources.Get("OpenFileLabel")) as Promise); if (result === ResourceManager.Resources.Get("OpenFileLabel")) { @@ -184,13 +184,13 @@ export abstract class ConversionTask extends PuppeteerTask /** * Loads a converter according to the settings. - * + * * @param documentRoot * The path to the root of the document. - * + * * @param document * The document to convert. - * + * * @returns * A converter generated by the settings. */ @@ -228,7 +228,7 @@ export abstract class ConversionTask extends PuppeteerTask exception instanceof Error && "path" in exception) { - throw new FileException(null, exception["path"]); + throw new FileException(null, (exception as any)["path"]); } else { @@ -285,7 +285,7 @@ export abstract class ConversionTask extends PuppeteerTask protected async LoadParser(): Promise { let parser: MarkdownIt.MarkdownIt; - let slugify = text => + let slugify = (text: string) => Transliteration.slugify( text, { @@ -338,7 +338,7 @@ export abstract class ConversionTask extends PuppeteerTask containerClass: Settings.Default.TocSettings.Class, markerPattern: Settings.Default.TocSettings.Indicator, listType: Settings.Default.TocSettings.ListType === ListType.Ordered ? "ol" : "ul", - slugify: heading => slugifier.CreateSlug(heading) + slugify: (heading: string) => slugifier.CreateSlug(heading) }); } diff --git a/src/MarkdownConverter/PuppeteerTask.ts b/src/MarkdownConverter/PuppeteerTask.ts index 7aed1686..8b76efe9 100644 --- a/src/MarkdownConverter/PuppeteerTask.ts +++ b/src/MarkdownConverter/PuppeteerTask.ts @@ -14,7 +14,7 @@ export abstract class PuppeteerTask extends Task { /** * Initializes a new instance of the `PuppeteerTask` class. - * + * * @param extension * The extension this task belongs to. */ @@ -35,16 +35,16 @@ export abstract class PuppeteerTask extends Task await this.ExecuteTask(); } else if ( - await window.showInformationMessage( + await (window.showInformationMessage( ResourceManager.Resources.Get("UpdateMessage"), - ResourceManager.Resources.Get("No")) === ResourceManager.Resources.Get("Yes")) + ResourceManager.Resources.Get("No")) as Promise) === ResourceManager.Resources.Get("Yes")) { let revision = this.Extension.ChromiumRevision; let success = false; do { - await window.withProgress( + await (window.withProgress( { location: ProgressLocation.Notification, title: Format(ResourceManager.Resources.Get("UpdateRunning"), revision) @@ -58,7 +58,7 @@ export abstract class PuppeteerTask extends Task await browserFetcher.download( revision, - (downloadBytes, totalBytes) => + (downloadBytes: number, totalBytes: number) => { let newProgress = Math.floor((downloadBytes / totalBytes) * 100); @@ -79,15 +79,15 @@ export abstract class PuppeteerTask extends Task { success = false; } - }); + }) as Promise); } while ( !await FileSystem.pathExists(Puppeteer.executablePath()) && !success && - await window.showWarningMessage( + await (window.showWarningMessage( ResourceManager.Resources.Get("UpdateFailed"), ResourceManager.Resources.Get("Yes"), - ResourceManager.Resources.Get("No")) === ResourceManager.Resources.Get("Yes")); + ResourceManager.Resources.Get("No")) as Promise) === ResourceManager.Resources.Get("Yes")); } } catch (exception) @@ -104,7 +104,7 @@ export abstract class PuppeteerTask extends Task } else { - message = "" + exception; + message = `${exception}`; } window.showErrorMessage(message); @@ -114,5 +114,5 @@ export abstract class PuppeteerTask extends Task /** * Executes the task. */ - protected abstract async ExecuteTask(); + protected abstract async ExecuteTask(): Promise; } \ No newline at end of file diff --git a/src/MarkdownConverter/Task.ts b/src/MarkdownConverter/Task.ts index 564134e7..e75a6e7d 100644 --- a/src/MarkdownConverter/Task.ts +++ b/src/MarkdownConverter/Task.ts @@ -12,7 +12,7 @@ export abstract class Task /** * Initializes a new instance of the `Task` class. - * + * * @param extension * The extension this task belongs to. */ @@ -37,5 +37,5 @@ export abstract class Task /** * Executes the task. */ - public abstract async Execute(); + public abstract async Execute(): Promise; } \ No newline at end of file diff --git a/src/MarkdownConverter/Utilities.ts b/src/MarkdownConverter/Utilities.ts index f5f1e465..055af3d6 100644 --- a/src/MarkdownConverter/Utilities.ts +++ b/src/MarkdownConverter/Utilities.ts @@ -22,7 +22,7 @@ export class Utilities { let current: IteratorResult; let iterator = this.TryGetUsername(); - + do { current = await iterator.next(); @@ -44,7 +44,7 @@ export class Utilities { let environment = process.env; let variableNames = this.envVars.filter(x => x in environment); - + for (let variableName of variableNames) { if (environment[variableName] !== null) @@ -61,7 +61,7 @@ export class Utilities */ private static async CheckGit() { - return await shell.asyncExec("git config --global user.name"); + return shell.asyncExec("git config --global user.name"); } /** @@ -77,7 +77,7 @@ export class Utilities */ private static async CheckOsaScript() { - return await shell.asyncExec("osascript -e long user name of (system info)"); + return shell.asyncExec("osascript -e long user name of (system info)"); } /** @@ -87,7 +87,7 @@ export class Utilities { yield Utilities.CheckEnv(); - yield* (async function*() + yield* (async function* () { let methods: (() => Promise)[] = []; methods.push(Utilities.CheckGit); diff --git a/src/Properties/Settings.ts b/src/Properties/Settings.ts index cf1d5a7a..b8fbd385 100644 --- a/src/Properties/Settings.ts +++ b/src/Properties/Settings.ts @@ -39,7 +39,7 @@ export class Settings */ public get DestinationOrigin(): DestinationOrigin { - return DestinationOrigin[this.getConfigEntry("DestinationOrigin")]; + return (DestinationOrigin as any)[this.getConfigEntry("DestinationOrigin")]; } /** @@ -76,7 +76,7 @@ export class Settings for (let conversionType of conversionTypes) { - types.push(ConversionType[conversionType]); + types.push((ConversionType as any)[conversionType]); } return types; @@ -103,7 +103,7 @@ export class Settings */ public get EmojiType(): EmojiType { - return EmojiType[this.getConfigEntry("Parser.EmojiType")]; + return (EmojiType as any)[this.getConfigEntry("Parser.EmojiType")]; } /** @@ -125,25 +125,25 @@ export class Settings { let width: string = this.getConfigEntry("Document.Paper.PaperFormat.Width"); let height: string = this.getConfigEntry("Document.Paper.PaperFormat.Height"); - + let format = new CustomPaperFormat(width, height); paper.Format = format; } catch (exception) { let format = new StandardizedPaperFormat(); - format.Format = StandardizedFormatType[this.getConfigEntry("Document.Paper.PaperFormat.Format")]; - format.Orientation = PaperOrientation[this.getConfigEntry("Document.Paper.PaperFormat.Orientation", PaperOrientation[PaperOrientation.Portrait])]; + format.Format = (StandardizedFormatType as any)[this.getConfigEntry("Document.Paper.PaperFormat.Format")]; + format.Orientation = (PaperOrientation as any)[this.getConfigEntry("Document.Paper.PaperFormat.Orientation", PaperOrientation[PaperOrientation.Portrait])]; paper.Format = format; } - for (let side of [ "Top", "Right", "Bottom", "Left" ]) + for (let side of ["Top", "Right", "Bottom", "Left"]) { let configKey = "Document.Paper.Margin." + side; if (this.config.has(configKey)) { - paper.Margin[side] = this.config.get(configKey); + (paper.Margin as any)[side] = this.config.get(configKey); } } @@ -239,7 +239,7 @@ export class Settings * * @param key * The key of the entry. - * + * * @param defaultValue * The default value to return. */ diff --git a/src/System/Drawing/Document.ts b/src/System/Drawing/Document.ts index 78e750a9..d17c2614 100644 --- a/src/System/Drawing/Document.ts +++ b/src/System/Drawing/Document.ts @@ -29,7 +29,7 @@ export class Document extends Renderable /** * The quality of the document. */ - private quality: number = 90; + private quality = 90; /** * The attributes of the document. @@ -39,7 +39,7 @@ export class Document extends Renderable /** * The format to print the date. */ - private dateFormat: string = "Default"; + private dateFormat = "Default"; /** * The language to print values. @@ -54,7 +54,7 @@ export class Document extends Renderable /** * A value indicating whether headers and footers are enabled. */ - private headerFooterEnabled: boolean = false; + private headerFooterEnabled = false; /** * The header of the document. @@ -89,6 +89,9 @@ export class Document extends Renderable ResourceManager.Files.Get("SystemStyle") ]; + /** + * The ecma-scripts of the document. + */ private scripts: string[] = []; /** @@ -98,10 +101,10 @@ export class Document extends Renderable /** * Initializes a new instance of the Document class with a file-path and a configuration. - * + * * @param document * The `TextDocument` to load the info from. - * + * * @param config * The configuration to set. */ @@ -278,6 +281,7 @@ export class Document extends Renderable { return this.styleSheets; } + public set StyleSheets(value: string[]) { this.styleSheets = value; @@ -290,37 +294,12 @@ export class Document extends Renderable { return this.scripts; } + public set Scripts(value: string[]) { this.scripts = value; } - /** - * Renders content of the document. - * - * @param content - * The content which is to be rendered. - */ - protected async RenderText(content: string): Promise - { - let view = {}; - - for (let key in this.Attributes) - { - let value = this.Attributes[key]; - - if (value instanceof Date || Date.parse(value)) - { - value = new DateTimeFormatter(this.Locale).Format(this.DateFormat, new Date(value)); - } - - view[key] = value; - } - - let html = this.parser.render(content); - return Mustache.render(html, view); - } - /** * Renders the body of the document. */ @@ -377,4 +356,30 @@ export class Document extends Renderable return Mustache.render(this.Template, view); } + + /** + * Renders content of the document. + * + * @param content + * The content which is to be rendered. + */ + protected async RenderText(content: string): Promise + { + let view: { [key: string]: string } = {}; + + for (let key in this.Attributes) + { + let value = this.Attributes[key]; + + if (value instanceof Date || Date.parse(value)) + { + value = new DateTimeFormatter(this.Locale).Format(this.DateFormat, new Date(value)); + } + + view[key] = value; + } + + let html = this.parser.render(content); + return Mustache.render(html, view); + } } \ No newline at end of file diff --git a/src/System/Globalization/DateTimeFormatter.ts b/src/System/Globalization/DateTimeFormatter.ts index 48254729..0d745ddc 100644 --- a/src/System/Globalization/DateTimeFormatter.ts +++ b/src/System/Globalization/DateTimeFormatter.ts @@ -17,64 +17,12 @@ export class DateTimeFormatter */ private pattern: RegExp = /d{1,4}|f{1,7}|F{1,7}|h{1,2}|H{1,2}|m{1,2}|M{1,4}|s{1,2}|t{1,2}|y{1,5}|\\.|'[^']*'/g; - /** - * Returns the tokens to replace. - */ - private GetTokens(date: Date = new Date()): { [id: string]: string } - { - let getDay = () => - { - let day = date.getDay() - 1; - - if (day < 0) - { - day = 6; - } - - return day; - }; - - let dateTimeTokens: { [id: string]: string } = - { - get ddd() - { - return ResourceManager.Resources.Get("DateTime.DaysOfWeek.ShortNames", this.locale)[getDay()]; - }, - - get dddd() - { - return ResourceManager.Resources.Get("DateTime.DaysOfWeek.FullNames", this.locale)[getDay()]; - }, - - get MMM() - { - return ResourceManager.Resources.Get("DateTime.Months.ShortNames", this.locale)[date.getMonth()]; - }, - - get MMMM() - { - return ResourceManager.Resources.Get("DateTime.Months.FullNames", this.locale)[date.getMonth()]; - }, - - get t() - { - return ResourceManager.Resources.Get("DateTime.TimeDesignator.ShortNames", this.locale)[(date.getHours() < 12 ? 0 : 1)]; - }, - - get tt() - { - return ResourceManager.Resources.Get("DateTime.TimeDesignator.FullNames", this.locale)[(date.getHours() < 12 ? 0 : 1)]; - } - }; - return dateTimeTokens; - } - /** * Initializes a new instance of the DateTimeFormatter class with a locale and a resource-path. - * + * * @param locale * The locale to format the date. - * + * * @param resourcePath * The path to load the localized values from. */ @@ -86,12 +34,25 @@ export class DateTimeFormatter } } + /** + * Gets or sets the locale to format the date. + */ + public get Locale(): CultureInfo + { + return this.locale; + } + + public set Locale(value: CultureInfo) + { + this.locale = value; + } + /** * Formats a date-value. - * + * * @param date * The date to format. - * + * * @param formatString * The format-string to format the date-value. */ @@ -168,14 +129,55 @@ export class DateTimeFormatter } /** - * Gets or sets the locale to format the date. + * Returns the tokens to replace. */ - public get Locale(): CultureInfo - { - return this.locale; - } - public set Locale(value: CultureInfo) + private GetTokens(date: Date = new Date()): { [id: string]: string } { - this.locale = value; + let locale = this.Locale; + let getDay = () => + { + let day = date.getDay() - 1; + + if (day < 0) + { + day = 6; + } + + return day; + }; + + let dateTimeTokens: { [id: string]: string } = + { + get ddd() + { + return ResourceManager.Resources.Get("DateTime.DaysOfWeek.ShortNames", locale)[getDay()]; + }, + + get dddd() + { + return ResourceManager.Resources.Get("DateTime.DaysOfWeek.FullNames", locale)[getDay()]; + }, + + get MMM() + { + return ResourceManager.Resources.Get("DateTime.Months.ShortNames", locale)[date.getMonth()]; + }, + + get MMMM() + { + return ResourceManager.Resources.Get("DateTime.Months.FullNames", locale)[date.getMonth()]; + }, + + get t() + { + return ResourceManager.Resources.Get("DateTime.TimeDesignator.ShortNames", locale)[(date.getHours() < 12 ? 0 : 1)]; + }, + + get tt() + { + return ResourceManager.Resources.Get("DateTime.TimeDesignator.FullNames", locale)[(date.getHours() < 12 ? 0 : 1)]; + } + }; + return dateTimeTokens; } } \ No newline at end of file diff --git a/src/markdown-it-checkbox.d.ts b/src/markdown-it-checkbox.d.ts new file mode 100644 index 00000000..bd484a23 --- /dev/null +++ b/src/markdown-it-checkbox.d.ts @@ -0,0 +1,5 @@ +declare module "markdown-it-checkbox" +{ + let MarkdownItCheckbox: any; + export = MarkdownItCheckbox; +} \ No newline at end of file diff --git a/src/markdown-it-emoji.d.ts b/src/markdown-it-emoji.d.ts new file mode 100644 index 00000000..95af4010 --- /dev/null +++ b/src/markdown-it-emoji.d.ts @@ -0,0 +1,5 @@ +declare module "markdown-it-emoji" +{ + let MarkdownItCheckbox: any; + export = MarkdownItCheckbox; +} \ No newline at end of file diff --git a/src/markdown-it-table-of-contents.d.ts b/src/markdown-it-table-of-contents.d.ts new file mode 100644 index 00000000..e7173ce3 --- /dev/null +++ b/src/markdown-it-table-of-contents.d.ts @@ -0,0 +1,5 @@ +declare module "markdown-it-table-of-contents" +{ + let MarkdownItToc: any; + export = MarkdownItToc; +} \ No newline at end of file diff --git a/src/twemoji.d.ts b/src/twemoji.d.ts new file mode 100644 index 00000000..619c0926 --- /dev/null +++ b/src/twemoji.d.ts @@ -0,0 +1,153 @@ +declare module "twemoji" +{ + /** + * Represents options for generating `img`-tags. + */ + interface IOptions + { + /** + * Gets or sets the file-base to load the emojis from. + */ + base?: string; + + /** + * Gets or sets the size of the emoji. + */ + size?: string; + + /** + * Gets or sets the extension of the emoji-file. + */ + ext?: string; + } + + /** + * Represents options for processing `HTMLElement`s. + */ + interface IDOMOptions + { + /** + * Generates the location of the icon. + */ + callback?: (icon: string, options: IOptions) => string; + + /** + * Generates the attributes of the `img`-tag. + */ + attributes?: (icon: string, variant: string) => { [attribute: string]: string }; + + /** + * Gets or sets the base-uri to get the icons from. + */ + base?: string; + + /** + * Gets or sets the extensions of the icon-files. + */ + ext?: string; + + /** + * The class-name to set. + */ + className?: string; + + /** + * Gets or sets the size of the icons. + */ + size?: string | number; + + /** + * Gets or sets the directory to load the icon from. + */ + folder?: string; + } + + type SourceCallback = (icon: string, options: IOptions, variant: string) => string; + + class Utilities + { + /** + * Converts a hex-value to UTF-16. + * + * @param text + * The text to convert. + * + * @returns + * The converted text. + */ + public fromCodePoint(text: string): string; + + /** + * Converts an UTF-16 text to hex-codepoints. + * @param text + * The text to convert. + * + * @returns + * The converted code-points. + */ + public toCodePoint(text: string): string; + } + + class TwEmoji + { + /** + * Provides some utilities. + */ + public readonly convert: { + } + + /** + * Replaces all emojis of the `text` with ``-tags. + * + * @param text + * The text to process. + * + * @returns + * The html-representation of the `text`. + */ + public parse(text: string): string; + + /** + * Replaces all emojis of the `text` with ``-tags. + * + * @param text + * The text to process. + * + * @param callback + * Receives the emoji-options and returns the icon-location. + * + * @returns + * The html-representation of the `text`. + */ + public parse(text: string, callback: SourceCallback): string; + + /** + * Replaces all emojis of the `text` with ``-tags. + * + * @param text + * The text to process. + * + * @param options + * Override-options and a callback for generating the icon-location. + * + * @returns + * The html-representation of the `text`. + */ + public parse(text: string, options: IOptions & { callback: SourceCallback }): string; + + /** + * Replaces all emojis in the `element` with ``-elements. + * + * @param element + * The element to process. + * + * @param options + * The options for the process. + */ + public parse(element: HTMLElement, options?: IDOMOptions): void; + } + + let twemoji: TwEmoji; + + export = twemoji; +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index de1bbffc..4cadf9fd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,6 +5,7 @@ "module": "commonjs", "lib": [ "es7", + "esnext", "dom" ], "plugins": [ From 16a0f8e60c94b531b3f7ba480403fe604d3e76ff Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 14 Jan 2019 16:27:16 +0100 Subject: [PATCH 20/77] Add the new tslint-plugin to the extension-recommendations --- .vscode/extensions.json | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .vscode/extensions.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..161ad1ec --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "ms-vscode.vscode-typescript-tslint-plugin" + ] +} \ No newline at end of file From 7ad517a184b1e65761360e242ad1ca24498e5dc7 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 14 Jan 2019 16:27:26 +0100 Subject: [PATCH 21/77] Ensure all modules are loaded by https --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 28814a73..cfa9145a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "dependencies": { "@types/clone": { "version": "0.1.30", - "resolved": "http://registry.npmjs.org/@types/clone/-/clone-0.1.30.tgz", + "resolved": "https://registry.npmjs.org/@types/clone/-/clone-0.1.30.tgz", "integrity": "sha1-5zZWSMG0ITalnH1QQGN7O1yDthQ=", "dev": true }, @@ -1033,7 +1033,7 @@ "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -2002,7 +2002,7 @@ "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "requires": { "brace-expansion": "^1.1.7" } From 18fdc24ec5fe59264afe6053386a2a30a31a246e Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 14 Jan 2019 16:49:02 +0100 Subject: [PATCH 22/77] Rework the npm-scripts --- .vscode/tasks.json | 2 +- package.json | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 4fabfb9f..a66cd54f 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -20,7 +20,7 @@ { "label": "Compile", "type": "npm", - "script": "compile", + "script": "build", "problemMatcher": "$tsc", "group": "build" }, diff --git a/package.json b/package.json index 37167d12..2c650317 100644 --- a/package.json +++ b/package.json @@ -351,12 +351,15 @@ } }, "scripts": { - "vscode:prepublish": "npm run compile", - "compile": "tsc -p ./", - "watch": "tsc -watch -p ./", - "lint": "tslint -p . -t verbose", + "vscode:prepublish": "npm run rebuild", + "build": "tsc -p .", + "rebuild": "npm run clean && npm run build", + "watch": "tsc -p . --watch", + "clean": "rimraf ./out", + "lint": "tslint -p ./ -t verbose", "postinstall": "node ./node_modules/vscode/bin/install", - "test": "npm run compile && node ./node_modules/vscode/bin/test" + "test": "node ./node_modules/vscode/bin/test", + "prepare": "npm run rebuild" }, "devDependencies": { "@types/clone": "^0.1.30", From 3f0601d058ff3355747d960b2f718181e2ec36a8 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 14 Jan 2019 16:49:19 +0100 Subject: [PATCH 23/77] Rework the vscode-settings --- .vscode/settings.json | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 62ab92fd..a8ab5e23 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,10 +1,6 @@ -// Place your settings in this file to overwrite default and user settings. { - "search.exclude": { - "out": true // set this to false to include "out" folder in search results - }, "javascript.format.placeOpenBraceOnNewLineForControlBlocks": true, "javascript.format.placeOpenBraceOnNewLineForFunctions": true, - "typescript.format.placeOpenBraceOnNewLineForFunctions": true, - "typescript.format.placeOpenBraceOnNewLineForControlBlocks": true + "typescript.format.placeOpenBraceOnNewLineForControlBlocks": true, + "typescript.format.placeOpenBraceOnNewLineForFunctions": true } \ No newline at end of file From ac630ff69b2c5b83771f881beda99538519c407b Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 14 Jan 2019 16:52:01 +0100 Subject: [PATCH 24/77] Adjust the test-file according to tslint --- src/test/index.ts | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/test/index.ts b/src/test/index.ts index 2cf5e834..bd7b46af 100644 --- a/src/test/index.ts +++ b/src/test/index.ts @@ -1,22 +1,23 @@ -// -// PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING -// -// This file is providing the test runner to use when running extension tests. -// By default the test runner in use is Mocha based. -// -// You can provide your own test runner if you want to override it by exporting -// a function run(testRoot: string, clb: (error:Error) => void) that the extension -// host can call to run the tests. The test runner is expected to use console.log -// to report the results back to the caller. When the tests are finished, return -// a possible error to the callback or null if none. +/** + * PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING + * + * This file is providing the test runner to use when running extension tests. + * By default the test runner in use is Mocha based. + * + * You can provide your own test runner if you want to override it by exporting + * a function run(testRoot: string, clb: (error:Error) => void) that the extension + * host can call to run the tests. The test runner is expected to use console.log + * to report the results back to the caller. When the tests are finished, return + * a possible error to the callback or null if none. + */ import * as testRunner from "vscode/lib/testrunner"; // You can directly control Mocha options by uncommenting the following lines // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info testRunner.configure({ - ui: "tdd", // the TDD UI is being used in extension.test.ts (suite, test, etc.) - useColors: true // colored output from test results + ui: "tdd", // The TDD UI is being used in extension.test.ts (suite, test, etc.) + useColors: true // Colored output from test results }); module.exports = testRunner; \ No newline at end of file From d99b3085a45ca25aacdd6058b1e05ee95875be8a Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 16 Jan 2019 13:57:01 +0100 Subject: [PATCH 25/77] Rearrange the changelog-file --- CHANGELOG.md | 170 ++++++++++++++++++++++++++++----------------------- 1 file changed, 93 insertions(+), 77 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fe62467..b39bb5f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,31 +4,37 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [MarkdownConverter Unreleased] -### Changes +## MarkdownConverter Unreleased - Prevented port-collisions when converting multiple files at once -## [MarkdownConverter v1.1.2] -### Changes - - Implemented a clean way to handle files outside of the current workspace +[Show differences][v1.2.0] -## [MarkdownConverter v1.1.1] -### Changes - - Fixed absolute path handling +## MarkdownConverter v1.1.2 + - Implemented a clean way to handle files outside of the current workspace + Thanks to [@jkhsjdhjs](https://github.com/jkhsjdhjs) for reporting the issue -## [MarkdownConverter v1.1.0] +[Show differences][v1.1.2] + +## MarkdownConverter v1.1.1 + - Fixed absolute path handling + Thanks to [@007pig](https://github.com/007pig) for reporting the issue + +[Show differences][v1.1.1] + +## MarkdownConverter v1.1.0 ### Breaking Changes - The `OutDir`-setting is now called `DestinationPath` - The `DestinationPath` is considered relative to the `DestinationOrigin` -## Changes +## Other - Documents located in sub-directories are now converted correctly Thanks to [@mjwsteenbergen](https://github.com/mjwsteenbergen) for reporting the issue - People can now choose whether to consider the `DestinationPath` relative to the `WorkspaceFolder` or relative to the directory of the document-file. - Added a prompt for specifying a `DestinationPath` which is displayed when `MarkdownConverter` the `DestinationPath`, none or more than 1 workspace-folders are opened and the name of the file is untitled -## [MarkdownConverter v1.0.1] -### Changes +[Show differences][v1.1.0] + +## MarkdownConverter v1.0.1 - Allowed users to enable the default parser rather than the default stylesheets Thanks to [@mjwsteenbergen](https://github.com/mjwsteenbergen) for his contribution - Renamed some settings @@ -36,102 +42,112 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - `markdownConverter.Document.EmojiType` => `markdownConverter.Parser.EmojiType` - `markdownConverter.Document.Toc` => `markdownConverter.Parser.Toc` -## [MarkdownConverter v1.0.0] -### Changes - - Replaced [PhantomJS](http://phantomjs.org/) by [puppeteer](https://github.com/GoogleChrome/puppeteer) - - Provided the functionality to render local files - - Provided the functionality to - - Reworked the path-handling of the settings - - Reworked the code for better readability - -## [MarkdownConverter v0.0.13] -### Changes - - Beautified the system-stylesheet - -## [MarkdownConverter v0.0.12] -### Changes - - Reworked the settings and remove unnecessary settings - - Fixed extension-provided styles +[Show differences][v1.0.1] + +## MarkdownConverter v1.0.0 + - Replace [PhantomJS](http://phantomjs.org/) by [puppeteer](https://github.com/GoogleChrome/puppeteer) + - Provide the functionality to render local files + - Provide the functionality to + - Rework the path-handling of the settings + - Rework the code for better readability + +[Show differences][v1.0.0] + +## MarkdownConverter v0.0.13 + - Reworked the system-stylesheet + +[Show differences][v0.0.13] + +## MarkdownConverter v0.0.12 + - Cleaned up all settings + - Fixed extension-provides styles - Improved path-handling for untitled files - Implemented localization using [`localizable-resources`](https://npmjs.org/package/localizable-resources) -## [MarkdownConverter v0.0.11] -### Changes - - Renamed `MarkdownConverter` to `Markdown Converter` - - Fixed Multi-Workspacefolder support +[Show differences][v0.0.12] -## [MarkdownConverter v0.0.10] -### Additions - - Added support for Chinese headings +## Markdown Converter v0.0.11 +- Renamed `MarkdownConverter` to `Markdown Converter` +- Fixed Multi-Workspacefolder support -### Changes - - Disabled `markdown-it`'s link policy +[Show differences][v0.0.11] -## [MarkdownConverter v0.0.9] -## Additions - - Provided "table of content"-feature +## MakrdownConverter v0.0.10 +- Added support for Chinese headings +- Disabled markdown-it's link policy -## Changes +[Show differences][v0.0.10] + +## MarkdownConverter v0.0.9 - Made the rebuild-process platform-independent - Adjusted the way to open up files - Updated the sync-request-module + - Added "table of content"-feature -## [MarkdownConverter v0.0.8] -## Addotopms - - Provided the functionallity to choose whether to embed or link certain css-files [#4](https://github.com/manuth/MarkdownConverter/issues/4) +[Show differences][v0.0.9] -### Changes +## MarkdownConverter v0.0.8 - Reworked the PhantomJS-process [#1](https://github.com/manuth/MarkdownConverter/issues/1) - Adjusted the way to handle templates [#6](https://github.com/manuth/MarkdownConverter/issues/6) - - Changed missleading error-messages [#7](https://github.com/manuth/MarkdownConverter/issues/7) + - Provided the functionallity to choose whether to embed or link certain css-files [#4](https://github.com/manuth/MarkdownConverter/issues/4) + - Patched missleading error-messages [#7](https://github.com/manuth/MarkdownConverter/issues/7) -## [MarkdownConverter v0.0.7] -### Additions - - Added TypeScript-definitions - - Added PhantomJS-rebuild functionallity in order to build PhantomJS for the propper os. [#2](https://github.com/manuth/MarkdownConverter/issues/2) +[Show differences][v0.0.8] -### Changes +## MarkdownConverter v0.0.7 - Adjusted the version-numbers - Improved the date-test for security-reasons + - Added TypeScript-definitions + - Added PhantomJS-rebuild functionallity in order to build PhantomJS for the propper os. [#2](https://github.com/manuth/MarkdownConverter/issues/2) -## MarkdownConverter v0.0.6 -### Additions - - Added FrontMatter-validation - - Added JavaScript-logic-variables +[Show differences][v0.0.7] -### Changes +## MarkdownConverter v0.0.6 + - Added malformated FrontMatter-Recognition - Improved the MarkDown-document-detection + - Added JavaScript-logic-variables - Fixed the broken PageNumber and PageCount-variables +[Show differences][v0.0.6] + ## MarkdownConverter v0.0.5 -### Changes - Reworked the error-messages -## MarkdownConverter v0.0.4 -### Changes - - Removed test-code +[Show differences][v0.0.5] -## MarkdownConverter v0.0.3 -## Additions +## MarkdownConverter v0.0.4 - Added a new Icon + - Reworked the README - Added [Checkbox-Support](https://www.npmjs.com/package/markdown-it-checkbox) -### Changes - - Reworked the README +[Show differences][v0.0.4] ## MarkdownConverter v0.0.2 - - First release + - Improved the error-handling + - Improved the stability of the code + +[Show differences][v0.0.2] + +## MarkdownConverter v0.0.1 + - Initial release + +[Show differences][v0.0.1] -[MarkdownConverter v1.1.1]: https://github.com/manuth/MarkdownConverter/compare/v1.1.1...v1.1.2 -[MarkdownConverter v1.1.1]: https://github.com/manuth/MarkdownConverter/compare/v1.1.0...v1.1.1 -[MarkdownConverter v1.1.0]: https://github.com/manuth/MarkdownConverter/compare/v1.0.1...v1.1.0 -[MarkdownConverter v1.0.1]: https://github.com/manuth/MarkdownConverter/compare/v1.0.0...v1.0.1 -[MarkdownConverter v1.0.0]: https://github.com/manuth/MarkdownConverter/compare/v0.0.13...v1.0.0 -[MarkdownConverter v0.0.13]: https://github.com/manuth/MarkdownConverter/compare/v0.0.12...v0.0.13 -[MarkdownConverter v0.0.12]: https://github.com/manuth/MarkdownConverter/compare/v0.0.11...v0.0.12 -[MarkdownConverter v0.0.11]: https://github.com/manuth/MarkdownConverter/compare/v0.0.10...v0.0.11 -[MarkdownConverter v0.0.10]: https://github.com/manuth/MarkdownConverter/compare/v0.0.9...v0.0.10 -[MarkdownConverter v0.0.9]: https://github.com/manuth/MarkdownConverter/compare/v0.0.8...v0.0.9 -[MarkdownConverter v0.0.8]: https://github.com/manuth/MarkdownConverter/compare/v0.0.7...v0.0.8 -[MarkdownConverter v0.0.7]: https://github.com/manuth/MarkdownConverter/compare/v0.0.4...v0.0.7 \ No newline at end of file +[v0.0.1]: https://github.com/manuth/MarkdownConverter/compare/97826ca...v0.0.1 +[v0.0.2]: https://github.com/manuth/MarkdownConverter/compare/v0.0.1...v0.0.2 +[v0.0.4]: https://github.com/manuth/MarkdownConverter/compare/v0.0.2...v0.0.4 +[v0.0.5]: https://github.com/manuth/MarkdownConverter/compare/v0.0.4...v0.0.5 +[v0.0.6]: https://github.com/manuth/MarkdownConverter/compare/v0.0.5...v0.0.6 +[v0.0.7]: https://github.com/manuth/MarkdownConverter/compare/v0.0.6...v0.0.7 +[v0.0.8]: https://github.com/manuth/MarkdownConverter/compare/v0.0.7...v0.0.8 +[v0.0.9]: https://github.com/manuth/MarkdownConverter/compare/v0.0.8...v0.0.9 +[v0.0.10]: https://github.com/manuth/MarkdownConverter/compare/v0.0.9...v0.0.10 +[v0.0.11]: https://github.com/manuth/MarkdownConverter/compare/v0.0.10...v0.0.11 +[v0.0.12]: https://github.com/manuth/MarkdownConverter/compare/v0.0.11...v0.0.12 +[v0.0.13]: https://github.com/manuth/MarkdownConverter/compare/v0.0.12...v0.0.13 +[v1.0.0]: https://github.com/manuth/MarkdownConverter/compare/v0.0.13...v1.0.0 +[v1.0.1]: https://github.com/manuth/MarkdownConverter/compare/v1.0.0...v1.0.1 +[v1.1.0]: https://github.com/manuth/MarkdownConverter/compare/v1.0.0...v1.1.0 +[v1.1.1]: https://github.com/manuth/MarkdownConverter/compare/v1.1.0...v1.1.1 +[v1.1.1]: https://github.com/manuth/MarkdownConverter/compare/v1.1.1...v1.2.0 \ No newline at end of file From 8f576883d62d53a257e6924278e45f008225ac91 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 16 Jan 2019 19:29:43 +0100 Subject: [PATCH 26/77] Rework the directory-structure --- .gitignore | 2 +- .npmignore | 4 ++-- .vscode/launch.json | 6 +++--- .vscodeignore | 12 ++++++------ package-lock.json | 37 +++++++++++++++++++++++++++++++++++++ package.json | 7 ++++--- tsconfig.json | 2 +- 7 files changed, 54 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 9679e6ab..58e5351a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ # Build results -[Oo]ut/ +[Ll]ib/ # Logs logs diff --git a/.npmignore b/.npmignore index e104c3ac..6bc6155f 100644 --- a/.npmignore +++ b/.npmignore @@ -68,11 +68,11 @@ tsconfig.json tslint.json # Source-maps -[Oo]ut/**/*.js.map +[Ll]ib/**/*.js.map # Unit-Tests test/ -[Oo]ut/tests/ +[Ll]ib/tests/ # Visual Studio Code-Environment .vscode/ diff --git a/.vscode/launch.json b/.vscode/launch.json index e9aa1628..bdc29ca0 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -15,7 +15,7 @@ "--locale=en" ], "outFiles": [ - "${workspaceFolder}/out/**/*.js" + "${workspaceFolder}/lib/**/*.js" ], "preLaunchTask": "Watch" }, @@ -26,10 +26,10 @@ "runtimeExecutable": "${execPath}", "args": [ "--extensionDevelopmentPath=${workspaceFolder}", - "--extensionTestsPath=${workspaceFolder}/out/test" + "--extensionTestsPath=${workspaceFolder}/lib/test" ], "outFiles": [ - "${workspaceFolder}/out/test/**/*.js" + "${workspaceFolder}/lib/test/**/*.js" ], "preLaunchTask": "Watch" } diff --git a/.vscodeignore b/.vscodeignore index 8037385d..ecf50e5d 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -1,9 +1,9 @@ -.vscode/** -.vscode-test/** -lib/tests/** -lib/**/*.map -node_modules/puppeteer/.local-chromium/** -src/** +.vscode/ +.vscode-test/ +[LL]ib/tests/ +[Ll]ib/**/*.map +node_modules/puppeteer/.local-chromium/ +src/ .gitignore tsconfig.json vsc-extension-quickstart.md diff --git a/package-lock.json b/package-lock.json index cfa9145a..53da27b8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -592,6 +592,31 @@ "resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz", "integrity": "sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c=" }, + "cross-env": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-5.2.0.tgz", + "integrity": "sha512-jtdNFfFW1hB7sMhr/H6rW1Z45LFqyI431m3qU6bFXcQ3Eh7LtBuG3h74o7ohHZ3crrRkkqHlo4jYHFPcjroANg==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.5", + "is-windows": "^1.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + } + } + }, "cross-spawn": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", @@ -1656,6 +1681,12 @@ "integrity": "sha1-1LVcafUYhvm2XHDWwmItN+KfSP4=", "dev": true }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -2101,6 +2132,12 @@ "resolved": "https://registry.npmjs.org/mustache/-/mustache-2.3.2.tgz", "integrity": "sha512-KpMNwdQsYz3O/SBS1qJ/o3sqUJ5wSb8gb0pul8CO0S56b9Y2ALm8zCfsjPXsqGFfoNBkDwZuZIAjhsZI03gYVQ==" }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, "node.extend": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/node.extend/-/node.extend-1.1.6.tgz", diff --git a/package.json b/package.json index 2c650317..52c4178e 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "activationEvents": [ "onCommand:markdownConverter.Convert" ], - "main": "./out/extension", + "main": "./lib/extension", "contributes": { "commands": [ { @@ -355,10 +355,10 @@ "build": "tsc -p .", "rebuild": "npm run clean && npm run build", "watch": "tsc -p . --watch", - "clean": "rimraf ./out", + "clean": "rimraf ./lib", "lint": "tslint -p ./ -t verbose", "postinstall": "node ./node_modules/vscode/bin/install", - "test": "node ./node_modules/vscode/bin/test", + "test": "cross-env CODE_TESTS_PATH=\"./lib/test\" node ./node_modules/vscode/bin/test", "prepare": "npm run rebuild" }, "devDependencies": { @@ -377,6 +377,7 @@ "@types/string-template": "^1.0.2", "@types/transliteration": "^1.6.0", "@types/yamljs": "^0.2.30", + "cross-env": "^5.2.0", "tslint": "^5.11.0", "typescript": "^2.9.2", "vscode": "^1.1.21" diff --git a/tsconfig.json b/tsconfig.json index 4cadf9fd..61e52882 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,7 +14,7 @@ } ], "target": "es6", - "outDir": "./out", + "outDir": "./lib", "declaration": true, "sourceMap": true, "resolveJsonModule": true, From 6acf3d91de7de74ae5e1c6d3e8c86064b3c9b1f6 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 17 Jan 2019 08:58:07 +0100 Subject: [PATCH 27/77] Delete useless file --- vsc-extension-quickstart.md | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 vsc-extension-quickstart.md diff --git a/vsc-extension-quickstart.md b/vsc-extension-quickstart.md deleted file mode 100644 index 8a91f638..00000000 --- a/vsc-extension-quickstart.md +++ /dev/null @@ -1,33 +0,0 @@ -# Welcome to your VS Code Extension - -## What's in the folder -* This folder contains all of the files necessary for your extension. -* `package.json` - this is the manifest file in which you declare your extension and command. -The sample plugin registers a command and defines its title and command name. With this information -VS Code can show the command in the command palette. It doesn’t yet need to load the plugin. -* `src/extension.ts` - this is the main file where you will provide the implementation of your command. -The file exports one function, `activate`, which is called the very first time your extension is -activated (in this case by executing the command). Inside the `activate` function we call `registerCommand`. -We pass the function containing the implementation of the command as the second parameter to -`registerCommand`. - -## Get up and running straight away -* Press `F5` to open a new window with your extension loaded. -* Run your command from the command palette by pressing (`Ctrl+Shift+P` or `Cmd+Shift+P` on Mac) and typing `Hello World`. -* Set breakpoints in your code inside `src/extension.ts` to debug your extension. -* Find output from your extension in the debug console. - -## Make changes -* You can relaunch the extension from the debug toolbar after changing code in `src/extension.ts`. -* You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes. - -## Explore the API -* You can open the full set of our API when you open the file `node_modules/vscode/vscode.d.ts`. - -## Run tests -* Open the debug viewlet (`Ctrl+Shift+D` or `Cmd+Shift+D` on Mac) and from the launch configuration dropdown pick `Launch Tests`. -* Press `F5` to run the tests in a new window with your extension loaded. -* See the output of the test result in the debug console. -* Make changes to `test/extension.test.ts` or create new test files inside the `test` folder. - * By convention, the test runner will only consider files matching the name pattern `**.test.ts`. - * You can create folders inside the `test` folder to structure your tests any way you want. From 3f84b2c1af94a3bfb29d52c8e557a24fb03aa7fc Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 21 Jan 2019 14:16:09 +0100 Subject: [PATCH 28/77] Rearrange the test-environment --- src/test/extension.test.ts | 6 +++--- src/tests/main.test.ts | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 src/tests/main.test.ts diff --git a/src/test/extension.test.ts b/src/test/extension.test.ts index 4b2fcc44..48458621 100644 --- a/src/test/extension.test.ts +++ b/src/test/extension.test.ts @@ -1,4 +1,4 @@ -// Defines a Mocha test suite to group tests of similar kind together -suite("MarkdownConverter", () => +(() => { -}); \ No newline at end of file + require("../tests/main.test"); +})(); \ No newline at end of file diff --git a/src/tests/main.test.ts b/src/tests/main.test.ts new file mode 100644 index 00000000..0df391d4 --- /dev/null +++ b/src/tests/main.test.ts @@ -0,0 +1,5 @@ +suite( + "MarkdownConverter", + () => + { + }); \ No newline at end of file From 18aace89949e04650326577f378db903a84c35e9 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 21 Jan 2019 14:21:51 +0100 Subject: [PATCH 29/77] Rework the ignore-files --- .gitignore | 3 ++ .npmignore | 81 -------------------------------------------- .vscodeignore | 93 +++++++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 89 insertions(+), 88 deletions(-) delete mode 100644 .npmignore diff --git a/.gitignore b/.gitignore index 58e5351a..5bc6d4f9 100644 --- a/.gitignore +++ b/.gitignore @@ -54,6 +54,9 @@ typings/ # Output of 'npm pack' *.tgz +# Output of 'vsce package' +*.vsix + # Yarn Integrity file .yarn-integrity diff --git a/.npmignore b/.npmignore deleted file mode 100644 index 6bc6155f..00000000 --- a/.npmignore +++ /dev/null @@ -1,81 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# TypeScript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env - -# next.js build output -.next - -# Source-files -[Ss]rc/ - -# TypeScript config-files -tsconfig.json -tslint.json - -# Source-maps -[Ll]ib/**/*.js.map - -# Unit-Tests -test/ -[Ll]ib/tests/ - -# Visual Studio Code-Environment -.vscode/ - -# Visual Studio Code Experimental Instance -.vscode-test/ diff --git a/.vscodeignore b/.vscodeignore index ecf50e5d..9d19c056 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -1,10 +1,89 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# TypeScript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Output of 'vsce package' +*.vsix + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# next.js build output +.next + +# Visual Studio Code Experimental Instance +.vscode-test/ + +# Source-files +[Ss]rc/ + +# TypeScript config-files +tsconfig.json +tslint.json + +# Source-maps +[Ll]ib/**/*.js.map + +# Unit-Tests +[Ll]ib/test/ +[Ll]ib/tests/ + +# Visual Studio Code-Environment .vscode/ + +# Visual Studio Code Experimental Instance .vscode-test/ -[LL]ib/tests/ -[Ll]ib/**/*.map -node_modules/puppeteer/.local-chromium/ -src/ + +# Ignore-files .gitignore -tsconfig.json -vsc-extension-quickstart.md -tslint.json \ No newline at end of file + +# Local Chromium-Versions +node_modules/puppeteer/.local-chromium/ From fec26494617d23a3fd047b3ed3bfc284fae17053 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 21 Jan 2019 14:23:24 +0100 Subject: [PATCH 30/77] Rework the tasks --- .vscode/launch.json | 4 ++-- .vscode/tasks.json | 23 ++++++++++++++--------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index bdc29ca0..eff7767e 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -17,7 +17,7 @@ "outFiles": [ "${workspaceFolder}/lib/**/*.js" ], - "preLaunchTask": "Watch" + "preLaunchTask": "Build" }, { "name": "Extension Tests", @@ -31,7 +31,7 @@ "outFiles": [ "${workspaceFolder}/lib/test/**/*.js" ], - "preLaunchTask": "Watch" + "preLaunchTask": "Build" } ] } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index a66cd54f..6e583cd8 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -4,31 +4,36 @@ "version": "2.0.0", "tasks": [ { - "label": "Watch", + "label": "Build", "type": "npm", "script": "watch", + "group": { + "kind": "build", + "isDefault": true + }, "problemMatcher": "$tsc-watch", "isBackground": true, "presentation": { "reveal": "never" - }, - "group": { - "kind": "build", - "isDefault": true } }, { - "label": "Compile", + "label": "Rebuild", "type": "npm", - "script": "build", + "script": "rebuild", "problemMatcher": "$tsc", - "group": "build" + "presentation": { + "reveal": "never" + } }, { "label": "Lint", "type": "npm", "script": "lint", - "problemMatcher": "$tslint5" + "problemMatcher": "$tslint5", + "presentation": { + "reveal": "never" + } } ] } \ No newline at end of file From bed5172af34724a0ac636767521d2e3a8eb35cb3 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 21 Jan 2019 14:23:37 +0100 Subject: [PATCH 31/77] Rearrange the debug-configuration --- .vscode/launch.json | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index eff7767e..8fce881d 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,14 +1,13 @@ -// A launch configuration that compiles the extension and then opens it inside a new window -// Use IntelliSense to learn about possible attributes. -// Hover to view descriptions of existing attributes. -// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 { + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { - "name": "Extension", "type": "extensionHost", "request": "launch", + "name": "Launch Extension", "runtimeExecutable": "${execPath}", "args": [ "--extensionDevelopmentPath=${workspaceFolder}", @@ -20,9 +19,9 @@ "preLaunchTask": "Build" }, { - "name": "Extension Tests", "type": "extensionHost", "request": "launch", + "name": "Launch Tests", "runtimeExecutable": "${execPath}", "args": [ "--extensionDevelopmentPath=${workspaceFolder}", From 6a69c948b854d1b406f143e9ede48888cfa4fad2 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 21 Jan 2019 14:24:38 +0100 Subject: [PATCH 32/77] Rearrange the package-manifest --- package.json | 143 ++++++++++++++++++++++++++------------------------- 1 file changed, 74 insertions(+), 69 deletions(-) diff --git a/package.json b/package.json index 52c4178e..3bb9ece3 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,12 @@ { "name": "markdown-converter", "displayName": "Markdown Converter", - "markdownDescription": "Provides the functionallity to convert MarkDown-files to html, pdf or png.", + "icon": "Resources/Icon.png", "version": "1.1.2", + "description": "A markdown-converter for Visual Studio Code", + "markdownDescription": "A Markdown-converter for Visual Studio Code", + "author": "Manuel Thalmann (https://nuth.ch)", "publisher": "manuth", - "author": { - "name": "Manuel Thalmann", - "email": "m@nuth.ch", - "url": "https://nuth.ch" - }, - "icon": "Resources/Icon.png", "license": "MIT", "keywords": [ "MarkDown", @@ -18,20 +15,86 @@ "PDF", "PNG" ], + "categories": [ + "Other" + ], + "main": "lib/extension.js", + "types": "lib/extension.d.ts", + "directories": { + "lib": "lib" + }, "repository": { "type": "git", "url": "https://github.com/manuth/MarkdownConverter.git" }, + "bugs": { + "url": "https://github.com/manuth/MarkdownConverter/issues" + }, + "homepage": "https://github.com/manuth/MarkdownConverter#readme", "engines": { "vscode": "^1.23.0" }, - "categories": [ - "Other" - ], + "scripts": { + "vscode:prepublish": "npm run rebuild", + "build": "tsc -p .", + "rebuild": "npm run clean && npm run build", + "watch": "tsc -p . --watch", + "clean": "rimraf ./lib", + "lint": "tslint -p ./ -t verbose", + "postinstall": "node ./node_modules/vscode/bin/install", + "test": "cross-env CODE_TESTS_PATH=\"./lib/test\" node ./node_modules/vscode/bin/test", + "prepare": "npm run rebuild" + }, + "devDependencies": { + "@types/clone": "^0.1.30", + "@types/dedent": "^0.7.0", + "@types/fs-extra": "^5.0.4", + "@types/get-port": "^4.0.0", + "@types/highlight.js": "^9.12.3", + "@types/http-server": "^0.10.0", + "@types/markdown-it": "0.0.3", + "@types/markdown-it-anchor": "^4.0.2", + "@types/mocha": "^2.2.48", + "@types/mustache": "^0.8.31", + "@types/node": "^10.12.0", + "@types/puppeteer": "^1.9.0", + "@types/string-template": "^1.0.2", + "@types/transliteration": "^1.6.0", + "@types/yamljs": "^0.2.30", + "cross-env": "^5.2.0", + "tslint": "^5.11.0", + "typescript": "^2.9.2", + "vscode": "^1.1.21" + }, + "dependencies": { + "async-shelljs": "^0.1.2", + "clone": "^2.1.2", + "culture-info": "0.0.4", + "dedent": "^0.7.0", + "front-matter": "^2.3.0", + "fs-extra": "^6.0.1", + "get-port": "^4.0.0", + "highlight.js": "^9.13.1", + "highlightjs": "^9.12.0", + "http-server": "^0.11.1", + "localizable-resources": "^1.0.6", + "markdown-it": "^8.4.2", + "markdown-it-anchor": "^5.0.2", + "markdown-it-checkbox": "^1.1.0", + "markdown-it-emoji": "^1.3.0", + "markdown-it-table-of-contents": "^0.4.3", + "multi-integer-range": "^3.0.0", + "mustache": "^2.3.2", + "puppeteer": "^1.9.0", + "rc": "^1.2.8", + "string-template": "^1.0.0", + "transliteration": "^1.6.6", + "twemoji": "^2.5.1", + "yamljs": "^0.3.0" + }, "activationEvents": [ "onCommand:markdownConverter.Convert" ], - "main": "./lib/extension", "contributes": { "commands": [ { @@ -349,63 +412,5 @@ } } } - }, - "scripts": { - "vscode:prepublish": "npm run rebuild", - "build": "tsc -p .", - "rebuild": "npm run clean && npm run build", - "watch": "tsc -p . --watch", - "clean": "rimraf ./lib", - "lint": "tslint -p ./ -t verbose", - "postinstall": "node ./node_modules/vscode/bin/install", - "test": "cross-env CODE_TESTS_PATH=\"./lib/test\" node ./node_modules/vscode/bin/test", - "prepare": "npm run rebuild" - }, - "devDependencies": { - "@types/clone": "^0.1.30", - "@types/dedent": "^0.7.0", - "@types/fs-extra": "^5.0.4", - "@types/get-port": "^4.0.0", - "@types/highlight.js": "^9.12.3", - "@types/http-server": "^0.10.0", - "@types/markdown-it": "0.0.3", - "@types/markdown-it-anchor": "^4.0.2", - "@types/mocha": "^2.2.48", - "@types/mustache": "^0.8.31", - "@types/node": "^10.12.0", - "@types/puppeteer": "^1.9.0", - "@types/string-template": "^1.0.2", - "@types/transliteration": "^1.6.0", - "@types/yamljs": "^0.2.30", - "cross-env": "^5.2.0", - "tslint": "^5.11.0", - "typescript": "^2.9.2", - "vscode": "^1.1.21" - }, - "dependencies": { - "async-shelljs": "^0.1.2", - "clone": "^2.1.2", - "culture-info": "0.0.4", - "dedent": "^0.7.0", - "front-matter": "^2.3.0", - "fs-extra": "^6.0.1", - "get-port": "^4.0.0", - "highlight.js": "^9.13.1", - "highlightjs": "^9.12.0", - "http-server": "^0.11.1", - "localizable-resources": "^1.0.6", - "markdown-it": "^8.4.2", - "markdown-it-anchor": "^5.0.2", - "markdown-it-checkbox": "^1.1.0", - "markdown-it-emoji": "^1.3.0", - "markdown-it-table-of-contents": "^0.4.3", - "multi-integer-range": "^3.0.0", - "mustache": "^2.3.2", - "puppeteer": "^1.9.0", - "rc": "^1.2.8", - "string-template": "^1.0.0", - "transliteration": "^1.6.6", - "twemoji": "^2.5.1", - "yamljs": "^0.3.0" } } From 8ffbb92ef25e90cd69ad583ab74903287e2fb468 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 21 Jan 2019 15:47:10 +0100 Subject: [PATCH 33/77] Adjust the code according to tslint --- src/MarkdownConverter/ConversionType.ts | 2 +- src/MarkdownConverter/ConvertAllTask.ts | 2 +- src/MarkdownConverter/ConvertTask.ts | 12 +- src/MarkdownConverter/Converter.ts | 10 +- src/MarkdownConverter/MarkdownExtensions.ts | 140 ++++++++++++++---- src/System/Drawing/CustomPaperFormat.ts | 6 +- src/System/Drawing/DocumentFragment.ts | 6 +- src/System/Drawing/Margin.ts | 18 ++- src/System/Drawing/Renderable.ts | 26 ++-- src/System/Drawing/Slugifier.ts | 4 +- src/System/Drawing/StandardizedPaperFormat.ts | 4 +- src/System/Drawing/TocSettings.ts | 6 +- src/System/Exception.ts | 6 +- src/System/IO/FileException.ts | 4 +- src/System/IO/FileNotFoundException.ts | 4 +- src/System/Text/StringUtils.ts | 21 ++- src/System/YAML/Mark.ts | 47 ++++++ src/System/YAML/YAMLException.ts | 8 +- src/extension.ts | 36 +++-- tslint.json | 9 +- 20 files changed, 261 insertions(+), 110 deletions(-) diff --git a/src/MarkdownConverter/ConversionType.ts b/src/MarkdownConverter/ConversionType.ts index 7a171d51..a4d65f96 100644 --- a/src/MarkdownConverter/ConversionType.ts +++ b/src/MarkdownConverter/ConversionType.ts @@ -12,7 +12,7 @@ export enum ConversionType * Indicates a JPG-conversion */ JPEG, - + /** * Indicates a PDF-conversion. */ diff --git a/src/MarkdownConverter/ConvertAllTask.ts b/src/MarkdownConverter/ConvertAllTask.ts index 9e052c13..4544d20a 100644 --- a/src/MarkdownConverter/ConvertAllTask.ts +++ b/src/MarkdownConverter/ConvertAllTask.ts @@ -9,7 +9,7 @@ export class ConvertAllTask extends ConversionTask { /** * Initializes a new instance of the `ConvertAllTask` class. - * + * * @param extension * The extension the task belongs to. */ diff --git a/src/MarkdownConverter/ConvertTask.ts b/src/MarkdownConverter/ConvertTask.ts index 4886d3b4..43a32e7b 100644 --- a/src/MarkdownConverter/ConvertTask.ts +++ b/src/MarkdownConverter/ConvertTask.ts @@ -11,7 +11,7 @@ export class ConvertTask extends ConversionTask { /** * Initializes a new instance of the `ConvertTask` class. - * + * * @param extension * The extension the task belongs to. */ @@ -20,6 +20,11 @@ export class ConvertTask extends ConversionTask super(extension); } + public async ExecuteTask() + { + return this.Convert(this.GetMarkdownDocument()); + } + /** * Tries to find a markdown-file. */ @@ -40,9 +45,4 @@ export class ConvertTask extends ConversionTask throw new MarkdownFileNotFoundException(); } - - public async ExecuteTask() - { - await this.Convert(this.GetMarkdownDocument()); - } } \ No newline at end of file diff --git a/src/MarkdownConverter/Converter.ts b/src/MarkdownConverter/Converter.ts index 72b44710..2fb0d495 100644 --- a/src/MarkdownConverter/Converter.ts +++ b/src/MarkdownConverter/Converter.ts @@ -43,16 +43,16 @@ export class Converter /** * A value indicating whether the converter has been initialized. */ - private initialized: boolean = false; + private initialized = false; /** * A value indicating whether the converter has been disposed. */ - private disposed: boolean = false; + private disposed = false; /** * Initializes a new instance of the Constructor class with a filepath. - * + * * @param document * The document which is to be converted. */ @@ -192,10 +192,10 @@ export class Converter /** * Starts the conversion. - * + * * @param conversionType * The type to convert the document to. - * + * * @param path * The path to save the converted file to. */ diff --git a/src/MarkdownConverter/MarkdownExtensions.ts b/src/MarkdownConverter/MarkdownExtensions.ts index 43cd71d0..5d3b989b 100644 --- a/src/MarkdownConverter/MarkdownExtensions.ts +++ b/src/MarkdownConverter/MarkdownExtensions.ts @@ -2,16 +2,34 @@ import * as path from "path"; import * as vscode from "vscode"; -// This class was copied from vscode -// https://github.com/Microsoft/vscode/blob/4be0f0723091ae10b14ba20b334847d607bb7d55/extensions/markdown-language-features/src/markdownExtensions.ts - +/* This class was copied from vscode: + * https://github.com/Microsoft/vscode/blob/4be0f0723091ae10b14ba20b334847d607bb7d55/extensions/markdown-language-features/src/markdownExtensions.ts + */ + +/** + * Resolves a resource of a markdown-extension. + * + * @param extension + * The extension the resource belongs to. + * + * @param resourcePath + * The path to the resource. + */ const resolveExtensionResource = (extension: vscode.Extension, resourcePath: string): vscode.Uri => { - return vscode.Uri.file(path.join(extension.extensionPath, resourcePath)) - .with({ scheme: "vscode-resource" }); + return vscode.Uri.file(path.join(extension.extensionPath, resourcePath)).with({ scheme: "vscode-resource" }); }; -const resolveExtensionResources = (extension: vscode.Extension, resourcePaths: any): vscode.Uri[] => +/** + * Resolves multiple resources of a markdown-extension. + * + * @param extension + * The extension the resources belong to. + * + * @param resourcePaths + * The paths of the resources to resolve. + */ +const resolveExtensionResources = (extension: vscode.Extension, resourcePaths: string[]): vscode.Uri[] => { const result: vscode.Uri[] = []; if (Array.isArray(resourcePaths)) @@ -21,53 +39,95 @@ const resolveExtensionResources = (extension: vscode.Extension, resourcePat try { result.push(resolveExtensionResource(extension, resource)); - } catch (e) + } + catch (e) { - // noop } } } return result; }; +/** + * Represents the contributions of a markdown-extension. + */ export class MarkdownExtensionContributions { + /** + * The path to the markdown-extension. + */ + public readonly extensionPath: string; + + /** + * The provided scripts. + */ private readonly scripts: vscode.Uri[] = []; + + /** + * The provided styles. + */ private readonly styles: vscode.Uri[] = []; + + /** + * The roots of the markdown-preview. + */ private readonly previewResourceRootsVal: vscode.Uri[] = []; + + /** + * The plugins of the markdown-preview. + */ private readonly plugins: Thenable<(md: any) => any>[] = []; + /** + * A value indicating whether the contributions are loaded. + */ private loaded = false; - public constructor( - public readonly extensionPath: string, - ) { } + public constructor(extensionPath: string) + { + this.extensionPath = extensionPath; + } + /** + * Gets the provided scripts. + */ public get previewScripts(): vscode.Uri[] { - this.ensureLoaded(); + this.load(); return this.scripts; } + /** + * Gets the provided styles. + */ public get previewStyles(): vscode.Uri[] { - this.ensureLoaded(); + this.load(); return this.styles; } + /** + * Gets the roots of the markdown-preview. + */ public get previewResourceRoots(): vscode.Uri[] { - this.ensureLoaded(); + this.load(); return this.previewResourceRootsVal; } + /** + * Gets the plugins of the markdown-preview. + */ public get markdownItPlugins(): Thenable<(md: any) => any>[] { - this.ensureLoaded(); + this.load(); return this.plugins; } - private ensureLoaded() + /** + * Loads the contributions of all extension. + */ + private load() { if (this.loaded) { @@ -94,10 +154,16 @@ export class MarkdownExtensionContributions } } - private tryLoadMarkdownItPlugins( - contributes: any, - extension: vscode.Extension - ) + /** + * Loads a markdown-it plugin. + * + * @param contributes + * The contributions of the extension. + * + * @param extension + * The extension of to load the plug-in from. + */ + private tryLoadMarkdownItPlugins(contributes: any, extension: vscode.Extension) { if (contributes["markdown.markdownItPlugins"]) { @@ -112,23 +178,41 @@ export class MarkdownExtensionContributions } } - private tryLoadPreviewScripts( - contributes: any, - extension: vscode.Extension - ) + /** + * Loads the preview-scripts. + * + * @param contributes + * The contributions of the extension. + * + * @param extension + * The extension to load the contributions from. + */ + private tryLoadPreviewScripts(contributes: any, extension: vscode.Extension) { this.scripts.push(...resolveExtensionResources(extension, contributes["markdown.previewScripts"])); } - private tryLoadPreviewStyles( - contributes: any, - extension: vscode.Extension - ) + /** + * Loads the styles. + * + * @param contributes + * The contributions of the extension. + * + * @param extension + * The extension to load the contributions from. + */ + private tryLoadPreviewStyles(contributes: any, extension: vscode.Extension) { this.styles.push(...resolveExtensionResources(extension, contributes["markdown.previewStyles"])); } } +/** + * Gets all markdown-contributions. + * + * @param context + * The context provided by Visual Studio Code. + */ export function getMarkdownExtensionContributions(context: vscode.ExtensionContext): MarkdownExtensionContributions { return new MarkdownExtensionContributions(context.extensionPath); diff --git a/src/System/Drawing/CustomPaperFormat.ts b/src/System/Drawing/CustomPaperFormat.ts index 82c1b07b..9c0ec7b5 100644 --- a/src/System/Drawing/CustomPaperFormat.ts +++ b/src/System/Drawing/CustomPaperFormat.ts @@ -18,10 +18,10 @@ export class CustomPaperFormat extends PaperFormat /** * Initializes a new instance of the `CustomPaperFormat` class. - * + * * @param width * The width. - * + * * @param height * The height. */ @@ -39,7 +39,7 @@ export class CustomPaperFormat extends PaperFormat { return this.width; } - + public set Width(value: string) { this.width = value; diff --git a/src/System/Drawing/DocumentFragment.ts b/src/System/Drawing/DocumentFragment.ts index 330c6d20..d2ce8171 100644 --- a/src/System/Drawing/DocumentFragment.ts +++ b/src/System/Drawing/DocumentFragment.ts @@ -13,7 +13,7 @@ export class DocumentFragment extends Renderable /** * Initializes a new instance of the `Document` class. - * + * * @param document * The document this fragment belongs to. */ @@ -33,12 +33,12 @@ export class DocumentFragment extends Renderable /** * Renders a text. - * + * * @param text * The text to render. */ protected async RenderText(text: string): Promise { - return await this.RenderTextBy(this.Document, text); + return this.RenderTextBy(this.Document, text); } } \ No newline at end of file diff --git a/src/System/Drawing/Margin.ts b/src/System/Drawing/Margin.ts index aad0e3df..f0664814 100644 --- a/src/System/Drawing/Margin.ts +++ b/src/System/Drawing/Margin.ts @@ -25,16 +25,16 @@ export class Margin /** * Initializes a new instance of the Margin class. - * + * * @param top * The top margin. - * + * * @param right * The right margin. - * + * * @param bottom * The bottom margin. - * + * * @param left * The left margin. */ @@ -44,9 +44,9 @@ export class Margin constructor(top: string, right?: string, bottom?: string, left?: string) { this.top = - this.right = - this.bottom = - this.left = top; + this.right = + this.bottom = + this.left = top; if (right) { @@ -71,6 +71,7 @@ export class Margin { return this.top; } + public set Top(value: string) { this.top = value; @@ -83,6 +84,7 @@ export class Margin { return this.right; } + public set Right(value: string) { this.right = value; @@ -95,6 +97,7 @@ export class Margin { return this.bottom; } + public set Bottom(value: string) { this.bottom = value; @@ -107,6 +110,7 @@ export class Margin { return this.left; } + public set Left(value: string) { this.left = value; diff --git a/src/System/Drawing/Renderable.ts b/src/System/Drawing/Renderable.ts index fdcc0d8a..f1dd7619 100644 --- a/src/System/Drawing/Renderable.ts +++ b/src/System/Drawing/Renderable.ts @@ -11,7 +11,7 @@ export abstract class Renderable /** * Initializes a new instance of the `Renderable` class. */ - public constructor(content: string = "") + public constructor(content = "") { this.content = content; } @@ -29,33 +29,33 @@ export abstract class Renderable this.content = value; } + /** + * Renders the component. + */ + public async Render(): Promise + { + return this.RenderText(this.Content); + } + /** * Renders a text using a custom renderer. - * + * * @param renderer * The renderer to render the text. - * + * * @param text * The text to render. */ protected async RenderTextBy(renderer: Renderable, text: string): Promise { - return await renderer.RenderText(text); + return renderer.RenderText(text); } /** * Renders a text. - * + * * @param text * The text to render. */ protected abstract async RenderText(text: string): Promise; - - /** - * Renders the component. - */ - public async Render(): Promise - { - return await this.RenderText(this.Content); - } } \ No newline at end of file diff --git a/src/System/Drawing/Slugifier.ts b/src/System/Drawing/Slugifier.ts index 58af6caa..92d587f9 100644 --- a/src/System/Drawing/Slugifier.ts +++ b/src/System/Drawing/Slugifier.ts @@ -31,7 +31,7 @@ export class Slugifier /** * Slugifies a text. - * + * * @param text * The text that is to be slugified. */ @@ -53,7 +53,7 @@ export class Slugifier /** * Slugifies a text. - * + * * @param text * The text that is to be slugified. */ diff --git a/src/System/Drawing/StandardizedPaperFormat.ts b/src/System/Drawing/StandardizedPaperFormat.ts index 39279efe..542f3855 100644 --- a/src/System/Drawing/StandardizedPaperFormat.ts +++ b/src/System/Drawing/StandardizedPaperFormat.ts @@ -20,10 +20,10 @@ export class StandardizedPaperFormat extends PaperFormat /** * Initializes a new instance of the `StandardizedPaperFormat` class. - * + * * @param format * The orientation of the paper. - * + * * @param orientation * The orientation of the paper. */ diff --git a/src/System/Drawing/TocSettings.ts b/src/System/Drawing/TocSettings.ts index 9d7704a1..7db78526 100644 --- a/src/System/Drawing/TocSettings.ts +++ b/src/System/Drawing/TocSettings.ts @@ -28,13 +28,13 @@ export class TocSettings /** * Initializes a new instance of the `TocSettingsClass`. - * + * * @param $class * The css-class of the toc-container. - * + * * @param levels * The levels to display inside the toc. - * + * * @param indicator * A regexp which should be replaced by the toc inside the document. */ diff --git a/src/System/Exception.ts b/src/System/Exception.ts index 91c610f3..57f0fd67 100644 --- a/src/System/Exception.ts +++ b/src/System/Exception.ts @@ -15,11 +15,11 @@ export class Exception extends Error /** * Initializes a new instance of the `Exception`. - * + * * @param message * The error message that explains the reason for the exception. - * - * @param innerException + * + * @param innerException * The exception that is the cause of the current exception, or a null reference if no inner exception is specified. */ public constructor(message?: string, innerException?: Exception) diff --git a/src/System/IO/FileException.ts b/src/System/IO/FileException.ts index 9f7ff018..37788a2f 100644 --- a/src/System/IO/FileException.ts +++ b/src/System/IO/FileException.ts @@ -14,10 +14,10 @@ export class FileException extends IOException /** * Initializes a new instance of the FileException class with a message and a path. - * + * * @param message * The message of the exception. - * + * * @param path * The path to the file which caused the exception. */ diff --git a/src/System/IO/FileNotFoundException.ts b/src/System/IO/FileNotFoundException.ts index 9920f036..e5368553 100644 --- a/src/System/IO/FileNotFoundException.ts +++ b/src/System/IO/FileNotFoundException.ts @@ -8,10 +8,10 @@ export class FileNotFoundException extends FileException { /** * Initializes a new instance of the FileNotFoundException class with a message and a path. - * + * * @param message * The message of the exception. - * + * * @param path * The path to the file which caused the exception. */ diff --git a/src/System/Text/StringUtils.ts b/src/System/Text/StringUtils.ts index a9a4297f..b9a8857f 100644 --- a/src/System/Text/StringUtils.ts +++ b/src/System/Text/StringUtils.ts @@ -5,18 +5,17 @@ export class StringUtils { /** * Converts a string to code its code-points-value. - * + * * @param subject * The string to convert. */ public static UTF8CharToCodePoints(subject: string): number { let buffer = Buffer.from(subject); - let result: number = 0; + let result = 0; let length; - /* - * Determining the mask-type of the UTF-8 char. + /* Determining the mask-type of the UTF-8 char. * The UTF-8 Masks are as followed: * | Unicode-Range | UTF-8-Mask | Length (in bytes) | * |-----------------------|------------------------------------:|------------------:| @@ -50,7 +49,7 @@ export class StringUtils length--; - for (let i: number = 0; i <= length; i++) + for (let i = 0; i <= length; i++) { if ((buffer[i] & 0xC0) === 0x80 || i === 0) { @@ -67,13 +66,13 @@ export class StringUtils /** * Returns a new string that right-aligns the characters in this instance by padding them on the left with a specified Unicode character, for a specified total length. - * + * * @param subject * The subject to pad. - * + * * @param totalWidth * The number of characters in the resulting string, equal to the number of original characters plus any additional padding characters. - * + * * @param paddingChar * A Unicode padding character. */ @@ -88,14 +87,14 @@ export class StringUtils /** * Converts a number to a hexadecimal string. - * + * * @param subject * The number to convert. - * + * * @param size * The length of the string to return. */ - public static DecToHexString(subject: number, length: number = 2): string + public static DecToHexString(subject: number, length = 2): string { return this.PadLeft(subject.toString(16), length, "0"); } diff --git a/src/System/YAML/Mark.ts b/src/System/YAML/Mark.ts index 46f4570b..0fdbbafe 100644 --- a/src/System/YAML/Mark.ts +++ b/src/System/YAML/Mark.ts @@ -1,11 +1,58 @@ +/** + * Represents the position in a text. + */ export interface IMark { + /** + * Gets or sets the name of the marker. + */ name: string; + + /** + * Gets or sets the text. + */ buffer: Buffer; + + /** + * Gets or sets the position. + */ position: number; + + /** + * Gets or sets the line-number of the position to mark. + */ line: number; + + /** + * Gets or sets the column-number of the position to mark. + */ column: number; + /** + * Generates a string representing the marker. + * + * @param indent + * The indentation of the error-message. + * + * @param maxLength + * The max number of characters to render in a row. + * + * @returns + * A string representing the marker. + */ getSnippet(indent?: number, maxLength?: number): string; + + /** + * Generates a string representing the marker. + * + * @param indent + * The indentation of the error-message. + * + * @param maxLength + * The max number of characters to render in a row. + * + * @returns + * A string representing the marker. + */ toString(compact?: boolean): string; } \ No newline at end of file diff --git a/src/System/YAML/YAMLException.ts b/src/System/YAML/YAMLException.ts index d9afe10d..cb16c404 100644 --- a/src/System/YAML/YAMLException.ts +++ b/src/System/YAML/YAMLException.ts @@ -27,16 +27,16 @@ export class YAMLException extends Exception /** * Initializes a new instance of the YAMLException class with a name, a reason, a mark and a message. - * + * * @param name * The name of the exception. - * + * * @param reason * The reason for the exception. - * + * * @param mark * The mark of the position that caused the exception. - * + * * @param message * The message of the exception. */ diff --git a/src/extension.ts b/src/extension.ts index b654932a..7ea83df1 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -57,7 +57,7 @@ export class Extension /** * Activates the extension. - * + * * @param context * A collection of utilities private to an extension. */ @@ -66,8 +66,8 @@ export class Extension this.context = context; context.subscriptions.push( - commands.registerCommand("markdownConverter.Convert", async () => await this.Convert()), - commands.registerCommand("markdownConverter.ConvertAll", async () => await this.ConvertAll())); + commands.registerCommand("markdownConverter.Convert", async () => this.Convert()), + commands.registerCommand("markdownConverter.ConvertAll", async () => this.ConvertAll())); return { extendMarkdownIt: (md: any) => @@ -78,6 +78,13 @@ export class Extension }; } + /** + * Disposes the extension. + */ + public async Dispose() + { + } + /** * Converts an opened `TextDocument`. */ @@ -93,18 +100,23 @@ export class Extension { await new ConvertAllTask(this).Execute(); } - - /** - * Disposes the extension. - */ - public async Dispose() - { - } } +/** + * The extension itself. + */ export let extension = new Extension(); -export let activate = async (context: ExtensionContext) => await extension.Activate(context); +/** + * Activates the extension. + * + * @param context + * The context provided by Visual Studio Code. + */ +export let activate = async (context: ExtensionContext) => extension.Activate(context); -export let deactivate = async () => await extension.Dispose(); +/** + * Deactivates the extension. + */ +export let deactivate = async () => extension.Dispose(); (Symbol as any).asyncIterator = Symbol.asyncIterator || Symbol.for("Symbol.asyncIterator"); \ No newline at end of file diff --git a/tslint.json b/tslint.json index 8a0ffbfc..16b2dd13 100644 --- a/tslint.json +++ b/tslint.json @@ -26,8 +26,14 @@ }, "no-empty-interface": false, "no-inferrable-types": true, + "unified-signatures": false, // Functionality - "await-promise": true, + "await-promise": { + "options": [ + "PromiseLike", + "Thenable" + ] + }, "ban-comma-operator": true, "forin": false, "no-bitwise": false, @@ -119,7 +125,6 @@ ] } }, - "await-promise": true, // Functionality "ban-comma-operator": true, "forin": false, From 8b6f68dfca073d56d21f1e4e38f2ddf93cfdaead Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 21 Jan 2019 16:24:49 +0100 Subject: [PATCH 34/77] Beautify the MarkdownContributions --- src/MarkdownConverter/ConversionTask.ts | 4 +- ...Extensions.ts => MarkdownContributions.ts} | 177 ++++++++---------- 2 files changed, 85 insertions(+), 96 deletions(-) rename src/MarkdownConverter/{MarkdownExtensions.ts => MarkdownContributions.ts} (50%) diff --git a/src/MarkdownConverter/ConversionTask.ts b/src/MarkdownConverter/ConversionTask.ts index 8dee8eba..6b3ad95e 100644 --- a/src/MarkdownConverter/ConversionTask.ts +++ b/src/MarkdownConverter/ConversionTask.ts @@ -26,7 +26,7 @@ import { StringUtils } from "../System/Text/StringUtils"; import { ConversionType } from "./ConversionType"; import { Converter } from "./Converter"; import { DestinationOrigin } from "./DestinationOrigin"; -import { getMarkdownExtensionContributions } from "./MarkdownExtensions"; +import { MarkdownContributions } from "./MarkdownContributions"; import { PuppeteerTask } from "./PuppeteerTask"; import { Utilities } from "./Utilities"; @@ -238,7 +238,7 @@ export abstract class ConversionTask extends PuppeteerTask if (Settings.Default.SystemParserEnabled) { - let mdExtensions = getMarkdownExtensionContributions(this.Extension.Context); + let mdExtensions = new MarkdownContributions(this.Extension.Context.extensionPath); for (let styleSheet of mdExtensions.previewStyles) { diff --git a/src/MarkdownConverter/MarkdownExtensions.ts b/src/MarkdownConverter/MarkdownContributions.ts similarity index 50% rename from src/MarkdownConverter/MarkdownExtensions.ts rename to src/MarkdownConverter/MarkdownContributions.ts index 5d3b989b..def1e063 100644 --- a/src/MarkdownConverter/MarkdownExtensions.ts +++ b/src/MarkdownConverter/MarkdownContributions.ts @@ -1,57 +1,14 @@ -import * as path from "path"; -import * as vscode from "vscode"; - -/* This class was copied from vscode: - * https://github.com/Microsoft/vscode/blob/4be0f0723091ae10b14ba20b334847d607bb7d55/extensions/markdown-language-features/src/markdownExtensions.ts - */ - -/** - * Resolves a resource of a markdown-extension. - * - * @param extension - * The extension the resource belongs to. - * - * @param resourcePath - * The path to the resource. - */ -const resolveExtensionResource = (extension: vscode.Extension, resourcePath: string): vscode.Uri => -{ - return vscode.Uri.file(path.join(extension.extensionPath, resourcePath)).with({ scheme: "vscode-resource" }); -}; +import * as Path from "path"; +import { Extension, extensions, Uri } from "vscode"; /** - * Resolves multiple resources of a markdown-extension. - * - * @param extension - * The extension the resources belong to. + * Provides the functionality to load markdown-conributions. * - * @param resourcePaths - * The paths of the resources to resolve. - */ -const resolveExtensionResources = (extension: vscode.Extension, resourcePaths: string[]): vscode.Uri[] => -{ - const result: vscode.Uri[] = []; - if (Array.isArray(resourcePaths)) - { - for (const resource of resourcePaths) - { - try - { - result.push(resolveExtensionResource(extension, resource)); - } - catch (e) - { - } - } - } - return result; -}; - -/** - * Represents the contributions of a markdown-extension. + * For more information see the original code: + * https://github.com/Microsoft/vscode/blob/4be0f0723091ae10b14ba20b334847d607bb7d55/extensions/markdown-language-features/src/markdownExtensions.ts */ -export class MarkdownExtensionContributions +export class MarkdownContributions { /** * The path to the markdown-extension. @@ -61,17 +18,17 @@ export class MarkdownExtensionContributions /** * The provided scripts. */ - private readonly scripts: vscode.Uri[] = []; + private readonly scripts: Uri[] = []; /** * The provided styles. */ - private readonly styles: vscode.Uri[] = []; + private readonly styles: Uri[] = []; /** * The roots of the markdown-preview. */ - private readonly previewResourceRootsVal: vscode.Uri[] = []; + private readonly resourceRoots: Uri[] = []; /** * The plugins of the markdown-preview. @@ -83,6 +40,9 @@ export class MarkdownExtensionContributions */ private loaded = false; + /** + * Initializes a new instance of the `MarkdownContributions` class. + */ public constructor(extensionPath: string) { this.extensionPath = extensionPath; @@ -91,28 +51,28 @@ export class MarkdownExtensionContributions /** * Gets the provided scripts. */ - public get previewScripts(): vscode.Uri[] + public get previewScripts(): Uri[] { - this.load(); + this.Load(); return this.scripts; } /** * Gets the provided styles. */ - public get previewStyles(): vscode.Uri[] + public get previewStyles(): Uri[] { - this.load(); + this.Load(); return this.styles; } /** * Gets the roots of the markdown-preview. */ - public get previewResourceRoots(): vscode.Uri[] + public get previewResourceRoots(): Uri[] { - this.load(); - return this.previewResourceRootsVal; + this.Load(); + return this.resourceRoots; } /** @@ -120,14 +80,54 @@ export class MarkdownExtensionContributions */ public get markdownItPlugins(): Thenable<(md: any) => any>[] { - this.load(); + this.Load(); return this.plugins; } /** - * Loads the contributions of all extension. + * Resolves the path to a resource. + * + * @param extension + * The extension the resource belongs to. + * + * @param resourcePath + * The path to the resource. + */ + private static ResolveExtensionResource(extension: Extension, resourcePath: string): Uri + { + return Uri.file(Path.join(extension.extensionPath, resourcePath)).with({ scheme: "vscode-resource" }); + } + + /** + * Resolves the path to the resources of an extension. + * + * @param extension + * The extension the resources belong to. + * + * @param resourcePaths + * The paths to the resources. + */ + private static ResolveExtensionResources(extension: Extension, resourcePaths: string[]): Uri[] + { + let result: Uri[] = []; + + for (let resourcePath of resourcePaths) + { + try + { + result.push(MarkdownContributions.ResolveExtensionResource(extension, resourcePath)); + } + catch + { } + } + + return result; + } + + /** + * Loads all contributions. */ - private load() + private async Load(): Promise { if (this.loaded) { @@ -135,7 +135,7 @@ export class MarkdownExtensionContributions } this.loaded = true; - for (const extension of vscode.extensions.all) + for (const extension of extensions.all) { const contributes = extension.packageJSON && extension.packageJSON.contributes; if (!contributes) @@ -144,16 +144,30 @@ export class MarkdownExtensionContributions } this.tryLoadPreviewStyles(contributes, extension); - this.tryLoadPreviewScripts(contributes, extension); - this.tryLoadMarkdownItPlugins(contributes, extension); + this.LoadScripts(contributes, extension); + this.LoadMarkdownPlugins(extension, contributes); if (contributes["markdown.previewScripts"] || contributes["markdown.previewStyles"]) { - this.previewResourceRootsVal.push(vscode.Uri.file(extension.extensionPath)); + this.resourceRoots.push(Uri.file(extension.extensionPath)); } } } + /** + * Loads the preview-scripts. + * + * @param contributes + * The contributions of the extension. + * + * @param extension + * The extension to load the contributions from. + */ + private LoadScripts(contributes: any, extension: Extension) + { + this.scripts.push(...MarkdownContributions.ResolveExtensionResources(extension, contributes["markdown.previewScripts"])); + } + /** * Loads a markdown-it plugin. * @@ -163,7 +177,7 @@ export class MarkdownExtensionContributions * @param extension * The extension of to load the plug-in from. */ - private tryLoadMarkdownItPlugins(contributes: any, extension: vscode.Extension) + private LoadMarkdownPlugins(extension: Extension, contributes: any) { if (contributes["markdown.markdownItPlugins"]) { @@ -178,20 +192,6 @@ export class MarkdownExtensionContributions } } - /** - * Loads the preview-scripts. - * - * @param contributes - * The contributions of the extension. - * - * @param extension - * The extension to load the contributions from. - */ - private tryLoadPreviewScripts(contributes: any, extension: vscode.Extension) - { - this.scripts.push(...resolveExtensionResources(extension, contributes["markdown.previewScripts"])); - } - /** * Loads the styles. * @@ -201,19 +201,8 @@ export class MarkdownExtensionContributions * @param extension * The extension to load the contributions from. */ - private tryLoadPreviewStyles(contributes: any, extension: vscode.Extension) + private tryLoadPreviewStyles(contributes: any, extension: Extension) { - this.styles.push(...resolveExtensionResources(extension, contributes["markdown.previewStyles"])); + this.styles.push(...MarkdownContributions.ResolveExtensionResources(extension, contributes["markdown.previewStyles"])); } -} - -/** - * Gets all markdown-contributions. - * - * @param context - * The context provided by Visual Studio Code. - */ -export function getMarkdownExtensionContributions(context: vscode.ExtensionContext): MarkdownExtensionContributions -{ - return new MarkdownExtensionContributions(context.extensionPath); } \ No newline at end of file From 2b0e3ce0576e0c37b6a9c2e745fd8f0747730a57 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 21 Jan 2019 16:42:07 +0100 Subject: [PATCH 35/77] Normalize imports --- src/MarkdownConverter/ConversionTask.ts | 24 +++++++++---------- src/MarkdownConverter/Converter.ts | 12 +++++----- .../MarkdownContributions.ts | 2 +- src/MarkdownConverter/PuppeteerTask.ts | 6 ++--- src/MarkdownConverter/Utilities.ts | 2 +- src/Properties/ResourceManager.ts | 2 +- src/Properties/Settings.ts | 2 +- src/System/Drawing/Document.ts | 14 +++++------ src/System/Drawing/Slugifier.ts | 2 +- src/System/IO/FileException.ts | 2 +- src/System/IO/FileNotFoundException.ts | 2 +- src/System/YAML/YAMLException.ts | 2 +- src/extension.ts | 2 +- src/test/index.ts | 2 +- 14 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/MarkdownConverter/ConversionTask.ts b/src/MarkdownConverter/ConversionTask.ts index 6b3ad95e..e1d82328 100644 --- a/src/MarkdownConverter/ConversionTask.ts +++ b/src/MarkdownConverter/ConversionTask.ts @@ -1,17 +1,17 @@ -import * as ChildProcess from "child_process"; +import ChildProcess = require("child_process"); import clone = require("clone"); import CultureInfo from "culture-info"; -import * as FileSystem from "fs-extra"; -import * as HighlightJs from "highlight.js"; -import * as MarkdownIt from "markdown-it"; -import * as Anchor from "markdown-it-anchor"; -import * as Checkbox from "markdown-it-checkbox"; -import * as MarkdownItEmoji from "markdown-it-emoji"; -import * as MarkdownItToc from "markdown-it-table-of-contents"; -import * as Path from "path"; -import * as Format from "string-template"; -import * as Transliteration from "transliteration"; -import * as TwEmoji from "twemoji"; +import FileSystem = require("fs-extra"); +import HighlightJs = require("highlight.js"); +import MarkdownIt = require("markdown-it"); +import Anchor = require("markdown-it-anchor"); +import Checkbox = require("markdown-it-checkbox"); +import MarkdownItEmoji = require("markdown-it-emoji"); +import MarkdownItToc = require("markdown-it-table-of-contents"); +import Path = require("path"); +import Format = require("string-template"); +import Transliteration = require("transliteration"); +import TwEmoji = require("twemoji"); import { isNullOrUndefined } from "util"; import { TextDocument, window, workspace, WorkspaceFolder } from "vscode"; import { Extension } from "../extension"; diff --git a/src/MarkdownConverter/Converter.ts b/src/MarkdownConverter/Converter.ts index 2fb0d495..e84d193d 100644 --- a/src/MarkdownConverter/Converter.ts +++ b/src/MarkdownConverter/Converter.ts @@ -1,10 +1,10 @@ -import * as FS from "fs-extra"; -import * as PortFinder from "get-port"; -import * as http from "http"; -import * as Server from "http-server"; -import * as Path from "path"; +import FS = require("fs-extra"); +import PortFinder = require("get-port"); +import http = require("http"); +import Server = require("http-server"); +import Path = require("path"); import Puppeteer = require("puppeteer"); -import * as URL from "url"; +import URL = require("url"); import { isNullOrUndefined } from "util"; import { Document } from "../System/Drawing/Document"; import { FileException } from "../System/IO/FileException"; diff --git a/src/MarkdownConverter/MarkdownContributions.ts b/src/MarkdownConverter/MarkdownContributions.ts index def1e063..86e3640f 100644 --- a/src/MarkdownConverter/MarkdownContributions.ts +++ b/src/MarkdownConverter/MarkdownContributions.ts @@ -1,5 +1,5 @@ -import * as Path from "path"; +import Path = require("path"); import { Extension, extensions, Uri } from "vscode"; /** diff --git a/src/MarkdownConverter/PuppeteerTask.ts b/src/MarkdownConverter/PuppeteerTask.ts index 8b76efe9..dfa3888f 100644 --- a/src/MarkdownConverter/PuppeteerTask.ts +++ b/src/MarkdownConverter/PuppeteerTask.ts @@ -1,6 +1,6 @@ -import * as FileSystem from "fs-extra"; -import * as Puppeteer from "puppeteer"; -import * as Format from "string-template"; +import FileSystem = require("fs-extra"); +import Puppeteer = require("puppeteer"); +import Format = require("string-template"); import { ProgressLocation, window } from "vscode"; import { Extension } from "../extension"; import { ResourceManager } from "../Properties/ResourceManager"; diff --git a/src/MarkdownConverter/Utilities.ts b/src/MarkdownConverter/Utilities.ts index 055af3d6..985e59f7 100644 --- a/src/MarkdownConverter/Utilities.ts +++ b/src/MarkdownConverter/Utilities.ts @@ -1,4 +1,4 @@ -import * as shell from "async-shelljs"; +import shell = require("async-shelljs"); /** * Provides static methods. diff --git a/src/Properties/ResourceManager.ts b/src/Properties/ResourceManager.ts index a72cc30e..ae709526 100644 --- a/src/Properties/ResourceManager.ts +++ b/src/Properties/ResourceManager.ts @@ -1,5 +1,5 @@ import CultureInfo from "culture-info"; -import * as Path from "path"; +import Path = require("path"); import { Resource } from "../System/Resources/Resource"; /** diff --git a/src/Properties/Settings.ts b/src/Properties/Settings.ts index b8fbd385..e4090bf7 100644 --- a/src/Properties/Settings.ts +++ b/src/Properties/Settings.ts @@ -1,4 +1,4 @@ -import * as VSCode from "vscode"; +import VSCode = require("vscode"); import { MultiRange } from "../../node_modules/multi-integer-range"; import { ConversionType } from "../MarkdownConverter/ConversionType"; import { DestinationOrigin } from "../MarkdownConverter/DestinationOrigin"; diff --git a/src/System/Drawing/Document.ts b/src/System/Drawing/Document.ts index d17c2614..909be4e5 100644 --- a/src/System/Drawing/Document.ts +++ b/src/System/Drawing/Document.ts @@ -1,13 +1,13 @@ import CultureInfo from "culture-info"; -import * as Dedent from "dedent"; -import * as FrontMatter from "front-matter"; -import * as FileSystem from "fs-extra"; +import Dedent = require("dedent"); +import FrontMatter = require("front-matter"); +import FileSystem = require("fs-extra"); import { MarkdownIt } from "markdown-it"; -import * as Mustache from "mustache"; -import * as OS from "os"; -import * as Path from "path"; +import Mustache = require("mustache"); +import OS = require("os"); +import Path = require("path"); import { TextDocument } from "vscode"; -import * as YAML from "yamljs"; +import YAML = require("yamljs"); import { ResourceManager } from "../../Properties/ResourceManager"; import { DateTimeFormatter } from "../Globalization/DateTimeFormatter"; import { FileException } from "../IO/FileException"; diff --git a/src/System/Drawing/Slugifier.ts b/src/System/Drawing/Slugifier.ts index 92d587f9..84d2836d 100644 --- a/src/System/Drawing/Slugifier.ts +++ b/src/System/Drawing/Slugifier.ts @@ -1,4 +1,4 @@ -import * as Transliteration from "transliteration"; +import Transliteration = require("transliteration"); /** * Provides the functionality to generate slugs. diff --git a/src/System/IO/FileException.ts b/src/System/IO/FileException.ts index 37788a2f..1ade0ff5 100644 --- a/src/System/IO/FileException.ts +++ b/src/System/IO/FileException.ts @@ -1,4 +1,4 @@ -import * as Format from "string-template"; +import Format = require("string-template"); import { ResourceManager } from "../../Properties/ResourceManager"; import { IOException } from "./IOException"; diff --git a/src/System/IO/FileNotFoundException.ts b/src/System/IO/FileNotFoundException.ts index e5368553..94f3cc52 100644 --- a/src/System/IO/FileNotFoundException.ts +++ b/src/System/IO/FileNotFoundException.ts @@ -1,4 +1,4 @@ -import * as Format from "string-template"; +import Format = require("string-template"); import { FileException } from "./FileException"; /** diff --git a/src/System/YAML/YAMLException.ts b/src/System/YAML/YAMLException.ts index cb16c404..8a849b7d 100644 --- a/src/System/YAML/YAMLException.ts +++ b/src/System/YAML/YAMLException.ts @@ -1,4 +1,4 @@ -import * as Format from "string-template"; +import Format = require("string-template"); import { ResourceManager } from "../../Properties/ResourceManager"; import { Exception } from "../Exception"; import { IMark } from "./Mark"; diff --git a/src/extension.ts b/src/extension.ts index 7ea83df1..bdb18a89 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -2,7 +2,7 @@ // Import the module and reference it with the alias vscode in your code below import CultureInfo from "culture-info"; import { MarkdownIt } from "markdown-it"; -import * as Path from "path"; +import Path = require("path"); import { commands, env, ExtensionContext } from "vscode"; import { ConvertAllTask } from "./MarkdownConverter/ConvertAllTask"; import { ConvertTask } from "./MarkdownConverter/ConvertTask"; diff --git a/src/test/index.ts b/src/test/index.ts index bd7b46af..79e0e814 100644 --- a/src/test/index.ts +++ b/src/test/index.ts @@ -11,7 +11,7 @@ * a possible error to the callback or null if none. */ -import * as testRunner from "vscode/lib/testrunner"; +import testRunner = require("vscode/lib/testrunner"); // You can directly control Mocha options by uncommenting the following lines // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info From 822bdd3eff640ce7f72f949c6d6bd4e2bbfde796 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 21 Jan 2019 16:57:02 +0100 Subject: [PATCH 36/77] Remove useless class --- src/MarkdownConverter/ConversionTask.ts | 7 +- src/System/Globalization/DateTimeFormatter.ts | 21 ++-- src/System/Text/StringUtils.ts | 101 ------------------ src/twemoji.d.ts | 3 +- 4 files changed, 14 insertions(+), 118 deletions(-) delete mode 100644 src/System/Text/StringUtils.ts diff --git a/src/MarkdownConverter/ConversionTask.ts b/src/MarkdownConverter/ConversionTask.ts index e1d82328..67e2c9c3 100644 --- a/src/MarkdownConverter/ConversionTask.ts +++ b/src/MarkdownConverter/ConversionTask.ts @@ -1,5 +1,5 @@ import ChildProcess = require("child_process"); -import clone = require("clone"); +import Clone = require("clone"); import CultureInfo from "culture-info"; import FileSystem = require("fs-extra"); import HighlightJs = require("highlight.js"); @@ -22,7 +22,6 @@ import { EmojiType } from "../System/Drawing/EmojiType"; import { ListType } from "../System/Drawing/ListType"; import { Slugifier } from "../System/Drawing/Slugifier"; import { FileException } from "../System/IO/FileException"; -import { StringUtils } from "../System/Text/StringUtils"; import { ConversionType } from "./ConversionType"; import { Converter } from "./Converter"; import { DestinationOrigin } from "./DestinationOrigin"; @@ -296,7 +295,7 @@ export abstract class ConversionTask extends PuppeteerTask if (Settings.Default.SystemParserEnabled) { - parser = clone(this.Extension.VSCodeParser); + parser = Clone(this.Extension.VSCodeParser); parser.normalizeLink = (link: string) => link; parser.normalizeLinkText = (link: string) => link; } @@ -362,7 +361,7 @@ export abstract class ConversionTask extends PuppeteerTask 'class="emoji" ' + `title=":${token[id].markup}:" ` + `alt=":${token[id].markup}:" ` + - `src="https://assets-cdn.github.com/images/icons/emoji/unicode/${StringUtils.UTF8CharToCodePoints(token[id].content).toString(16).toLowerCase()}.png" ` + + `src="https://assets-cdn.github.com/images/icons/emoji/unicode/${TwEmoji.convert.toCodePoint(token[id].content).toLowerCase()}.png" ` + 'align="absmiddle" />'; } }; diff --git a/src/System/Globalization/DateTimeFormatter.ts b/src/System/Globalization/DateTimeFormatter.ts index 0d745ddc..ebbc18da 100644 --- a/src/System/Globalization/DateTimeFormatter.ts +++ b/src/System/Globalization/DateTimeFormatter.ts @@ -1,6 +1,5 @@ import CultureInfo from "culture-info"; import { ResourceManager } from "../../Properties/ResourceManager"; -import { StringUtils } from "../Text/StringUtils"; /** * Provides the functionallity to format a date. @@ -72,13 +71,13 @@ export class DateTimeFormatter { if (/^f+$/g.test(match)) { - return StringUtils.PadLeft(date.getMilliseconds().toString(), match.length, "0"); + return date.getMilliseconds().toString().padStart(match.length, "0"); } else if (/^F+$/g.test(match)) { if (date.getMilliseconds() > 0) { - return StringUtils.PadLeft(date.getMilliseconds().toString(), match.length, "0"); + return date.getMilliseconds().toString().padStart(match.length, "0"); } else { @@ -87,36 +86,36 @@ export class DateTimeFormatter } else if (/^d{1,2}$/g.test(match)) { - return StringUtils.PadLeft(date.getDate().toString(), match.length, "0"); + return date.getDate().toString().padStart(match.length, "0"); } else if (/^h+$/g.test(match)) { let hours = (date.getHours() % 12 || 12); - return StringUtils.PadLeft(hours.toString(), match.length, "0"); + return hours.toString().padStart(match.length, "0"); } else if (/^H+$/g.test(match)) { - return StringUtils.PadLeft(date.getHours().toString(), match.length, "0"); + return date.getHours().toString().padStart(match.length, "0"); } else if (/^m+$/g.test(match)) { - return StringUtils.PadLeft(date.getMinutes().toString(), match.length, "0"); + return date.getMinutes().toString().padStart(match.length, "0"); } else if (/^M{1,2}$/g.test(match)) { - return StringUtils.PadLeft((date.getMonth() + 1).toString(), match.length, "0"); + return (date.getMonth() + 1).toString().padStart(match.length, "0"); } else if (/^s+$/g.test(match)) { - return StringUtils.PadLeft(date.getSeconds().toString(), match.length, "0"); + return date.getSeconds().toString().padStart(match.length, "0"); } else if (/^y{1,2}$/g.test(match)) { - return StringUtils.PadLeft(date.getFullYear().toString().slice(-2), match.length, "0"); + return date.getFullYear().toString().slice(-2).padStart(match.length, "0"); } else if (/^y+$/g.test(match)) { - return StringUtils.PadLeft(date.getFullYear().toString(), match.length, "0"); + return date.getFullYear().toString().padStart(match.length, "0"); } else if (match in tokens) { diff --git a/src/System/Text/StringUtils.ts b/src/System/Text/StringUtils.ts deleted file mode 100644 index b9a8857f..00000000 --- a/src/System/Text/StringUtils.ts +++ /dev/null @@ -1,101 +0,0 @@ -/** - * Provides string-functionalities. - */ -export class StringUtils -{ - /** - * Converts a string to code its code-points-value. - * - * @param subject - * The string to convert. - */ - public static UTF8CharToCodePoints(subject: string): number - { - let buffer = Buffer.from(subject); - let result = 0; - let length; - - /* Determining the mask-type of the UTF-8 char. - * The UTF-8 Masks are as followed: - * | Unicode-Range | UTF-8-Mask | Length (in bytes) | - * |-----------------------|------------------------------------:|------------------:| - * | 0000 0000 – 0000 007F | 0xxxxxxx | 1 | - * | 0000 0080 – 0000 07FF | 110xxxxx 10xxxxxx | 2 | - * | 0000 0800 – 0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx | 3 | - * | 0001 0000 – 0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx | 4 | - */ - - if ((buffer[0] & 0x80) === 0x0) - { - return buffer[0]; - } - - if ((buffer[0] & 0xE0) === 0xC0) - { - length = 2; - buffer[0] = buffer[0] & 0x1F; - } - if ((buffer[0] & 0xF0) === 0xE0) - { - length = 3; - buffer[0] = buffer[0] & 0xF; - } - - if ((buffer[0] & 0xF8) === 0xF0) - { - length = 4; - buffer[0] = buffer[0] & 0x7; - } - - length--; - - for (let i = 0; i <= length; i++) - { - if ((buffer[i] & 0xC0) === 0x80 || i === 0) - { - buffer[i] = buffer[i] & 0x3F; - result += ((buffer[i] << ((length - i) * 8)) >> ((length - i) * 2)); - } - else - { - throw new SyntaxError("The given character isn't a valid UTF-8-character."); - } - } - return result; - } - - /** - * Returns a new string that right-aligns the characters in this instance by padding them on the left with a specified Unicode character, for a specified total length. - * - * @param subject - * The subject to pad. - * - * @param totalWidth - * The number of characters in the resulting string, equal to the number of original characters plus any additional padding characters. - * - * @param paddingChar - * A Unicode padding character. - */ - public static PadLeft(subject: string, totalWidth: number, paddingChar: string) - { - for (let i: number = subject.length; i < totalWidth; i++) - { - subject = paddingChar + subject; - } - return subject; - } - - /** - * Converts a number to a hexadecimal string. - * - * @param subject - * The number to convert. - * - * @param size - * The length of the string to return. - */ - public static DecToHexString(subject: number, length = 2): string - { - return this.PadLeft(subject.toString(16), length, "0"); - } -} \ No newline at end of file diff --git a/src/twemoji.d.ts b/src/twemoji.d.ts index 619c0926..afd53d5b 100644 --- a/src/twemoji.d.ts +++ b/src/twemoji.d.ts @@ -93,8 +93,7 @@ declare module "twemoji" /** * Provides some utilities. */ - public readonly convert: { - } + public readonly convert: Utilities /** * Replaces all emojis of the `text` with ``-tags. From 5ab42e428149cb0cfe9c7bb2eef5bb26d66e6f9a Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 21 Jan 2019 17:00:14 +0100 Subject: [PATCH 37/77] Rework the directory-structure --- src/{MarkdownConverter => }/ConversionTask.ts | 16 ++++++++-------- src/{MarkdownConverter => }/ConversionType.ts | 0 src/{MarkdownConverter => }/ConvertAllTask.ts | 2 +- src/{MarkdownConverter => }/ConvertTask.ts | 4 ++-- src/{MarkdownConverter => }/Converter.ts | 4 ++-- src/{MarkdownConverter => }/DestinationOrigin.ts | 0 .../MarkdownContributions.ts | 0 .../MarkdownFileNotFoundException.ts | 4 ++-- src/Properties/Settings.ts | 4 ++-- src/{MarkdownConverter => }/PuppeteerTask.ts | 6 +++--- src/{MarkdownConverter => }/Task.ts | 2 +- src/{MarkdownConverter => }/Utilities.ts | 0 src/extension.ts | 4 ++-- 13 files changed, 23 insertions(+), 23 deletions(-) rename src/{MarkdownConverter => }/ConversionTask.ts (96%) rename src/{MarkdownConverter => }/ConversionType.ts (100%) rename src/{MarkdownConverter => }/ConvertAllTask.ts (98%) rename src/{MarkdownConverter => }/ConvertTask.ts (93%) rename src/{MarkdownConverter => }/Converter.ts (98%) rename src/{MarkdownConverter => }/DestinationOrigin.ts (100%) rename src/{MarkdownConverter => }/MarkdownContributions.ts (100%) rename src/{MarkdownConverter => }/MarkdownFileNotFoundException.ts (70%) rename src/{MarkdownConverter => }/PuppeteerTask.ts (96%) rename src/{MarkdownConverter => }/Task.ts (94%) rename src/{MarkdownConverter => }/Utilities.ts (100%) diff --git a/src/MarkdownConverter/ConversionTask.ts b/src/ConversionTask.ts similarity index 96% rename from src/MarkdownConverter/ConversionTask.ts rename to src/ConversionTask.ts index 67e2c9c3..a4d4aef0 100644 --- a/src/MarkdownConverter/ConversionTask.ts +++ b/src/ConversionTask.ts @@ -14,19 +14,19 @@ import Transliteration = require("transliteration"); import TwEmoji = require("twemoji"); import { isNullOrUndefined } from "util"; import { TextDocument, window, workspace, WorkspaceFolder } from "vscode"; -import { Extension } from "../extension"; -import { ResourceManager } from "../Properties/ResourceManager"; -import { Settings } from "../Properties/Settings"; -import { Document } from "../System/Drawing/Document"; -import { EmojiType } from "../System/Drawing/EmojiType"; -import { ListType } from "../System/Drawing/ListType"; -import { Slugifier } from "../System/Drawing/Slugifier"; -import { FileException } from "../System/IO/FileException"; import { ConversionType } from "./ConversionType"; import { Converter } from "./Converter"; import { DestinationOrigin } from "./DestinationOrigin"; +import { Extension } from "./extension"; import { MarkdownContributions } from "./MarkdownContributions"; +import { ResourceManager } from "./Properties/ResourceManager"; +import { Settings } from "./Properties/Settings"; import { PuppeteerTask } from "./PuppeteerTask"; +import { Document } from "./System/Drawing/Document"; +import { EmojiType } from "./System/Drawing/EmojiType"; +import { ListType } from "./System/Drawing/ListType"; +import { Slugifier } from "./System/Drawing/Slugifier"; +import { FileException } from "./System/IO/FileException"; import { Utilities } from "./Utilities"; /** diff --git a/src/MarkdownConverter/ConversionType.ts b/src/ConversionType.ts similarity index 100% rename from src/MarkdownConverter/ConversionType.ts rename to src/ConversionType.ts diff --git a/src/MarkdownConverter/ConvertAllTask.ts b/src/ConvertAllTask.ts similarity index 98% rename from src/MarkdownConverter/ConvertAllTask.ts rename to src/ConvertAllTask.ts index 4544d20a..117517a6 100644 --- a/src/MarkdownConverter/ConvertAllTask.ts +++ b/src/ConvertAllTask.ts @@ -1,6 +1,6 @@ import { extensions, TextDocument, workspace } from "vscode"; -import { Extension } from "../extension"; import { ConversionTask } from "./ConversionTask"; +import { Extension } from "./extension"; /** * Represents a task for converting all documents in the workspace. diff --git a/src/MarkdownConverter/ConvertTask.ts b/src/ConvertTask.ts similarity index 93% rename from src/MarkdownConverter/ConvertTask.ts rename to src/ConvertTask.ts index 43a32e7b..644034d3 100644 --- a/src/MarkdownConverter/ConvertTask.ts +++ b/src/ConvertTask.ts @@ -1,8 +1,8 @@ import { TextDocument, window } from "vscode"; -import { Extension } from "../extension"; -import { Settings } from "../Properties/Settings"; import { ConversionTask } from "./ConversionTask"; +import { Extension } from "./extension"; import { MarkdownFileNotFoundException } from "./MarkdownFileNotFoundException"; +import { Settings } from "./Properties/Settings"; /** * Represens a task for converting the currently opened document. diff --git a/src/MarkdownConverter/Converter.ts b/src/Converter.ts similarity index 98% rename from src/MarkdownConverter/Converter.ts rename to src/Converter.ts index e84d193d..a27a7aed 100644 --- a/src/MarkdownConverter/Converter.ts +++ b/src/Converter.ts @@ -6,9 +6,9 @@ import Path = require("path"); import Puppeteer = require("puppeteer"); import URL = require("url"); import { isNullOrUndefined } from "util"; -import { Document } from "../System/Drawing/Document"; -import { FileException } from "../System/IO/FileException"; import { ConversionType } from "./ConversionType"; +import { Document } from "./System/Drawing/Document"; +import { FileException } from "./System/IO/FileException"; /** * Provides a markdown-converter. diff --git a/src/MarkdownConverter/DestinationOrigin.ts b/src/DestinationOrigin.ts similarity index 100% rename from src/MarkdownConverter/DestinationOrigin.ts rename to src/DestinationOrigin.ts diff --git a/src/MarkdownConverter/MarkdownContributions.ts b/src/MarkdownContributions.ts similarity index 100% rename from src/MarkdownConverter/MarkdownContributions.ts rename to src/MarkdownContributions.ts diff --git a/src/MarkdownConverter/MarkdownFileNotFoundException.ts b/src/MarkdownFileNotFoundException.ts similarity index 70% rename from src/MarkdownConverter/MarkdownFileNotFoundException.ts rename to src/MarkdownFileNotFoundException.ts index 8b2ae9ee..6454874e 100644 --- a/src/MarkdownConverter/MarkdownFileNotFoundException.ts +++ b/src/MarkdownFileNotFoundException.ts @@ -1,5 +1,5 @@ -import { ResourceManager } from "../Properties/ResourceManager"; -import { FileNotFoundException } from "../System/IO/FileNotFoundException"; +import { ResourceManager } from "./Properties/ResourceManager"; +import { FileNotFoundException } from "./System/IO/FileNotFoundException"; /** * Occurs when a markdown-file couldn't be found. diff --git a/src/Properties/Settings.ts b/src/Properties/Settings.ts index e4090bf7..2c171f6c 100644 --- a/src/Properties/Settings.ts +++ b/src/Properties/Settings.ts @@ -1,7 +1,7 @@ import VSCode = require("vscode"); import { MultiRange } from "../../node_modules/multi-integer-range"; -import { ConversionType } from "../MarkdownConverter/ConversionType"; -import { DestinationOrigin } from "../MarkdownConverter/DestinationOrigin"; +import { ConversionType } from "../ConversionType"; +import { DestinationOrigin } from "../DestinationOrigin"; import { CustomPaperFormat } from "../System/Drawing/CustomPaperFormat"; import { EmojiType } from "../System/Drawing/EmojiType"; import { ListType } from "../System/Drawing/ListType"; diff --git a/src/MarkdownConverter/PuppeteerTask.ts b/src/PuppeteerTask.ts similarity index 96% rename from src/MarkdownConverter/PuppeteerTask.ts rename to src/PuppeteerTask.ts index dfa3888f..080f806e 100644 --- a/src/MarkdownConverter/PuppeteerTask.ts +++ b/src/PuppeteerTask.ts @@ -2,9 +2,9 @@ import FileSystem = require("fs-extra"); import Puppeteer = require("puppeteer"); import Format = require("string-template"); import { ProgressLocation, window } from "vscode"; -import { Extension } from "../extension"; -import { ResourceManager } from "../Properties/ResourceManager"; -import { Exception } from "../System/Exception"; +import { Extension } from "./extension"; +import { ResourceManager } from "./Properties/ResourceManager"; +import { Exception } from "./System/Exception"; import { Task } from "./Task"; /** diff --git a/src/MarkdownConverter/Task.ts b/src/Task.ts similarity index 94% rename from src/MarkdownConverter/Task.ts rename to src/Task.ts index e75a6e7d..2d1b06dc 100644 --- a/src/MarkdownConverter/Task.ts +++ b/src/Task.ts @@ -1,4 +1,4 @@ -import { Extension } from "../extension"; +import { Extension } from "./extension"; /** * Represents a task. diff --git a/src/MarkdownConverter/Utilities.ts b/src/Utilities.ts similarity index 100% rename from src/MarkdownConverter/Utilities.ts rename to src/Utilities.ts diff --git a/src/extension.ts b/src/extension.ts index bdb18a89..427ba625 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -4,8 +4,8 @@ import CultureInfo from "culture-info"; import { MarkdownIt } from "markdown-it"; import Path = require("path"); import { commands, env, ExtensionContext } from "vscode"; -import { ConvertAllTask } from "./MarkdownConverter/ConvertAllTask"; -import { ConvertTask } from "./MarkdownConverter/ConvertTask"; +import { ConvertAllTask } from "./ConvertAllTask"; +import { ConvertTask } from "./ConvertTask"; import { ResourceManager } from "./Properties/ResourceManager"; /** From 7fcbfd43151b3ae12144d50a0be9d0c2e580fe38 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 22 Jan 2019 13:28:59 +0100 Subject: [PATCH 38/77] Replace "localizable-resources" by "localized-resource-manager" --- package-lock.json | 76 +++++++++++++------ package.json | 3 +- src/ConversionTask.ts | 22 +++--- src/MarkdownFileNotFoundException.ts | 4 +- src/Properties/ResourceManager.ts | 44 ----------- src/Properties/Resources.ts | 43 +++++++++++ src/PuppeteerTask.ts | 18 ++--- src/System/Drawing/Document.ts | 6 +- src/System/Globalization/DateTimeFormatter.ts | 18 ++--- src/System/IO/FileException.ts | 4 +- src/System/Resources/Resource.ts | 54 ------------- src/System/YAML/YAMLException.ts | 4 +- src/extension.ts | 6 +- 13 files changed, 139 insertions(+), 163 deletions(-) delete mode 100644 src/Properties/ResourceManager.ts create mode 100644 src/Properties/Resources.ts delete mode 100644 src/System/Resources/Resource.ts diff --git a/package-lock.json b/package-lock.json index 53da27b8..cfbbafaf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -560,6 +560,14 @@ "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", "dev": true }, + "comment-json": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-1.1.3.tgz", + "integrity": "sha1-aYbDMw/uDEyeAMI5jNYa+l2PI54=", + "requires": { + "json-parser": "^1.0.0" + } + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -628,9 +636,9 @@ } }, "culture-info": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/culture-info/-/culture-info-0.0.4.tgz", - "integrity": "sha512-V9LBPJGPJpQib30+nvbStq4jwc1dNinCEgc0uOrMbYwDyX//JLfRurna5YALtj9NhVqiP7gPRD20+Mr8Z9aZMg==" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/culture-info/-/culture-info-1.0.2.tgz", + "integrity": "sha512-pJMu0569vgfeHKJlBzfZ5rqzouP1UqvJP6yPYYgo7Jqr9ZntcwHLUh05WqqmQLiLdj9M0AJLZvHXiJ3LgYnYWg==" }, "dashdash": { "version": "1.14.1", @@ -1734,6 +1742,21 @@ "dev": true, "optional": true }, + "json-parser": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/json-parser/-/json-parser-1.1.5.tgz", + "integrity": "sha1-5i7FJh0aal/CDoEqMgdAxtkAVnc=", + "requires": { + "esprima": "^2.7.0" + }, + "dependencies": { + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=" + } + } + }, "json-schema": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", @@ -1818,34 +1841,38 @@ "uc.micro": "^1.0.1" } }, - "localizable-resources": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/localizable-resources/-/localizable-resources-1.0.6.tgz", - "integrity": "sha512-zR8dZsELW92caIdovliOwbsSCiJ54cGkkquAq2CQ65+WuDP3NwEORlZpUKImYG5BwOTIkoG+uyksrwBrHeW/Uw==", - "requires": { - "culture-info": "0.0.4", - "fs-extra": "^6.0.1", - "mustache": "^2.3.0", - "yamljs": "^0.3.0" + "localized-resource-manager": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/localized-resource-manager/-/localized-resource-manager-1.0.1.tgz", + "integrity": "sha512-BsCEMrotACaMD9twfoHLonnYLXOSm2ZTpeXlL4Iwh5ZrXpJmhNYUkgskf+Pyh8LwyBJlZgwvYJi3Pta4cAreUA==", + "requires": { + "@types/mustache": "^0.8.32", + "comment-json": "^1.1.3", + "culture-info": "^1.0.2", + "fs-extra": "^7.0.1", + "mustache": "^3.0.1", + "yaml": "^1.2.0" }, "dependencies": { + "@types/mustache": { + "version": "0.8.32", + "resolved": "https://registry.npmjs.org/@types/mustache/-/mustache-0.8.32.tgz", + "integrity": "sha512-RTVWV485OOf4+nO2+feurk0chzHkSjkjALiejpHltyuMf/13fGymbbNNFrSKdSSUg1TIwzszXdWsVirxgqYiFA==" + }, "fs-extra": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-6.0.1.tgz", - "integrity": "sha512-GnyIkKhhzXZUWFCaJzvyDLEEgDkPfb4/TPvJCJVuS8MWZgoSsErf++QpiAlDnKFcqhRlm+tIOcencCjyJE6ZCA==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", "requires": { "graceful-fs": "^4.1.2", "jsonfile": "^4.0.0", "universalify": "^0.1.0" } }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "requires": { - "graceful-fs": "^4.1.6" - } + "mustache": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-3.0.1.tgz", + "integrity": "sha512-jFI/4UVRsRYdUbuDTKT7KzfOp7FiD5WzYmmwNwXyUVypC0xjoTL78Fqc0jHUPIvvGD+6DQSPHIt1NE7D1ArsqA==" } } }, @@ -3207,6 +3234,11 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" }, + "yaml": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.2.1.tgz", + "integrity": "sha512-LuOeoZc6LYguU9H/XCbrPfuDpCGJVf+o/r9uLCGnsHiHk/8Cr7IVeXOilO8yK0XA8QJPlX22KVofINt8xhdwqg==" + }, "yamljs": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/yamljs/-/yamljs-0.3.0.tgz", diff --git a/package.json b/package.json index 3bb9ece3..8ebac322 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,6 @@ "dependencies": { "async-shelljs": "^0.1.2", "clone": "^2.1.2", - "culture-info": "0.0.4", "dedent": "^0.7.0", "front-matter": "^2.3.0", "fs-extra": "^6.0.1", @@ -77,7 +76,7 @@ "highlight.js": "^9.13.1", "highlightjs": "^9.12.0", "http-server": "^0.11.1", - "localizable-resources": "^1.0.6", + "localized-resource-manager": "^1.0.1", "markdown-it": "^8.4.2", "markdown-it-anchor": "^5.0.2", "markdown-it-checkbox": "^1.1.0", diff --git a/src/ConversionTask.ts b/src/ConversionTask.ts index a4d4aef0..895ae88a 100644 --- a/src/ConversionTask.ts +++ b/src/ConversionTask.ts @@ -1,8 +1,8 @@ import ChildProcess = require("child_process"); import Clone = require("clone"); -import CultureInfo from "culture-info"; import FileSystem = require("fs-extra"); import HighlightJs = require("highlight.js"); +import { CultureInfo } from "localized-resource-manager"; import MarkdownIt = require("markdown-it"); import Anchor = require("markdown-it-anchor"); import Checkbox = require("markdown-it-checkbox"); @@ -19,7 +19,7 @@ import { Converter } from "./Converter"; import { DestinationOrigin } from "./DestinationOrigin"; import { Extension } from "./extension"; import { MarkdownContributions } from "./MarkdownContributions"; -import { ResourceManager } from "./Properties/ResourceManager"; +import { Resources } from "./Properties/Resources"; import { Settings } from "./Properties/Settings"; import { PuppeteerTask } from "./PuppeteerTask"; import { Document } from "./System/Drawing/Document"; @@ -104,8 +104,8 @@ export abstract class ConversionTask extends PuppeteerTask { origin = await (window.showInputBox({ ignoreFocusOut: true, - prompt: ResourceManager.Resources.Get("DestinationPath"), - placeHolder: ResourceManager.Resources.Get("DestinationPathExample") + prompt: Resources.Resources.Get("DestinationPath"), + placeHolder: Resources.Resources.Get("DestinationPathExample") }) as Promise); } @@ -152,10 +152,10 @@ export abstract class ConversionTask extends PuppeteerTask (async () => { let result = await (window.showInformationMessage( - Format(ResourceManager.Resources.Get("SuccessMessage"), ConversionType[type], destination), - ResourceManager.Resources.Get("OpenFileLabel")) as Promise); + Format(Resources.Resources.Get("SuccessMessage"), ConversionType[type], destination), + Resources.Resources.Get("OpenFileLabel")) as Promise); - if (result === ResourceManager.Resources.Get("OpenFileLabel")) + if (result === Resources.Resources.Get("OpenFileLabel")) { switch (process.platform) { @@ -169,7 +169,7 @@ export abstract class ConversionTask extends PuppeteerTask ChildProcess.exec(`bash -c 'xdg-open "${destination}"'`); break; default: - window.showWarningMessage(ResourceManager.Resources.Get("UnsupportedPlatformException")); + window.showWarningMessage(Resources.Resources.Get("UnsupportedPlatformException")); break; } } @@ -218,7 +218,7 @@ export abstract class ConversionTask extends PuppeteerTask } else if (Settings.Default.SystemParserEnabled) { - converter.Document.Template = (await FileSystem.readFile(ResourceManager.Files.Get("SystemTemplate"))).toString(); + converter.Document.Template = (await FileSystem.readFile(Resources.Files.Get("SystemTemplate"))).toString(); } } catch (exception) @@ -256,12 +256,12 @@ export abstract class ConversionTask extends PuppeteerTask { if (!Settings.Default.SystemParserEnabled) { - converter.Document.StyleSheets.push(ResourceManager.Files.Get("DefaultHighlight")); + converter.Document.StyleSheets.push(Resources.Files.Get("DefaultHighlight")); } } else { - converter.Document.StyleSheets.push(Path.join(ResourceManager.Files.Get("HighlightJSStylesDir"), Settings.Default.HighlightStyle + ".css")); + converter.Document.StyleSheets.push(Path.join(Resources.Files.Get("HighlightJSStylesDir"), Settings.Default.HighlightStyle + ".css")); } } diff --git a/src/MarkdownFileNotFoundException.ts b/src/MarkdownFileNotFoundException.ts index 6454874e..3d0ba61d 100644 --- a/src/MarkdownFileNotFoundException.ts +++ b/src/MarkdownFileNotFoundException.ts @@ -1,4 +1,4 @@ -import { ResourceManager } from "./Properties/ResourceManager"; +import { Resources } from "./Properties/Resources"; import { FileNotFoundException } from "./System/IO/FileNotFoundException"; /** @@ -11,6 +11,6 @@ export class MarkdownFileNotFoundException extends FileNotFoundException */ constructor() { - super(ResourceManager.Resources.Get("MarkdownFileException"), null); + super(Resources.Resources.Get("MarkdownFileException"), null); } } \ No newline at end of file diff --git a/src/Properties/ResourceManager.ts b/src/Properties/ResourceManager.ts deleted file mode 100644 index ae709526..00000000 --- a/src/Properties/ResourceManager.ts +++ /dev/null @@ -1,44 +0,0 @@ -import CultureInfo from "culture-info"; -import Path = require("path"); -import { Resource } from "../System/Resources/Resource"; - -/** - * Represents the resources of the module. - */ -export class ResourceManager -{ - /** - * The resources. - */ - private static resources = new Resource(Path.join(__dirname, "..", "..", "Resources", "MarkdownConverter")); - - /** - * The files. - */ - private static files = new Resource(Path.join(__dirname, "..", "..", "Resources", "Files")); - - /** - * Sets the culture of the resources. - */ - public static set Culture(value: CultureInfo) - { - this.resources.Culture = - this.files.Culture = value; - } - - /** - * Gets the resources. - */ - public static get Resources(): Resource - { - return this.resources; - } - - /** - * Gets the files. - */ - public static get Files(): Resource - { - return this.files; - } -} \ No newline at end of file diff --git a/src/Properties/Resources.ts b/src/Properties/Resources.ts new file mode 100644 index 00000000..4a0551d6 --- /dev/null +++ b/src/Properties/Resources.ts @@ -0,0 +1,43 @@ +import { CultureInfo, ResourceManager } from "localized-resource-manager"; +import Path = require("path"); + +/** + * Represents the resources of the module. + */ +export class Resources +{ + /** + * The resources. + */ + private static resources = new ResourceManager(Path.join(__dirname, "..", "..", "Resources", "MarkdownConverter")); + + /** + * The files. + */ + private static files = new ResourceManager(Path.join(__dirname, "..", "..", "Resources", "Files")); + + /** + * Sets the culture of the resources. + */ + public static set Culture(value: CultureInfo) + { + this.resources.Locale = + this.files.Locale = value; + } + + /** + * Gets the resources. + */ + public static get Resources(): ResourceManager + { + return this.resources; + } + + /** + * Gets the files. + */ + public static get Files(): ResourceManager + { + return this.files; + } +} \ No newline at end of file diff --git a/src/PuppeteerTask.ts b/src/PuppeteerTask.ts index 080f806e..2b08d402 100644 --- a/src/PuppeteerTask.ts +++ b/src/PuppeteerTask.ts @@ -3,7 +3,7 @@ import Puppeteer = require("puppeteer"); import Format = require("string-template"); import { ProgressLocation, window } from "vscode"; import { Extension } from "./extension"; -import { ResourceManager } from "./Properties/ResourceManager"; +import { Resources } from "./Properties/Resources"; import { Exception } from "./System/Exception"; import { Task } from "./Task"; @@ -36,8 +36,8 @@ export abstract class PuppeteerTask extends Task } else if ( await (window.showInformationMessage( - ResourceManager.Resources.Get("UpdateMessage"), - ResourceManager.Resources.Get("No")) as Promise) === ResourceManager.Resources.Get("Yes")) + Resources.Resources.Get("UpdateMessage"), + Resources.Resources.Get("No")) as Promise) === Resources.Resources.Get("Yes")) { let revision = this.Extension.ChromiumRevision; let success = false; @@ -47,7 +47,7 @@ export abstract class PuppeteerTask extends Task await (window.withProgress( { location: ProgressLocation.Notification, - title: Format(ResourceManager.Resources.Get("UpdateRunning"), revision) + title: Format(Resources.Resources.Get("UpdateRunning"), revision) }, async (reporter) => { @@ -72,7 +72,7 @@ export abstract class PuppeteerTask extends Task } }); - window.showInformationMessage(ResourceManager.Resources.Get("UpdateSuccess")); + window.showInformationMessage(Resources.Resources.Get("UpdateSuccess")); success = true; } catch @@ -85,9 +85,9 @@ export abstract class PuppeteerTask extends Task !await FileSystem.pathExists(Puppeteer.executablePath()) && !success && await (window.showWarningMessage( - ResourceManager.Resources.Get("UpdateFailed"), - ResourceManager.Resources.Get("Yes"), - ResourceManager.Resources.Get("No")) as Promise) === ResourceManager.Resources.Get("Yes")); + Resources.Resources.Get("UpdateFailed"), + Resources.Resources.Get("Yes"), + Resources.Resources.Get("No")) as Promise) === Resources.Resources.Get("Yes")); } } catch (exception) @@ -100,7 +100,7 @@ export abstract class PuppeteerTask extends Task } else if (exception instanceof Error) { - message = Format(ResourceManager.Resources.Get("UnknownException"), exception.name, exception.message); + message = Format(Resources.Resources.Get("UnknownException"), exception.name, exception.message); } else { diff --git a/src/System/Drawing/Document.ts b/src/System/Drawing/Document.ts index 909be4e5..e14bf122 100644 --- a/src/System/Drawing/Document.ts +++ b/src/System/Drawing/Document.ts @@ -1,14 +1,14 @@ -import CultureInfo from "culture-info"; import Dedent = require("dedent"); import FrontMatter = require("front-matter"); import FileSystem = require("fs-extra"); +import { CultureInfo } from "localized-resource-manager"; import { MarkdownIt } from "markdown-it"; import Mustache = require("mustache"); import OS = require("os"); import Path = require("path"); import { TextDocument } from "vscode"; import YAML = require("yamljs"); -import { ResourceManager } from "../../Properties/ResourceManager"; +import { Resources } from "../../Properties/Resources"; import { DateTimeFormatter } from "../Globalization/DateTimeFormatter"; import { FileException } from "../IO/FileException"; import { YAMLException } from "../YAML/YAMLException"; @@ -86,7 +86,7 @@ export class Document extends Renderable * The stylesheets of the document. */ private styleSheets: string[] = [ - ResourceManager.Files.Get("SystemStyle") + Resources.Files.Get("SystemStyle") ]; /** diff --git a/src/System/Globalization/DateTimeFormatter.ts b/src/System/Globalization/DateTimeFormatter.ts index ebbc18da..79a8e602 100644 --- a/src/System/Globalization/DateTimeFormatter.ts +++ b/src/System/Globalization/DateTimeFormatter.ts @@ -1,5 +1,5 @@ -import CultureInfo from "culture-info"; -import { ResourceManager } from "../../Properties/ResourceManager"; +import { CultureInfo } from "localized-resource-manager"; +import { Resources } from "../../Properties/Resources"; /** * Provides the functionallity to format a date. @@ -61,7 +61,7 @@ export class DateTimeFormatter try { - formatString = ResourceManager.Resources.Get("DateTime.Formats." + formatString, this.locale); + formatString = Resources.Resources.Get("DateTime.Formats." + formatString, this.locale); } catch { @@ -149,32 +149,32 @@ export class DateTimeFormatter { get ddd() { - return ResourceManager.Resources.Get("DateTime.DaysOfWeek.ShortNames", locale)[getDay()]; + return Resources.Resources.Get("DateTime.DaysOfWeek.ShortNames", locale)[getDay()]; }, get dddd() { - return ResourceManager.Resources.Get("DateTime.DaysOfWeek.FullNames", locale)[getDay()]; + return Resources.Resources.Get("DateTime.DaysOfWeek.FullNames", locale)[getDay()]; }, get MMM() { - return ResourceManager.Resources.Get("DateTime.Months.ShortNames", locale)[date.getMonth()]; + return Resources.Resources.Get("DateTime.Months.ShortNames", locale)[date.getMonth()]; }, get MMMM() { - return ResourceManager.Resources.Get("DateTime.Months.FullNames", locale)[date.getMonth()]; + return Resources.Resources.Get("DateTime.Months.FullNames", locale)[date.getMonth()]; }, get t() { - return ResourceManager.Resources.Get("DateTime.TimeDesignator.ShortNames", locale)[(date.getHours() < 12 ? 0 : 1)]; + return Resources.Resources.Get("DateTime.TimeDesignator.ShortNames", locale)[(date.getHours() < 12 ? 0 : 1)]; }, get tt() { - return ResourceManager.Resources.Get("DateTime.TimeDesignator.FullNames", locale)[(date.getHours() < 12 ? 0 : 1)]; + return Resources.Resources.Get("DateTime.TimeDesignator.FullNames", locale)[(date.getHours() < 12 ? 0 : 1)]; } }; return dateTimeTokens; diff --git a/src/System/IO/FileException.ts b/src/System/IO/FileException.ts index 1ade0ff5..8a52b3ef 100644 --- a/src/System/IO/FileException.ts +++ b/src/System/IO/FileException.ts @@ -1,5 +1,5 @@ import Format = require("string-template"); -import { ResourceManager } from "../../Properties/ResourceManager"; +import { Resources } from "../../Properties/Resources"; import { IOException } from "./IOException"; /** @@ -29,6 +29,6 @@ export class FileException extends IOException public get Message(): string { - return Format(ResourceManager.Resources.Get("FileException"), this.Path); + return Format(Resources.Resources.Get("FileException"), this.Path); } } \ No newline at end of file diff --git a/src/System/Resources/Resource.ts b/src/System/Resources/Resource.ts deleted file mode 100644 index dd75c9cf..00000000 --- a/src/System/Resources/Resource.ts +++ /dev/null @@ -1,54 +0,0 @@ -import CultureInfo from "culture-info"; -import { ResourceManager } from "localizable-resources"; - -/** - * Provides the functionality for handling resources. - */ -export class Resource -{ - /** - * The resources handled by this `Resource`. - */ - private resources: ResourceManager; - - /** - * Initializes a new instance of the `Resource` class. - * - * @param baseFileName - * The base name of the resource-files. - * - * @param culture - * The culture which resources to get by default. - */ - public constructor(baseFileName: string, locale?: CultureInfo) - { - this.resources = new ResourceManager(baseFileName, locale); - } - - /** - * Gets or sets the culture of the resources. - */ - public get Culture(): CultureInfo - { - return this.resources.Culture; - } - - public set Culture(value: CultureInfo) - { - this.resources.Culture = value; - } - - /** - * Gets the resource-object with the specified id. - * - * @param id - * The id of the resource to return. - * - * @param culture - * The culture which resource-object to get. - */ - public Get(id: string, culture?: CultureInfo) - { - return (this.resources.GetObject(id, culture) as any) as T; - } -} \ No newline at end of file diff --git a/src/System/YAML/YAMLException.ts b/src/System/YAML/YAMLException.ts index 8a849b7d..4aa71ebe 100644 --- a/src/System/YAML/YAMLException.ts +++ b/src/System/YAML/YAMLException.ts @@ -1,5 +1,5 @@ import Format = require("string-template"); -import { ResourceManager } from "../../Properties/ResourceManager"; +import { Resources } from "../../Properties/Resources"; import { Exception } from "../Exception"; import { IMark } from "./Mark"; @@ -70,7 +70,7 @@ export class YAMLException extends Exception public get Message(): string { - return Format(ResourceManager.Resources.Get("YAMLException"), this.Mark.line + 1, this.Mark.column + 1); + return Format(Resources.Resources.Get("YAMLException"), this.Mark.line + 1, this.Mark.column + 1); } /** diff --git a/src/extension.ts b/src/extension.ts index 427ba625..fea7c601 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,12 +1,12 @@ // The module 'vscode' contains the VS Code extensibility API // Import the module and reference it with the alias vscode in your code below -import CultureInfo from "culture-info"; +import { CultureInfo } from "localized-resource-manager"; import { MarkdownIt } from "markdown-it"; import Path = require("path"); import { commands, env, ExtensionContext } from "vscode"; import { ConvertAllTask } from "./ConvertAllTask"; import { ConvertTask } from "./ConvertTask"; -import { ResourceManager } from "./Properties/ResourceManager"; +import { Resources } from "./Properties/Resources"; /** * Represens the extension itself. @@ -28,7 +28,7 @@ export class Extension */ public constructor() { - ResourceManager.Culture = new CultureInfo(env.language); + Resources.Culture = new CultureInfo(env.language); } /** From c927cbbe2ebd9c54bb62a0dd50d1a79675cf6826 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 22 Jan 2019 13:42:34 +0100 Subject: [PATCH 39/77] Rework the way to query the full name of the user --- src/Utilities.ts | 68 ++++++++++++++++++------------------------------ src/extension.ts | 3 +-- tsconfig.json | 3 +-- 3 files changed, 27 insertions(+), 47 deletions(-) diff --git a/src/Utilities.ts b/src/Utilities.ts index 985e59f7..e2b4101a 100644 --- a/src/Utilities.ts +++ b/src/Utilities.ts @@ -1,4 +1,5 @@ import shell = require("async-shelljs"); +import { isNullOrUndefined } from "util"; /** * Provides static methods. @@ -20,19 +21,36 @@ export class Utilities */ public static async GetFullName(): Promise { - let current: IteratorResult; - let iterator = this.TryGetUsername(); + let methods: (() => Promise)[] = []; - do + methods = [ + async () => this.CheckEnv(), + this.CheckGit + ]; + + if (process.platform === "win32") + { + methods.push(this.CheckWmic); + } + else if (process.platform === "darwin") { - current = await iterator.next(); + methods.push(this.CheckOsaScript); + } - if (current.value !== null) + for (let method of methods) + { + try { - return current.value.trim(); + let result = await method(); + + if (!isNullOrUndefined(result)) + { + return result.trim(); + } } + catch + { } } - while (!current.done); return ""; } @@ -79,40 +97,4 @@ export class Utilities { return shell.asyncExec("osascript -e long user name of (system info)"); } - - /** - * A set of functions to figure out the user-name. - */ - private static async* TryGetUsername() - { - yield Utilities.CheckEnv(); - - yield* (async function* () - { - let methods: (() => Promise)[] = []; - methods.push(Utilities.CheckGit); - - if (process.platform === "win32") - { - methods.push(Utilities.CheckWmic); - } - - if (process.platform === "darwin") - { - methods.push(Utilities.CheckOsaScript); - } - - for (let method of methods) - { - try - { - yield await method(); - } - catch - { - yield null; - } - } - })(); - } } \ No newline at end of file diff --git a/src/extension.ts b/src/extension.ts index fea7c601..a6d4ad9e 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -118,5 +118,4 @@ export let activate = async (context: ExtensionContext) => extension.Activate(co /** * Deactivates the extension. */ -export let deactivate = async () => extension.Dispose(); -(Symbol as any).asyncIterator = Symbol.asyncIterator || Symbol.for("Symbol.asyncIterator"); \ No newline at end of file +export let deactivate = async () => extension.Dispose(); \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 61e52882..0bdbbf58 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -23,7 +23,6 @@ "strictFunctionTypes": true, "noImplicitAny": true, "noImplicitReturns": true, - "noImplicitThis": true, - "downlevelIteration": true + "noImplicitThis": true } } \ No newline at end of file From 93c301d26fd6536985dd960092f92da4ffad82e6 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 8 Aug 2019 15:39:54 +0200 Subject: [PATCH 40/77] Update all dependencies --- package-lock.json | 2389 +++++++------------------------- package.json | 51 +- src/ConversionTask.ts | 4 +- src/System/Drawing/Document.ts | 2 +- src/extension.ts | 2 +- 5 files changed, 516 insertions(+), 1932 deletions(-) diff --git a/package-lock.json b/package-lock.json index cfbbafaf..71752f7d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,34 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/highlight": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", + "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + } + }, + "@babel/runtime": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.5.5.tgz", + "integrity": "sha512-28QvEGyQyNkB0/m2B4FU7IEZGK2NUrcMtT6BZEFALTguLk+AUT6ofsHtPk5QyjAdUkpMJ+/Em+quwz4HOt30AQ==", + "requires": { + "regenerator-runtime": "^0.13.2" + } + }, "@types/clone": { "version": "0.1.30", "resolved": "https://registry.npmjs.org/@types/clone/-/clone-0.1.30.tgz", @@ -31,20 +59,14 @@ "integrity": "sha512-KEIlhXnIutzKwRbQkGWb/I4HFqBuUykAdHgDED6xqwXJfONCjF5VoE0cXEiurh3XauygxzeDzgtXUqvLkxFzzA==" }, "@types/fs-extra": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-5.0.4.tgz", - "integrity": "sha512-DsknoBvD8s+RFfSGjmERJ7ZOP1HI0UZRA3FSI+Zakhrc/Gy26YQsLI+m5V5DHxroHRJqCDLKJp7Hixn8zyaF7g==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-8.0.0.tgz", + "integrity": "sha512-bCtL5v9zdbQW86yexOlXWTEGvLNqWxMFyi7gQA7Gcthbezr2cPSOb8SkESVKA937QD5cIwOFLDFt0MQoXOEr9Q==", "dev": true, "requires": { "@types/node": "*" } }, - "@types/get-port": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/get-port/-/get-port-4.0.0.tgz", - "integrity": "sha512-Zp1GxOt3GNbIQqz2hSHSH7LALpTPvPHMA/aYut3VeitDgGwqcXEVvDQWWP3kPABsh3CGSHPSt67DN6jnc7oJMA==", - "dev": true - }, "@types/glob": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", @@ -70,16 +92,25 @@ "@types/connect": "*" } }, - "@types/markdown-it": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-0.0.3.tgz", - "integrity": "sha512-phGgIOAnmTr8SD1epgkHS3Jkfh0YDKjveeTHf/TmR+Dhq2DtonabEd6EBi2qG6o4xS0Nq0Jw4psI/IPKiUw2qg==", + "@types/linkify-it": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-2.1.0.tgz", + "integrity": "sha512-Q7DYAOi9O/+cLLhdaSvKdaumWyHbm7HAk/bFwwyTuU0arR5yyCeW5GOoqt4tJTpDRxhpx9Q8kQL6vMpuw9hDSw==", "dev": true }, + "@types/markdown-it": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-0.0.8.tgz", + "integrity": "sha512-ouaTOi5kAdkTPl97u6uDkth9od4pQffPF9STcjYVZKFrEwLYf15s7Z772WxWE3IOcYBJglaT0XqdyNEiEfGgYg==", + "dev": true, + "requires": { + "@types/linkify-it": "*" + } + }, "@types/markdown-it-anchor": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/markdown-it-anchor/-/markdown-it-anchor-4.0.2.tgz", - "integrity": "sha512-D0Zn61ISNfrTSlDiqkDHTP0fR2dJqOWTNP36xQh39K9q6bzk9DiHfUi2bJ24jS3CQv/o3HkQldWVOLbOjDmJUQ==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/markdown-it-anchor/-/markdown-it-anchor-4.0.3.tgz", + "integrity": "sha512-L0NDW75vkovFradOQiPsodVkmJhA11LTDOgkJL0bsRvDo7uMWAwJWpC3oDCBCrP4mBJurP+adKZm0FP3GoGnmw==", "dev": true, "requires": { "@types/markdown-it": "*" @@ -91,26 +122,26 @@ "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==" }, "@types/mocha": { - "version": "2.2.48", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-2.2.48.tgz", - "integrity": "sha512-nlK/iyETgafGli8Zh9zJVCTicvU3iajSkRwOh3Hhiva598CMqNJ4NcVCGMTGKpGpTYj/9R8RLzS9NAykSSCqGw==", + "version": "5.2.7", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", + "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==", "dev": true }, "@types/mustache": { - "version": "0.8.31", - "resolved": "https://registry.npmjs.org/@types/mustache/-/mustache-0.8.31.tgz", - "integrity": "sha512-72flCZJkEJHPwhmpHgg4a0ZBLssMhg5NB0yltRblRlZMo4py3B/u/d7icevc4EeN9MPQUo/dPtuVOoVy9ih6cQ==", + "version": "0.8.32", + "resolved": "https://registry.npmjs.org/@types/mustache/-/mustache-0.8.32.tgz", + "integrity": "sha512-RTVWV485OOf4+nO2+feurk0chzHkSjkjALiejpHltyuMf/13fGymbbNNFrSKdSSUg1TIwzszXdWsVirxgqYiFA==", "dev": true }, "@types/node": { - "version": "10.12.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.0.tgz", - "integrity": "sha512-3TUHC3jsBAB7qVRGxT6lWyYo2v96BMmD2PTcl47H25Lu7UXtFH/2qqmKiVrnel6Ne//0TFYf6uvNX+HW2FRkLQ==" + "version": "12.7.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.1.tgz", + "integrity": "sha512-aK9jxMypeSrhiYofWWBf/T7O+KwaiAHzM4sveCdWPn71lzUSMimRnKzhXDKfKwV1kWoBo2P1aGgaIYGLf9/ljw==" }, "@types/puppeteer": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@types/puppeteer/-/puppeteer-1.9.0.tgz", - "integrity": "sha512-ZP3wL4Lqpgu4xZbz/0vQhbIZnllNEawVW3oTpEXyJg+uhf/YQgL8oeTrfoUwj9JXE9UUe53eqmgLl29/d2gjqQ==", + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/@types/puppeteer/-/puppeteer-1.19.0.tgz", + "integrity": "sha512-Db9LWOuTm2bR/qgPE7PQCmnsCQ6flHdULuIDWTks8YdQ/SGHKg5WGWG54gl0734NDKCTF5MbqAp2qWuvBiyQ3Q==", "dev": true, "requires": { "@types/node": "*" @@ -132,9 +163,9 @@ "dev": true }, "@types/transliteration": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@types/transliteration/-/transliteration-1.6.0.tgz", - "integrity": "sha512-AIZfLypT0VEufKNU5Ml7IBwVGr1lNReZdmUrfHHokbgJmdUhXrRCtgqRLSnTIrBUJ/H28AfgcWqCONqR/vGydA==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@types/transliteration/-/transliteration-1.6.1.tgz", + "integrity": "sha512-on+MQcm19abVUxiBiWjzLp/5Aqde9cnQTT3h4xG0MWFQ7jPHUB6hoAYrpcNTnQsaXoo5D8JBBwx+WQIEIhVcNA==", "dev": true }, "@types/yamljs": { @@ -144,60 +175,39 @@ "dev": true }, "agent-base": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", - "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", + "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", "requires": { "es6-promisify": "^5.0.0" } }, "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", + "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", "dev": true, "requires": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", + "fast-deep-equal": "^2.0.1", "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, - "ansi-cyan": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ansi-cyan/-/ansi-cyan-0.1.1.tgz", - "integrity": "sha1-U4rlKK+JgvKK4w2G8vF0VtJgmHM=", - "dev": true, - "requires": { - "ansi-wrap": "0.1.0" - } + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" }, - "ansi-red": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ansi-red/-/ansi-red-0.1.1.tgz", - "integrity": "sha1-jGOPnRCAgAo1PJwoyKgcpHBdlGw=", + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { - "ansi-wrap": "0.1.0" + "color-convert": "^1.9.0" } }, - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" - }, - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "ansi-wrap": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz", - "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=", - "dev": true - }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -213,67 +223,6 @@ } } }, - "arr-diff": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-1.1.0.tgz", - "integrity": "sha1-aHwydYFjWI/vfeezb6vklesaOZo=", - "dev": true, - "requires": { - "arr-flatten": "^1.0.1", - "array-slice": "^0.2.3" - } - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true - }, - "arr-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-2.1.0.tgz", - "integrity": "sha1-IPnqtexw9cfSFbEHexw5Fh0pLH0=", - "dev": true - }, - "array-differ": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", - "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", - "dev": true - }, - "array-slice": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-0.2.3.tgz", - "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU=", - "dev": true - }, - "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "dev": true, - "requires": { - "array-uniq": "^1.0.1" - } - }, - "array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", - "dev": true - }, - "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", - "dev": true - }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true - }, "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -295,9 +244,9 @@ "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" }, "async-limiter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", - "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==" }, "async-shelljs": { "version": "0.1.2", @@ -326,47 +275,6 @@ "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", "dev": true }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } - } - }, "balanced-match": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", @@ -377,20 +285,10 @@ "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", "dev": true, - "optional": true, "requires": { "tweetnacl": "^0.14.3" } }, - "block-stream": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", - "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", - "dev": true, - "requires": { - "inherits": "~2.0.0" - } - }, "brace-expansion": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.7.tgz", @@ -400,27 +298,10 @@ "concat-map": "0.0.1" } }, - "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", - "dev": true, - "requires": { - "expand-range": "^1.8.1", - "preserve": "^0.2.0", - "repeat-element": "^1.1.2" - } - }, "browser-stdout": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", - "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=", - "dev": true - }, - "buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, "buffer-from": { @@ -435,9 +316,9 @@ "dev": true }, "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=" + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" }, "caseless": { "version": "0.12.0", @@ -446,44 +327,24 @@ "dev": true }, "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } } }, "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" } }, "clone": { @@ -491,45 +352,10 @@ "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=" }, - "clone-buffer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", - "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", - "dev": true - }, - "clone-stats": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-0.0.1.tgz", - "integrity": "sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE=", - "dev": true - }, - "cloneable-readable": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.2.tgz", - "integrity": "sha512-Bq6+4t+lbM8vhTs/Bef5c5AdEMtapp/iFb6+s4/Hh9MVTt8OLKH7ZOOZSCT+Ys7hsHvqv0GuMPJ1lnQJVHvxpg==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "process-nextick-args": "^2.0.0", - "readable-stream": "^2.3.5" - } - }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" - }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, "requires": { "color-name": "1.1.3" } @@ -537,8 +363,7 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "colors": { "version": "1.0.3", @@ -546,26 +371,29 @@ "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=" }, "combined-stream": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, "requires": { "delayed-stream": "~1.0.0" } }, "commander": { - "version": "2.17.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", - "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", "dev": true }, "comment-json": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-1.1.3.tgz", - "integrity": "sha1-aYbDMw/uDEyeAMI5jNYa+l2PI54=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-2.1.0.tgz", + "integrity": "sha512-OcO+nJnUtp29j9SwHVcP/F8t/9piiOQj7APXTj75cK/qFAgX7PtGV31ullzwZbBwiA5Rmj25C32FaFgwcu1Uwg==", "requires": { - "json-parser": "^1.0.0" + "core-util-is": "^1.0.2", + "esprima": "^4.0.1", + "has-own-prop": "^2.0.0", + "repeat-string": "^1.6.1" } }, "concat-map": { @@ -584,12 +412,6 @@ "typedarray": "^0.0.6" } }, - "convert-source-map": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", - "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=", - "dev": true - }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -625,20 +447,10 @@ } } }, - "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", - "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, "culture-info": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/culture-info/-/culture-info-1.0.2.tgz", - "integrity": "sha512-pJMu0569vgfeHKJlBzfZ5rqzouP1UqvJP6yPYYgo7Jqr9ZntcwHLUh05WqqmQLiLdj9M0AJLZvHXiJ3LgYnYWg==" + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/culture-info/-/culture-info-1.0.4.tgz", + "integrity": "sha512-h7DTEXPWNTeGG1uTG7cwntbWMIIzLLguAuBycKSPafDCDrORgWhHO7VycmUQz+8q2Ds0R+tGPNrIABkUGYyr3A==" }, "dashdash": { "version": "1.14.1", @@ -665,27 +477,15 @@ } }, "decamelize": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-2.0.0.tgz", - "integrity": "sha512-Ikpp5scV3MSYxY39ymh45ZLEecsTdv/Xj2CaQfI8RLMuwi7XvjX9H/fhraiSuU+C5w5NTDu4ZU72xNiZnurBPg==", - "requires": { - "xregexp": "4.0.0" - } + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" }, "dedent": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=" }, - "deep-assign": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/deep-assign/-/deep-assign-1.0.0.tgz", - "integrity": "sha1-sJJ0O+hCfcYh6gBnzex+cN0Z83s=", - "dev": true, - "requires": { - "is-obj": "^1.0.0" - } - }, "deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", @@ -703,39 +503,20 @@ "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true }, - "duplexer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", - "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", - "dev": true - }, - "duplexify": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.0.tgz", - "integrity": "sha512-fO3Di4tBKJpYTFHAxTU00BcfWMY9w24r/x21a6rZRbsD/ToUgGxsMbiGRmB7uVAXeGKXD9MwiLZa5E97EVgIRQ==", - "dev": true, - "requires": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" - } - }, "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", "dev": true, - "optional": true, "requires": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" } }, "ecstatic": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ecstatic/-/ecstatic-3.2.1.tgz", - "integrity": "sha512-BAdHx9LOCG1fwxY8MIydUBskl8UUQrYeC3WE14FA1DPlBzqoG1aOgEkypcSpmiiel8RAj8gW1s40RrclfrpGUg==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ecstatic/-/ecstatic-3.3.2.tgz", + "integrity": "sha512-fLf9l1hnwrHI2xn9mEDT7KIi22UDqA2jaCwyCbSUJh9a1V+LEUSL/JO/6TIz/QyuBURWUHrFL5Kg2TtO1bkkog==", "requires": { "he": "^1.1.1", "mime": "^1.6.0", @@ -750,24 +531,20 @@ } } }, - "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", - "dev": true, - "requires": { - "once": "^1.4.0" - } + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" }, "entities": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", - "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", + "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==" }, "es6-promise": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.5.tgz", - "integrity": "sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg==" + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" }, "es6-promisify": { "version": "5.0.0", @@ -789,95 +566,22 @@ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" }, "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, - "event-stream": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", - "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=", - "dev": true, - "requires": { - "duplexer": "~0.1.1", - "from": "~0", - "map-stream": "~0.1.0", - "pause-stream": "0.0.11", - "split": "0.3", - "stream-combiner": "~0.0.4", - "through": "~2.3.1" - } - }, "eventemitter3": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.0.tgz", "integrity": "sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA==" }, - "execa": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", - "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", - "requires": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", - "dev": true, - "requires": { - "is-posix-bracket": "^0.1.0" - } - }, - "expand-range": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", - "dev": true, - "requires": { - "fill-range": "^2.1.0" - } - }, "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", "dev": true }, - "extend-shallow": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-1.1.4.tgz", - "integrity": "sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE=", - "dev": true, - "requires": { - "kind-of": "^1.1.0" - } - }, - "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - }, - "dependencies": { - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - } - } - }, "extract-zip": { "version": "1.6.7", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.7.tgz", @@ -906,9 +610,9 @@ "dev": true }, "fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", "dev": true }, "fast-json-stable-stringify": { @@ -925,25 +629,6 @@ "pend": "~1.2.0" } }, - "filename-regex": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", - "dev": true - }, - "fill-range": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", - "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", - "dev": true, - "requires": { - "is-number": "^2.1.0", - "isobject": "^2.0.0", - "randomatic": "^3.0.0", - "repeat-element": "^1.1.2", - "repeat-string": "^1.5.2" - } - }, "find-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", @@ -952,12 +637,6 @@ "locate-path": "^3.0.0" } }, - "first-chunk-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz", - "integrity": "sha1-Wb+1DNkF9g18OUzT2ayqtOatk04=", - "dev": true - }, "follow-redirects": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.1.tgz", @@ -966,21 +645,6 @@ "debug": "^3.1.0" } }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "for-own": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", - "dev": true, - "requires": { - "for-in": "^1.0.1" - } - }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -988,36 +652,30 @@ "dev": true }, "form-data": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", - "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", "dev": true, "requires": { "asynckit": "^0.4.0", - "combined-stream": "1.0.6", + "combined-stream": "^1.0.6", "mime-types": "^2.1.12" } }, - "from": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", - "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=", - "dev": true - }, "front-matter": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/front-matter/-/front-matter-2.3.0.tgz", - "integrity": "sha1-cgOviWzjV+4E4qpFFp6pHtf2dQQ=", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/front-matter/-/front-matter-3.0.2.tgz", + "integrity": "sha512-iBGZaWyzqgsrPGsqrXZP6N4hp5FzSKDi18nfAoYpgz3qK5sAwFv/ojmn3VS60SOgLvq6CtojNqy0y6ZNz05IzQ==", "requires": { - "js-yaml": "^3.10.0" + "js-yaml": "^3.13.1" } }, "fs-extra": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-6.0.1.tgz", - "integrity": "sha512-GnyIkKhhzXZUWFCaJzvyDLEEgDkPfb4/TPvJCJVuS8MWZgoSsErf++QpiAlDnKFcqhRlm+tIOcencCjyJE6ZCA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", "requires": { - "graceful-fs": "^4.1.2", + "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", "universalify": "^0.1.0" } @@ -1027,32 +685,18 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, - "fstream": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", - "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "inherits": "~2.0.0", - "mkdirp": ">=0.5 0", - "rimraf": "2" - } - }, "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, "get-port": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/get-port/-/get-port-4.0.0.tgz", - "integrity": "sha512-Yy3yNI2oShgbaWg4cmPhWjkZfktEvpKI09aDX4PZzNtlU9obuYrX7x2mumQsrNxlF+Ls7OtMQW/u+X4s896bOQ==" - }, - "get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-5.0.0.tgz", + "integrity": "sha512-imzMU0FjsZqNa6BqOjbbW6w5BivHIuQKopjpPqcnx0AVHJQKCxK1O+Ab3OrVXhrekqfVMjwA9ZYu062R+KcIsQ==", + "requires": { + "type-fest": "^0.3.0" + } }, "getpass": { "version": "0.1.7", @@ -1076,425 +720,53 @@ "path-is-absolute": "^1.0.0" } }, - "glob-base": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "graceful-fs": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.1.tgz", + "integrity": "sha512-b9usnbDGnD928gJB3LrCmxoibr3VE4U2SMo5PBuBnokWyDADTqDPXg4YpwKF1trpH+UbGp7QLicO3+aWEy0+mw==" + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", "dev": true, "requires": { - "glob-parent": "^2.0.0", - "is-glob": "^2.0.0" - }, - "dependencies": { - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "dev": true, - "requires": { - "is-glob": "^2.0.0" - } - }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - } - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - } - }, - "glob-stream": { - "version": "5.3.5", - "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-5.3.5.tgz", - "integrity": "sha1-pVZlqajM3EGRWofHAeMtTgFvrSI=", - "dev": true, - "requires": { - "extend": "^3.0.0", - "glob": "^5.0.3", - "glob-parent": "^3.0.0", - "micromatch": "^2.3.7", - "ordered-read-streams": "^0.3.0", - "through2": "^0.6.0", - "to-absolute-glob": "^0.1.1", - "unique-stream": "^2.0.2" - }, - "dependencies": { - "glob": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", - "dev": true, - "requires": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - }, - "through2": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", - "dev": true, - "requires": { - "readable-stream": ">=1.0.33-1 <1.1.0-0", - "xtend": ">=4.0.0 <4.1.0-0" - } - } - } - }, - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" - }, - "growl": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.3.tgz", - "integrity": "sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q==", - "dev": true - }, - "gulp-chmod": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/gulp-chmod/-/gulp-chmod-2.0.0.tgz", - "integrity": "sha1-AMOQuSigeZslGsz2MaoJ4BzGKZw=", - "dev": true, - "requires": { - "deep-assign": "^1.0.0", - "stat-mode": "^0.2.0", - "through2": "^2.0.0" - } - }, - "gulp-filter": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/gulp-filter/-/gulp-filter-5.1.0.tgz", - "integrity": "sha1-oF4Rr/sHz33PQafeHLe2OsN4PnM=", - "dev": true, - "requires": { - "multimatch": "^2.0.0", - "plugin-error": "^0.1.2", - "streamfilter": "^1.0.5" - } - }, - "gulp-gunzip": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gulp-gunzip/-/gulp-gunzip-1.0.0.tgz", - "integrity": "sha1-FbdBFF6Dqcb1CIYkG1fMWHHxUak=", - "dev": true, - "requires": { - "through2": "~0.6.5", - "vinyl": "~0.4.6" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - }, - "through2": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", - "dev": true, - "requires": { - "readable-stream": ">=1.0.33-1 <1.1.0-0", - "xtend": ">=4.0.0 <4.1.0-0" - } - } - } - }, - "gulp-remote-src-vscode": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/gulp-remote-src-vscode/-/gulp-remote-src-vscode-0.5.0.tgz", - "integrity": "sha512-/9vtSk9eI9DEWCqzGieglPqmx0WUQ9pwPHyHFpKmfxqdgqGJC2l0vFMdYs54hLdDsMDEZFLDL2J4ikjc4hQ5HQ==", - "dev": true, - "requires": { - "event-stream": "^3.3.4", - "node.extend": "^1.1.2", - "request": "^2.79.0", - "through2": "^2.0.3", - "vinyl": "^2.0.1" - }, - "dependencies": { - "clone": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", - "dev": true - }, - "clone-stats": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", - "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", - "dev": true - }, - "vinyl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.0.tgz", - "integrity": "sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg==", - "dev": true, - "requires": { - "clone": "^2.1.1", - "clone-buffer": "^1.0.0", - "clone-stats": "^1.0.0", - "cloneable-readable": "^1.0.0", - "remove-trailing-separator": "^1.0.1", - "replace-ext": "^1.0.0" - } - } - } - }, - "gulp-sourcemaps": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/gulp-sourcemaps/-/gulp-sourcemaps-1.6.0.tgz", - "integrity": "sha1-uG/zSdgBzrVuHZ59x7vLS33uYAw=", - "dev": true, - "requires": { - "convert-source-map": "^1.1.1", - "graceful-fs": "^4.1.2", - "strip-bom": "^2.0.0", - "through2": "^2.0.0", - "vinyl": "^1.0.0" - }, - "dependencies": { - "clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", - "dev": true - }, - "replace-ext": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz", - "integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ=", - "dev": true - }, - "vinyl": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-1.2.0.tgz", - "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", - "dev": true, - "requires": { - "clone": "^1.0.0", - "clone-stats": "^0.0.1", - "replace-ext": "0.0.1" - } - } - } - }, - "gulp-symdest": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/gulp-symdest/-/gulp-symdest-1.1.0.tgz", - "integrity": "sha1-wWUyBzLRks5W/ZQnH/oSMjS/KuA=", - "dev": true, - "requires": { - "event-stream": "^3.3.1", - "mkdirp": "^0.5.1", - "queue": "^3.1.0", - "vinyl-fs": "^2.4.3" - } - }, - "gulp-untar": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/gulp-untar/-/gulp-untar-0.0.7.tgz", - "integrity": "sha512-0QfbCH2a1k2qkTLWPqTX+QO4qNsHn3kC546YhAP3/n0h+nvtyGITDuDrYBMDZeW4WnFijmkOvBWa5HshTic1tw==", - "dev": true, - "requires": { - "event-stream": "~3.3.4", - "streamifier": "~0.1.1", - "tar": "^2.2.1", - "through2": "~2.0.3", - "vinyl": "^1.2.0" - }, - "dependencies": { - "clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", - "dev": true - }, - "replace-ext": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz", - "integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ=", - "dev": true - }, - "vinyl": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-1.2.0.tgz", - "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", - "dev": true, - "requires": { - "clone": "^1.0.0", - "clone-stats": "^0.0.1", - "replace-ext": "0.0.1" - } - } - } - }, - "gulp-vinyl-zip": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/gulp-vinyl-zip/-/gulp-vinyl-zip-2.1.0.tgz", - "integrity": "sha1-JOQGhdwFtxSZlSRQmeBZAmO+ja0=", - "dev": true, - "requires": { - "event-stream": "^3.3.1", - "queue": "^4.2.1", - "through2": "^2.0.3", - "vinyl": "^2.0.2", - "vinyl-fs": "^2.0.0", - "yauzl": "^2.2.1", - "yazl": "^2.2.1" - }, - "dependencies": { - "clone": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", - "dev": true - }, - "clone-stats": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", - "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", - "dev": true - }, - "queue": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/queue/-/queue-4.5.0.tgz", - "integrity": "sha512-DwxpAnqJuoQa+wyDgQuwkSshkhlqIlWEvwvdAY27fDPunZ2cVJzXU4JyjY+5l7zs7oGLaYAQm4MbLOVFAHFBzA==", - "dev": true, - "requires": { - "inherits": "~2.0.0" - } - }, - "vinyl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.0.tgz", - "integrity": "sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg==", - "dev": true, - "requires": { - "clone": "^2.1.1", - "clone-buffer": "^1.0.0", - "clone-stats": "^1.0.0", - "cloneable-readable": "^1.0.0", - "remove-trailing-separator": "^1.0.1", - "replace-ext": "^1.0.0" - } - } - } - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true - }, - "har-validator": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz", - "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", - "dev": true, - "requires": { - "ajv": "^5.3.0", + "ajv": "^6.5.5", "har-schema": "^2.0.0" } }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - } - } - }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, + "has-own-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz", + "integrity": "sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==" + }, "he": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=" }, "highlight.js": { - "version": "9.13.1", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.13.1.tgz", - "integrity": "sha512-Sc28JNQNDzaH6PORtRLMvif9RSn1mYuOoX3omVjnb0+HbpPygU2ALBI0R/wsiqCb4/fcp07Gdo8g+fhtFrQl6A==" + "version": "9.15.9", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.15.9.tgz", + "integrity": "sha512-M0zZvfLr5p0keDMCAhNBp03XJbKBxUx5AfyfufMdFMEP4N/Xj6dh0IqC75ys7BAzceR34NgcvXjupRVaHBPPVQ==" }, "highlightjs": { "version": "9.12.0", @@ -1511,6 +783,16 @@ "requires-port": "^1.0.0" } }, + "http-proxy-agent": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz", + "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", + "dev": true, + "requires": { + "agent-base": "4", + "debug": "3.1.0" + } + }, "http-server": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/http-server/-/http-server-0.11.1.tgz", @@ -1538,11 +820,11 @@ } }, "https-proxy-agent": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", - "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz", + "integrity": "sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg==", "requires": { - "agent-base": "^4.1.0", + "agent-base": "^4.3.0", "debug": "^3.1.0" } }, @@ -1570,125 +852,17 @@ "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=" }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" - }, - "is": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/is/-/is-3.2.1.tgz", - "integrity": "sha1-0Kwq1V63sL7JJqUmb2xmKqqD3KU=", - "dev": true - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "is-dotfile": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", - "dev": true - }, - "is-equal-shallow": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", - "dev": true, - "requires": { - "is-primitive": "^2.0.0" - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" }, - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "^2.1.0" - } - }, - "is-number": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", - "dev": true - }, - "is-posix-bracket": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", - "dev": true - }, - "is-primitive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", - "dev": true - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" - }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", "dev": true }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", - "dev": true - }, - "is-valid-glob": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-0.3.0.tgz", - "integrity": "sha1-1LVcafUYhvm2XHDWwmItN+KfSP4=", - "dev": true - }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -1703,16 +877,8 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" - }, - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true }, "isstream": { "version": "0.1.2", @@ -1721,15 +887,15 @@ "dev": true }, "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, "js-yaml": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", - "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", "requires": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -1739,23 +905,7 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true, - "optional": true - }, - "json-parser": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/json-parser/-/json-parser-1.1.5.tgz", - "integrity": "sha1-5i7FJh0aal/CDoEqMgdAxtkAVnc=", - "requires": { - "esprima": "^2.7.0" - }, - "dependencies": { - "esprima": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", - "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=" - } - } + "dev": true }, "json-schema": { "version": "0.2.3", @@ -1764,20 +914,11 @@ "dev": true }, "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, - "json-stable-stringify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", - "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", - "dev": true, - "requires": { - "jsonify": "~0.0.0" - } - }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -1792,12 +933,6 @@ "graceful-fs": "^4.1.6" } }, - "jsonify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", - "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", - "dev": true - }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -1810,69 +945,31 @@ "verror": "1.10.0" } }, - "kind-of": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz", - "integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ=", - "dev": true - }, - "lazystream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", - "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=", - "dev": true, - "requires": { - "readable-stream": "^2.0.5" - } - }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "requires": { - "invert-kv": "^1.0.0" - } - }, "linkify-it": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.0.3.tgz", - "integrity": "sha1-2UpGSPmxwXnWT6lykSaL22zpQ08=", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz", + "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==", "requires": { "uc.micro": "^1.0.1" } }, "localized-resource-manager": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/localized-resource-manager/-/localized-resource-manager-1.0.1.tgz", - "integrity": "sha512-BsCEMrotACaMD9twfoHLonnYLXOSm2ZTpeXlL4Iwh5ZrXpJmhNYUkgskf+Pyh8LwyBJlZgwvYJi3Pta4cAreUA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/localized-resource-manager/-/localized-resource-manager-1.0.3.tgz", + "integrity": "sha512-MpdL4tr4K19K774H6PPO2FCLqP00TeK+ZU7bG1REEAKQJ4XtX3omSZM95diLp36U6b/17w4uz7Q7s+3FGMrglQ==", "requires": { "@types/mustache": "^0.8.32", - "comment-json": "^1.1.3", - "culture-info": "^1.0.2", - "fs-extra": "^7.0.1", + "comment-json": "^2.1.0", + "culture-info": "^1.0.4", + "fs-extra": "^8.1.0", "mustache": "^3.0.1", - "yaml": "^1.2.0" + "yaml": "^1.6.0" }, "dependencies": { "@types/mustache": { "version": "0.8.32", "resolved": "https://registry.npmjs.org/@types/mustache/-/mustache-0.8.32.tgz", "integrity": "sha512-RTVWV485OOf4+nO2+feurk0chzHkSjkjALiejpHltyuMf/13fGymbbNNFrSKdSSUg1TIwzszXdWsVirxgqYiFA==" - }, - "fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "mustache": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mustache/-/mustache-3.0.1.tgz", - "integrity": "sha512-jFI/4UVRsRYdUbuDTKT7KzfOp7FiD5WzYmmwNwXyUVypC0xjoTL78Fqc0jHUPIvvGD+6DQSPHIt1NE7D1ArsqA==" } } }, @@ -1885,31 +982,10 @@ "path-exists": "^3.0.0" } }, - "lodash.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=", - "dev": true - }, - "lru-cache": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", - "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "map-stream": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", - "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=", - "dev": true - }, "markdown-it": { - "version": "8.4.2", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.2.tgz", - "integrity": "sha512-GcRz3AWTqSUphY3vsUqQSFMbgR38a4Lh3GWlHRh/7MRwz8mcu9n2IO7HOh+bXHrR9kOPDl5RNCaEsrneb+xhHQ==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-9.0.1.tgz", + "integrity": "sha512-XC9dMBHg28Xi7y5dPuLjM61upIGPJG8AiHNHYqIaXER2KNnn7eKnM5/sF0ImNnyoV224Ogn9b1Pck8VH4k0bxw==", "requires": { "argparse": "^1.0.7", "entities": "~1.1.1", @@ -1919,9 +995,9 @@ } }, "markdown-it-anchor": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-5.0.2.tgz", - "integrity": "sha512-AFM/woBI8QDJMS/9+MmsBMT5/AR+ImfOsunQZTZhzcTmna3rIzAzbOh5E0l6mlFM/i9666BpUtkqQ9bS7WApCg==" + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-5.2.4.tgz", + "integrity": "sha512-n8zCGjxA3T+Mx1pG8HEgbJbkB8JFUuRkeTZQuIM8iPY6oQ8sWOPRZJDFC9a/pNg2QkHEjjGkhBEl/RSyzaDZ3A==" }, "markdown-it-checkbox": { "version": "1.1.0", @@ -1944,119 +1020,35 @@ "integrity": "sha1-m+4OmpkKljupbfaYDE/dsF37Tcw=" }, "markdown-it-table-of-contents": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/markdown-it-table-of-contents/-/markdown-it-table-of-contents-0.4.3.tgz", - "integrity": "sha512-x/OdaRzLYxAjmB+jIVlXuE3nX7tZTLDQxm58RkgjTLyQ+I290jYQvPS9cJjVN6SM3U6K6CHKYNgUtPNZmLblYQ==" - }, - "math-random": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", - "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", - "dev": true + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/markdown-it-table-of-contents/-/markdown-it-table-of-contents-0.4.4.tgz", + "integrity": "sha512-TAIHTHPwa9+ltKvKPWulm/beozQU41Ab+FIefRaQV1NRnpzwcV9QOe6wXQS5WLivm5Q/nlo0rl6laGkMDZE7Gw==" }, "mdurl": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=" }, - "mem": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", - "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "merge-stream": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", - "integrity": "sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=", - "dev": true, - "requires": { - "readable-stream": "^2.0.1" - } - }, - "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "dev": true, - "requires": { - "arr-diff": "^2.0.0", - "array-unique": "^0.2.1", - "braces": "^1.8.2", - "expand-brackets": "^0.1.4", - "extglob": "^0.3.1", - "filename-regex": "^2.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.1", - "kind-of": "^3.0.2", - "normalize-path": "^2.0.1", - "object.omit": "^2.0.0", - "parse-glob": "^3.0.4", - "regex-cache": "^0.4.2" - }, - "dependencies": { - "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "dev": true, - "requires": { - "arr-flatten": "^1.0.1" - } - }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "mime": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.3.1.tgz", - "integrity": "sha512-OEUllcVoydBHGN1z84yfQDimn58pZNNNXgZlHXSboxMlFvgI6MXSWpWKpFRra7H1HxpVhHTkrghfRW49k6yjeg==" + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", + "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==" }, "mime-db": { - "version": "1.36.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.36.0.tgz", - "integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw==", + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", "dev": true }, "mime-types": { - "version": "2.1.20", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.20.tgz", - "integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==", + "version": "2.1.24", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", + "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", "dev": true, "requires": { - "mime-db": "~1.36.0" + "mime-db": "1.40.0" } }, - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" - }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -2086,48 +1078,37 @@ } }, "mocha": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-4.1.0.tgz", - "integrity": "sha512-0RVnjg1HJsXY2YFDoTNzcc1NKhYuXKRrBAG2gDygmJJA136Cs2QlRliZG1mA0ap7cuaT30mw16luAeln+4RiNA==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", + "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", "dev": true, "requires": { - "browser-stdout": "1.3.0", - "commander": "2.11.0", + "browser-stdout": "1.3.1", + "commander": "2.15.1", "debug": "3.1.0", - "diff": "3.3.1", + "diff": "3.5.0", "escape-string-regexp": "1.0.5", "glob": "7.1.2", - "growl": "1.10.3", + "growl": "1.10.5", "he": "1.1.1", + "minimatch": "3.0.4", "mkdirp": "0.5.1", - "supports-color": "4.4.0" + "supports-color": "5.4.0" }, "dependencies": { "commander": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", - "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", - "dev": true - }, - "diff": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz", - "integrity": "sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww==", - "dev": true - }, - "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", "dev": true }, "supports-color": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", - "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "^2.0.0" + "has-flag": "^3.0.0" } } } @@ -2138,26 +1119,14 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, "multi-integer-range": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/multi-integer-range/-/multi-integer-range-3.0.0.tgz", - "integrity": "sha1-2OwnRNCHWPKs+BZT0v4DipXPdZU=" - }, - "multimatch": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz", - "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=", - "dev": true, - "requires": { - "array-differ": "^1.0.0", - "array-union": "^1.0.1", - "arrify": "^1.0.0", - "minimatch": "^3.0.0" - } + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/multi-integer-range/-/multi-integer-range-4.0.7.tgz", + "integrity": "sha512-THuAnyKxIogrhWvHXHMEWxR90TCFcz/RHsnTcGKAOxdOMaNZSKkujOHMC2LZGMc/j+Jdf31FJcL66au/U0mS1Q==" }, "mustache": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/mustache/-/mustache-2.3.2.tgz", - "integrity": "sha512-KpMNwdQsYz3O/SBS1qJ/o3sqUJ5wSb8gb0pul8CO0S56b9Y2ALm8zCfsjPXsqGFfoNBkDwZuZIAjhsZI03gYVQ==" + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-3.0.1.tgz", + "integrity": "sha512-jFI/4UVRsRYdUbuDTKT7KzfOp7FiD5WzYmmwNwXyUVypC0xjoTL78Fqc0jHUPIvvGD+6DQSPHIt1NE7D1ArsqA==" }, "nice-try": { "version": "1.0.5", @@ -2165,59 +1134,12 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, - "node.extend": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/node.extend/-/node.extend-1.1.6.tgz", - "integrity": "sha1-p7iCyC1sk6SGOlUEvV3o7IYli5Y=", - "dev": true, - "requires": { - "is": "^3.1.0" - } - }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "requires": { - "path-key": "^2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" - }, "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", "dev": true }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - }, - "object.omit": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", - "dev": true, - "requires": { - "for-own": "^0.1.4", - "is-extendable": "^0.1.1" - } - }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -2243,39 +1165,14 @@ "minimist": { "version": "0.0.10", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", - "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=" - } - } - }, - "ordered-read-streams": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-0.3.0.tgz", - "integrity": "sha1-cTfmmzKYuzQiR6G77jiByA4v14s=", - "dev": true, - "requires": { - "is-stream": "^1.0.1", - "readable-stream": "^2.0.1" - } - }, - "os-locale": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", - "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", - "requires": { - "execa": "^0.7.0", - "lcid": "^1.0.0", - "mem": "^1.1.0" + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=" + } } }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" - }, "p-limit": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.0.0.tgz", - "integrity": "sha512-fl5s52lI5ahKCernzzIyAP0QAZbGIovtVHGwpcu1Jr/EpzLVDI2myISHwGqK7m8uQFugVWSrbxH7XnhGtvEc+A==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", "requires": { "p-try": "^2.0.0" } @@ -2289,44 +1186,9 @@ } }, "p-try": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", - "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==" - }, - "parse-glob": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", - "dev": true, - "requires": { - "glob-base": "^0.3.0", - "is-dotfile": "^1.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.0" - }, - "dependencies": { - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - } - } - }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", - "dev": true + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" }, "path-exists": { "version": "3.0.0", @@ -2341,22 +1203,14 @@ "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true }, "path-parse": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=" }, - "pause-stream": { - "version": "0.0.11", - "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", - "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", - "dev": true, - "requires": { - "through": "~2.3" - } - }, "pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", @@ -2368,19 +1222,6 @@ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", "dev": true }, - "plugin-error": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-0.1.2.tgz", - "integrity": "sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4=", - "dev": true, - "requires": { - "ansi-cyan": "^0.1.1", - "ansi-red": "^0.1.1", - "arr-diff": "^1.0.1", - "arr-union": "^2.0.1", - "extend-shallow": "^1.1.2" - } - }, "portfinder": { "version": "1.0.19", "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.19.tgz", @@ -2401,57 +1242,61 @@ } } }, - "preserve": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", - "dev": true - }, "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, "progress": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.1.tgz", - "integrity": "sha512-OE+a6vzqazc+K6LxJrX5UPyKFvGnL5CYmq2jFGNIBWHpc4QyE49/YOumcrpQFJpfejmvRtbJzgO1zPmMCqlbBg==" + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==" }, "proxy-from-env": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz", "integrity": "sha1-M8UDmPcOp+uW0h97gXYwpVeRx+4=" }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" - }, "psl": { - "version": "1.1.29", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", - "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.3.0.tgz", + "integrity": "sha512-avHdspHO+9rQTLbv1RO+MPYeP/SzsCoxofjVnHanETfQhTJrmB0HlDoW+EiN/R+C0BZ+gERab9NY0lPN2TxNag==", "dev": true }, "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, "puppeteer": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-1.9.0.tgz", - "integrity": "sha512-GH4PmhJf9wBRAPvtJkEJLAvdNNOofZortmBZSj8cGWYni98GUFqsf66blOEfJbo5B8l0KG5HR2d/W2MejnUrzg==", + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-1.19.0.tgz", + "integrity": "sha512-2S6E6ygpoqcECaagDbBopoSOPDv0pAZvTbnBgUY+6hq0/XDFDOLEMNlHF/SKJlzcaZ9ckiKjKDuueWI3FN/WXw==", "requires": { - "debug": "^3.1.0", + "debug": "^4.1.0", "extract-zip": "^1.6.6", "https-proxy-agent": "^2.2.1", "mime": "^2.0.3", - "progress": "^2.0.0", + "progress": "^2.0.1", "proxy-from-env": "^1.0.0", "rimraf": "^2.6.1", - "ws": "^5.1.1" + "ws": "^6.1.0" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } } }, "qs": { @@ -2461,45 +1306,11 @@ "dev": true }, "querystringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.0.0.tgz", - "integrity": "sha512-eTPo5t/4bgaMNZxyjWx6N2a6AuE0mq51KWvpc7nU/MAqixcI6v6KrGUKES0HaomdnolQBBXU/++X6/QQ9KL4tw==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz", + "integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==", "dev": true }, - "queue": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/queue/-/queue-3.1.0.tgz", - "integrity": "sha1-bEnQHwCeIlZ4h4nyv/rGuLmZBYU=", - "dev": true, - "requires": { - "inherits": "~2.0.0" - } - }, - "randomatic": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.0.tgz", - "integrity": "sha512-KnGPVE0lo2WoXxIZ7cPR8YBpiol4gsSuOwDSg410oHh80ZMp5EiypNqL2K4Z77vJn6lB5rap7IkAmcUlalcnBQ==", - "dev": true, - "requires": { - "is-number": "^4.0.0", - "kind-of": "^6.0.0", - "math-random": "^1.0.1" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - } - } - }, "rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", @@ -2533,38 +1344,15 @@ "resolve": "^1.1.6" } }, - "regex-cache": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", - "dev": true, - "requires": { - "is-equal-shallow": "^0.1.3" - } - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", - "dev": true + "regenerator-runtime": { + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz", + "integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw==" }, "repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, - "replace-ext": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", - "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", - "dev": true + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" }, "request": { "version": "2.88.0", @@ -2592,18 +1380,6 @@ "tough-cookie": "~2.4.3", "tunnel-agent": "^0.6.0", "uuid": "^3.3.2" - }, - "dependencies": { - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "dev": true, - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - } - } } }, "require-directory": { @@ -2612,9 +1388,9 @@ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" }, "requires-port": { "version": "1.0.0", @@ -2630,11 +1406,26 @@ } }, "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "requires": { - "glob": "^7.0.5" + "glob": "^7.1.3" + }, + "dependencies": { + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } } }, "safe-buffer": { @@ -2663,6 +1454,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, "requires": { "shebang-regex": "^1.0.0" } @@ -2670,7 +1462,8 @@ "shebang-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true }, "shelljs": { "version": "0.8.2", @@ -2682,11 +1475,6 @@ "rechoir": "^0.6.2" } }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -2694,28 +1482,19 @@ "dev": true }, "source-map-support": { - "version": "0.5.9", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.9.tgz", - "integrity": "sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==", + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", "dev": true, "requires": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" } }, - "split": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", - "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=", - "dev": true, - "requires": { - "through": "2" - } - }, "sshpk": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", - "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", "dev": true, "requires": { "asn1": "~0.2.3", @@ -2729,54 +1508,19 @@ "tweetnacl": "~0.14.0" } }, - "stat-mode": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/stat-mode/-/stat-mode-0.2.2.tgz", - "integrity": "sha1-5sgLYjEj19gM8TLOU480YokHJQI=", - "dev": true - }, - "stream-combiner": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", - "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=", - "dev": true, - "requires": { - "duplexer": "~0.1.1" - } - }, - "stream-shift": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", - "dev": true - }, - "streamfilter": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/streamfilter/-/streamfilter-1.0.7.tgz", - "integrity": "sha512-Gk6KZM+yNA1JpW0KzlZIhjo3EaBJDkYfXtYSbOwNIQ7Zd6006E6+sCFlW1NDvFG/vnXhKmw6TJJgiEQg/8lXfQ==", - "dev": true, - "requires": { - "readable-stream": "^2.0.2" - } - }, - "streamifier": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/streamifier/-/streamifier-0.1.1.tgz", - "integrity": "sha1-l+mNj6TRBdYqJpHR3AfoINuN/E8=", - "dev": true - }, "string-template": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/string-template/-/string-template-1.0.0.tgz", "integrity": "sha1-np8iM9wA8hhxjsN5oopWc+zKi5Y=" }, "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "requires": { + "emoji-regex": "^7.0.1", "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "strip-ansi": "^5.1.0" } }, "string_decoder": { @@ -2788,137 +1532,78 @@ } }, "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "^0.2.0" - } - }, - "strip-bom-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-bom-stream/-/strip-bom-stream-1.0.0.tgz", - "integrity": "sha1-5xRDmFd9Uaa+0PoZlPoF9D/ZiO4=", - "dev": true, + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "requires": { - "first-chunk-stream": "^1.0.0", - "strip-bom": "^2.0.0" + "ansi-regex": "^4.1.0" } }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" - }, "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" }, "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - }, - "tar": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", - "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", - "dev": true, - "requires": { - "block-stream": "*", - "fstream": "^1.0.2", - "inherits": "2" - } - }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true - }, - "through2": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", - "dev": true, - "requires": { - "readable-stream": "^2.1.5", - "xtend": "~4.0.1" - } - }, - "through2-filter": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-2.0.0.tgz", - "integrity": "sha1-YLxVoNrLdghdsfna6Zq0P4PWIuw=", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { - "through2": "~2.0.0", - "xtend": "~4.0.0" + "has-flag": "^3.0.0" } }, - "to-absolute-glob": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-0.1.1.tgz", - "integrity": "sha1-HN+kcqnvUMI57maZm2YsoOs5k38=", + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", "dev": true, "requires": { - "extend-shallow": "^2.0.1" + "psl": "^1.1.24", + "punycode": "^1.4.1" }, "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true } } }, "transliteration": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/transliteration/-/transliteration-1.6.6.tgz", - "integrity": "sha1-in6KswRK0Z8jP1DBWJTL9p5dIF4=", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/transliteration/-/transliteration-2.1.5.tgz", + "integrity": "sha512-RxxxbAzTU0Y7IWJulZ9LRjJPcdC269cSJI6NCOwYQrw7TjSN2gBBZDD6slrgO1+XkxGNfAmtFAInpvk22HMq0w==", "requires": { - "yargs": "^12.0.1" + "yargs": "^13.2.4" } }, "tslib": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", - "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", + "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", "dev": true }, "tslint": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.11.0.tgz", - "integrity": "sha1-mPMMAurjzecAYgHkwzywi0hYHu0=", + "version": "5.18.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.18.0.tgz", + "integrity": "sha512-Q3kXkuDEijQ37nXZZLKErssQVnwCV/+23gFEMROi8IlbaBG6tXqLPQJ5Wjcyt/yHPKBC+hD5SzuGaMora+ZS6w==", "dev": true, "requires": { - "babel-code-frame": "^6.22.0", + "@babel/code-frame": "^7.0.0", "builtin-modules": "^1.1.1", "chalk": "^2.3.0", "commander": "^2.12.1", "diff": "^3.2.0", "glob": "^7.1.1", - "js-yaml": "^3.7.0", + "js-yaml": "^3.13.1", "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", "resolve": "^1.3.2", "semver": "^5.3.0", "tslib": "^1.8.0", - "tsutils": "^2.27.2" + "tsutils": "^2.29.0" } }, "tsutils": { @@ -2943,13 +1628,39 @@ "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true, - "optional": true + "dev": true }, "twemoji": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/twemoji/-/twemoji-2.5.1.tgz", - "integrity": "sha1-KWZHxhY8fwR0WIccKuviXqj/6DQ=" + "version": "12.1.2", + "resolved": "https://registry.npmjs.org/twemoji/-/twemoji-12.1.2.tgz", + "integrity": "sha512-myi1YKL4nXBWorlmHDxHxHTCpel0e0jGtWQwwab0XyCAf3r9PnkZX0c+IAnPW+K6+TKXBJulMRPifeMhiPKYuw==", + "requires": { + "fs-extra": "^8.0.1", + "jsonfile": "^5.0.0", + "twemoji-parser": "12.1.0", + "universalify": "^0.1.2" + }, + "dependencies": { + "jsonfile": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-5.0.0.tgz", + "integrity": "sha512-NQRZ5CRo74MhMMC3/3r5g2k4fjodJ/wh8MxjFbCViWKFjxrnudWSY5vomh+23ZaXzAS7J3fBZIR2dV6WbmfM0w==", + "requires": { + "graceful-fs": "^4.1.6", + "universalify": "^0.1.2" + } + } + } + }, + "twemoji-parser": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/twemoji-parser/-/twemoji-parser-12.1.0.tgz", + "integrity": "sha512-jaHYltumP/E8nR+YzRrY753j9dEpL3zH8+pDXgf9h/10wHeW/9IIjs6mZ1Z/Syh8rIaOQObev1BAX/AinFmuOg==" + }, + "type-fest": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", + "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==" }, "typedarray": { "version": "0.0.6", @@ -2957,15 +1668,15 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" }, "typescript": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz", - "integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz", + "integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==", "dev": true }, "uc.micro": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.5.tgz", - "integrity": "sha512-JoLI4g5zv5qNyT09f4YAvEZIIV1oOjqnewYg5D38dkQljIzpPT296dbIGvKro3digYI1bkb7W6EP1y4uDlmzLg==" + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==" }, "union": { "version": "0.4.6", @@ -2982,33 +1693,32 @@ } } }, - "unique-stream": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.2.1.tgz", - "integrity": "sha1-WqADz76Uxf+GbE59ZouxxNuts2k=", - "dev": true, - "requires": { - "json-stable-stringify": "^1.0.0", - "through2-filter": "^2.0.0" - } - }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, "url-join": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/url-join/-/url-join-2.0.5.tgz", "integrity": "sha1-WvIvGMBSoACkjXuCxenC4v7tpyg=" }, "url-parse": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.3.tgz", - "integrity": "sha512-rh+KuAW36YKo0vClhQzLLveoj8FwPJNu65xLb7Mrt+eZht0IPT0IXgSv8gcMegZ6NvjJUALf6Mf25POlMwD1Fw==", + "version": "1.4.7", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz", + "integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==", "dev": true, "requires": { - "querystringify": "^2.0.0", + "querystringify": "^2.1.1", "requires-port": "^1.0.0" } }, @@ -3023,12 +1733,6 @@ "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", "dev": true }, - "vali-date": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz", - "integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY=", - "dev": true - }, "verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", @@ -3040,110 +1744,36 @@ "extsprintf": "^1.2.0" } }, - "vinyl": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.4.6.tgz", - "integrity": "sha1-LzVsh6VQolVGHza76ypbqL94SEc=", - "dev": true, - "requires": { - "clone": "^0.2.0", - "clone-stats": "^0.0.1" - }, - "dependencies": { - "clone": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/clone/-/clone-0.2.0.tgz", - "integrity": "sha1-xhJqkK1Pctv1rNskPMN3JP6T/B8=", - "dev": true - } - } - }, - "vinyl-fs": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-2.4.4.tgz", - "integrity": "sha1-vm/zJwy1Xf19MGNkDegfJddTIjk=", - "dev": true, - "requires": { - "duplexify": "^3.2.0", - "glob-stream": "^5.3.2", - "graceful-fs": "^4.0.0", - "gulp-sourcemaps": "1.6.0", - "is-valid-glob": "^0.3.0", - "lazystream": "^1.0.0", - "lodash.isequal": "^4.0.0", - "merge-stream": "^1.0.0", - "mkdirp": "^0.5.0", - "object-assign": "^4.0.0", - "readable-stream": "^2.0.4", - "strip-bom": "^2.0.0", - "strip-bom-stream": "^1.0.0", - "through2": "^2.0.0", - "through2-filter": "^2.0.0", - "vali-date": "^1.0.0", - "vinyl": "^1.0.0" - }, - "dependencies": { - "clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", - "dev": true - }, - "replace-ext": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz", - "integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ=", - "dev": true - }, - "vinyl": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-1.2.0.tgz", - "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", - "dev": true, - "requires": { - "clone": "^1.0.0", - "clone-stats": "^0.0.1", - "replace-ext": "0.0.1" - } - } - } - }, - "vinyl-source-stream": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vinyl-source-stream/-/vinyl-source-stream-1.1.2.tgz", - "integrity": "sha1-YrU6E1YQqJbpjKlr7jqH8Aio54A=", - "dev": true, - "requires": { - "through2": "^2.0.3", - "vinyl": "^0.4.3" - } - }, "vscode": { - "version": "1.1.21", - "resolved": "https://registry.npmjs.org/vscode/-/vscode-1.1.21.tgz", - "integrity": "sha512-tJl9eL15ZMm6vzCYYeQ26sSYRuXGMGPsaeIAmG2rOOYRn01jdaDg6I4b9G5Ed6FISdmn6egpKThk4o4om8Ax/A==", + "version": "1.1.36", + "resolved": "https://registry.npmjs.org/vscode/-/vscode-1.1.36.tgz", + "integrity": "sha512-cGFh9jmGLcTapCpPCKvn8aG/j9zVQ+0x5hzYJq5h5YyUXVGa1iamOaB2M2PZXoumQPES4qeAP1FwkI0b6tL4bQ==", "dev": true, "requires": { "glob": "^7.1.2", - "gulp-chmod": "^2.0.0", - "gulp-filter": "^5.0.1", - "gulp-gunzip": "1.0.0", - "gulp-remote-src-vscode": "^0.5.0", - "gulp-symdest": "^1.1.0", - "gulp-untar": "^0.0.7", - "gulp-vinyl-zip": "^2.1.0", - "mocha": "^4.0.1", - "request": "^2.83.0", + "mocha": "^5.2.0", + "request": "^2.88.0", "semver": "^5.4.1", "source-map-support": "^0.5.0", - "url-parse": "^1.4.3", - "vinyl-source-stream": "^1.1.0" + "url-parse": "^1.4.4", + "vscode-test": "^0.4.1" + } + }, + "vscode-test": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/vscode-test/-/vscode-test-0.4.3.tgz", + "integrity": "sha512-EkMGqBSefZH2MgW65nY05rdRSko15uvzq4VAPM5jVmwYuFQKE7eikKXNJDRxL+OITXHB6pI+a3XqqD32Y3KC5w==", + "dev": true, + "requires": { + "http-proxy-agent": "^2.1.0", + "https-proxy-agent": "^2.2.1" } }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, "requires": { "isexe": "^2.0.0" } @@ -3159,43 +1789,21 @@ "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=" }, "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" }, "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "requires": { - "ansi-regex": "^2.0.0" + "color-convert": "^1.9.0" } } } @@ -3206,38 +1814,25 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "ws": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", - "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", + "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", "requires": { "async-limiter": "~1.0.0" } }, - "xregexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-4.0.0.tgz", - "integrity": "sha512-PHyM+sQouu7xspQQwELlGwwd05mXUFqwFYfqPO0cC7x4fxyHnnuetmQr6CjJiafIDoH4MogHb9dOoJzR/Y4rFg==" - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "dev": true - }, "y18n": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" - }, "yaml": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.2.1.tgz", - "integrity": "sha512-LuOeoZc6LYguU9H/XCbrPfuDpCGJVf+o/r9uLCGnsHiHk/8Cr7IVeXOilO8yK0XA8QJPlX22KVofINt8xhdwqg==" + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.6.0.tgz", + "integrity": "sha512-iZfse3lwrJRoSlfs/9KQ9iIXxs9++RvBFVzAqbbBiFT+giYtyanevreF9r61ZTbGMgWQBxAua3FzJiniiJXWWw==", + "requires": { + "@babel/runtime": "^7.4.5" + } }, "yamljs": { "version": "0.3.0", @@ -3249,30 +1844,29 @@ } }, "yargs": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.1.tgz", - "integrity": "sha512-B0vRAp1hRX4jgIOWFtjfNjd9OA9RWYZ6tqGA9/I/IrTMsxmKvtWy+ersM+jzpQqbC3YfLzeABPdeTgcJ9eu1qQ==", + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", + "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", "requires": { - "cliui": "^4.0.0", - "decamelize": "^2.0.0", + "cliui": "^5.0.0", "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^2.0.0", + "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", + "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", - "string-width": "^2.0.0", + "string-width": "^3.0.0", "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^10.1.0" + "y18n": "^4.0.0", + "yargs-parser": "^13.1.1" } }, "yargs-parser": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", - "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", "requires": { - "camelcase": "^4.1.0" + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" } }, "yauzl": { @@ -3282,15 +1876,6 @@ "requires": { "fd-slicer": "~1.0.1" } - }, - "yazl": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/yazl/-/yazl-2.4.3.tgz", - "integrity": "sha1-7CblzIfVYBud+EMtvdPNLlFzoHE=", - "dev": true, - "requires": { - "buffer-crc32": "~0.2.3" - } } } } diff --git a/package.json b/package.json index 8ebac322..329d1223 100644 --- a/package.json +++ b/package.json @@ -48,47 +48,46 @@ "devDependencies": { "@types/clone": "^0.1.30", "@types/dedent": "^0.7.0", - "@types/fs-extra": "^5.0.4", - "@types/get-port": "^4.0.0", + "@types/fs-extra": "^8.0.0", "@types/highlight.js": "^9.12.3", "@types/http-server": "^0.10.0", - "@types/markdown-it": "0.0.3", - "@types/markdown-it-anchor": "^4.0.2", - "@types/mocha": "^2.2.48", - "@types/mustache": "^0.8.31", - "@types/node": "^10.12.0", - "@types/puppeteer": "^1.9.0", + "@types/markdown-it": "0.0.8", + "@types/markdown-it-anchor": "^4.0.3", + "@types/mocha": "^5.2.7", + "@types/mustache": "^0.8.32", + "@types/node": "^12.7.1", + "@types/puppeteer": "^1.19.0", "@types/string-template": "^1.0.2", - "@types/transliteration": "^1.6.0", + "@types/transliteration": "^1.6.1", "@types/yamljs": "^0.2.30", "cross-env": "^5.2.0", - "tslint": "^5.11.0", - "typescript": "^2.9.2", - "vscode": "^1.1.21" + "tslint": "^5.18.0", + "typescript": "^3.5.3", + "vscode": "^1.1.36" }, "dependencies": { "async-shelljs": "^0.1.2", "clone": "^2.1.2", "dedent": "^0.7.0", - "front-matter": "^2.3.0", - "fs-extra": "^6.0.1", - "get-port": "^4.0.0", - "highlight.js": "^9.13.1", + "front-matter": "^3.0.2", + "fs-extra": "^8.1.0", + "get-port": "^5.0.0", + "highlight.js": "^9.15.9", "highlightjs": "^9.12.0", "http-server": "^0.11.1", - "localized-resource-manager": "^1.0.1", - "markdown-it": "^8.4.2", - "markdown-it-anchor": "^5.0.2", + "localized-resource-manager": "^1.0.3", + "markdown-it": "^9.0.1", + "markdown-it-anchor": "^5.2.4", "markdown-it-checkbox": "^1.1.0", - "markdown-it-emoji": "^1.3.0", - "markdown-it-table-of-contents": "^0.4.3", - "multi-integer-range": "^3.0.0", - "mustache": "^2.3.2", - "puppeteer": "^1.9.0", + "markdown-it-emoji": "^1.4.0", + "markdown-it-table-of-contents": "^0.4.4", + "multi-integer-range": "^4.0.7", + "mustache": "^3.0.1", + "puppeteer": "^1.19.0", "rc": "^1.2.8", "string-template": "^1.0.0", - "transliteration": "^1.6.6", - "twemoji": "^2.5.1", + "transliteration": "^2.1.5", + "twemoji": "^12.1.2", "yamljs": "^0.3.0" }, "activationEvents": [ diff --git a/src/ConversionTask.ts b/src/ConversionTask.ts index 895ae88a..83fa41c1 100644 --- a/src/ConversionTask.ts +++ b/src/ConversionTask.ts @@ -281,9 +281,9 @@ export abstract class ConversionTask extends PuppeteerTask /** * Loads a parser according to the settings. */ - protected async LoadParser(): Promise + protected async LoadParser(): Promise { - let parser: MarkdownIt.MarkdownIt; + let parser: MarkdownIt; let slugify = (text: string) => Transliteration.slugify( text, diff --git a/src/System/Drawing/Document.ts b/src/System/Drawing/Document.ts index e14bf122..da6a4b2e 100644 --- a/src/System/Drawing/Document.ts +++ b/src/System/Drawing/Document.ts @@ -2,7 +2,7 @@ import Dedent = require("dedent"); import FrontMatter = require("front-matter"); import FileSystem = require("fs-extra"); import { CultureInfo } from "localized-resource-manager"; -import { MarkdownIt } from "markdown-it"; +import MarkdownIt = require("markdown-it"); import Mustache = require("mustache"); import OS = require("os"); import Path = require("path"); diff --git a/src/extension.ts b/src/extension.ts index a6d4ad9e..fcab00aa 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,7 +1,7 @@ // The module 'vscode' contains the VS Code extensibility API // Import the module and reference it with the alias vscode in your code below import { CultureInfo } from "localized-resource-manager"; -import { MarkdownIt } from "markdown-it"; +import MarkdownIt = require("markdown-it"); import Path = require("path"); import { commands, env, ExtensionContext } from "vscode"; import { ConvertAllTask } from "./ConvertAllTask"; From 9ca133af89e3f7775d8f85e0547f4e715b8ab8b8 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 8 Aug 2019 16:47:44 +0200 Subject: [PATCH 41/77] Refactor the settings-class --- src/Properties/Settings.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Properties/Settings.ts b/src/Properties/Settings.ts index 2c171f6c..2cb939d7 100644 --- a/src/Properties/Settings.ts +++ b/src/Properties/Settings.ts @@ -5,6 +5,7 @@ import { DestinationOrigin } from "../DestinationOrigin"; import { CustomPaperFormat } from "../System/Drawing/CustomPaperFormat"; import { EmojiType } from "../System/Drawing/EmojiType"; import { ListType } from "../System/Drawing/ListType"; +import { Margin } from "../System/Drawing/Margin"; import { Paper } from "../System/Drawing/Paper"; import { PaperOrientation } from "../System/Drawing/PaperOrientation"; import { StandardizedFormatType } from "../System/Drawing/StandardizedFormatType"; @@ -39,7 +40,7 @@ export class Settings */ public get DestinationOrigin(): DestinationOrigin { - return (DestinationOrigin as any)[this.getConfigEntry("DestinationOrigin")]; + return DestinationOrigin[this.getConfigEntry("DestinationOrigin")]; } /** @@ -72,11 +73,11 @@ export class Settings public get ConversionType(): ConversionType[] { let types: ConversionType[] = []; - let conversionTypes: string[] = this.getConfigEntry("ConversionType", [ConversionType[ConversionType.PDF]]); + let conversionTypes = this.getConfigEntry>("ConversionType", [ConversionType[ConversionType.PDF] as keyof typeof ConversionType]); for (let conversionType of conversionTypes) { - types.push((ConversionType as any)[conversionType]); + types.push(ConversionType[conversionType]); } return types; @@ -137,13 +138,13 @@ export class Settings paper.Format = format; } - for (let side of ["Top", "Right", "Bottom", "Left"]) + for (let side of (Object.keys(paper.Margin) as Array)) { let configKey = "Document.Paper.Margin." + side; if (this.config.has(configKey)) { - (paper.Margin as any)[side] = this.config.get(configKey); + paper.Margin[side] = this.config.get(configKey); } } From 93b8bd3b0bdae6bac3a05e335ee8688ccef8a6ec Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 8 Aug 2019 23:05:27 +0200 Subject: [PATCH 42/77] Add configuration-presets --- package-lock.json | 12 +++ package.json | 2 + tsconfig.json | 12 +-- tslint.json | 187 +--------------------------------------------- 4 files changed, 17 insertions(+), 196 deletions(-) diff --git a/package-lock.json b/package-lock.json index 71752f7d..5b4a6eb7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,6 +32,18 @@ "regenerator-runtime": "^0.13.2" } }, + "@manuth/tsconfig": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@manuth/tsconfig/-/tsconfig-1.2.2.tgz", + "integrity": "sha512-GAlxyYTPA88/aScFPWup7LTmlbpukFB1jGolccffXWRe/MBkH6pU2K9yYKXvHoppNzCvYvdVJ91b72qexbuy5Q==", + "dev": true + }, + "@manuth/tslint-presets": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@manuth/tslint-presets/-/tslint-presets-1.0.4.tgz", + "integrity": "sha512-Q7VQGQqilKfi/bH3yAww+R6NEMoP/v4ioOplI0ptSKMLVqqsQc2RkHevOyVQGPsxtQX9+hEtMr4rxUwnmhYhfA==", + "dev": true + }, "@types/clone": { "version": "0.1.30", "resolved": "https://registry.npmjs.org/@types/clone/-/clone-0.1.30.tgz", diff --git a/package.json b/package.json index 329d1223..d469ab7b 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,8 @@ "prepare": "npm run rebuild" }, "devDependencies": { + "@manuth/tsconfig": "^1.2.2", + "@manuth/tslint-presets": "^1.0.4", "@types/clone": "^0.1.30", "@types/dedent": "^0.7.0", "@types/fs-extra": "^8.0.0", diff --git a/tsconfig.json b/tsconfig.json index 0bdbbf58..4844bff1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,4 +1,5 @@ { + "extends": "@manuth/tsconfig/recommended", "compileOnSave": true, "compilerOptions": { "rootDir": "./src", @@ -14,15 +15,6 @@ } ], "target": "es6", - "outDir": "./lib", - "declaration": true, - "sourceMap": true, - "resolveJsonModule": true, - "forceConsistentCasingInFileNames": true, - "alwaysStrict": true, - "strictFunctionTypes": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true + "outDir": "./lib" } } \ No newline at end of file diff --git a/tslint.json b/tslint.json index 16b2dd13..5cb674fe 100644 --- a/tslint.json +++ b/tslint.json @@ -1,188 +1,3 @@ { - "defaultSeverity": "warning", - "extends": "tslint:recommended", - "rules": { - // General - "member-ordering": { - "options": { - "order": [ - "public-static-field", - "public-instance-field", - "protected-static-field", - "protected-instance-field", - "private-static-field", - "private-instance-field", - "public-constructor", - "protected-constructor", - "private-constructor", - "public-static-method", - "public-instance-method", - "protected-static-method", - "protected-instance-method", - "private-static-method", - "private-instance-method" - ] - } - }, - "no-empty-interface": false, - "no-inferrable-types": true, - "unified-signatures": false, - // Functionality - "await-promise": { - "options": [ - "PromiseLike", - "Thenable" - ] - }, - "ban-comma-operator": true, - "forin": false, - "no-bitwise": false, - "no-console": false, - "no-duplicate-switch-case": true, - "no-dynamic-delete": true, - "no-empty": false, - "no-floating-promises": false, - "no-for-in-array": false, - "no-return-await": true, - "no-shadowed-variable": false, - "no-string-literal": false, - "no-sparse-arrays": true, - "restrict-plus-operands": true, - "triple-equals": true, - // Maintainability - "eofline": false, - "max-classes-per-file": false, - "max-line-length": false, - "no-default-export": true, - "no-duplicate-imports": true, - "no-trailing-whitespace": true, - "object-literal-sort-keys": false, - "prefer-const": false, - "trailing-comma": false, - // Style - "array-type": false, - "arrow-parens": false, - "comment-format": { - "options": [ - "check-space", - "check-uppercase" - ] - }, - "completed-docs": { - "options": [ - "classes", - "enum-members", - "enums", - "functions", - "interfaces", - "methods", - "properties", - "types", - "variables" - ] - }, - "match-default-export-name": true, - "no-boolean-literal-compare": true, - "no-parameter-properties": true, - "no-redundant-jsdoc": true, - "no-reference-import": true, - "no-unnecessary-qualifier": true, - "no-unnecessary-type-assertion": true, - "one-line": false, - "number-literal-format": true, - "prefer-object-spread": true, - "return-undefined": true, - "space-before-function-paren": { - "options": { - "anonymous": "always", - "asyncArrow": "always", - "constructor": "never", - "method": "never", - "named": "never" - } - } - }, - "jsRules": { - // General - "member-ordering": { - "options": { - "order": [ - "public-static-field", - "protected-static-field", - "private-static-field", - "public-instance-field", - "protected-instance-field", - "private-instance-field", - "public-constructor", - "protected-constructor", - "private-constructor", - "public-static-method", - "protected-static-method", - "private-static-method", - "public-instance-method", - "protected-instance-method", - "private-instance-method" - ] - } - }, - // Functionality - "ban-comma-operator": true, - "forin": false, - "no-bitwise": false, - "no-console": false, - "no-duplicate-switch-case": true, - "no-dynamic-delete": true, - "no-empty": false, - "no-for-in-array": false, - "no-return-await": true, - "no-shadowed-variable": false, - "no-string-literal": false, - "no-sparse-arrays": true, - "restrict-plus-operands": true, - "triple-equals": true, - // Maintainability - "eofline": false, - "max-classes-per-file": false, - "max-line-length": false, - "no-default-export": true, - "no-duplicate-imports": true, - "no-trailing-whitespace": true, - "object-literal-sort-keys": false, - "prefer-const": false, - "trailing-comma": false, - // Style - "arrow-parens": false, - "comment-format": { - "options": [ - "check-space", - "check-uppercase" - ] - }, - "completed-docs": { - "options": [ - "classes", - "enum-members", - "enums", - "functions", - "interfaces", - "methods", - "properties", - "types", - "variables" - ] - }, - "one-line": false, - "number-literal-format": true, - "prefer-method-signature": true, - "return-undefined": true, - "space-before-function-paren": { - "options": { - "anonymous": "always", - "asyncArrow": "always", - "constructor": "never", - "method": "never", - "named": "never" - } - } - } + "extends": "@manuth/tslint-presets/recommended" } \ No newline at end of file From 62b2d13218d545ebe673ac0eb3c30aafd14715bd Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 8 Aug 2019 23:05:45 +0200 Subject: [PATCH 43/77] Adjust the files according to tslint --- src/ConversionTask.ts | 2 +- src/ConvertAllTask.ts | 3 +++ src/ConvertTask.ts | 3 +++ src/MarkdownContributions.ts | 4 ++-- src/System/Drawing/CustomPaperFormat.ts | 3 +++ src/System/Drawing/Margin.ts | 3 +-- src/System/Drawing/StandardizedPaperFormat.ts | 3 +++ src/System/IO/FileException.ts | 3 +++ src/System/YAML/YAMLException.ts | 5 ++++- src/Utilities.ts | 2 +- 10 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/ConversionTask.ts b/src/ConversionTask.ts index 83fa41c1..119d331a 100644 --- a/src/ConversionTask.ts +++ b/src/ConversionTask.ts @@ -116,7 +116,7 @@ export abstract class ConversionTask extends PuppeteerTask destinationPath = Settings.Default.DestinationPath; } - let tasks: Promise[] = []; + let tasks: Array> = []; let fileName = Path.parse(document.fileName).name; let converter = await this.LoadConverter(documentRoot, document); await converter.Initialize(); diff --git a/src/ConvertAllTask.ts b/src/ConvertAllTask.ts index 117517a6..252742e2 100644 --- a/src/ConvertAllTask.ts +++ b/src/ConvertAllTask.ts @@ -18,6 +18,9 @@ export class ConvertAllTask extends ConversionTask super(extension); } + /** + * @inheritdoc + */ protected async ExecuteTask() { for (let document of await this.GetDocuments()) diff --git a/src/ConvertTask.ts b/src/ConvertTask.ts index 644034d3..2f0e26d7 100644 --- a/src/ConvertTask.ts +++ b/src/ConvertTask.ts @@ -20,6 +20,9 @@ export class ConvertTask extends ConversionTask super(extension); } + /** + * @inheritdoc + */ public async ExecuteTask() { return this.Convert(this.GetMarkdownDocument()); diff --git a/src/MarkdownContributions.ts b/src/MarkdownContributions.ts index 86e3640f..8a460c26 100644 --- a/src/MarkdownContributions.ts +++ b/src/MarkdownContributions.ts @@ -33,7 +33,7 @@ export class MarkdownContributions /** * The plugins of the markdown-preview. */ - private readonly plugins: Thenable<(md: any) => any>[] = []; + private readonly plugins: Array any>> = []; /** * A value indicating whether the contributions are loaded. @@ -78,7 +78,7 @@ export class MarkdownContributions /** * Gets the plugins of the markdown-preview. */ - public get markdownItPlugins(): Thenable<(md: any) => any>[] + public get markdownItPlugins(): Array any>> { this.Load(); return this.plugins; diff --git a/src/System/Drawing/CustomPaperFormat.ts b/src/System/Drawing/CustomPaperFormat.ts index 9c0ec7b5..2ba3b0a7 100644 --- a/src/System/Drawing/CustomPaperFormat.ts +++ b/src/System/Drawing/CustomPaperFormat.ts @@ -58,6 +58,9 @@ export class CustomPaperFormat extends PaperFormat this.height = value; } + /** + * @inheritdoc + */ public get PDFOptions(): Partial { return { diff --git a/src/System/Drawing/Margin.ts b/src/System/Drawing/Margin.ts index f0664814..9b57a915 100644 --- a/src/System/Drawing/Margin.ts +++ b/src/System/Drawing/Margin.ts @@ -38,8 +38,7 @@ export class Margin * @param left * The left margin. */ - constructor(all: string); - constructor(vertical: string, horizontal: string); + constructor(all: string, horizontal?: string); constructor(top: string, right: string, bottom: string, left: string); constructor(top: string, right?: string, bottom?: string, left?: string) { diff --git a/src/System/Drawing/StandardizedPaperFormat.ts b/src/System/Drawing/StandardizedPaperFormat.ts index 542f3855..18864a9e 100644 --- a/src/System/Drawing/StandardizedPaperFormat.ts +++ b/src/System/Drawing/StandardizedPaperFormat.ts @@ -60,6 +60,9 @@ export class StandardizedPaperFormat extends PaperFormat this.orientation = value; } + /** + * @inheritdoc + */ public get PDFOptions(): Partial { return { diff --git a/src/System/IO/FileException.ts b/src/System/IO/FileException.ts index 8a52b3ef..158c16b2 100644 --- a/src/System/IO/FileException.ts +++ b/src/System/IO/FileException.ts @@ -27,6 +27,9 @@ export class FileException extends IOException this.Path = path; } + /** + * @inheritdoc + */ public get Message(): string { return Format(Resources.Resources.Get("FileException"), this.Path); diff --git a/src/System/YAML/YAMLException.ts b/src/System/YAML/YAMLException.ts index 4aa71ebe..41117e2b 100644 --- a/src/System/YAML/YAMLException.ts +++ b/src/System/YAML/YAMLException.ts @@ -46,7 +46,7 @@ export class YAMLException extends Exception super(); if (arguments.length === 1) { - let exception: { name: string, reason: string, mark: any, message: string } = name; + let exception = name; this.name = exception.name; this.reason = exception.reason; this.mark = exception.mark; @@ -68,6 +68,9 @@ export class YAMLException extends Exception return this.name; } + /** + * @inheritdoc + */ public get Message(): string { return Format(Resources.Resources.Get("YAMLException"), this.Mark.line + 1, this.Mark.column + 1); diff --git a/src/Utilities.ts b/src/Utilities.ts index e2b4101a..dbe6a3ed 100644 --- a/src/Utilities.ts +++ b/src/Utilities.ts @@ -21,7 +21,7 @@ export class Utilities */ public static async GetFullName(): Promise { - let methods: (() => Promise)[] = []; + let methods: Array<() => Promise> = []; methods = [ async () => this.CheckEnv(), From df01d08d794f6988d10feee5add0b75c512154e8 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 8 Aug 2019 23:18:06 +0200 Subject: [PATCH 44/77] Clean up the extension-file --- src/extension.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index fcab00aa..0dd399f8 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,5 +1,3 @@ -// The module 'vscode' contains the VS Code extensibility API -// Import the module and reference it with the alias vscode in your code below import { CultureInfo } from "localized-resource-manager"; import MarkdownIt = require("markdown-it"); import Path = require("path"); @@ -103,9 +101,9 @@ export class Extension } /** - * The extension itself. + * An instance of the extension. */ -export let extension = new Extension(); +const extension = new Extension(); /** * Activates the extension. From 0862f14ca164f9f2ca0abc598bdddc78daee9c86 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 8 Aug 2019 23:32:48 +0200 Subject: [PATCH 45/77] Rearrange the environment --- src/{ => Conversion}/ConversionTask.ts | 24 +++++++++---------- src/{ => Conversion}/ConversionType.ts | 0 src/{ => Conversion}/ConvertAllTask.ts | 2 +- src/{ => Conversion}/ConvertTask.ts | 6 ++--- src/{ => Conversion}/Converter.ts | 4 ++-- src/Properties/Settings.ts | 22 ++++++++--------- src/{ => System}/DestinationOrigin.ts | 0 .../CustomPaperFormat.ts | 0 src/System/{Drawing => Documents}/Document.ts | 0 .../DocumentFragment.ts | 0 .../{Drawing => Documents}/EmojiType.ts | 0 src/System/{Drawing => Documents}/ListType.ts | 0 src/System/{Drawing => Documents}/Margin.ts | 0 src/System/{Drawing => Documents}/Paper.ts | 0 .../{Drawing => Documents}/PaperFormat.ts | 0 .../PaperOrientation.ts | 0 .../{Drawing => Documents}/Renderable.ts | 0 .../{Drawing => Documents}/Slugifier.ts | 0 .../StandardizedFormatType.ts | 0 .../StandardizedPaperFormat.ts | 0 .../{Drawing => Documents}/TocSettings.ts | 0 src/{ => System}/markdown-it-checkbox.d.ts | 0 src/{ => System}/markdown-it-emoji.d.ts | 0 .../markdown-it-table-of-contents.d.ts | 0 src/{ => System}/twemoji.d.ts | 0 src/extension.ts | 4 ++-- 26 files changed, 31 insertions(+), 31 deletions(-) rename src/{ => Conversion}/ConversionTask.ts (95%) rename src/{ => Conversion}/ConversionType.ts (100%) rename src/{ => Conversion}/ConvertAllTask.ts (98%) rename src/{ => Conversion}/ConvertTask.ts (87%) rename src/{ => Conversion}/Converter.ts (98%) rename src/{ => System}/DestinationOrigin.ts (100%) rename src/System/{Drawing => Documents}/CustomPaperFormat.ts (100%) rename src/System/{Drawing => Documents}/Document.ts (100%) rename src/System/{Drawing => Documents}/DocumentFragment.ts (100%) rename src/System/{Drawing => Documents}/EmojiType.ts (100%) rename src/System/{Drawing => Documents}/ListType.ts (100%) rename src/System/{Drawing => Documents}/Margin.ts (100%) rename src/System/{Drawing => Documents}/Paper.ts (100%) rename src/System/{Drawing => Documents}/PaperFormat.ts (100%) rename src/System/{Drawing => Documents}/PaperOrientation.ts (100%) rename src/System/{Drawing => Documents}/Renderable.ts (100%) rename src/System/{Drawing => Documents}/Slugifier.ts (100%) rename src/System/{Drawing => Documents}/StandardizedFormatType.ts (100%) rename src/System/{Drawing => Documents}/StandardizedPaperFormat.ts (100%) rename src/System/{Drawing => Documents}/TocSettings.ts (100%) rename src/{ => System}/markdown-it-checkbox.d.ts (100%) rename src/{ => System}/markdown-it-emoji.d.ts (100%) rename src/{ => System}/markdown-it-table-of-contents.d.ts (100%) rename src/{ => System}/twemoji.d.ts (100%) diff --git a/src/ConversionTask.ts b/src/Conversion/ConversionTask.ts similarity index 95% rename from src/ConversionTask.ts rename to src/Conversion/ConversionTask.ts index 119d331a..401579e9 100644 --- a/src/ConversionTask.ts +++ b/src/Conversion/ConversionTask.ts @@ -14,20 +14,20 @@ import Transliteration = require("transliteration"); import TwEmoji = require("twemoji"); import { isNullOrUndefined } from "util"; import { TextDocument, window, workspace, WorkspaceFolder } from "vscode"; +import { Extension } from "../extension"; +import { MarkdownContributions } from "../MarkdownContributions"; +import { Resources } from "../Properties/Resources"; +import { Settings } from "../Properties/Settings"; +import { PuppeteerTask } from "../PuppeteerTask"; +import { DestinationOrigin } from "../System/DestinationOrigin"; +import { Document } from "../System/Documents/Document"; +import { EmojiType } from "../System/Documents/EmojiType"; +import { ListType } from "../System/Documents/ListType"; +import { Slugifier } from "../System/Documents/Slugifier"; +import { FileException } from "../System/IO/FileException"; +import { Utilities } from "../Utilities"; import { ConversionType } from "./ConversionType"; import { Converter } from "./Converter"; -import { DestinationOrigin } from "./DestinationOrigin"; -import { Extension } from "./extension"; -import { MarkdownContributions } from "./MarkdownContributions"; -import { Resources } from "./Properties/Resources"; -import { Settings } from "./Properties/Settings"; -import { PuppeteerTask } from "./PuppeteerTask"; -import { Document } from "./System/Drawing/Document"; -import { EmojiType } from "./System/Drawing/EmojiType"; -import { ListType } from "./System/Drawing/ListType"; -import { Slugifier } from "./System/Drawing/Slugifier"; -import { FileException } from "./System/IO/FileException"; -import { Utilities } from "./Utilities"; /** * Represents a task which is able to convert markdown-files. diff --git a/src/ConversionType.ts b/src/Conversion/ConversionType.ts similarity index 100% rename from src/ConversionType.ts rename to src/Conversion/ConversionType.ts diff --git a/src/ConvertAllTask.ts b/src/Conversion/ConvertAllTask.ts similarity index 98% rename from src/ConvertAllTask.ts rename to src/Conversion/ConvertAllTask.ts index 252742e2..38781f3f 100644 --- a/src/ConvertAllTask.ts +++ b/src/Conversion/ConvertAllTask.ts @@ -1,6 +1,6 @@ import { extensions, TextDocument, workspace } from "vscode"; +import { Extension } from "../extension"; import { ConversionTask } from "./ConversionTask"; -import { Extension } from "./extension"; /** * Represents a task for converting all documents in the workspace. diff --git a/src/ConvertTask.ts b/src/Conversion/ConvertTask.ts similarity index 87% rename from src/ConvertTask.ts rename to src/Conversion/ConvertTask.ts index 2f0e26d7..24afc5bc 100644 --- a/src/ConvertTask.ts +++ b/src/Conversion/ConvertTask.ts @@ -1,8 +1,8 @@ import { TextDocument, window } from "vscode"; +import { Extension } from "../extension"; +import { MarkdownFileNotFoundException } from "../MarkdownFileNotFoundException"; +import { Settings } from "../Properties/Settings"; import { ConversionTask } from "./ConversionTask"; -import { Extension } from "./extension"; -import { MarkdownFileNotFoundException } from "./MarkdownFileNotFoundException"; -import { Settings } from "./Properties/Settings"; /** * Represens a task for converting the currently opened document. diff --git a/src/Converter.ts b/src/Conversion/Converter.ts similarity index 98% rename from src/Converter.ts rename to src/Conversion/Converter.ts index a27a7aed..45ced068 100644 --- a/src/Converter.ts +++ b/src/Conversion/Converter.ts @@ -6,9 +6,9 @@ import Path = require("path"); import Puppeteer = require("puppeteer"); import URL = require("url"); import { isNullOrUndefined } from "util"; +import { Document } from "../System/Documents/Document"; +import { FileException } from "../System/IO/FileException"; import { ConversionType } from "./ConversionType"; -import { Document } from "./System/Drawing/Document"; -import { FileException } from "./System/IO/FileException"; /** * Provides a markdown-converter. diff --git a/src/Properties/Settings.ts b/src/Properties/Settings.ts index 2cb939d7..b6babf06 100644 --- a/src/Properties/Settings.ts +++ b/src/Properties/Settings.ts @@ -1,16 +1,16 @@ import VSCode = require("vscode"); import { MultiRange } from "../../node_modules/multi-integer-range"; -import { ConversionType } from "../ConversionType"; -import { DestinationOrigin } from "../DestinationOrigin"; -import { CustomPaperFormat } from "../System/Drawing/CustomPaperFormat"; -import { EmojiType } from "../System/Drawing/EmojiType"; -import { ListType } from "../System/Drawing/ListType"; -import { Margin } from "../System/Drawing/Margin"; -import { Paper } from "../System/Drawing/Paper"; -import { PaperOrientation } from "../System/Drawing/PaperOrientation"; -import { StandardizedFormatType } from "../System/Drawing/StandardizedFormatType"; -import { StandardizedPaperFormat } from "../System/Drawing/StandardizedPaperFormat"; -import { TocSettings } from "../System/Drawing/TocSettings"; +import { ConversionType } from "../Conversion/ConversionType"; +import { DestinationOrigin } from "../System/DestinationOrigin"; +import { CustomPaperFormat } from "../System/Documents/CustomPaperFormat"; +import { EmojiType } from "../System/Documents/EmojiType"; +import { ListType } from "../System/Documents/ListType"; +import { Margin } from "../System/Documents/Margin"; +import { Paper } from "../System/Documents/Paper"; +import { PaperOrientation } from "../System/Documents/PaperOrientation"; +import { StandardizedFormatType } from "../System/Documents/StandardizedFormatType"; +import { StandardizedPaperFormat } from "../System/Documents/StandardizedPaperFormat"; +import { TocSettings } from "../System/Documents/TocSettings"; /** * Provides access to settings. diff --git a/src/DestinationOrigin.ts b/src/System/DestinationOrigin.ts similarity index 100% rename from src/DestinationOrigin.ts rename to src/System/DestinationOrigin.ts diff --git a/src/System/Drawing/CustomPaperFormat.ts b/src/System/Documents/CustomPaperFormat.ts similarity index 100% rename from src/System/Drawing/CustomPaperFormat.ts rename to src/System/Documents/CustomPaperFormat.ts diff --git a/src/System/Drawing/Document.ts b/src/System/Documents/Document.ts similarity index 100% rename from src/System/Drawing/Document.ts rename to src/System/Documents/Document.ts diff --git a/src/System/Drawing/DocumentFragment.ts b/src/System/Documents/DocumentFragment.ts similarity index 100% rename from src/System/Drawing/DocumentFragment.ts rename to src/System/Documents/DocumentFragment.ts diff --git a/src/System/Drawing/EmojiType.ts b/src/System/Documents/EmojiType.ts similarity index 100% rename from src/System/Drawing/EmojiType.ts rename to src/System/Documents/EmojiType.ts diff --git a/src/System/Drawing/ListType.ts b/src/System/Documents/ListType.ts similarity index 100% rename from src/System/Drawing/ListType.ts rename to src/System/Documents/ListType.ts diff --git a/src/System/Drawing/Margin.ts b/src/System/Documents/Margin.ts similarity index 100% rename from src/System/Drawing/Margin.ts rename to src/System/Documents/Margin.ts diff --git a/src/System/Drawing/Paper.ts b/src/System/Documents/Paper.ts similarity index 100% rename from src/System/Drawing/Paper.ts rename to src/System/Documents/Paper.ts diff --git a/src/System/Drawing/PaperFormat.ts b/src/System/Documents/PaperFormat.ts similarity index 100% rename from src/System/Drawing/PaperFormat.ts rename to src/System/Documents/PaperFormat.ts diff --git a/src/System/Drawing/PaperOrientation.ts b/src/System/Documents/PaperOrientation.ts similarity index 100% rename from src/System/Drawing/PaperOrientation.ts rename to src/System/Documents/PaperOrientation.ts diff --git a/src/System/Drawing/Renderable.ts b/src/System/Documents/Renderable.ts similarity index 100% rename from src/System/Drawing/Renderable.ts rename to src/System/Documents/Renderable.ts diff --git a/src/System/Drawing/Slugifier.ts b/src/System/Documents/Slugifier.ts similarity index 100% rename from src/System/Drawing/Slugifier.ts rename to src/System/Documents/Slugifier.ts diff --git a/src/System/Drawing/StandardizedFormatType.ts b/src/System/Documents/StandardizedFormatType.ts similarity index 100% rename from src/System/Drawing/StandardizedFormatType.ts rename to src/System/Documents/StandardizedFormatType.ts diff --git a/src/System/Drawing/StandardizedPaperFormat.ts b/src/System/Documents/StandardizedPaperFormat.ts similarity index 100% rename from src/System/Drawing/StandardizedPaperFormat.ts rename to src/System/Documents/StandardizedPaperFormat.ts diff --git a/src/System/Drawing/TocSettings.ts b/src/System/Documents/TocSettings.ts similarity index 100% rename from src/System/Drawing/TocSettings.ts rename to src/System/Documents/TocSettings.ts diff --git a/src/markdown-it-checkbox.d.ts b/src/System/markdown-it-checkbox.d.ts similarity index 100% rename from src/markdown-it-checkbox.d.ts rename to src/System/markdown-it-checkbox.d.ts diff --git a/src/markdown-it-emoji.d.ts b/src/System/markdown-it-emoji.d.ts similarity index 100% rename from src/markdown-it-emoji.d.ts rename to src/System/markdown-it-emoji.d.ts diff --git a/src/markdown-it-table-of-contents.d.ts b/src/System/markdown-it-table-of-contents.d.ts similarity index 100% rename from src/markdown-it-table-of-contents.d.ts rename to src/System/markdown-it-table-of-contents.d.ts diff --git a/src/twemoji.d.ts b/src/System/twemoji.d.ts similarity index 100% rename from src/twemoji.d.ts rename to src/System/twemoji.d.ts diff --git a/src/extension.ts b/src/extension.ts index 0dd399f8..12269937 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -2,8 +2,8 @@ import { CultureInfo } from "localized-resource-manager"; import MarkdownIt = require("markdown-it"); import Path = require("path"); import { commands, env, ExtensionContext } from "vscode"; -import { ConvertAllTask } from "./ConvertAllTask"; -import { ConvertTask } from "./ConvertTask"; +import { ConvertAllTask } from "./Conversion/ConvertAllTask"; +import { ConvertTask } from "./Conversion/ConvertTask"; import { Resources } from "./Properties/Resources"; /** From fdcf44b348dd5eea835cbcdfc342d78f28ca4f9e Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Fri, 9 Aug 2019 00:05:37 +0200 Subject: [PATCH 46/77] Rename confusing variables --- src/Conversion/ConversionTask.ts | 15 +++++++-------- src/Conversion/Converter.ts | 23 +++++++++++++---------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/src/Conversion/ConversionTask.ts b/src/Conversion/ConversionTask.ts index 401579e9..85e794c7 100644 --- a/src/Conversion/ConversionTask.ts +++ b/src/Conversion/ConversionTask.ts @@ -85,7 +85,6 @@ export abstract class ConversionTask extends PuppeteerTask } let workspaceRoot = !isNullOrUndefined(currentWorkspace) ? currentWorkspace.uri.fsPath : null; - let documentRoot = workspaceRoot || documentFolder; if (!Path.isAbsolute(Settings.Default.DestinationPath)) { @@ -118,7 +117,7 @@ export abstract class ConversionTask extends PuppeteerTask let tasks: Array> = []; let fileName = Path.parse(document.fileName).name; - let converter = await this.LoadConverter(documentRoot, document); + let converter = await this.LoadConverter(workspaceRoot || documentFolder, document); await converter.Initialize(); await FileSystem.ensureDir(destinationPath); @@ -184,8 +183,8 @@ export abstract class ConversionTask extends PuppeteerTask /** * Loads a converter according to the settings. * - * @param documentRoot - * The path to the root of the document. + * @param workspaceRoot + * The path to the root of the workspace of the document. * * @param document * The document to convert. @@ -193,9 +192,9 @@ export abstract class ConversionTask extends PuppeteerTask * @returns * A converter generated by the settings. */ - protected async LoadConverter(documentRoot: string, document: TextDocument): Promise + protected async LoadConverter(workspaceRoot: string, document: TextDocument): Promise { - let converter = new Converter(documentRoot, new Document(document, await this.LoadParser())); + let converter = new Converter(workspaceRoot, new Document(document, await this.LoadParser())); converter.Document.Quality = Settings.Default.ConversionQuality; Object.assign(converter.Document.Attributes, Settings.Default.Attributes); @@ -214,7 +213,7 @@ export abstract class ConversionTask extends PuppeteerTask { if (Settings.Default.Template) { - converter.Document.Template = (await FileSystem.readFile(Path.resolve(documentRoot || ".", Settings.Default.Template))).toString(); + converter.Document.Template = (await FileSystem.readFile(Path.resolve(workspaceRoot || ".", Settings.Default.Template))).toString(); } else if (Settings.Default.SystemParserEnabled) { @@ -269,7 +268,7 @@ export abstract class ConversionTask extends PuppeteerTask { if (!Path.isAbsolute(styleSheet)) { - styleSheet = Path.resolve(documentRoot || ".", styleSheet); + styleSheet = Path.resolve(workspaceRoot || ".", styleSheet); } converter.Document.StyleSheets.push(styleSheet); diff --git a/src/Conversion/Converter.ts b/src/Conversion/Converter.ts index 45ced068..6a21c486 100644 --- a/src/Conversion/Converter.ts +++ b/src/Conversion/Converter.ts @@ -16,9 +16,9 @@ import { ConversionType } from "./ConversionType"; export class Converter { /** - * The root-directory of the document. + * The root-directory of the workspace of the document. */ - private documentRoot: string; + private workspaceRoot: string; /** * The document which is to be converted. @@ -53,21 +53,24 @@ export class Converter /** * Initializes a new instance of the Constructor class with a filepath. * + * @param workspaceRoot + * The root of the workspace of the document. + * * @param document * The document which is to be converted. */ - constructor(documentRoot: string, document: Document) + constructor(workspaceRoot: string, document: Document) { - this.documentRoot = documentRoot; + this.workspaceRoot = workspaceRoot; this.document = document; } /** - * Gets or sets the root-directory of the document. + * Gets or sets the root-directory of the workspace of the document. */ - public get DocumentRoot(): string + public get WorkspaceRoot(): string { - return this.documentRoot; + return this.workspaceRoot; } /** @@ -101,8 +104,8 @@ export class Converter { return this.Initialized ? (URL.resolve( `http://localhost:${this.PortNumber}/`, - ((!isNullOrUndefined(this.Document.FileName) && !isNullOrUndefined(this.DocumentRoot)) ? - Path.relative(this.DocumentRoot, this.Document.FileName) : "index") + ".html")) : null; + ((!isNullOrUndefined(this.Document.FileName) && !isNullOrUndefined(this.WorkspaceRoot)) ? + Path.relative(this.WorkspaceRoot, this.Document.FileName) : "index") + ".html")) : null; } /** @@ -142,7 +145,7 @@ export class Converter { this.portNumber = await PortFinder(); this.webServer = (Server.createServer({ - root: this.DocumentRoot, + root: this.WorkspaceRoot, cors: true }) as any).server as http.Server; From 7a819cf961197c0c5497ba44bbb833cae9a29e28 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Fri, 9 Aug 2019 22:21:18 +0200 Subject: [PATCH 47/77] Move tasks to a separate directory --- src/{Conversion => Tasks}/ConversionTask.ts | 6 +++--- src/{Conversion => Tasks}/ConvertAllTask.ts | 0 src/{Conversion => Tasks}/ConvertTask.ts | 0 src/{ => Tasks}/PuppeteerTask.ts | 6 +++--- src/{ => Tasks}/Task.ts | 2 +- src/extension.ts | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) rename src/{Conversion => Tasks}/ConversionTask.ts (98%) rename src/{Conversion => Tasks}/ConvertAllTask.ts (100%) rename src/{Conversion => Tasks}/ConvertTask.ts (100%) rename src/{ => Tasks}/PuppeteerTask.ts (96%) rename src/{ => Tasks}/Task.ts (94%) diff --git a/src/Conversion/ConversionTask.ts b/src/Tasks/ConversionTask.ts similarity index 98% rename from src/Conversion/ConversionTask.ts rename to src/Tasks/ConversionTask.ts index 85e794c7..df17e704 100644 --- a/src/Conversion/ConversionTask.ts +++ b/src/Tasks/ConversionTask.ts @@ -14,11 +14,12 @@ import Transliteration = require("transliteration"); import TwEmoji = require("twemoji"); import { isNullOrUndefined } from "util"; import { TextDocument, window, workspace, WorkspaceFolder } from "vscode"; +import { ConversionType } from "../Conversion/ConversionType"; +import { Converter } from "../Conversion/Converter"; import { Extension } from "../extension"; import { MarkdownContributions } from "../MarkdownContributions"; import { Resources } from "../Properties/Resources"; import { Settings } from "../Properties/Settings"; -import { PuppeteerTask } from "../PuppeteerTask"; import { DestinationOrigin } from "../System/DestinationOrigin"; import { Document } from "../System/Documents/Document"; import { EmojiType } from "../System/Documents/EmojiType"; @@ -26,8 +27,7 @@ import { ListType } from "../System/Documents/ListType"; import { Slugifier } from "../System/Documents/Slugifier"; import { FileException } from "../System/IO/FileException"; import { Utilities } from "../Utilities"; -import { ConversionType } from "./ConversionType"; -import { Converter } from "./Converter"; +import { PuppeteerTask } from "./PuppeteerTask"; /** * Represents a task which is able to convert markdown-files. diff --git a/src/Conversion/ConvertAllTask.ts b/src/Tasks/ConvertAllTask.ts similarity index 100% rename from src/Conversion/ConvertAllTask.ts rename to src/Tasks/ConvertAllTask.ts diff --git a/src/Conversion/ConvertTask.ts b/src/Tasks/ConvertTask.ts similarity index 100% rename from src/Conversion/ConvertTask.ts rename to src/Tasks/ConvertTask.ts diff --git a/src/PuppeteerTask.ts b/src/Tasks/PuppeteerTask.ts similarity index 96% rename from src/PuppeteerTask.ts rename to src/Tasks/PuppeteerTask.ts index 2b08d402..9ba27e53 100644 --- a/src/PuppeteerTask.ts +++ b/src/Tasks/PuppeteerTask.ts @@ -2,9 +2,9 @@ import FileSystem = require("fs-extra"); import Puppeteer = require("puppeteer"); import Format = require("string-template"); import { ProgressLocation, window } from "vscode"; -import { Extension } from "./extension"; -import { Resources } from "./Properties/Resources"; -import { Exception } from "./System/Exception"; +import { Extension } from "../extension"; +import { Resources } from "../Properties/Resources"; +import { Exception } from "../System/Exception"; import { Task } from "./Task"; /** diff --git a/src/Task.ts b/src/Tasks/Task.ts similarity index 94% rename from src/Task.ts rename to src/Tasks/Task.ts index 2d1b06dc..e75a6e7d 100644 --- a/src/Task.ts +++ b/src/Tasks/Task.ts @@ -1,4 +1,4 @@ -import { Extension } from "./extension"; +import { Extension } from "../extension"; /** * Represents a task. diff --git a/src/extension.ts b/src/extension.ts index 12269937..0edd6a2d 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -2,9 +2,9 @@ import { CultureInfo } from "localized-resource-manager"; import MarkdownIt = require("markdown-it"); import Path = require("path"); import { commands, env, ExtensionContext } from "vscode"; -import { ConvertAllTask } from "./Conversion/ConvertAllTask"; -import { ConvertTask } from "./Conversion/ConvertTask"; import { Resources } from "./Properties/Resources"; +import { ConvertAllTask } from "./Tasks/ConvertAllTask"; +import { ConvertTask } from "./Tasks/ConvertTask"; /** * Represens the extension itself. From 49bdbd135f77733f18021da3ec842d794f369034 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 10 Aug 2019 13:12:42 +0200 Subject: [PATCH 48/77] Fix the changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b39bb5f8..e468d3a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -150,4 +150,5 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. [v1.0.1]: https://github.com/manuth/MarkdownConverter/compare/v1.0.0...v1.0.1 [v1.1.0]: https://github.com/manuth/MarkdownConverter/compare/v1.0.0...v1.1.0 [v1.1.1]: https://github.com/manuth/MarkdownConverter/compare/v1.1.0...v1.1.1 -[v1.1.1]: https://github.com/manuth/MarkdownConverter/compare/v1.1.1...v1.2.0 \ No newline at end of file +[v1.1.2]: https://github.com/manuth/MarkdownConverter/compare/v1.1.1...v1.1.2 +[v1.2.0]: https://github.com/manuth/MarkdownConverter/compare/v1.1.2...v1.2.0 \ No newline at end of file From 2627fed18502779766864d779a84c91aeb3074d4 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 10 Aug 2019 21:12:30 +0200 Subject: [PATCH 49/77] Remove DestinationPath and Origin in favor of DestinationPattern This commit fixes #27 --- package-lock.json | 5 + package.json | 27 +- package.nls.de-CH.json | 8 +- package.nls.de.json | 8 +- package.nls.json | 8 +- src/Properties/Settings.ts | 13 +- src/System/DestinationOrigin.ts | 15 - src/System/Documents/Slugifier.ts | 8 + src/System/es6-template-string.d.ts | 57 ++++ src/Tasks/ConversionRunner.ts | 438 ++++++++++++++++++++++++++++ src/Tasks/ConversionTask.ts | 357 +---------------------- src/Tasks/ConvertAllTask.ts | 2 +- src/Tasks/ConvertTask.ts | 2 +- 13 files changed, 536 insertions(+), 412 deletions(-) delete mode 100644 src/System/DestinationOrigin.ts create mode 100644 src/System/es6-template-string.d.ts create mode 100644 src/Tasks/ConversionRunner.ts diff --git a/package-lock.json b/package-lock.json index 5b4a6eb7..72c88636 100644 --- a/package-lock.json +++ b/package-lock.json @@ -566,6 +566,11 @@ "es6-promise": "^4.0.3" } }, + "es6-template-string": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es6-template-string/-/es6-template-string-1.1.0.tgz", + "integrity": "sha1-vNJXj4onysqxiUmvkeI6bIGH0hw=" + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", diff --git a/package.json b/package.json index d469ab7b..c449b46b 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ }, "homepage": "https://github.com/manuth/MarkdownConverter#readme", "engines": { - "vscode": "^1.23.0" + "vscode": "^1.37.0" }, "scripts": { "vscode:prepublish": "npm run rebuild", @@ -71,6 +71,7 @@ "async-shelljs": "^0.1.2", "clone": "^2.1.2", "dedent": "^0.7.0", + "es6-template-string": "^1.1.0", "front-matter": "^3.0.2", "fs-extra": "^8.1.0", "get-port": "^5.0.0", @@ -93,7 +94,8 @@ "yamljs": "^0.3.0" }, "activationEvents": [ - "onCommand:markdownConverter.Convert" + "onCommand:markdownConverter.Convert", + "onCommand:markdownConverter.ConvertAll" ], "contributes": { "commands": [ @@ -112,24 +114,11 @@ "configuration": { "title": "%Config%", "properties": { - "markdownConverter.DestinationOrigin": { - "title": "%Config.DestinationOrigin%", - "markdownDescription": "%Config.DestinationOrigin.Description%", - "default": "WorkspaceRoot", - "enum": [ - "WorkspaceRoot", - "DocumentFile" - ], - "enumDescriptions": [ - "%Config.DestinationOrigin.WorkspaceRoot%", - "%Config.DestinationOrigin.DocumentFile%" - ] - }, - "markdownConverter.DestinationPath": { - "title": "%Config.DestinationPath%", - "markdownDescription": "%Config.DestinationPath.Description%", + "markdownConverter.DestinationPattern": { + "title": "%Config.DestinationPattern%", + "markdownDescription": "%Config.DestinationPattern.Description%", "type": "string", - "default": "." + "default": "${workspaceFolder}/${dirname}/${basename}.${extension}" }, "markdownConverter.IgnoreLanguageMode": { "title": "%Config.IgnoreLanguageMode%", diff --git a/package.nls.de-CH.json b/package.nls.de-CH.json index da24dd8d..e495f136 100644 --- a/package.nls.de-CH.json +++ b/package.nls.de-CH.json @@ -2,12 +2,8 @@ "Command.Convert": "Dokument konvertieren", "Command.ConvertAll": "Alle Dokumente konvertieren", "Config": "MarkdownConverter-Einstellungen", - "Config.DestinationOrigin": "Ziel-Ort", - "Config.DestinationOrigin.Description": "Der Ort zu dem der `#markdownConverter.DestinationPath#` relativ ist.", - "Config.DestinationOrigin.WorkspaceRoot": "Gibt den Arbeits-Ordner an, falls einer geöffnet ist. Sonst wird der Ordnername des Dokuments verwendet.", - "Config.DestinationOrigin.DocumentFile": "Gibt den Ordner der Dokument-Datei an.", - "Config.DestinationPath": "Ziel-Ordner", - "Config.DestinationPath.Description": "Der Pfad, an dem die konvertierten Dateien abgelegt werden sollen.\n\n***Note:*** \nDer Pfad kann relativ zum `#markdownConverter.DestinationOrigin#` sein.", + "Config.DestinationPattern": "Ziel-Muster", + "Config.DestinationPattern.Description": "Das Muster zum Erzeugen des Ziel-Pfads.\n\nFolgende Variablen können verwendet werden:\n\n* `${workspaceFolder}`: \nEntweder der Pfad des `workspace`s oder des Ordners in dem sich das Dokument befindet.\n* `${dirname}`: \nDer relative Pfad vom `${workspaceFolder}` zum Ordner des Dokuments.\n* `${basename}`: \nDer Name der Dokument-Datei ohne Datei-Erweiterung.\n* `${extension}`: \nDie Datei-Erweiterung des Ziel-Datentyps.\n* `${filename}`: \nDer Name der Dokument-Datei.", "Config.IgnoreLanguageMode": "Sprache ignorieren", "Config.IgnoreLanguageMode.Description": "`true`, um die aktuell geöffnete Datei zu konvertieren, auch wenn für das aktuelle Dokument nicht Markdown als Sprache festgelegt ist; sonst `false`.", "Config.ConversionQuality": "Qualität", diff --git a/package.nls.de.json b/package.nls.de.json index 889f51ff..347da3ec 100644 --- a/package.nls.de.json +++ b/package.nls.de.json @@ -2,12 +2,8 @@ "Command.Convert": "Dokument konvertieren", "Command.ConvertAll": "Alle Dokumente konvertieren", "Config": "MarkdownConverter-Einstellungen", - "Config.DestinationOrigin": "Ziel-Ort", - "Config.DestinationOrigin.Description": "Der Ort zu dem der `#markdownConverter.DestinationPath#` relativ ist.", - "Config.DestinationOrigin.WorkspaceRoot": "Gibt den Arbeits-Ordner an, falls einer geöffnet ist. Sonst wird der Ordnername des Dokuments verwendet.", - "Config.DestinationOrigin.DocumentFile": "Gibt den Ordner der Dokument-Datei an.", - "Config.DestinationPath": "Ziel-Ordner", - "Config.DestinationPath.Description": "Der Pfad, an dem die konvertierten Dateien abgelegt werden sollen.\n\n***Note:*** \nDer Pfad kann relativ zum `#markdownConverter.DestinationOrigin#` sein.", + "Config.DestinationPattern": "Ziel-Muster", + "Config.DestinationPattern.Description": "Das Muster zum Erzeugen des Ziel-Pfads.\n\nFolgende Variablen können verwendet werden:\n\n* `${workspaceFolder}`: \nEntweder der Pfad des `workspace`s oder des Ordners in dem sich das Dokument befindet.\n* `${dirname}`: \nDer relative Pfad vom `${workspaceFolder}` zum Ordner des Dokuments.\n* `${filename}`: \nDer Name der Dokument-Datei.\n* `${basename}`: \nDer Name der Dokument-Datei ohne Datei-Erweiterung.\n* `${extension}`: \nDie Datei-Erweiterung des Ziel-Datentyps.", "Config.IgnoreLanguageMode": "Sprache ignorieren", "Config.IgnoreLanguageMode.Description": "`true`, um die aktuell geöffnete Datei zu konvertieren, auch wenn für das aktuelle Dokument nicht Markdown als Sprache festgelegt ist; sonst `false`.", "Config.ConversionQuality": "Qualität", diff --git a/package.nls.json b/package.nls.json index a647593a..caa53193 100644 --- a/package.nls.json +++ b/package.nls.json @@ -2,12 +2,8 @@ "Command.Convert": "Convert Document", "Command.ConvertAll": "Convert all Documents", "Config": "MarkdownConverter-Options", - "Config.DestinationOrigin": "Destination-Origin", - "Config.DestinationOrigin.Description": "The location the `#markdownConverter.DestinationPath#` may be relative to.", - "Config.DestinationOrigin.WorkspaceRoot": "Indicates either the root of the workspace if a workspace-folder is opened, otherwise the directory of the document-file will be used.", - "Config.DestinationOrigin.DocumentFile": "Indicates the directory of the document-file.", - "Config.DestinationPath": "Destination-Path", - "Config.DestinationPath.Description": "The path to save the converted files to.\n\n***Note:*** \nThe path may be relative to the `#markdownConverter.DestinationOrigin#`.", + "Config.DestinationPattern": "Destination-Pattern", + "Config.DestinationPattern.Description": "The pattern for creating a destination-path.\n\nFollowing variables can be used inside this expression:\n\n* `${workspaceFolder}`: \nEither the path to the `workspace` or the directory which contains the document.\n* `${dirname}`: \nThe relative path from the `${workspaceFolder}` to the directory which contains the document.\n* `${basename}`: \nThe name of the document-file without extension.\n* `${extension}`: \nThe file-extension of the destination-datatype.\n* `${filename}`: \nThe name of the document-file.", "Config.IgnoreLanguageMode": "Ignore Language", "Config.IgnoreLanguageMode.Description": "`true` to convert the current file even if the language isn't set to Markdown; otherwise `false`.", "Config.ConversionQuality": "Quality", diff --git a/src/Properties/Settings.ts b/src/Properties/Settings.ts index b6babf06..13005f18 100644 --- a/src/Properties/Settings.ts +++ b/src/Properties/Settings.ts @@ -1,7 +1,6 @@ import VSCode = require("vscode"); import { MultiRange } from "../../node_modules/multi-integer-range"; import { ConversionType } from "../Conversion/ConversionType"; -import { DestinationOrigin } from "../System/DestinationOrigin"; import { CustomPaperFormat } from "../System/Documents/CustomPaperFormat"; import { EmojiType } from "../System/Documents/EmojiType"; import { ListType } from "../System/Documents/ListType"; @@ -35,20 +34,12 @@ export class Settings return Settings.defaultInstance; } - /** - * Gets the location the `DestinationPath` is relative to. - */ - public get DestinationOrigin(): DestinationOrigin - { - return DestinationOrigin[this.getConfigEntry("DestinationOrigin")]; - } - /** * Gets the path to save the destination-files to. */ - public get DestinationPath(): string + public get DestinationPattern(): string { - return this.getConfigEntry("DestinationPath"); + return this.getConfigEntry("DestinationPattern"); } /** diff --git a/src/System/DestinationOrigin.ts b/src/System/DestinationOrigin.ts deleted file mode 100644 index eadac3a2..00000000 --- a/src/System/DestinationOrigin.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Represents a location to save files to. - */ -export enum DestinationOrigin -{ - /** - * Indicates either the workspace-root if a workspace is opened; otherwise the name of the directory of the document will be used. - */ - WorkspaceRoot, - - /** - * Indicates the directory of the document-file. - */ - DocumentFile -} \ No newline at end of file diff --git a/src/System/Documents/Slugifier.ts b/src/System/Documents/Slugifier.ts index 84d2836d..1a86f0b0 100644 --- a/src/System/Documents/Slugifier.ts +++ b/src/System/Documents/Slugifier.ts @@ -51,6 +51,14 @@ export class Slugifier return slug; } + /** + * Resets the slugifier. + */ + public Reset(): void + { + this.Slugs.splice(0, this.Slugs.length); + } + /** * Slugifies a text. * diff --git a/src/System/es6-template-string.d.ts b/src/System/es6-template-string.d.ts new file mode 100644 index 00000000..9c74da0e --- /dev/null +++ b/src/System/es6-template-string.d.ts @@ -0,0 +1,57 @@ +declare module "es6-template-string" { + /** + * Provides the functionality to process es6 template-strings. + */ + interface ES6Template + { + /** + * Renders an es6 template-string. + * + * @param template + * The template to render. + * + * @param context + * The variables to use. + */ + (template: string, context?: object): string; + + /** + * Renders an es6 template-string. + * + * @param template + * The template to render. + * + * @param context + * The variables to use. + */ + render(template: string, context?: object): string; + + /** + * Compiles a template. + * + * @param template + * The template to render. + */ + compile(template: string): CompiledRenderer; + } + + /** + * Represents a compiled renderer. + */ + interface CompiledRenderer + { + /** + * Renders the compiled template. + * + * @param context + * The variables to use. + */ + (context: object): string; + } + + /** + * Provides the functionality to render es6 string-templates. + */ + var template: ES6Template; + export = template; +} \ No newline at end of file diff --git a/src/Tasks/ConversionRunner.ts b/src/Tasks/ConversionRunner.ts new file mode 100644 index 00000000..c6ad227c --- /dev/null +++ b/src/Tasks/ConversionRunner.ts @@ -0,0 +1,438 @@ +import ChildProcess = require("child_process"); +import Clone = require("clone"); +import { CultureInfo } from "culture-info"; +import Template = require("es6-template-string"); +import FileSystem = require("fs-extra"); +import HighlightJs = require("highlight.js"); +import MarkdownIt = require("markdown-it"); +import Anchor = require("markdown-it-anchor"); +import Checkbox = require("markdown-it-checkbox"); +import MarkdownItEmoji = require("markdown-it-emoji"); +import MarkdownItToc = require("markdown-it-table-of-contents"); +import Path = require("path"); +import Format = require("string-template"); +import Transliteration = require("transliteration"); +import TwEmoji = require("twemoji"); +import { isNullOrUndefined } from "util"; +import { TextDocument, window, workspace, WorkspaceFolder } from "vscode"; +import { ConversionType } from "../Conversion/ConversionType"; +import { Converter } from "../Conversion/Converter"; +import { Extension } from "../extension"; +import { MarkdownContributions } from "../MarkdownContributions"; +import { Resources } from "../Properties/Resources"; +import { Settings } from "../Properties/Settings"; +import { Document } from "../System/Documents/Document"; +import { EmojiType } from "../System/Documents/EmojiType"; +import { ListType } from "../System/Documents/ListType"; +import { Slugifier } from "../System/Documents/Slugifier"; +import { FileException } from "../System/IO/FileException"; +import { Utilities } from "../Utilities"; + +/** + * Provides the functionality to load settings and run a `Converter`. + */ +export class ConversionRunner +{ + /** + * The extension the runner belongs to. + */ + private extension: Extension; + + /** + * The workspace-folder which has been chosen by the user. + */ + private lastChosenWorkspaceFolder: string; + + /** + * Initializes a new instance of the `ConversionRunner` class. + * + * @param extension + * The extension the runner belongs to. + */ + public constructor(extension: Extension) + { + this.extension = extension; + } + + /** + * Gets the extension the runner belongs to. + */ + public get Extension() + { + return this.extension; + } + + /** + * Gets the extension the runner belongs to. + */ + public set Extension(value) + { + this.extension = value; + } + + /** + * Executes the underlying `Converter`. + */ + public async Execute(document: TextDocument): Promise + { + let tasks: Array> = []; + let converter: Converter; + let workspaceRoot: string; + let documentFolder = document.isUntitled ? null : Path.dirname(document.fileName); + let parsedSourcePath = Path.parse(document.fileName); + let currentWorkspace: WorkspaceFolder; + + if (document.isUntitled) + { + if ((workspace.workspaceFolders || []).length === 1) + { + currentWorkspace = workspace.workspaceFolders[0]; + } + else + { + currentWorkspace = null; + } + } + else + { + currentWorkspace = workspace.getWorkspaceFolder(document.uri); + } + + workspaceRoot = !isNullOrUndefined(currentWorkspace) ? currentWorkspace.uri.fsPath : null; + converter = await this.LoadConverter(workspaceRoot || documentFolder, document); + await converter.Initialize(); + + for (let type of Settings.Default.ConversionType) + { + tasks.push( + (async () => + { + let destinationPath: string; + let workspaceFolder: string; + let workspaceFolderRequired: boolean; + let extension: string; + let context: object; + + switch (type) + { + case ConversionType.HTML: + extension = "html"; + break; + case ConversionType.JPEG: + extension = "jpg"; + break; + case ConversionType.PNG: + extension = "png"; + break; + case ConversionType.PDF: + extension = "pdf"; + break; + } + + workspaceFolder = + (!isNullOrUndefined(workspaceRoot) || !isNullOrUndefined(documentFolder) ? + (workspaceRoot || documentFolder) : ""); + + context = + new class + { + /** + * The name of the directory of the document. + */ + public dirname: string; + + /** + * The name of the document-file. + */ + public filename: string; + + /** + * The name of the document-file without extension. + */ + public basename: string; + + /** + * The name of the extension of the destination-type. + */ + public extension: string; + + constructor() + { + this.dirname = + (!isNullOrUndefined(workspaceRoot) && !isNullOrUndefined(documentFolder)) ? + Path.relative(workspaceRoot, documentFolder) : ""; + this.filename = parsedSourcePath.base; + this.basename = parsedSourcePath.name; + this.extension = extension; + } + + /** + * Either the path of the workspace-folder or the path to the folder of the document. + */ + public get workspaceFolder() + { + workspaceFolderRequired = isNullOrUndefined(workspaceFolder); + + if (workspaceFolderRequired) + { + return ""; + } + else + { + return workspaceFolder; + } + } + }(); + + do + { + try + { + destinationPath = Path.normalize(Template(Settings.Default.DestinationPattern, context)); + } + catch + { + try + { + destinationPath = Path.normalize(Template(Settings.Default.DestinationPattern, { ...context, workspaceFolder })); + workspaceFolderRequired = isNullOrUndefined(workspaceFolder); + } + catch (exception) + { + throw exception; + } + } + + if (workspaceFolderRequired) + { + while (isNullOrUndefined(workspaceFolder)) + { + this.lastChosenWorkspaceFolder = workspaceFolder = await ( + window.showInputBox( + { + ignoreFocusOut: true, + prompt: Resources.Resources.Get("DestinationPath"), + value: this.lastChosenWorkspaceFolder || undefined, + placeHolder: Resources.Resources.Get("DestinationPathExample") + })); + } + } + } + while (workspaceFolderRequired); + + await FileSystem.ensureDir(Path.dirname(destinationPath)); + await converter.Start(type, destinationPath); + + (async () => + { + let result = await (window.showInformationMessage( + Format(Resources.Resources.Get("SuccessMessage"), ConversionType[type], destinationPath), + Resources.Resources.Get("OpenFileLabel")) as Promise); + + if (result === Resources.Resources.Get("OpenFileLabel")) + { + switch (process.platform) + { + case "win32": + ChildProcess.exec(`"${destinationPath}"`); + break; + case "darwin": + ChildProcess.exec(`bash -c 'open "${destinationPath}"'`); + break; + case "linux": + ChildProcess.exec(`bash -c 'xdg-open "${destinationPath}"'`); + break; + default: + window.showWarningMessage(Resources.Resources.Get("UnsupportedPlatformException")); + break; + } + } + })(); + })()); + + await Promise.all(tasks); + await converter.Dispose(); + } + } + + /** + * Loads a converter according to the settings. + * + * @param workspaceRoot + * The path to the root of the workspace of the document. + * + * @param document + * The document to convert. + * + * @returns + * A converter generated by the settings. + */ + protected async LoadConverter(workspaceRoot: string, document: TextDocument): Promise + { + let converter = new Converter(workspaceRoot, new Document(document, await this.LoadParser())); + converter.Document.Quality = Settings.Default.ConversionQuality; + + Object.assign(converter.Document.Attributes, Settings.Default.Attributes); + converter.Document.Attributes.Author = converter.Document.Attributes.Author || await Utilities.GetFullName(); + + converter.Document.Locale = new CultureInfo(Settings.Default.Locale); + converter.Document.DateFormat = Settings.Default.DateFormat; + + converter.Document.Paper = Settings.Default.PaperFormat; + + converter.Document.HeaderFooterEnabled = Settings.Default.HeaderFooterEnabled; + converter.Document.Header.Content = Settings.Default.HeaderTemplate; + converter.Document.Footer.Content = Settings.Default.FooterTemplate; + + try + { + if (Settings.Default.Template) + { + converter.Document.Template = (await FileSystem.readFile(Path.resolve(workspaceRoot || ".", Settings.Default.Template))).toString(); + } + else if (Settings.Default.SystemParserEnabled) + { + converter.Document.Template = (await FileSystem.readFile(Resources.Files.Get("SystemTemplate"))).toString(); + } + } + catch (exception) + { + if ( + exception instanceof Error && + "path" in exception) + { + throw new FileException(null, (exception as any)["path"]); + } + else + { + throw exception; + } + } + + if (Settings.Default.SystemParserEnabled) + { + let mdExtensions = new MarkdownContributions(this.Extension.Context.extensionPath); + + for (let styleSheet of mdExtensions.previewStyles) + { + converter.Document.StyleSheets.push(styleSheet.fsPath); + } + + for (let script of mdExtensions.previewScripts) + { + converter.Document.Scripts.push(script.fsPath); + } + } + + if (Settings.Default.HighlightStyle !== "None") + { + if (Settings.Default.HighlightStyle === "Default") + { + if (!Settings.Default.SystemParserEnabled) + { + converter.Document.StyleSheets.push(Resources.Files.Get("DefaultHighlight")); + } + } + else + { + converter.Document.StyleSheets.push(Path.join(Resources.Files.Get("HighlightJSStylesDir"), Settings.Default.HighlightStyle + ".css")); + } + } + + for (let styleSheet of Settings.Default.StyleSheets) + { + if (!Path.isAbsolute(styleSheet)) + { + styleSheet = Path.resolve(workspaceRoot || ".", styleSheet); + } + + converter.Document.StyleSheets.push(styleSheet); + } + + return converter; + } + + /** + * Loads a parser according to the settings. + */ + protected async LoadParser(): Promise + { + let parser: MarkdownIt; + let slugifier = new Slugifier(); + + if (Settings.Default.SystemParserEnabled) + { + parser = Clone(this.Extension.VSCodeParser); + parser.normalizeLink = (link: string) => link; + parser.normalizeLinkText = (link: string) => link; + } + else + { + parser = new MarkdownIt({ + html: true, + highlight: (subject, language) => + { + if (Settings.Default.HighlightStyle !== "None") + { + subject = HighlightJs.highlight(language, subject, true).value; + } + else + { + subject = parser.utils.escapeHtml(subject); + } + + return `
${subject}
`; + } + }); + } + + parser.validateLink = () => true; + Anchor( + parser, + { + slugify: (heading) => slugifier.CreateSlug(heading) + }); + slugifier.Reset(); + + if (Settings.Default.TocSettings) + { + parser.use( + MarkdownItToc, + { + includeLevel: Settings.Default.TocSettings.Levels.toArray(), + containerClass: Settings.Default.TocSettings.Class, + markerPattern: Settings.Default.TocSettings.Indicator, + listType: Settings.Default.TocSettings.ListType === ListType.Ordered ? "ol" : "ul", + slugify: (heading: string) => slugifier.CreateSlug(heading) + }); + } + + parser.use(Checkbox); + + if (Settings.Default.EmojiType) + { + parser.use(MarkdownItEmoji); + parser.renderer.rules["emoji"] = (token, id) => + { + switch (Settings.Default.EmojiType) + { + case EmojiType.None: + return token[id].markup; + case EmojiType.Native: + return token[id].content; + case EmojiType.Twitter: + return TwEmoji.parse(token[id].content); + case EmojiType.GitHub: + return "'; + } + }; + } + + return parser; + } +} \ No newline at end of file diff --git a/src/Tasks/ConversionTask.ts b/src/Tasks/ConversionTask.ts index df17e704..81ed5c64 100644 --- a/src/Tasks/ConversionTask.ts +++ b/src/Tasks/ConversionTask.ts @@ -1,32 +1,5 @@ -import ChildProcess = require("child_process"); -import Clone = require("clone"); -import FileSystem = require("fs-extra"); -import HighlightJs = require("highlight.js"); -import { CultureInfo } from "localized-resource-manager"; -import MarkdownIt = require("markdown-it"); -import Anchor = require("markdown-it-anchor"); -import Checkbox = require("markdown-it-checkbox"); -import MarkdownItEmoji = require("markdown-it-emoji"); -import MarkdownItToc = require("markdown-it-table-of-contents"); -import Path = require("path"); -import Format = require("string-template"); -import Transliteration = require("transliteration"); -import TwEmoji = require("twemoji"); -import { isNullOrUndefined } from "util"; -import { TextDocument, window, workspace, WorkspaceFolder } from "vscode"; -import { ConversionType } from "../Conversion/ConversionType"; -import { Converter } from "../Conversion/Converter"; import { Extension } from "../extension"; -import { MarkdownContributions } from "../MarkdownContributions"; -import { Resources } from "../Properties/Resources"; -import { Settings } from "../Properties/Settings"; -import { DestinationOrigin } from "../System/DestinationOrigin"; -import { Document } from "../System/Documents/Document"; -import { EmojiType } from "../System/Documents/EmojiType"; -import { ListType } from "../System/Documents/ListType"; -import { Slugifier } from "../System/Documents/Slugifier"; -import { FileException } from "../System/IO/FileException"; -import { Utilities } from "../Utilities"; +import { ConversionRunner } from "./ConversionRunner"; import { PuppeteerTask } from "./PuppeteerTask"; /** @@ -34,6 +7,11 @@ import { PuppeteerTask } from "./PuppeteerTask"; */ export abstract class ConversionTask extends PuppeteerTask { + /** + * A component for running a conversion. + */ + private conversionRunner: ConversionRunner; + /** * Initializes a new instance of the `ConversionTask` class. * @@ -43,329 +21,14 @@ export abstract class ConversionTask extends PuppeteerTask public constructor(extension: Extension) { super(extension); + this.conversionRunner = new ConversionRunner(this.Extension); } /** - * Converts a document. - * - * @param document - * The document to convert. - */ - protected async Convert(document: TextDocument) - { - let destinationPath: string; - let documentFolder = document.isUntitled ? null : Path.dirname(document.fileName); - let currentWorkspace: WorkspaceFolder; - - if (document.isUntitled) - { - if ((workspace.workspaceFolders || []).length === 1) - { - currentWorkspace = workspace.workspaceFolders[0]; - } - else - { - currentWorkspace = null; - } - } - else - { - currentWorkspace = (workspace.workspaceFolders || []).find( - (workspaceFolder) => - { - let workspaceParts = workspaceFolder.uri.fsPath.split(Path.sep); - let documentParts = document.uri.fsPath.split(Path.sep); - - return workspaceParts.every( - (part, index) => - { - return part === documentParts[index]; - }); - }); - } - - let workspaceRoot = !isNullOrUndefined(currentWorkspace) ? currentWorkspace.uri.fsPath : null; - - if (!Path.isAbsolute(Settings.Default.DestinationPath)) - { - let origin: string = null; - - if (Settings.Default.DestinationOrigin === DestinationOrigin.WorkspaceRoot) - { - origin = workspaceRoot || documentFolder; - } - else if (Settings.Default.DestinationOrigin === DestinationOrigin.DocumentFile) - { - origin = documentFolder || workspaceRoot; - } - - while (isNullOrUndefined(origin)) - { - origin = await (window.showInputBox({ - ignoreFocusOut: true, - prompt: Resources.Resources.Get("DestinationPath"), - placeHolder: Resources.Resources.Get("DestinationPathExample") - }) as Promise); - } - - destinationPath = Path.resolve(origin, Settings.Default.DestinationPath); - } - else - { - destinationPath = Settings.Default.DestinationPath; - } - - let tasks: Array> = []; - let fileName = Path.parse(document.fileName).name; - let converter = await this.LoadConverter(workspaceRoot || documentFolder, document); - await converter.Initialize(); - await FileSystem.ensureDir(destinationPath); - - for (let type of Settings.Default.ConversionType) - { - let extension: string; - - switch (type) - { - case ConversionType.HTML: - extension = "html"; - break; - case ConversionType.JPEG: - extension = "jpg"; - break; - case ConversionType.PNG: - extension = "png"; - break; - case ConversionType.PDF: - extension = "pdf"; - break; - } - - let destination = Path.join(destinationPath, `${fileName}.${extension}`); - - tasks.push( - (async () => - { - await converter.Start(type, destination); - - (async () => - { - let result = await (window.showInformationMessage( - Format(Resources.Resources.Get("SuccessMessage"), ConversionType[type], destination), - Resources.Resources.Get("OpenFileLabel")) as Promise); - - if (result === Resources.Resources.Get("OpenFileLabel")) - { - switch (process.platform) - { - case "win32": - ChildProcess.exec(`"${destination}"`); - break; - case "darwin": - ChildProcess.exec(`bash -c 'open "${destination}"'`); - break; - case "linux": - ChildProcess.exec(`bash -c 'xdg-open "${destination}"'`); - break; - default: - window.showWarningMessage(Resources.Resources.Get("UnsupportedPlatformException")); - break; - } - } - })(); - })()); - } - - await Promise.all(tasks); - await converter.Dispose(); - } - - /** - * Loads a converter according to the settings. - * - * @param workspaceRoot - * The path to the root of the workspace of the document. - * - * @param document - * The document to convert. - * - * @returns - * A converter generated by the settings. - */ - protected async LoadConverter(workspaceRoot: string, document: TextDocument): Promise - { - let converter = new Converter(workspaceRoot, new Document(document, await this.LoadParser())); - converter.Document.Quality = Settings.Default.ConversionQuality; - - Object.assign(converter.Document.Attributes, Settings.Default.Attributes); - converter.Document.Attributes.Author = converter.Document.Attributes.Author || await Utilities.GetFullName(); - - converter.Document.Locale = new CultureInfo(Settings.Default.Locale); - converter.Document.DateFormat = Settings.Default.DateFormat; - - converter.Document.Paper = Settings.Default.PaperFormat; - - converter.Document.HeaderFooterEnabled = Settings.Default.HeaderFooterEnabled; - converter.Document.Header.Content = Settings.Default.HeaderTemplate; - converter.Document.Footer.Content = Settings.Default.FooterTemplate; - - try - { - if (Settings.Default.Template) - { - converter.Document.Template = (await FileSystem.readFile(Path.resolve(workspaceRoot || ".", Settings.Default.Template))).toString(); - } - else if (Settings.Default.SystemParserEnabled) - { - converter.Document.Template = (await FileSystem.readFile(Resources.Files.Get("SystemTemplate"))).toString(); - } - } - catch (exception) - { - if ( - exception instanceof Error && - "path" in exception) - { - throw new FileException(null, (exception as any)["path"]); - } - else - { - throw exception; - } - } - - if (Settings.Default.SystemParserEnabled) - { - let mdExtensions = new MarkdownContributions(this.Extension.Context.extensionPath); - - for (let styleSheet of mdExtensions.previewStyles) - { - converter.Document.StyleSheets.push(styleSheet.fsPath); - } - - for (let script of mdExtensions.previewScripts) - { - converter.Document.Scripts.push(script.fsPath); - } - } - - if (Settings.Default.HighlightStyle !== "None") - { - if (Settings.Default.HighlightStyle === "Default") - { - if (!Settings.Default.SystemParserEnabled) - { - converter.Document.StyleSheets.push(Resources.Files.Get("DefaultHighlight")); - } - } - else - { - converter.Document.StyleSheets.push(Path.join(Resources.Files.Get("HighlightJSStylesDir"), Settings.Default.HighlightStyle + ".css")); - } - } - - for (let styleSheet of Settings.Default.StyleSheets) - { - if (!Path.isAbsolute(styleSheet)) - { - styleSheet = Path.resolve(workspaceRoot || ".", styleSheet); - } - - converter.Document.StyleSheets.push(styleSheet); - } - - return converter; - } - - /** - * Loads a parser according to the settings. + * Gets a component for running a conversion. */ - protected async LoadParser(): Promise + public get ConversionRunner() { - let parser: MarkdownIt; - let slugify = (text: string) => - Transliteration.slugify( - text, - { - lowercase: true, - separator: "-", - ignore: [] - }); - - if (Settings.Default.SystemParserEnabled) - { - parser = Clone(this.Extension.VSCodeParser); - parser.normalizeLink = (link: string) => link; - parser.normalizeLinkText = (link: string) => link; - } - else - { - parser = new MarkdownIt({ - html: true, - highlight: (subject, language) => - { - if (Settings.Default.HighlightStyle !== "None") - { - subject = HighlightJs.highlight(language, subject, true).value; - } - else - { - subject = parser.utils.escapeHtml(subject); - } - - return `
${subject}
`; - } - }); - } - - parser.validateLink = () => true; - - Anchor( - parser, - { - slugify - }); - - if (Settings.Default.TocSettings) - { - let slugifier = new Slugifier(); - parser.use( - MarkdownItToc, - { - includeLevel: Settings.Default.TocSettings.Levels.toArray(), - containerClass: Settings.Default.TocSettings.Class, - markerPattern: Settings.Default.TocSettings.Indicator, - listType: Settings.Default.TocSettings.ListType === ListType.Ordered ? "ol" : "ul", - slugify: (heading: string) => slugifier.CreateSlug(heading) - }); - } - - parser.use(Checkbox); - - if (Settings.Default.EmojiType) - { - parser.use(MarkdownItEmoji); - parser.renderer.rules["emoji"] = (token, id) => - { - switch (Settings.Default.EmojiType) - { - case EmojiType.None: - return token[id].markup; - case EmojiType.Native: - return token[id].content; - case EmojiType.Twitter: - return TwEmoji.parse(token[id].content); - case EmojiType.GitHub: - return "'; - } - }; - } - - return parser; + return this.conversionRunner; } } \ No newline at end of file diff --git a/src/Tasks/ConvertAllTask.ts b/src/Tasks/ConvertAllTask.ts index 38781f3f..f72c8594 100644 --- a/src/Tasks/ConvertAllTask.ts +++ b/src/Tasks/ConvertAllTask.ts @@ -25,7 +25,7 @@ export class ConvertAllTask extends ConversionTask { for (let document of await this.GetDocuments()) { - await this.Convert(document); + await this.ConversionRunner.Execute(document); } } diff --git a/src/Tasks/ConvertTask.ts b/src/Tasks/ConvertTask.ts index 24afc5bc..e3aedb19 100644 --- a/src/Tasks/ConvertTask.ts +++ b/src/Tasks/ConvertTask.ts @@ -25,7 +25,7 @@ export class ConvertTask extends ConversionTask */ public async ExecuteTask() { - return this.Convert(this.GetMarkdownDocument()); + return this.ConversionRunner.Execute(this.GetMarkdownDocument()); } /** From fc5817cfe4e28b3910501317c78d37c863d0502f Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 10 Aug 2019 22:24:22 +0200 Subject: [PATCH 50/77] Move to the new vscode-packages --- .vscode/launch.json | 3 +- package-lock.json | 1085 ++++++++++++++++++++++++++---------------- package.json | 8 +- src/test/index.ts | 61 ++- src/test/runTests.ts | 20 + 5 files changed, 735 insertions(+), 442 deletions(-) create mode 100644 src/test/runTests.ts diff --git a/.vscode/launch.json b/.vscode/launch.json index 8fce881d..dce0fb93 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,8 +10,7 @@ "name": "Launch Extension", "runtimeExecutable": "${execPath}", "args": [ - "--extensionDevelopmentPath=${workspaceFolder}", - "--locale=en" + "--extensionDevelopmentPath=${workspaceFolder}" ], "outFiles": [ "${workspaceFolder}/lib/**/*.js" diff --git a/package-lock.json b/package-lock.json index 72c88636..baf99de0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -180,6 +180,12 @@ "integrity": "sha512-on+MQcm19abVUxiBiWjzLp/5Aqde9cnQTT3h4xG0MWFQ7jPHUB6hoAYrpcNTnQsaXoo5D8JBBwx+WQIEIhVcNA==", "dev": true }, + "@types/vscode": { + "version": "1.37.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.37.0.tgz", + "integrity": "sha512-PRfeuqYuzk3vjf+puzxltIUWC+AhEGYpFX29/37w30DQSQnpf5AgMVf7GDBAdmTbWTBou+EMFz/Ne6XCM/KxzQ==", + "dev": true + }, "@types/yamljs": { "version": "0.2.30", "resolved": "https://registry.npmjs.org/@types/yamljs/-/yamljs-0.2.30.tgz", @@ -194,17 +200,11 @@ "es6-promisify": "^5.0.0" } }, - "ajv": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", - "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } + "ansi-colors": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", + "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", + "dev": true }, "ansi-regex": { "version": "4.1.0", @@ -235,21 +235,6 @@ } } }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "dev": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - }, "async": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", @@ -269,38 +254,11 @@ "shelljs": "^0.8.1" } }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true - }, - "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", - "dev": true - }, "balanced-match": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=" }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dev": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, "brace-expansion": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.7.tgz", @@ -332,12 +290,6 @@ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true - }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -364,6 +316,12 @@ "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=" }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -382,15 +340,6 @@ "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=" }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, "commander": { "version": "2.20.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", @@ -459,20 +408,24 @@ } } }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, "culture-info": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/culture-info/-/culture-info-1.0.4.tgz", "integrity": "sha512-h7DTEXPWNTeGG1uTG7cwntbWMIIzLLguAuBycKSPafDCDrORgWhHO7VycmUQz+8q2Ds0R+tGPNrIABkUGYyr3A==" }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, "debug": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", @@ -503,11 +456,14 @@ "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } }, "diff": { "version": "3.5.0", @@ -515,16 +471,6 @@ "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dev": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, "ecstatic": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/ecstatic/-/ecstatic-3.3.2.tgz", @@ -548,11 +494,45 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, "entities": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==" }, + "es-abstract": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", + "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.0", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "is-callable": "^1.1.4", + "is-regex": "^1.0.4", + "object-keys": "^1.0.12" + } + }, + "es-to-primitive": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", + "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, "es6-promise": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", @@ -593,11 +573,20 @@ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.0.tgz", "integrity": "sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA==" }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } }, "extract-zip": { "version": "1.6.7", @@ -620,24 +609,6 @@ } } }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", - "dev": true - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", - "dev": true - }, "fd-slicer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", @@ -654,6 +625,15 @@ "locate-path": "^3.0.0" } }, + "flat": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", + "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", + "dev": true, + "requires": { + "is-buffer": "~2.0.3" + } + }, "follow-redirects": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.1.tgz", @@ -662,23 +642,6 @@ "debug": "^3.1.0" } }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, "front-matter": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/front-matter/-/front-matter-3.0.2.tgz", @@ -702,6 +665,12 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -715,19 +684,19 @@ "type-fest": "^0.3.0" } }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", "dev": true, "requires": { - "assert-plus": "^1.0.0" + "pump": "^3.0.0" } }, "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -748,20 +717,13 @@ "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true - }, - "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, "requires": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" + "function-bind": "^1.1.1" } }, "has-flag": { @@ -775,6 +737,12 @@ "resolved": "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz", "integrity": "sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==" }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "dev": true + }, "he": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", @@ -825,17 +793,6 @@ "union": "~0.4.3" } }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, "https-proxy-agent": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz", @@ -869,17 +826,59 @@ "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=" }, + "invert-kv": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "dev": true + }, + "is-buffer": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", + "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==", + "dev": true + }, + "is-callable": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "dev": true + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "^1.0.1" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, + "is-symbol": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", + "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.0" + } + }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -897,12 +896,6 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true - }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -918,30 +911,6 @@ "esprima": "^4.0.0" } }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "dev": true - }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -950,16 +919,13 @@ "graceful-fs": "^4.1.6" } }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "lcid": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", "dev": true, "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" + "invert-kv": "^2.0.0" } }, "linkify-it": { @@ -999,6 +965,30 @@ "path-exists": "^3.0.0" } }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "log-symbols": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", + "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "dev": true, + "requires": { + "chalk": "^2.0.1" + } + }, + "map-age-cleaner": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", + "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", + "dev": true, + "requires": { + "p-defer": "^1.0.0" + } + }, "markdown-it": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-9.0.1.tgz", @@ -1046,26 +1036,28 @@ "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=" }, + "mem": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", + "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", + "dev": true, + "requires": { + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^2.0.0", + "p-is-promise": "^2.0.0" + } + }, "mime": { "version": "2.4.4", "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==" }, - "mime-db": { - "version": "1.40.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", - "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true }, - "mime-types": { - "version": "2.1.24", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", - "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", - "dev": true, - "requires": { - "mime-db": "1.40.0" - } - }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -1095,38 +1087,193 @@ } }, "mocha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.0.tgz", + "integrity": "sha512-qwfFgY+7EKAAUAdv7VYMZQknI7YJSGesxHyhn6qD52DV8UcSZs5XwCifcZGMVIE4a5fbmhvbotxC0DLQ0oKohQ==", "dev": true, "requires": { + "ansi-colors": "3.2.3", "browser-stdout": "1.3.1", - "commander": "2.15.1", - "debug": "3.1.0", + "debug": "3.2.6", "diff": "3.5.0", "escape-string-regexp": "1.0.5", - "glob": "7.1.2", + "find-up": "3.0.0", + "glob": "7.1.3", "growl": "1.10.5", - "he": "1.1.1", + "he": "1.2.0", + "js-yaml": "3.13.1", + "log-symbols": "2.2.0", "minimatch": "3.0.4", "mkdirp": "0.5.1", - "supports-color": "5.4.0" + "ms": "2.1.1", + "node-environment-flags": "1.0.5", + "object.assign": "4.1.0", + "strip-json-comments": "2.0.1", + "supports-color": "6.0.0", + "which": "1.3.1", + "wide-align": "1.1.3", + "yargs": "13.2.2", + "yargs-parser": "13.0.0", + "yargs-unparser": "1.5.0" }, "dependencies": { - "commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + }, + "dependencies": { + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + } + } + }, + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", + "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", "dev": true, "requires": { "has-flag": "^3.0.0" } + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "yargs": { + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.2.tgz", + "integrity": "sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "os-locale": "^3.1.0", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.0.0" + } + }, + "yargs-parser": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz", + "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } } } }, @@ -1151,12 +1298,67 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "node-environment-flags": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.5.tgz", + "integrity": "sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ==", + "dev": true, + "requires": { + "object.getownpropertydescriptors": "^2.0.3", + "semver": "^5.7.0" + }, + "dependencies": { + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + } + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, + "object.getownpropertydescriptors": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", + "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.5.1" + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -1186,6 +1388,35 @@ } } }, + "os-locale": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "dev": true, + "requires": { + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" + } + }, + "p-defer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", + "dev": true + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", + "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", + "dev": true + }, "p-limit": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", @@ -1233,12 +1464,6 @@ "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=" }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true - }, "portfinder": { "version": "1.0.19", "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.19.tgz", @@ -1274,17 +1499,15 @@ "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz", "integrity": "sha1-M8UDmPcOp+uW0h97gXYwpVeRx+4=" }, - "psl": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.3.0.tgz", - "integrity": "sha512-avHdspHO+9rQTLbv1RO+MPYeP/SzsCoxofjVnHanETfQhTJrmB0HlDoW+EiN/R+C0BZ+gERab9NY0lPN2TxNag==", - "dev": true - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } }, "puppeteer": { "version": "1.19.0", @@ -1316,18 +1539,6 @@ } } }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true - }, - "querystringify": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz", - "integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==", - "dev": true - }, "rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", @@ -1371,34 +1582,6 @@ "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "dev": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - } - }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -1450,12 +1633,6 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, "semver": { "version": "5.5.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz", @@ -1492,39 +1669,12 @@ "rechoir": "^0.6.2" } }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, - "source-map-support": { - "version": "0.5.13", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", - "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "dev": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, "string-template": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/string-template/-/string-template-1.0.0.tgz", @@ -1556,6 +1706,12 @@ "ansi-regex": "^4.1.0" } }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", @@ -1570,24 +1726,6 @@ "has-flag": "^3.0.0" } }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "dev": true, - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - } - } - }, "transliteration": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/transliteration/-/transliteration-2.1.5.tgz", @@ -1632,21 +1770,6 @@ "tslib": "^1.8.1" } }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true - }, "twemoji": { "version": "12.1.2", "resolved": "https://registry.npmjs.org/twemoji/-/twemoji-12.1.2.tgz", @@ -1715,75 +1838,25 @@ "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, "url-join": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/url-join/-/url-join-2.0.5.tgz", "integrity": "sha1-WvIvGMBSoACkjXuCxenC4v7tpyg=" }, - "url-parse": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz", - "integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==", - "dev": true, - "requires": { - "querystringify": "^2.1.1", - "requires-port": "^1.0.0" - } - }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", - "dev": true - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "vscode": { - "version": "1.1.36", - "resolved": "https://registry.npmjs.org/vscode/-/vscode-1.1.36.tgz", - "integrity": "sha512-cGFh9jmGLcTapCpPCKvn8aG/j9zVQ+0x5hzYJq5h5YyUXVGa1iamOaB2M2PZXoumQPES4qeAP1FwkI0b6tL4bQ==", - "dev": true, - "requires": { - "glob": "^7.1.2", - "mocha": "^5.2.0", - "request": "^2.88.0", - "semver": "^5.4.1", - "source-map-support": "^0.5.0", - "url-parse": "^1.4.4", - "vscode-test": "^0.4.1" - } - }, "vscode-test": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/vscode-test/-/vscode-test-0.4.3.tgz", - "integrity": "sha512-EkMGqBSefZH2MgW65nY05rdRSko15uvzq4VAPM5jVmwYuFQKE7eikKXNJDRxL+OITXHB6pI+a3XqqD32Y3KC5w==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/vscode-test/-/vscode-test-1.2.0.tgz", + "integrity": "sha512-aowqgc8gZe0eflzVUXsBjBrlsJ8eC35kfgfSEeHu9PKA1vQKm/3rVK43TlbxGue8hKtZBElNAJ5QuYklR/vLJA==", "dev": true, "requires": { "http-proxy-agent": "^2.1.0", - "https-proxy-agent": "^2.2.1" + "https-proxy-agent": "^2.2.1", + "rimraf": "^2.6.3" } }, "which": { @@ -1800,6 +1873,42 @@ "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" }, + "wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, + "requires": { + "string-width": "^1.0.2 || 2" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, "wordwrap": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", @@ -1886,6 +1995,144 @@ "decamelize": "^1.2.0" } }, + "yargs-unparser": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.5.0.tgz", + "integrity": "sha512-HK25qidFTCVuj/D1VfNiEndpLIeJN78aqgR23nL3y4N0U/91cOAzqfHlF8n2BvoNDcZmJKin3ddNSvOxSr8flw==", + "dev": true, + "requires": { + "flat": "^4.1.0", + "lodash": "^4.17.11", + "yargs": "^12.0.5" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + } + }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "yargs": { + "version": "12.0.5", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", + "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^1.0.1", + "os-locale": "^3.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1 || ^4.0.0", + "yargs-parser": "^11.1.1" + } + }, + "yargs-parser": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", + "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, "yauzl": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz", diff --git a/package.json b/package.json index c449b46b..d69fad6d 100644 --- a/package.json +++ b/package.json @@ -41,8 +41,7 @@ "watch": "tsc -p . --watch", "clean": "rimraf ./lib", "lint": "tslint -p ./ -t verbose", - "postinstall": "node ./node_modules/vscode/bin/install", - "test": "cross-env CODE_TESTS_PATH=\"./lib/test\" node ./node_modules/vscode/bin/test", + "test": "node ./lib/test/runTests", "prepare": "npm run rebuild" }, "devDependencies": { @@ -61,11 +60,14 @@ "@types/puppeteer": "^1.19.0", "@types/string-template": "^1.0.2", "@types/transliteration": "^1.6.1", + "@types/vscode": "^1.37.0", "@types/yamljs": "^0.2.30", "cross-env": "^5.2.0", + "glob": "^7.1.4", + "mocha": "^6.2.0", "tslint": "^5.18.0", "typescript": "^3.5.3", - "vscode": "^1.1.36" + "vscode-test": "^1.2.0" }, "dependencies": { "async-shelljs": "^0.1.2", diff --git a/src/test/index.ts b/src/test/index.ts index 79e0e814..2e7afbfe 100644 --- a/src/test/index.ts +++ b/src/test/index.ts @@ -1,23 +1,48 @@ +import Glob = require("glob"); +import Mocha = require("mocha"); +import Path = require("path"); +import { promisify } from "util"; + /** - * PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING - * - * This file is providing the test runner to use when running extension tests. - * By default the test runner in use is Mocha based. - * - * You can provide your own test runner if you want to override it by exporting - * a function run(testRoot: string, clb: (error:Error) => void) that the extension - * host can call to run the tests. The test runner is expected to use console.log - * to report the results back to the caller. When the tests are finished, return - * a possible error to the callback or null if none. + * Runs the extension-tests. */ +export async function run() +{ + let mocha = new Mocha( + { + ui: "tdd" + }); + + mocha.useColors(true); -import testRunner = require("vscode/lib/testrunner"); + return new Promise( + async (resolve, reject) => + { + let files = await promisify(Glob)("**/*.test.js", { cwd: __dirname }); -// You can directly control Mocha options by uncommenting the following lines -// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info -testRunner.configure({ - ui: "tdd", // The TDD UI is being used in extension.test.ts (suite, test, etc.) - useColors: true // Colored output from test results -}); + for (let file of files) + { + mocha.addFile(Path.resolve(__dirname, file)); + } -module.exports = testRunner; \ No newline at end of file + try + { + mocha.run( + (failures) => + { + if (failures > 0) + { + reject(new Error(`${failures} ${failures > 1 ? "tests" : "test"} failed.`)); + } + else + { + resolve(); + } + }); + } + catch (exception) + { + reject(exception); + } + }); +} \ No newline at end of file diff --git a/src/test/runTests.ts b/src/test/runTests.ts new file mode 100644 index 00000000..c089db79 --- /dev/null +++ b/src/test/runTests.ts @@ -0,0 +1,20 @@ +import Path = require("path"); +import { runTests } from "vscode-test"; + +(async function main() +{ + try + { + await runTests( + { + extensionDevelopmentPath: Path.resolve(__dirname, "..", ".."), + extensionTestsPath: Path.resolve(__dirname) + }); + } + catch (exception) + { + console.error(exception); + console.error("Failed to run tests"); + process.exit(1); + } +})(); \ No newline at end of file From d3c3759eae80171e7bc1e5fdae5192ad3d3c7f47 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 10 Aug 2019 23:30:43 +0200 Subject: [PATCH 51/77] Add a fix for activating the system-parser --- src/Tasks/ConversionRunner.ts | 5 ++++ src/extension.ts | 44 ++++++++++++++++++++++++++++++++++- 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/src/Tasks/ConversionRunner.ts b/src/Tasks/ConversionRunner.ts index c6ad227c..f2a523c9 100644 --- a/src/Tasks/ConversionRunner.ts +++ b/src/Tasks/ConversionRunner.ts @@ -269,6 +269,11 @@ export class ConversionRunner */ protected async LoadConverter(workspaceRoot: string, document: TextDocument): Promise { + if (isNullOrUndefined(this.Extension.VSCodeParser)) + { + await this.Extension.EnableSystemParser(); + } + let converter = new Converter(workspaceRoot, new Document(document, await this.LoadParser())); converter.Document.Quality = Settings.Default.ConversionQuality; diff --git a/src/extension.ts b/src/extension.ts index 0edd6a2d..7c7d8607 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,7 +1,7 @@ import { CultureInfo } from "localized-resource-manager"; import MarkdownIt = require("markdown-it"); import Path = require("path"); -import { commands, env, ExtensionContext } from "vscode"; +import { commands, env, ExtensionContext, TextEditor, Uri, ViewColumn, window, workspace } from "vscode"; import { Resources } from "./Properties/Resources"; import { ConvertAllTask } from "./Tasks/ConvertAllTask"; import { ConvertTask } from "./Tasks/ConvertTask"; @@ -21,11 +21,22 @@ export class Extension */ private vsCodeParser: MarkdownIt = null; + /** + * A `TextEditor` which is used for triggering the `extendMarkdownIt`-method. + */ + private systemParserFixEditor: TextEditor; + + /** + * A method for resolving the system-parser fix. + */ + private systemParserFixResolver: () => void; + /** * Initializes a new instance of the `Extension` class. */ public constructor() { + this.systemParserFixResolver = () => { }; Resources.Culture = new CultureInfo(env.language); } @@ -71,6 +82,14 @@ export class Extension extendMarkdownIt: (md: any) => { this.vsCodeParser = md; + + if (window.activeTextEditor === this.systemParserFixEditor) + { + commands.executeCommand("workbench.action.closeActiveEditor"); + } + + this.systemParserFixResolver(); + return md; } }; @@ -83,6 +102,29 @@ export class Extension { } + /** + * Enables the system-parser. + */ + public async EnableSystemParser() + { + let document = await workspace.openTextDocument(Uri.parse("untitled:MarkdownConverter.md")); + + let result = new Promise( + (resolve) => + { + this.systemParserFixResolver = resolve; + }); + + this.systemParserFixEditor = await window.showTextDocument( + document, + { + viewColumn: ViewColumn.Beside, + preview: true + }); + + return result; + } + /** * Converts an opened `TextDocument`. */ From bf96e534f318e526dffbe9063a130ceb3dc1b737 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 11 Aug 2019 02:40:12 +0200 Subject: [PATCH 52/77] Fix the conversion-runner --- src/Tasks/ConversionRunner.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Tasks/ConversionRunner.ts b/src/Tasks/ConversionRunner.ts index f2a523c9..46892964 100644 --- a/src/Tasks/ConversionRunner.ts +++ b/src/Tasks/ConversionRunner.ts @@ -249,10 +249,10 @@ export class ConversionRunner } })(); })()); - - await Promise.all(tasks); - await converter.Dispose(); } + + await Promise.all(tasks); + await converter.Dispose(); } /** From 35ab0bc67b9d9002a3ea94b59cb701d57ac99732 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 11 Aug 2019 02:41:01 +0200 Subject: [PATCH 53/77] Provide the functionality to create self-contained HTMLs This commit fixes #24 --- package-lock.json | 647 +++++++++++++++++++++++++++++- package.json | 4 + src/Conversion/ConversionType.ts | 5 + src/Conversion/Converter.ts | 186 +++++---- src/Conversion/ConverterPlugin.ts | 119 ++++++ src/Tasks/ConversionRunner.ts | 1 + 6 files changed, 882 insertions(+), 80 deletions(-) create mode 100644 src/Conversion/ConverterPlugin.ts diff --git a/package-lock.json b/package-lock.json index baf99de0..0675014a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,6 +44,12 @@ "integrity": "sha512-Q7VQGQqilKfi/bH3yAww+R6NEMoP/v4ioOplI0ptSKMLVqqsQc2RkHevOyVQGPsxtQX9+hEtMr4rxUwnmhYhfA==", "dev": true }, + "@types/caseless": { + "version": "0.12.2", + "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.2.tgz", + "integrity": "sha512-6ckxMjBBD8URvjB6J3NcnuAn5Pkl7t3TizAg+xdlzzQGSPSmBcXf8KoIH0ua/i+tio+ZRUHEXp0HEmvaR4kt0w==", + "dev": true + }, "@types/clone": { "version": "0.1.30", "resolved": "https://registry.npmjs.org/@types/clone/-/clone-0.1.30.tgz", @@ -159,6 +165,18 @@ "@types/node": "*" } }, + "@types/request": { + "version": "2.48.2", + "resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.2.tgz", + "integrity": "sha512-gP+PSFXAXMrd5PcD7SqHeUjdGshAI8vKQ3+AvpQr3ht9iQea+59LOKvKITcQI+Lg+1EIkDP6AFSBUJPWG8GDyA==", + "dev": true, + "requires": { + "@types/caseless": "*", + "@types/node": "*", + "@types/tough-cookie": "*", + "form-data": "^2.5.0" + } + }, "@types/shelljs": { "version": "0.7.9", "resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.7.9.tgz", @@ -174,6 +192,17 @@ "integrity": "sha1-NjsnPJtFZwXjER41cekkj2R066Q=", "dev": true }, + "@types/tmp": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@types/tmp/-/tmp-0.1.0.tgz", + "integrity": "sha512-6IwZ9HzWbCq6XoQWhxLpDjuADodH/MKXRUIDFudvgjcVdjFknvmR+DNsoUeer4XPrEnrZs04Jj+kfV9pFsrhmA==" + }, + "@types/tough-cookie": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-2.3.5.tgz", + "integrity": "sha512-SCcK7mvGi3+ZNz833RRjFIxrn4gI1PPR3NtuIS+6vMkvmsGjosqTJwRt5bAEFLRz+wtJMWv8+uOnZf2hi2QXTg==", + "dev": true + }, "@types/transliteration": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/@types/transliteration/-/transliteration-1.6.1.tgz", @@ -186,6 +215,15 @@ "integrity": "sha512-PRfeuqYuzk3vjf+puzxltIUWC+AhEGYpFX29/37w30DQSQnpf5AgMVf7GDBAdmTbWTBou+EMFz/Ne6XCM/KxzQ==", "dev": true }, + "@types/website-scraper": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@types/website-scraper/-/website-scraper-1.2.4.tgz", + "integrity": "sha512-ZXXnDI7JAAU444Qrnm9XdFZJsd8MlGc8dKNRQmRZ8cfO2Jzx/2yGE9yV96Gg7Cs064kuf+JLJpSUeX6bJxJVzg==", + "dev": true, + "requires": { + "@types/request": "*" + } + }, "@types/yamljs": { "version": "0.2.30", "resolved": "https://registry.npmjs.org/@types/yamljs/-/yamljs-0.2.30.tgz", @@ -200,6 +238,17 @@ "es6-promisify": "^5.0.0" } }, + "ajv": { + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", + "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, "ansi-colors": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", @@ -235,6 +284,24 @@ } } }, + "array-uniq": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-2.1.0.tgz", + "integrity": "sha512-bdHxtev7FN6+MXI1YFW0Q8mQ8dTJc2S8AMfju+ZR77pbg2yAdVyDlwkaUI7Har0LyOMRFPHrJ9lYdyjZZswdlQ==" + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, "async": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", @@ -254,11 +321,44 @@ "shelljs": "^0.8.1" } }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" + }, "balanced-match": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=" }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "bluebird": { + "version": "3.5.5", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz", + "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==" + }, + "boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=" + }, "brace-expansion": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.7.tgz", @@ -290,6 +390,11 @@ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -301,6 +406,29 @@ "supports-color": "^5.3.0" } }, + "cheerio": { + "version": "0.22.0", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.22.0.tgz", + "integrity": "sha1-qbqoYKP5tZWmuBsahocxIe06Jp4=", + "requires": { + "css-select": "~1.2.0", + "dom-serializer": "~0.1.0", + "entities": "~1.1.1", + "htmlparser2": "^3.9.1", + "lodash.assignin": "^4.0.9", + "lodash.bind": "^4.1.4", + "lodash.defaults": "^4.0.1", + "lodash.filter": "^4.4.0", + "lodash.flatten": "^4.2.0", + "lodash.foreach": "^4.3.0", + "lodash.map": "^4.4.0", + "lodash.merge": "^4.4.0", + "lodash.pick": "^4.2.1", + "lodash.reduce": "^4.4.0", + "lodash.reject": "^4.4.0", + "lodash.some": "^4.4.0" + } + }, "cliui": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", @@ -340,6 +468,14 @@ "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=" }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, "commander": { "version": "2.20.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", @@ -421,11 +557,40 @@ "which": "^1.2.9" } }, + "css-select": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", + "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", + "requires": { + "boolbase": "~1.0.0", + "css-what": "2.1", + "domutils": "1.5.1", + "nth-check": "~1.0.1" + } + }, + "css-url-parser": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/css-url-parser/-/css-url-parser-1.1.3.tgz", + "integrity": "sha1-qkAeXT3RwLkwTAlgKLuZIAH/XJc=" + }, + "css-what": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz", + "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==" + }, "culture-info": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/culture-info/-/culture-info-1.0.4.tgz", "integrity": "sha512-h7DTEXPWNTeGG1uTG7cwntbWMIIzLLguAuBycKSPafDCDrORgWhHO7VycmUQz+8q2Ds0R+tGPNrIABkUGYyr3A==" }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "^1.0.0" + } + }, "debug": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", @@ -465,12 +630,57 @@ "object-keys": "^1.0.12" } }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true }, + "dom-serializer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz", + "integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==", + "requires": { + "domelementtype": "^1.3.0", + "entities": "^1.1.1" + } + }, + "domelementtype": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==" + }, + "domhandler": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", + "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", + "requires": { + "domelementtype": "1" + } + }, + "domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "requires": { + "dom-serializer": "0", + "domelementtype": "1" + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, "ecstatic": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/ecstatic/-/ecstatic-3.3.2.tgz", @@ -588,6 +798,11 @@ "strip-eof": "^1.0.0" } }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, "extract-zip": { "version": "1.6.7", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.7.tgz", @@ -609,6 +824,21 @@ } } }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + }, "fd-slicer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", @@ -642,6 +872,22 @@ "debug": "^3.1.0" } }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.0.tgz", + "integrity": "sha512-WXieX3G/8side6VIqx44ablyULoGruSde5PNTxoUyo5CeyAMX6nVWUd0rgist/EuX655cjhUhTo1Fo3tRYqbcA==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, "front-matter": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/front-matter/-/front-matter-3.0.2.tgz", @@ -693,6 +939,14 @@ "pump": "^3.0.0" } }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "^1.0.0" + } + }, "glob": { "version": "7.1.4", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", @@ -717,6 +971,20 @@ "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "requires": { + "ajv": "^6.5.5", + "har-schema": "^2.0.0" + } + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -758,6 +1026,31 @@ "resolved": "https://registry.npmjs.org/highlightjs/-/highlightjs-9.12.0.tgz", "integrity": "sha512-eAhWMtDZaOZIQdxIP4UEB1vNp/CVXQPdMSihTSuaExhFIRC0BVpXbtP3mTP1hDoGOyh7nbB3cuC3sOPhG5wGDA==" }, + "htmlparser2": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz", + "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==", + "requires": { + "domelementtype": "^1.3.1", + "domhandler": "^2.3.0", + "domutils": "^1.5.1", + "entities": "^1.1.1", + "inherits": "^2.0.1", + "readable-stream": "^3.1.1" + }, + "dependencies": { + "readable-stream": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", + "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, "http-proxy": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.17.0.tgz", @@ -793,6 +1086,16 @@ "union": "~0.4.3" } }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, "https-proxy-agent": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz", @@ -879,6 +1182,11 @@ "has-symbols": "^1.0.0" } }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -896,6 +1204,11 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -911,6 +1224,26 @@ "esprima": "^4.0.0" } }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -919,6 +1252,17 @@ "graceful-fs": "^4.1.6" } }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, "lcid": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", @@ -968,8 +1312,67 @@ "lodash": { "version": "4.17.15", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", - "dev": true + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + }, + "lodash.assignin": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assignin/-/lodash.assignin-4.2.0.tgz", + "integrity": "sha1-uo31+4QesKPoBEIysOJjqNxqKKI=" + }, + "lodash.bind": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/lodash.bind/-/lodash.bind-4.2.1.tgz", + "integrity": "sha1-euMBfpOWIqwxt9fX3LGzTbFpDTU=" + }, + "lodash.defaults": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", + "integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=" + }, + "lodash.filter": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.filter/-/lodash.filter-4.6.0.tgz", + "integrity": "sha1-ZosdSYFgOuHMWm+nYBQ+SAtMSs4=" + }, + "lodash.flatten": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", + "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=" + }, + "lodash.foreach": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.foreach/-/lodash.foreach-4.5.0.tgz", + "integrity": "sha1-Gmo16s5AEoDH8G3d7DUWWrJ+PlM=" + }, + "lodash.map": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz", + "integrity": "sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=" + }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + }, + "lodash.pick": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz", + "integrity": "sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM=" + }, + "lodash.reduce": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.reduce/-/lodash.reduce-4.6.0.tgz", + "integrity": "sha1-8atrg5KZrUj3hKu/R2WW8DuRTTs=" + }, + "lodash.reject": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.reject/-/lodash.reject-4.6.0.tgz", + "integrity": "sha1-gNZJLcFHCGS79YNTO2UfQqn1JBU=" + }, + "lodash.some": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.some/-/lodash.some-4.6.0.tgz", + "integrity": "sha1-G7nzFO9ri63tE7VJFpsqlF62jk0=" }, "log-symbols": { "version": "2.2.0", @@ -1052,6 +1455,19 @@ "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==" }, + "mime-db": { + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" + }, + "mime-types": { + "version": "2.1.24", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", + "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "requires": { + "mime-db": "1.40.0" + } + }, "mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", @@ -1316,6 +1732,11 @@ } } }, + "normalize-url": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.3.0.tgz", + "integrity": "sha512-0NLtR71o4k6GLP+mr6Ty34c5GA6CMoEsncKJxvQd8NzPxaHRJNnb5gZE8R1XF4CPIS7QPHLJ74IFszwtNVAHVQ==" + }, "npm-run-path": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", @@ -1325,12 +1746,25 @@ "path-key": "^2.0.0" } }, + "nth-check": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", + "integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==", + "requires": { + "boolbase": "~1.0.0" + } + }, "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + }, "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", @@ -1433,6 +1867,14 @@ "p-limit": "^2.0.0" } }, + "p-queue": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-5.0.0.tgz", + "integrity": "sha512-6QfeouDf236N+MAxHch0CVIy8o/KBnmhttKjxZoOkUlzqU+u9rZgEyXH3OdckhTgawbqf5rpzmyR+07+Lv0+zg==", + "requires": { + "eventemitter3": "^3.1.0" + } + }, "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", @@ -1464,6 +1906,11 @@ "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=" }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, "portfinder": { "version": "1.0.19", "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.19.tgz", @@ -1499,6 +1946,11 @@ "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz", "integrity": "sha1-M8UDmPcOp+uW0h97gXYwpVeRx+4=" }, + "psl": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.3.0.tgz", + "integrity": "sha512-avHdspHO+9rQTLbv1RO+MPYeP/SzsCoxofjVnHanETfQhTJrmB0HlDoW+EiN/R+C0BZ+gERab9NY0lPN2TxNag==" + }, "pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -1509,6 +1961,11 @@ "once": "^1.3.1" } }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, "puppeteer": { "version": "1.19.0", "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-1.19.0.tgz", @@ -1539,6 +1996,11 @@ } } }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + }, "rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", @@ -1582,6 +2044,45 @@ "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" }, + "request": { + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "dependencies": { + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + } + } + }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -1633,6 +2134,11 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, "semver": { "version": "5.5.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz", @@ -1675,6 +2181,30 @@ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, + "srcset": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/srcset/-/srcset-2.0.0.tgz", + "integrity": "sha512-5/8AN7K95Ymo0xT9fL05wZGZEjbdyJh9NMc66NJK+qYaMfm3jJGmEOVfrp81kRauJC1fcqglUWY5mDLnILyfjw==", + "requires": { + "array-uniq": "^2.1.0" + } + }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, "string-template": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/string-template/-/string-template-1.0.0.tgz", @@ -1726,6 +2256,40 @@ "has-flag": "^3.0.0" } }, + "temp-filesystem": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/temp-filesystem/-/temp-filesystem-1.1.3.tgz", + "integrity": "sha512-np/Jd8Zem6FPZAhGq9Y+DAm6oPxrSVKVN6CCGf/jCtkVhpCYCR5zt6McvfcPgwrJwYYH8ZBs8UbgMIaiCrbObQ==", + "requires": { + "@types/tmp": "0.1.0", + "fs-extra": "^8.1.0", + "tmp": "0.1.0" + } + }, + "tmp": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.1.0.tgz", + "integrity": "sha512-J7Z2K08jbGcdA1kkQpJSqLF6T0tdQqpR2pnSUXsIchbPdTI9v3e85cLW0d6WDhwuAleOV71j2xWs8qMPfK7nKw==", + "requires": { + "rimraf": "^2.6.3" + } + }, + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + } + } + }, "transliteration": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/transliteration/-/transliteration-2.1.5.tgz", @@ -1770,6 +2334,19 @@ "tslib": "^1.8.1" } }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + }, "twemoji": { "version": "12.1.2", "resolved": "https://registry.npmjs.org/twemoji/-/twemoji-12.1.2.tgz", @@ -1838,6 +2415,14 @@ "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "requires": { + "punycode": "^2.1.0" + } + }, "url-join": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/url-join/-/url-join-2.0.5.tgz", @@ -1848,6 +2433,21 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, "vscode-test": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/vscode-test/-/vscode-test-1.2.0.tgz", @@ -1859,6 +2459,49 @@ "rimraf": "^2.6.3" } }, + "website-scraper": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/website-scraper/-/website-scraper-4.0.1.tgz", + "integrity": "sha512-ZErYi3351qFX8fi0blIhE7/qbj5SfVc5Ei+TWRKuNvNnzswEKWVGubyx+PevzZelitnFXqTz6qW7K/7dJP8nmQ==", + "requires": { + "bluebird": "^3.0.1", + "cheerio": "0.22.0", + "css-url-parser": "^1.0.0", + "debug": "^4.0.1", + "fs-extra": "^7.0.0", + "he": "^1.1.0", + "lodash": "^4.17.5", + "normalize-url": "^4.0.0", + "p-queue": "^5.0.0", + "request": "^2.85.0", + "srcset": "^2.0.0" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + } + }, + "fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", diff --git a/package.json b/package.json index d69fad6d..fb4b1a60 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,7 @@ "@types/string-template": "^1.0.2", "@types/transliteration": "^1.6.1", "@types/vscode": "^1.37.0", + "@types/website-scraper": "^1.2.4", "@types/yamljs": "^0.2.30", "cross-env": "^5.2.0", "glob": "^7.1.4", @@ -91,8 +92,10 @@ "puppeteer": "^1.19.0", "rc": "^1.2.8", "string-template": "^1.0.0", + "temp-filesystem": "^1.1.3", "transliteration": "^2.1.5", "twemoji": "^12.1.2", + "website-scraper": "^4.0.1", "yamljs": "^0.3.0" }, "activationEvents": [ @@ -146,6 +149,7 @@ "type": "string", "enum": [ "BMP", + "SelfContainedHTML", "HTML", "JPEG", "PDF", diff --git a/src/Conversion/ConversionType.ts b/src/Conversion/ConversionType.ts index a4d65f96..70f7279e 100644 --- a/src/Conversion/ConversionType.ts +++ b/src/Conversion/ConversionType.ts @@ -3,6 +3,11 @@ */ export enum ConversionType { + /** + * Indicates a self-contained HTML-conversion. + */ + SelfContainedHTML, + /** * Indicates an HTML-conversion. */ diff --git a/src/Conversion/Converter.ts b/src/Conversion/Converter.ts index 6a21c486..4ff36e2b 100644 --- a/src/Conversion/Converter.ts +++ b/src/Conversion/Converter.ts @@ -1,14 +1,18 @@ -import FS = require("fs-extra"); +import FileSystem = require("fs-extra"); import PortFinder = require("get-port"); +import Glob = require("glob"); import http = require("http"); import Server = require("http-server"); import Path = require("path"); import Puppeteer = require("puppeteer"); +import { TempDirectory } from "temp-filesystem"; import URL = require("url"); -import { isNullOrUndefined } from "util"; +import { isNullOrUndefined, promisify } from "util"; +import Scrape = require("website-scraper"); import { Document } from "../System/Documents/Document"; import { FileException } from "../System/IO/FileException"; import { ConversionType } from "./ConversionType"; +import { ConverterPlugin } from "./ConverterPlugin"; /** * Provides a markdown-converter. @@ -210,94 +214,120 @@ export class Converter } else { - if (conversionType !== ConversionType.HTML) + switch (conversionType) { - try - { - let page = await this.Browser.newPage(); - - page.on( - "request", - async request => + case ConversionType.HTML: + await FileSystem.writeFile(path, await this.Document.Render()); + break; + case ConversionType.SelfContainedHTML: + let tempDir = new TempDirectory(); + await FileSystem.remove(tempDir.FullName); + + await Scrape( + { + urls: [this.URL], + directory: tempDir.FullName, + plugins: [ + new ConverterPlugin( + this, + Path.basename(path)) + ] + } as any); + + for (let filename of await promisify(Glob)("**/*", { cwd: tempDir.FullName })) + { + if (await FileSystem.pathExists(tempDir.MakePath(filename))) { - if (request.url() === this.URL) + await FileSystem.move(tempDir.MakePath(filename), Path.join(Path.dirname(path), filename), { overwrite: true }); + } + } + + tempDir.Dispose(); + break; + default: + try + { + let page = await this.Browser.newPage(); + + page.on( + "request", + async request => { - await request.respond( + if (request.url() === this.URL) + { + await request.respond( + { + body: await this.Document.Render() + }); + } + else + { + await request.continue(); + } + }); + + await page.setRequestInterception(true); + await page.goto(this.URL, { waitUntil: "networkidle0", timeout: 0 }); + + switch (conversionType) + { + case ConversionType.PDF: + let styles = ` + `; + let pdfOptions: Puppeteer.PDFOptions = { + margin: { + top: this.Document.Paper.Margin.Top, + right: this.Document.Paper.Margin.Right, + bottom: this.Document.Paper.Margin.Bottom, + left: this.Document.Paper.Margin.Left + }, + printBackground: true, + path + }; + + Object.assign(pdfOptions, this.Document.Paper.Format.PDFOptions); + + if (this.Document.HeaderFooterEnabled) + { + pdfOptions.displayHeaderFooter = true; + pdfOptions.headerTemplate = styles + await this.Document.Header.Render(); + pdfOptions.footerTemplate = styles + await this.Document.Footer.Render(); + } - await page.setRequestInterception(true); - await page.goto(this.URL, { waitUntil: "networkidle0", timeout: 0 }); + await page.pdf(pdfOptions); + break; + default: + let screenshotOptions: Puppeteer.ScreenshotOptions = { + fullPage: true, + path + }; - switch (conversionType) - { - case ConversionType.PDF: - let styles = ` - `; - let pdfOptions: Puppeteer.PDFOptions = { - margin: { - top: this.Document.Paper.Margin.Top, - right: this.Document.Paper.Margin.Right, - bottom: this.Document.Paper.Margin.Bottom, - left: this.Document.Paper.Margin.Left - }, - printBackground: true, - path - }; - - Object.assign(pdfOptions, this.Document.Paper.Format.PDFOptions); - - if (this.Document.HeaderFooterEnabled) - { - pdfOptions.displayHeaderFooter = true; - pdfOptions.headerTemplate = styles + await this.Document.Header.Render(); - pdfOptions.footerTemplate = styles + await this.Document.Footer.Render(); - } - - await page.pdf(pdfOptions); - break; - default: - let screenshotOptions: Puppeteer.ScreenshotOptions = { - fullPage: true, - path - }; - - if (conversionType !== ConversionType.PNG) - { - screenshotOptions.quality = this.Document.Quality; - } - await page.screenshot(screenshotOptions); - break; + await page.screenshot(screenshotOptions); + break; + } } - } - catch (exception) - { - if ("path" in exception) - { - throw new FileException(null, exception["path"]); - } - else + catch (exception) { - throw exception; + if ("path" in exception) + { + throw new FileException(null, exception["path"]); + } + else + { + throw exception; + } } - } - } - else - { - await FS.writeFile(path, await this.Document.Render()); + break; } } } diff --git a/src/Conversion/ConverterPlugin.ts b/src/Conversion/ConverterPlugin.ts new file mode 100644 index 00000000..2709507f --- /dev/null +++ b/src/Conversion/ConverterPlugin.ts @@ -0,0 +1,119 @@ +import Path = require("path"); +import { Browser, launch } from "puppeteer"; +import { Converter } from "./Converter"; + +/** + * Generates filenames for the website-scraper. + */ +export class ConverterPlugin +{ + /** + * The converter this plugin belongs to. + */ + private converter: Converter; + + /** + * The name of the website to save. + */ + private websiteName: string; + + /** + * Initializes a new instance of the `FilenamePlugin` class. + * + * @param converter + * The converter this plugin belongs to. + * + * @param websiteName + * The name of the website to save. + */ + public constructor(converter: Converter, websiteName?: string) + { + this.converter = converter; + this.websiteName = websiteName; + } + + /** + * Gets the converter this plugin belongs to. + */ + public get Converter() + { + return this.converter; + } + + /** + * Gets the name of the website to save. + */ + public get WebsiteName() + { + return this.websiteName; + } + + /** + * Applies the plugin. + * + * @param registerAction + * A component for registering actions. + */ + public apply(registerAction: (name: string, callback: (options: any) => void) => void): void + { + let browser: Browser; + let occupiedFilenames: string[]; + let subdirectories: { [extension: string]: string }; + let defaultFilename: string; + + registerAction("beforeStart", + async ({ options }) => + { + browser = await launch(); + occupiedFilenames = []; + subdirectories = options.subdirectories; + defaultFilename = this.WebsiteName || options.defaultFilename; + }); + + registerAction("afterResponse", + async ({ response }) => + { + if (response.request.href === this.Converter.URL) + { + return this.Converter.Document.Render(); + } + else + { + const contentType = response.headers["content-type"]; + const isHtml = contentType && contentType.split(";")[0] === "text/html"; + + if (isHtml) + { + const url = response.request.href; + + const page = await browser.newPage(); + await page.goto(url); + const content = await page.content(); + await page.close(); + return content; + } + else + { + return response.body; + } + } + }); + registerAction("generateFilename", ({ resource }) => + { + let result: string; + let filename: string = require("website-scraper/lib/filename-generator/by-type")(resource, { subdirectories, defaultFilename }, occupiedFilenames); + + if (filename === "index.html") + { + result = filename = this.WebsiteName; + } + else + { + result = Path.join(Path.parse(defaultFilename).name, filename); + } + + occupiedFilenames.push(filename); + return { filename: result }; + }); + } +} \ No newline at end of file diff --git a/src/Tasks/ConversionRunner.ts b/src/Tasks/ConversionRunner.ts index 46892964..8106f2ed 100644 --- a/src/Tasks/ConversionRunner.ts +++ b/src/Tasks/ConversionRunner.ts @@ -115,6 +115,7 @@ export class ConversionRunner switch (type) { + case ConversionType.SelfContainedHTML: case ConversionType.HTML: extension = "html"; break; From c767084730607edec9b79ec2e8a94858210afb67 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 11 Aug 2019 03:24:00 +0200 Subject: [PATCH 54/77] Throw an exception if no markdown-file could be found --- src/Tasks/ConvertAllTask.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Tasks/ConvertAllTask.ts b/src/Tasks/ConvertAllTask.ts index f72c8594..9d653e14 100644 --- a/src/Tasks/ConvertAllTask.ts +++ b/src/Tasks/ConvertAllTask.ts @@ -1,5 +1,6 @@ import { extensions, TextDocument, workspace } from "vscode"; import { Extension } from "../extension"; +import { MarkdownFileNotFoundException } from "../MarkdownFileNotFoundException"; import { ConversionTask } from "./ConversionTask"; /** @@ -18,6 +19,21 @@ export class ConvertAllTask extends ConversionTask super(extension); } + /** + * @inheritdoc + */ + public async Execute() + { + if ((await this.GetDocuments()).length === 0) + { + throw new MarkdownFileNotFoundException(); + } + else + { + return super.Execute(); + } + } + /** * @inheritdoc */ From 0a9fbb4cf0df6c853894947ac630d79faa65dd15 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 11 Aug 2019 03:24:37 +0200 Subject: [PATCH 55/77] Provide the functionality to chain all markdown-documents This commit fixes #25 --- package.json | 5 +++++ package.nls.de-CH.json | 1 + package.nls.de.json | 1 + package.nls.json | 1 + src/Tasks/ChainTask.ts | 47 ++++++++++++++++++++++++++++++++++++++++++ src/extension.ts | 12 ++++++++++- 6 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 src/Tasks/ChainTask.ts diff --git a/package.json b/package.json index fb4b1a60..cef9a4ba 100644 --- a/package.json +++ b/package.json @@ -113,6 +113,11 @@ "command": "markdownConverter.ConvertAll", "category": "Markdown", "title": "%Command.ConvertAll%" + }, + { + "command": "markdownConverter.Chain", + "category": "Markdown", + "title": "%Command.Chain%" } ], "markdown.markdownItPlugins": true, diff --git a/package.nls.de-CH.json b/package.nls.de-CH.json index e495f136..ff0b670c 100644 --- a/package.nls.de-CH.json +++ b/package.nls.de-CH.json @@ -1,6 +1,7 @@ { "Command.Convert": "Dokument konvertieren", "Command.ConvertAll": "Alle Dokumente konvertieren", + "Command.Chain": "Alle Dokumente verketten", "Config": "MarkdownConverter-Einstellungen", "Config.DestinationPattern": "Ziel-Muster", "Config.DestinationPattern.Description": "Das Muster zum Erzeugen des Ziel-Pfads.\n\nFolgende Variablen können verwendet werden:\n\n* `${workspaceFolder}`: \nEntweder der Pfad des `workspace`s oder des Ordners in dem sich das Dokument befindet.\n* `${dirname}`: \nDer relative Pfad vom `${workspaceFolder}` zum Ordner des Dokuments.\n* `${basename}`: \nDer Name der Dokument-Datei ohne Datei-Erweiterung.\n* `${extension}`: \nDie Datei-Erweiterung des Ziel-Datentyps.\n* `${filename}`: \nDer Name der Dokument-Datei.", diff --git a/package.nls.de.json b/package.nls.de.json index 347da3ec..52cd1fb1 100644 --- a/package.nls.de.json +++ b/package.nls.de.json @@ -1,6 +1,7 @@ { "Command.Convert": "Dokument konvertieren", "Command.ConvertAll": "Alle Dokumente konvertieren", + "Command.Chain": "Alle Dokumente verketten", "Config": "MarkdownConverter-Einstellungen", "Config.DestinationPattern": "Ziel-Muster", "Config.DestinationPattern.Description": "Das Muster zum Erzeugen des Ziel-Pfads.\n\nFolgende Variablen können verwendet werden:\n\n* `${workspaceFolder}`: \nEntweder der Pfad des `workspace`s oder des Ordners in dem sich das Dokument befindet.\n* `${dirname}`: \nDer relative Pfad vom `${workspaceFolder}` zum Ordner des Dokuments.\n* `${filename}`: \nDer Name der Dokument-Datei.\n* `${basename}`: \nDer Name der Dokument-Datei ohne Datei-Erweiterung.\n* `${extension}`: \nDie Datei-Erweiterung des Ziel-Datentyps.", diff --git a/package.nls.json b/package.nls.json index caa53193..1f940f3b 100644 --- a/package.nls.json +++ b/package.nls.json @@ -1,6 +1,7 @@ { "Command.Convert": "Convert Document", "Command.ConvertAll": "Convert all Documents", + "Command.Chain": "Chain all Documents", "Config": "MarkdownConverter-Options", "Config.DestinationPattern": "Destination-Pattern", "Config.DestinationPattern.Description": "The pattern for creating a destination-path.\n\nFollowing variables can be used inside this expression:\n\n* `${workspaceFolder}`: \nEither the path to the `workspace` or the directory which contains the document.\n* `${dirname}`: \nThe relative path from the `${workspaceFolder}` to the directory which contains the document.\n* `${basename}`: \nThe name of the document-file without extension.\n* `${extension}`: \nThe file-extension of the destination-datatype.\n* `${filename}`: \nThe name of the document-file.", diff --git a/src/Tasks/ChainTask.ts b/src/Tasks/ChainTask.ts new file mode 100644 index 00000000..97d8ec8a --- /dev/null +++ b/src/Tasks/ChainTask.ts @@ -0,0 +1,47 @@ +import { EOL } from "os"; +import { TextDocument, workspace } from "vscode"; +import { Extension } from "../extension"; +import { ConvertAllTask } from "./ConvertAllTask"; + +/** + * Represents a task for chaining multiple documents. + */ +export class ChainTask extends ConvertAllTask +{ + /** + * Initializes a new instance of the `ChainTask` class. + * + * @param extension + * The extension the task belongs to. + */ + public constructor(extension: Extension) + { + super(extension); + } + + /** + * @inheritdoc + */ + protected async ExecuteTask() + { + let document: TextDocument; + let documents = await this.GetDocuments(); + let contents: string[]; + + documents.sort( + (x, y) => + { + return x.uri.toString().toLowerCase().localeCompare(y.uri.toString().toLowerCase()); + }); + + contents = documents.map((textDocument) => textDocument.getText()); + + document = await workspace.openTextDocument( + { + language: "markdown", + content: contents.join(EOL + EOL) + }); + + await this.ConversionRunner.Execute(document); + } +} \ No newline at end of file diff --git a/src/extension.ts b/src/extension.ts index 7c7d8607..4ef5ca8f 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -3,6 +3,7 @@ import MarkdownIt = require("markdown-it"); import Path = require("path"); import { commands, env, ExtensionContext, TextEditor, Uri, ViewColumn, window, workspace } from "vscode"; import { Resources } from "./Properties/Resources"; +import { ChainTask } from "./Tasks/ChainTask"; import { ConvertAllTask } from "./Tasks/ConvertAllTask"; import { ConvertTask } from "./Tasks/ConvertTask"; @@ -76,7 +77,8 @@ export class Extension context.subscriptions.push( commands.registerCommand("markdownConverter.Convert", async () => this.Convert()), - commands.registerCommand("markdownConverter.ConvertAll", async () => this.ConvertAll())); + commands.registerCommand("markdownConverter.ConvertAll", async () => this.ConvertAll()), + commands.registerCommand("markdownConverter.Chain", async () => this.Chain())); return { extendMarkdownIt: (md: any) => @@ -140,6 +142,14 @@ export class Extension { await new ConvertAllTask(this).Execute(); } + + /** + * Chains multiple documents together. + */ + protected async Chain() + { + await new ChainTask(this).Execute(); + } } /** From ef64d5a29b451b19e7d558db8b890cc87420d9a4 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 11 Aug 2019 03:57:23 +0200 Subject: [PATCH 56/77] Fix selfcontained html-files with utf8-characters --- package-lock.json | 11 +++++++++++ package.json | 2 ++ src/Conversion/ConverterPlugin.ts | 13 +++++++------ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0675014a..89b10308 100644 --- a/package-lock.json +++ b/package-lock.json @@ -209,6 +209,12 @@ "integrity": "sha512-on+MQcm19abVUxiBiWjzLp/5Aqde9cnQTT3h4xG0MWFQ7jPHUB6hoAYrpcNTnQsaXoo5D8JBBwx+WQIEIhVcNA==", "dev": true }, + "@types/utf8": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@types/utf8/-/utf8-2.1.6.tgz", + "integrity": "sha512-pRs2gYF5yoKYrgSaira0DJqVg2tFuF+Qjp838xS7K+mJyY2jJzjsrl6y17GbIa4uMRogMbxs+ghNCvKg6XyNrA==", + "dev": true + }, "@types/vscode": { "version": "1.37.0", "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.37.0.tgz", @@ -2428,6 +2434,11 @@ "resolved": "https://registry.npmjs.org/url-join/-/url-join-2.0.5.tgz", "integrity": "sha1-WvIvGMBSoACkjXuCxenC4v7tpyg=" }, + "utf8": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", + "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==" + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", diff --git a/package.json b/package.json index cef9a4ba..0c4d0ef0 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,7 @@ "@types/puppeteer": "^1.19.0", "@types/string-template": "^1.0.2", "@types/transliteration": "^1.6.1", + "@types/utf8": "^2.1.6", "@types/vscode": "^1.37.0", "@types/website-scraper": "^1.2.4", "@types/yamljs": "^0.2.30", @@ -95,6 +96,7 @@ "temp-filesystem": "^1.1.3", "transliteration": "^2.1.5", "twemoji": "^12.1.2", + "utf8": "^3.0.0", "website-scraper": "^4.0.1", "yamljs": "^0.3.0" }, diff --git a/src/Conversion/ConverterPlugin.ts b/src/Conversion/ConverterPlugin.ts index 2709507f..2e9f7b34 100644 --- a/src/Conversion/ConverterPlugin.ts +++ b/src/Conversion/ConverterPlugin.ts @@ -1,5 +1,6 @@ import Path = require("path"); import { Browser, launch } from "puppeteer"; +import Utf8 = require("utf8"); import { Converter } from "./Converter"; /** @@ -75,20 +76,20 @@ export class ConverterPlugin { if (response.request.href === this.Converter.URL) { - return this.Converter.Document.Render(); + return Utf8.encode(await this.Converter.Document.Render()); } else { - const contentType = response.headers["content-type"]; - const isHtml = contentType && contentType.split(";")[0] === "text/html"; + let contentType = response.headers["content-type"]; + let isHtml = contentType && contentType.split(";")[0] === "text/html"; if (isHtml) { - const url = response.request.href; + let url = response.request.href; - const page = await browser.newPage(); + let page = await browser.newPage(); await page.goto(url); - const content = await page.content(); + let content = await page.content(); await page.close(); return content; } From 28493da202ce3a492616209353f60feee2d9e894 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 12 Aug 2019 21:31:58 +0200 Subject: [PATCH 57/77] Fix the update-message --- src/Tasks/PuppeteerTask.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Tasks/PuppeteerTask.ts b/src/Tasks/PuppeteerTask.ts index 9ba27e53..3333cae7 100644 --- a/src/Tasks/PuppeteerTask.ts +++ b/src/Tasks/PuppeteerTask.ts @@ -37,6 +37,7 @@ export abstract class PuppeteerTask extends Task else if ( await (window.showInformationMessage( Resources.Resources.Get("UpdateMessage"), + Resources.Resources.Get("Yes"), Resources.Resources.Get("No")) as Promise) === Resources.Resources.Get("Yes")) { let revision = this.Extension.ChromiumRevision; From dc129f91c7b739a40cc1e021927d05e3d01cd210 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 15 Aug 2019 22:47:19 +0200 Subject: [PATCH 58/77] Add an extension-class for centralizing the error-output --- Resources/MarkdownConverter.de.json | 1 + Resources/MarkdownConverter.json | 4 +- src/Properties/Resources.ts | 9 +- src/System/Extensibility/Extension.ts | 154 ++++++++++++++++++++++++++ 4 files changed, 163 insertions(+), 5 deletions(-) create mode 100644 src/System/Extensibility/Extension.ts diff --git a/Resources/MarkdownConverter.de.json b/Resources/MarkdownConverter.de.json index 722dd981..dbac67d8 100644 --- a/Resources/MarkdownConverter.de.json +++ b/Resources/MarkdownConverter.de.json @@ -1,6 +1,7 @@ { "SuccessMessage": "Die konvertierte {0}-Datei wurde erfolgreich nach \"{1}\" geschrieben.", "OpenFileLabel": "Datei Öffnen", + "UncaughtException": "Ein unerwarteter Fehler ist aufgetreten", "FileException": "Auf die Datei \"{0}\" konnte nicht zugegriffen werden.", "MarkdownFileException": "Es konnte keine Markdown-Datei gefunden werden.", "YAMLException": "Fehler: Der YAML-Block ist nicht richtig formatiert. Zeile {0}, Spalte {1}.", diff --git a/Resources/MarkdownConverter.json b/Resources/MarkdownConverter.json index c1f83f8c..0fbfa34e 100644 --- a/Resources/MarkdownConverter.json +++ b/Resources/MarkdownConverter.json @@ -1,7 +1,9 @@ { "SuccessMessage": "Successfully wrote the {0}-file to \"{1}\".", "OpenFileLabel": "Open File", - "UnknownException": "{0}: {1}", + "UncaughtException": "An unexpected error occurred", + "UnknownException": "{{UncaughtException}}:\n{0}: {1}", + "UnknownError": "{{UncaughtException}}:\n{0}", "FileException": "Couldn't access \"{0}\".", "MarkdownFileException": "Couldn't find a markdown-file.", "YAMLException": "The YAML-block is malformatted. Line {0}, column {1}.", diff --git a/src/Properties/Resources.ts b/src/Properties/Resources.ts index 4a0551d6..962d630b 100644 --- a/src/Properties/Resources.ts +++ b/src/Properties/Resources.ts @@ -1,4 +1,4 @@ -import { CultureInfo, ResourceManager } from "localized-resource-manager"; +import { CultureInfo, IResourceManager, MustacheResourceManager, ResourceManager } from "localized-resource-manager"; import Path = require("path"); /** @@ -9,7 +9,8 @@ export class Resources /** * The resources. */ - private static resources = new ResourceManager(Path.join(__dirname, "..", "..", "Resources", "MarkdownConverter")); + private static resources = new MustacheResourceManager( + new ResourceManager(Path.join(__dirname, "..", "..", "Resources", "MarkdownConverter"))); /** * The files. @@ -28,7 +29,7 @@ export class Resources /** * Gets the resources. */ - public static get Resources(): ResourceManager + public static get Resources(): IResourceManager { return this.resources; } @@ -36,7 +37,7 @@ export class Resources /** * Gets the files. */ - public static get Files(): ResourceManager + public static get Files(): IResourceManager { return this.files; } diff --git a/src/System/Extensibility/Extension.ts b/src/System/Extensibility/Extension.ts new file mode 100644 index 00000000..0b11ad4a --- /dev/null +++ b/src/System/Extensibility/Extension.ts @@ -0,0 +1,154 @@ +import { CultureInfo } from "culture-info"; +import MarkdownIt = require("markdown-it"); +import Format = require("string-template"); +import { commands, env, ExtensionContext, TextEditor, Uri, ViewColumn, window, workspace } from "vscode"; +import { Resources } from "../../Properties/Resources"; +import { Task } from "../../Tasks/Task"; + +/** + * Represents an extension. + */ +export class Extension +{ + /** + * The context of the extension. + */ + private context: ExtensionContext = null; + + /** + * The parser provided by `Visual Studio Code` + */ + private vsCodeParser: MarkdownIt; + + /** + * A `TextEditor` which is used for triggering the `extendMarkdownIt`-method. + */ + private systemParserFixEditor: TextEditor; + + /** + * A method for resolving the system-parser fix. + */ + private systemParserFixResolver: () => void; + + /** + * Initializes a new instance of the `Extension` class. + */ + public constructor() + { + this.systemParserFixResolver = () => { }; + Resources.Culture = new CultureInfo(env.language); + } + + /** + * Gets context of the of the extension. + */ + public get Context() + { + return this.context; + } + + /** + * Gets the parser provided by Visual Studio Code. + */ + public get VSCodeParser() + { + return this.vsCodeParser; + } + + /** + * Activates the extension. + * + * @param context + * A collection of utilities private to an extension. + */ + public async Active(context: ExtensionContext) + { + this.context = context; + + return { + extendMarkdownIt: (md: any) => + { + this.vsCodeParser = md; + + if (window.activeTextEditor === this.systemParserFixEditor) + { + commands.executeCommand("workbench.action.closeActiveEditor"); + } + + this.systemParserFixResolver(); + + return md; + } + }; + } + + /** + * Disposes the extension. + */ + public async Dispose() + { + } + + /** + * Enables the system-parser. + */ + public async EnableSystemParser() + { + let document = await workspace.openTextDocument(Uri.parse("untitled:.md")); + + let result = new Promise( + (resolve) => + { + this.systemParserFixResolver = resolve; + }); + + this.systemParserFixEditor = await window.showTextDocument( + document, + { + viewColumn: ViewColumn.Beside, + preview: true + }); + + return result; + } + + /** + * Executes a task. + * + * @param task + * The task to execute. + */ + protected async ExecuteTask(task: Task) + { + try + { + await this.ExecuteTaskInternal(task); + } + catch (exception) + { + let message: string; + + if (exception instanceof Error) + { + message = Format(Resources.Resources.Get("UnknownException"), exception.name, exception.message); + } + else + { + message = Format(Resources.Resources.Get("UnknownError"), exception); + } + + window.showErrorMessage(message); + } + } + + /** + * Executes a task. + * + * @param task + * The task to execute. + */ + protected async ExecuteTaskInternal(task: Task) + { + return task.Execute(); + } +} \ No newline at end of file From e815151aaa619d014082d07988dec5716b5a60c2 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 15 Aug 2019 23:07:33 +0200 Subject: [PATCH 59/77] Move the error-output to the extension-class --- src/MarkdownConverterExtension.ts | 33 +++++++ src/Tasks/ChainTask.ts | 4 +- src/Tasks/ConversionRunner.ts | 6 +- src/Tasks/ConversionTask.ts | 4 +- src/Tasks/ConvertAllTask.ts | 4 +- src/Tasks/ConvertTask.ts | 4 +- src/Tasks/PuppeteerTask.ts | 138 ++++++++++++-------------- src/Tasks/Task.ts | 16 ++- src/extension.ts | 157 +----------------------------- 9 files changed, 116 insertions(+), 250 deletions(-) create mode 100644 src/MarkdownConverterExtension.ts diff --git a/src/MarkdownConverterExtension.ts b/src/MarkdownConverterExtension.ts new file mode 100644 index 00000000..56653643 --- /dev/null +++ b/src/MarkdownConverterExtension.ts @@ -0,0 +1,33 @@ +import Path = require("path"); +import { commands, ExtensionContext } from "vscode"; +import { Extension } from "./System/Extensibility/Extension"; +import { ChainTask } from "./Tasks/ChainTask"; +import { ConvertAllTask } from "./Tasks/ConvertAllTask"; +import { ConvertTask } from "./Tasks/ConvertTask"; + +/** + * Represents the `Markdown Converter` extension. + */ +export class MarkdownConverterExtension extends Extension +{ + /** + * Gets the chromium-revision of the extension. + */ + public get ChromiumRevision(): string + { + return require(Path.join(__dirname, "..", "node_modules", "puppeteer", "package.json"))["puppeteer"]["chromium_revision"]; + } + + /** + * @inheritdoc + */ + public async Activate(context: ExtensionContext) + { + context.subscriptions.push( + commands.registerCommand("markdownConverter.Convert", async () => this.ExecuteTask(new ConvertTask(this))), + commands.registerCommand("markdownConverter.ConvertAll", async () => this.ExecuteTask(new ConvertAllTask(this))), + commands.registerCommand("markdownConverter.Chain", async () => this.ExecuteTask(new ChainTask(this)))); + + return super.Active(context); + } +} \ No newline at end of file diff --git a/src/Tasks/ChainTask.ts b/src/Tasks/ChainTask.ts index 97d8ec8a..9ad80bd3 100644 --- a/src/Tasks/ChainTask.ts +++ b/src/Tasks/ChainTask.ts @@ -1,6 +1,6 @@ import { EOL } from "os"; import { TextDocument, workspace } from "vscode"; -import { Extension } from "../extension"; +import { MarkdownConverterExtension } from "../MarkdownConverterExtension"; import { ConvertAllTask } from "./ConvertAllTask"; /** @@ -14,7 +14,7 @@ export class ChainTask extends ConvertAllTask * @param extension * The extension the task belongs to. */ - public constructor(extension: Extension) + public constructor(extension: MarkdownConverterExtension) { super(extension); } diff --git a/src/Tasks/ConversionRunner.ts b/src/Tasks/ConversionRunner.ts index 8106f2ed..a71f4087 100644 --- a/src/Tasks/ConversionRunner.ts +++ b/src/Tasks/ConversionRunner.ts @@ -17,8 +17,8 @@ import { isNullOrUndefined } from "util"; import { TextDocument, window, workspace, WorkspaceFolder } from "vscode"; import { ConversionType } from "../Conversion/ConversionType"; import { Converter } from "../Conversion/Converter"; -import { Extension } from "../extension"; import { MarkdownContributions } from "../MarkdownContributions"; +import { MarkdownConverterExtension } from "../MarkdownConverterExtension"; import { Resources } from "../Properties/Resources"; import { Settings } from "../Properties/Settings"; import { Document } from "../System/Documents/Document"; @@ -36,7 +36,7 @@ export class ConversionRunner /** * The extension the runner belongs to. */ - private extension: Extension; + private extension: MarkdownConverterExtension; /** * The workspace-folder which has been chosen by the user. @@ -49,7 +49,7 @@ export class ConversionRunner * @param extension * The extension the runner belongs to. */ - public constructor(extension: Extension) + public constructor(extension: MarkdownConverterExtension) { this.extension = extension; } diff --git a/src/Tasks/ConversionTask.ts b/src/Tasks/ConversionTask.ts index 81ed5c64..a5472702 100644 --- a/src/Tasks/ConversionTask.ts +++ b/src/Tasks/ConversionTask.ts @@ -1,4 +1,4 @@ -import { Extension } from "../extension"; +import { MarkdownConverterExtension } from "../MarkdownConverterExtension"; import { ConversionRunner } from "./ConversionRunner"; import { PuppeteerTask } from "./PuppeteerTask"; @@ -18,7 +18,7 @@ export abstract class ConversionTask extends PuppeteerTask * @param extension * The extension the task belongs to. */ - public constructor(extension: Extension) + public constructor(extension: MarkdownConverterExtension) { super(extension); this.conversionRunner = new ConversionRunner(this.Extension); diff --git a/src/Tasks/ConvertAllTask.ts b/src/Tasks/ConvertAllTask.ts index 9d653e14..dd996e11 100644 --- a/src/Tasks/ConvertAllTask.ts +++ b/src/Tasks/ConvertAllTask.ts @@ -1,5 +1,5 @@ import { extensions, TextDocument, workspace } from "vscode"; -import { Extension } from "../extension"; +import { MarkdownConverterExtension } from "../MarkdownConverterExtension"; import { MarkdownFileNotFoundException } from "../MarkdownFileNotFoundException"; import { ConversionTask } from "./ConversionTask"; @@ -14,7 +14,7 @@ export class ConvertAllTask extends ConversionTask * @param extension * The extension the task belongs to. */ - public constructor(extension: Extension) + public constructor(extension: MarkdownConverterExtension) { super(extension); } diff --git a/src/Tasks/ConvertTask.ts b/src/Tasks/ConvertTask.ts index e3aedb19..62083e16 100644 --- a/src/Tasks/ConvertTask.ts +++ b/src/Tasks/ConvertTask.ts @@ -1,5 +1,5 @@ import { TextDocument, window } from "vscode"; -import { Extension } from "../extension"; +import { MarkdownConverterExtension } from "../MarkdownConverterExtension"; import { MarkdownFileNotFoundException } from "../MarkdownFileNotFoundException"; import { Settings } from "../Properties/Settings"; import { ConversionTask } from "./ConversionTask"; @@ -15,7 +15,7 @@ export class ConvertTask extends ConversionTask * @param extension * The extension the task belongs to. */ - public constructor(extension: Extension) + public constructor(extension: MarkdownConverterExtension) { super(extension); } diff --git a/src/Tasks/PuppeteerTask.ts b/src/Tasks/PuppeteerTask.ts index 3333cae7..bfdc12c2 100644 --- a/src/Tasks/PuppeteerTask.ts +++ b/src/Tasks/PuppeteerTask.ts @@ -2,7 +2,7 @@ import FileSystem = require("fs-extra"); import Puppeteer = require("puppeteer"); import Format = require("string-template"); import { ProgressLocation, window } from "vscode"; -import { Extension } from "../extension"; +import { MarkdownConverterExtension } from "../MarkdownConverterExtension"; import { Resources } from "../Properties/Resources"; import { Exception } from "../System/Exception"; import { Task } from "./Task"; @@ -10,7 +10,7 @@ import { Task } from "./Task"; /** * Represents a task which depends on Puppeteer. */ -export abstract class PuppeteerTask extends Task +export abstract class PuppeteerTask extends Task { /** * Initializes a new instance of the `PuppeteerTask` class. @@ -18,97 +18,83 @@ export abstract class PuppeteerTask extends Task * @param extension * The extension this task belongs to. */ - public constructor(extension: Extension) + public constructor(extension: MarkdownConverterExtension) { super(extension); } + /** + * Gets or sets the extension this task belongs to. + */ + public get Extension() + { + return super.Extension; + } + /** * Executes the task. */ public async Execute() { - try + if (await FileSystem.pathExists(Puppeteer.executablePath())) { - if (await FileSystem.pathExists(Puppeteer.executablePath())) - { - await this.ExecuteTask(); - } - else if ( - await (window.showInformationMessage( - Resources.Resources.Get("UpdateMessage"), - Resources.Resources.Get("Yes"), - Resources.Resources.Get("No")) as Promise) === Resources.Resources.Get("Yes")) - { - let revision = this.Extension.ChromiumRevision; - let success = false; + await this.ExecuteTask(); + } + else if ( + await (window.showInformationMessage( + Resources.Resources.Get("UpdateMessage"), + Resources.Resources.Get("Yes"), + Resources.Resources.Get("No")) as Promise) === Resources.Resources.Get("Yes")) + { + let revision = this.Extension.ChromiumRevision; + let success = false; - do - { - await (window.withProgress( - { - location: ProgressLocation.Notification, - title: Format(Resources.Resources.Get("UpdateRunning"), revision) - }, - async (reporter) => + do + { + await (window.withProgress( + { + location: ProgressLocation.Notification, + title: Format(Resources.Resources.Get("UpdateRunning"), revision) + }, + async (reporter) => + { + try { - try - { - let progress = 0; - let browserFetcher = (Puppeteer as any).createBrowserFetcher(); + let progress = 0; + let browserFetcher = (Puppeteer as any).createBrowserFetcher(); - await browserFetcher.download( - revision, - (downloadBytes: number, totalBytes: number) => - { - let newProgress = Math.floor((downloadBytes / totalBytes) * 100); + await browserFetcher.download( + revision, + (downloadBytes: number, totalBytes: number) => + { + let newProgress = Math.floor((downloadBytes / totalBytes) * 100); - if (newProgress > progress) - { - reporter.report({ - increment: newProgress - progress - }); - - progress = newProgress; - } - }); + if (newProgress > progress) + { + reporter.report({ + increment: newProgress - progress + }); - window.showInformationMessage(Resources.Resources.Get("UpdateSuccess")); - success = true; - } - catch - { - success = false; - } - }) as Promise); - } - while ( - !await FileSystem.pathExists(Puppeteer.executablePath()) && - !success && - await (window.showWarningMessage( - Resources.Resources.Get("UpdateFailed"), - Resources.Resources.Get("Yes"), - Resources.Resources.Get("No")) as Promise) === Resources.Resources.Get("Yes")); - } - } - catch (exception) - { - let message: string; + progress = newProgress; + } + }); - if (exception instanceof Exception) - { - message = exception.Message; - } - else if (exception instanceof Error) - { - message = Format(Resources.Resources.Get("UnknownException"), exception.name, exception.message); - } - else - { - message = `${exception}`; + window.showInformationMessage(Resources.Resources.Get("UpdateSuccess")); + success = true; + } + catch + { + success = false; + } + }) as Promise); } - - window.showErrorMessage(message); + while ( + !await FileSystem.pathExists(Puppeteer.executablePath()) && + !success && + await (window.showWarningMessage( + Resources.Resources.Get("UpdateFailed"), + Resources.Resources.Get("Yes"), + Resources.Resources.Get("No")) as Promise) === Resources.Resources.Get("Yes")); } } diff --git a/src/Tasks/Task.ts b/src/Tasks/Task.ts index e75a6e7d..61dd9597 100644 --- a/src/Tasks/Task.ts +++ b/src/Tasks/Task.ts @@ -1,14 +1,17 @@ -import { Extension } from "../extension"; +import { Extension } from "../System/Extensibility/Extension"; /** * Represents a task. + * + * @template TExtension + * The type of the extension. */ -export abstract class Task +export abstract class Task { /** * The extension this task belongs to. */ - private extension: Extension; + private extension: TExtension; /** * Initializes a new instance of the `Task` class. @@ -16,7 +19,7 @@ export abstract class Task * @param extension * The extension this task belongs to. */ - public constructor(extension: Extension) + public constructor(extension: TExtension) { this.extension = extension; } @@ -29,11 +32,6 @@ export abstract class Task return this.extension; } - public set Extension(value) - { - this.extension = value; - } - /** * Executes the task. */ diff --git a/src/extension.ts b/src/extension.ts index 4ef5ca8f..53f0a499 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,161 +1,10 @@ -import { CultureInfo } from "localized-resource-manager"; -import MarkdownIt = require("markdown-it"); -import Path = require("path"); -import { commands, env, ExtensionContext, TextEditor, Uri, ViewColumn, window, workspace } from "vscode"; -import { Resources } from "./Properties/Resources"; -import { ChainTask } from "./Tasks/ChainTask"; -import { ConvertAllTask } from "./Tasks/ConvertAllTask"; -import { ConvertTask } from "./Tasks/ConvertTask"; - -/** - * Represens the extension itself. - */ -export class Extension -{ - /** - * The context of the extension. - */ - private context: ExtensionContext = null; - - /** - * The parser provided by `Visual Studio Code` - */ - private vsCodeParser: MarkdownIt = null; - - /** - * A `TextEditor` which is used for triggering the `extendMarkdownIt`-method. - */ - private systemParserFixEditor: TextEditor; - - /** - * A method for resolving the system-parser fix. - */ - private systemParserFixResolver: () => void; - - /** - * Initializes a new instance of the `Extension` class. - */ - public constructor() - { - this.systemParserFixResolver = () => { }; - Resources.Culture = new CultureInfo(env.language); - } - - /** - * Gets the context of the extension. - */ - public get Context() - { - return this.context; - } - - /** - * Gets the parser provided by Visual Studio Code. - */ - public get VSCodeParser() - { - return this.vsCodeParser; - } - - /** - * Gets the chromium-revision of the extension. - */ - public get ChromiumRevision(): string - { - return require(Path.join("..", "node_modules", "puppeteer", "package.json"))["puppeteer"]["chromium_revision"]; - } - - /** - * Activates the extension. - * - * @param context - * A collection of utilities private to an extension. - */ - public async Activate(context: ExtensionContext) - { - this.context = context; - - context.subscriptions.push( - commands.registerCommand("markdownConverter.Convert", async () => this.Convert()), - commands.registerCommand("markdownConverter.ConvertAll", async () => this.ConvertAll()), - commands.registerCommand("markdownConverter.Chain", async () => this.Chain())); - - return { - extendMarkdownIt: (md: any) => - { - this.vsCodeParser = md; - - if (window.activeTextEditor === this.systemParserFixEditor) - { - commands.executeCommand("workbench.action.closeActiveEditor"); - } - - this.systemParserFixResolver(); - - return md; - } - }; - } - - /** - * Disposes the extension. - */ - public async Dispose() - { - } - - /** - * Enables the system-parser. - */ - public async EnableSystemParser() - { - let document = await workspace.openTextDocument(Uri.parse("untitled:MarkdownConverter.md")); - - let result = new Promise( - (resolve) => - { - this.systemParserFixResolver = resolve; - }); - - this.systemParserFixEditor = await window.showTextDocument( - document, - { - viewColumn: ViewColumn.Beside, - preview: true - }); - - return result; - } - - /** - * Converts an opened `TextDocument`. - */ - protected async Convert() - { - await new ConvertTask(this).Execute(); - } - - /** - * Converts all documents in the workspace. - */ - protected async ConvertAll() - { - await new ConvertAllTask(this).Execute(); - } - - /** - * Chains multiple documents together. - */ - protected async Chain() - { - await new ChainTask(this).Execute(); - } -} +import { ExtensionContext } from "vscode"; +import { MarkdownConverterExtension } from "./MarkdownConverterExtension"; /** * An instance of the extension. */ -const extension = new Extension(); +const extension = new MarkdownConverterExtension(); /** * Activates the extension. From f214b7e8b2d60430a600615b66038f7845d8f96c Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 17 Aug 2019 22:32:01 +0200 Subject: [PATCH 60/77] Rework the markdown-contributions --- .../Extensibility}/MarkdownContributions.ts | 14 ++++++++++++-- src/Tasks/ConversionRunner.ts | 2 +- src/Tasks/ConvertTask.ts | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) rename src/{ => System/Extensibility}/MarkdownContributions.ts (91%) diff --git a/src/MarkdownContributions.ts b/src/System/Extensibility/MarkdownContributions.ts similarity index 91% rename from src/MarkdownContributions.ts rename to src/System/Extensibility/MarkdownContributions.ts index 8a460c26..a222c4cb 100644 --- a/src/MarkdownContributions.ts +++ b/src/System/Extensibility/MarkdownContributions.ts @@ -165,7 +165,12 @@ export class MarkdownContributions */ private LoadScripts(contributes: any, extension: Extension) { - this.scripts.push(...MarkdownContributions.ResolveExtensionResources(extension, contributes["markdown.previewScripts"])); + let scripts = contributes["markdown.previewScripts"]; + + if (scripts instanceof Array) + { + this.scripts.push(...MarkdownContributions.ResolveExtensionResources(extension, scripts)); + } } /** @@ -203,6 +208,11 @@ export class MarkdownContributions */ private tryLoadPreviewStyles(contributes: any, extension: Extension) { - this.styles.push(...MarkdownContributions.ResolveExtensionResources(extension, contributes["markdown.previewStyles"])); + let styles = contributes["markdown.previewStyles"]; + + if (styles instanceof Array) + { + this.styles.push(...MarkdownContributions.ResolveExtensionResources(extension, styles)); + } } } \ No newline at end of file diff --git a/src/Tasks/ConversionRunner.ts b/src/Tasks/ConversionRunner.ts index a71f4087..97906e9a 100644 --- a/src/Tasks/ConversionRunner.ts +++ b/src/Tasks/ConversionRunner.ts @@ -17,7 +17,6 @@ import { isNullOrUndefined } from "util"; import { TextDocument, window, workspace, WorkspaceFolder } from "vscode"; import { ConversionType } from "../Conversion/ConversionType"; import { Converter } from "../Conversion/Converter"; -import { MarkdownContributions } from "../MarkdownContributions"; import { MarkdownConverterExtension } from "../MarkdownConverterExtension"; import { Resources } from "../Properties/Resources"; import { Settings } from "../Properties/Settings"; @@ -25,6 +24,7 @@ import { Document } from "../System/Documents/Document"; import { EmojiType } from "../System/Documents/EmojiType"; import { ListType } from "../System/Documents/ListType"; import { Slugifier } from "../System/Documents/Slugifier"; +import { MarkdownContributions } from "../System/Extensibility/MarkdownContributions"; import { FileException } from "../System/IO/FileException"; import { Utilities } from "../Utilities"; diff --git a/src/Tasks/ConvertTask.ts b/src/Tasks/ConvertTask.ts index 62083e16..466c0191 100644 --- a/src/Tasks/ConvertTask.ts +++ b/src/Tasks/ConvertTask.ts @@ -23,7 +23,7 @@ export class ConvertTask extends ConversionTask /** * @inheritdoc */ - public async ExecuteTask() + protected async ExecuteTask() { return this.ConversionRunner.Execute(this.GetMarkdownDocument()); } From a948c2728254b92aaf2e5473265adf9d2afa6ea1 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 17 Aug 2019 22:33:11 +0200 Subject: [PATCH 61/77] Fix the malworking SystemParser-fix --- src/System/Extensibility/Extension.ts | 35 ++++++++++++++++----------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/System/Extensibility/Extension.ts b/src/System/Extensibility/Extension.ts index 0b11ad4a..82f49211 100644 --- a/src/System/Extensibility/Extension.ts +++ b/src/System/Extensibility/Extension.ts @@ -25,6 +25,11 @@ export class Extension */ private systemParserFixEditor: TextEditor; + /** + * A promise for waiting for the system-parser to be fixed. + */ + private systemParserFixPromise: Promise; + /** * A method for resolving the system-parser fix. */ @@ -35,7 +40,12 @@ export class Extension */ public constructor() { - this.systemParserFixResolver = () => { }; + this.systemParserFixPromise = new Promise( + (resolve) => + { + this.systemParserFixResolver = resolve; + }); + Resources.Culture = new CultureInfo(env.language); } @@ -96,20 +106,17 @@ export class Extension { let document = await workspace.openTextDocument(Uri.parse("untitled:.md")); - let result = new Promise( - (resolve) => - { - this.systemParserFixResolver = resolve; - }); - - this.systemParserFixEditor = await window.showTextDocument( - document, - { - viewColumn: ViewColumn.Beside, - preview: true - }); + if (!this.VSCodeParser) + { + this.systemParserFixEditor = await window.showTextDocument( + document, + { + viewColumn: ViewColumn.Beside, + preview: true + }); + } - return result; + return this.systemParserFixPromise; } /** From f20c2bb97a26b4fd7c7a58dfb8a3ed715dcb7abe Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 17 Aug 2019 22:33:35 +0200 Subject: [PATCH 62/77] Move the chromium-prompt to the extension-class --- src/MarkdownConverterExtension.ts | 87 +++++++++++++++++++++++++- src/Tasks/ChromiumNotFoundException.ts | 7 +++ src/Tasks/PuppeteerTask.ts | 61 +----------------- 3 files changed, 96 insertions(+), 59 deletions(-) create mode 100644 src/Tasks/ChromiumNotFoundException.ts diff --git a/src/MarkdownConverterExtension.ts b/src/MarkdownConverterExtension.ts index 56653643..a2cf068b 100644 --- a/src/MarkdownConverterExtension.ts +++ b/src/MarkdownConverterExtension.ts @@ -1,9 +1,15 @@ +import FileSystem = require("fs-extra"); import Path = require("path"); -import { commands, ExtensionContext } from "vscode"; +import Puppeteer = require("puppeteer"); +import Format = require("string-template"); +import { commands, ExtensionContext, ProgressLocation, window } from "vscode"; +import { Resources } from "./Properties/Resources"; import { Extension } from "./System/Extensibility/Extension"; import { ChainTask } from "./Tasks/ChainTask"; +import { ChromiumNotFoundException } from "./Tasks/ChromiumNotFoundException"; import { ConvertAllTask } from "./Tasks/ConvertAllTask"; import { ConvertTask } from "./Tasks/ConvertTask"; +import { Task } from "./Tasks/Task"; /** * Represents the `Markdown Converter` extension. @@ -30,4 +36,83 @@ export class MarkdownConverterExtension extends Extension return super.Active(context); } + + /** + * @inheritdoc + */ + protected async ExecuteTaskInternal(task: Task) + { + try + { + await super.ExecuteTaskInternal(task); + } + catch (exception) + { + if (exception instanceof ChromiumNotFoundException) + { + if ( + await (window.showInformationMessage( + Resources.Resources.Get("UpdateMessage"), + Resources.Resources.Get("Yes"), + Resources.Resources.Get("No"))) === Resources.Resources.Get("Yes")) + { + let revision = this.ChromiumRevision; + let success = false; + + do + { + await (window.withProgress( + { + location: ProgressLocation.Notification, + title: Format(Resources.Resources.Get("UpdateRunning"), revision) + }, + async (reporter) => + { + try + { + let progress = 0; + let browserFetcher = Puppeteer.createBrowserFetcher(); + + await browserFetcher.download( + revision, + (downloadBytes, totalBytes) => + { + let newProgress = Math.floor((downloadBytes / totalBytes) * 100); + + if (newProgress > progress) + { + reporter.report( + { + increment: newProgress - progress + }); + + progress = newProgress; + } + }); + + window.showInformationMessage(Resources.Resources.Get("UpdateSuccess")); + success = true; + return this.ExecuteTaskInternal(task); + } + catch + { + success = false; + } + })); + } + while ( + !await FileSystem.pathExists(Puppeteer.executablePath()) && + !success && + await (window.showWarningMessage( + Resources.Resources.Get("UpdateFailed"), + Resources.Resources.Get("Yes"), + Resources.Resources.Get("No"))) === Resources.Resources.Get("Yes")); + } + } + else + { + throw exception; + } + } + } } \ No newline at end of file diff --git a/src/Tasks/ChromiumNotFoundException.ts b/src/Tasks/ChromiumNotFoundException.ts new file mode 100644 index 00000000..ea11c76c --- /dev/null +++ b/src/Tasks/ChromiumNotFoundException.ts @@ -0,0 +1,7 @@ +import { Exception } from "../System/Exception"; + +/** + * An exception that occurrs when chromium could not be found or is not installed. + */ +export class ChromiumNotFoundException extends Exception +{ } \ No newline at end of file diff --git a/src/Tasks/PuppeteerTask.ts b/src/Tasks/PuppeteerTask.ts index bfdc12c2..f37fb723 100644 --- a/src/Tasks/PuppeteerTask.ts +++ b/src/Tasks/PuppeteerTask.ts @@ -1,10 +1,7 @@ import FileSystem = require("fs-extra"); import Puppeteer = require("puppeteer"); -import Format = require("string-template"); -import { ProgressLocation, window } from "vscode"; import { MarkdownConverterExtension } from "../MarkdownConverterExtension"; -import { Resources } from "../Properties/Resources"; -import { Exception } from "../System/Exception"; +import { ChromiumNotFoundException } from "./ChromiumNotFoundException"; import { Task } from "./Task"; /** @@ -40,61 +37,9 @@ export abstract class PuppeteerTask extends Task { await this.ExecuteTask(); } - else if ( - await (window.showInformationMessage( - Resources.Resources.Get("UpdateMessage"), - Resources.Resources.Get("Yes"), - Resources.Resources.Get("No")) as Promise) === Resources.Resources.Get("Yes")) + else { - let revision = this.Extension.ChromiumRevision; - let success = false; - - do - { - await (window.withProgress( - { - location: ProgressLocation.Notification, - title: Format(Resources.Resources.Get("UpdateRunning"), revision) - }, - async (reporter) => - { - try - { - let progress = 0; - let browserFetcher = (Puppeteer as any).createBrowserFetcher(); - - await browserFetcher.download( - revision, - (downloadBytes: number, totalBytes: number) => - { - let newProgress = Math.floor((downloadBytes / totalBytes) * 100); - - if (newProgress > progress) - { - reporter.report({ - increment: newProgress - progress - }); - - progress = newProgress; - } - }); - - window.showInformationMessage(Resources.Resources.Get("UpdateSuccess")); - success = true; - } - catch - { - success = false; - } - }) as Promise); - } - while ( - !await FileSystem.pathExists(Puppeteer.executablePath()) && - !success && - await (window.showWarningMessage( - Resources.Resources.Get("UpdateFailed"), - Resources.Resources.Get("Yes"), - Resources.Resources.Get("No")) as Promise) === Resources.Resources.Get("Yes")); + throw new ChromiumNotFoundException(); } } From d90146ea21c02695dcf8fcd36e44dd3c3acfdbc0 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 17 Aug 2019 23:25:33 +0200 Subject: [PATCH 63/77] Externalize the file-reports to the extension-class --- src/Conversion/IConvertedFile.ts | 17 ++++++++ src/MarkdownConverterExtension.ts | 64 +++++++++++++++++++++++++++++-- src/Tasks/ChainTask.ts | 7 ++-- src/Tasks/ConversionRunner.ts | 43 ++++++++------------- src/Tasks/ConvertAllTask.ts | 11 +++--- src/Tasks/ConvertTask.ts | 7 ++-- src/Tasks/PuppeteerTask.ts | 11 ++++-- 7 files changed, 114 insertions(+), 46 deletions(-) create mode 100644 src/Conversion/IConvertedFile.ts diff --git a/src/Conversion/IConvertedFile.ts b/src/Conversion/IConvertedFile.ts new file mode 100644 index 00000000..9dfc7bb9 --- /dev/null +++ b/src/Conversion/IConvertedFile.ts @@ -0,0 +1,17 @@ +import { ConversionType } from "./ConversionType"; + +/** + * Provides information about a converted file. + */ +export interface IConvertedFile +{ + /** + * The type of the converted file. + */ + Type: ConversionType; + + /** + * The name of the converted file. + */ + FileName: string; +} \ No newline at end of file diff --git a/src/MarkdownConverterExtension.ts b/src/MarkdownConverterExtension.ts index a2cf068b..8090de52 100644 --- a/src/MarkdownConverterExtension.ts +++ b/src/MarkdownConverterExtension.ts @@ -1,21 +1,64 @@ +import ChildProcess = require("child_process"); import FileSystem = require("fs-extra"); import Path = require("path"); import Puppeteer = require("puppeteer"); import Format = require("string-template"); -import { commands, ExtensionContext, ProgressLocation, window } from "vscode"; +import { commands, ExtensionContext, Progress, ProgressLocation, window } from "vscode"; +import { ConversionType } from "./Conversion/ConversionType"; +import { IConvertedFile } from "./Conversion/IConvertedFile"; import { Resources } from "./Properties/Resources"; import { Extension } from "./System/Extensibility/Extension"; import { ChainTask } from "./Tasks/ChainTask"; import { ChromiumNotFoundException } from "./Tasks/ChromiumNotFoundException"; import { ConvertAllTask } from "./Tasks/ConvertAllTask"; import { ConvertTask } from "./Tasks/ConvertTask"; -import { Task } from "./Tasks/Task"; +import { PuppeteerTask } from "./Tasks/PuppeteerTask"; /** * Represents the `Markdown Converter` extension. */ export class MarkdownConverterExtension extends Extension { + /** + * Provides the functionality to report converted files. + */ + private fileReporter: Progress; + + /** + * Initializes a new instance of the `MarkdownConverterExtension` class. + */ + public constructor() + { + super(); + this.fileReporter = { + async report(file) + { + let result = await (window.showInformationMessage( + Format(Resources.Resources.Get("SuccessMessage"), ConversionType[file.Type], file.FileName), + Resources.Resources.Get("OpenFileLabel"))); + + if (result === Resources.Resources.Get("OpenFileLabel")) + { + switch (process.platform) + { + case "win32": + ChildProcess.exec(`"${file.FileName}"`); + break; + case "darwin": + ChildProcess.exec(`bash -c 'open "${file.FileName}"'`); + break; + case "linux": + ChildProcess.exec(`bash -c 'xdg-open "${file.FileName}"'`); + break; + default: + window.showWarningMessage(Resources.Resources.Get("UnsupportedPlatformException")); + break; + } + } + } + }; + } + /** * Gets the chromium-revision of the extension. */ @@ -40,11 +83,24 @@ export class MarkdownConverterExtension extends Extension /** * @inheritdoc */ - protected async ExecuteTaskInternal(task: Task) + protected async ExecuteTaskInternal(task: PuppeteerTask) { try { - await super.ExecuteTaskInternal(task); + let fileReporter: Progress; + + if (task instanceof ConvertAllTask) + { + fileReporter = { + report() { } + }; + } + else + { + fileReporter = this.fileReporter; + } + + task.Execute(fileReporter); } catch (exception) { diff --git a/src/Tasks/ChainTask.ts b/src/Tasks/ChainTask.ts index 9ad80bd3..76c85185 100644 --- a/src/Tasks/ChainTask.ts +++ b/src/Tasks/ChainTask.ts @@ -1,5 +1,6 @@ import { EOL } from "os"; -import { TextDocument, workspace } from "vscode"; +import { Progress, TextDocument, workspace } from "vscode"; +import { IConvertedFile } from "../Conversion/IConvertedFile"; import { MarkdownConverterExtension } from "../MarkdownConverterExtension"; import { ConvertAllTask } from "./ConvertAllTask"; @@ -22,7 +23,7 @@ export class ChainTask extends ConvertAllTask /** * @inheritdoc */ - protected async ExecuteTask() + protected async ExecuteTask(fileReporter?: Progress) { let document: TextDocument; let documents = await this.GetDocuments(); @@ -42,6 +43,6 @@ export class ChainTask extends ConvertAllTask content: contents.join(EOL + EOL) }); - await this.ConversionRunner.Execute(document); + await this.ConversionRunner.Execute(document, fileReporter); } } \ No newline at end of file diff --git a/src/Tasks/ConversionRunner.ts b/src/Tasks/ConversionRunner.ts index 97906e9a..ee743d87 100644 --- a/src/Tasks/ConversionRunner.ts +++ b/src/Tasks/ConversionRunner.ts @@ -10,13 +10,12 @@ import Checkbox = require("markdown-it-checkbox"); import MarkdownItEmoji = require("markdown-it-emoji"); import MarkdownItToc = require("markdown-it-table-of-contents"); import Path = require("path"); -import Format = require("string-template"); -import Transliteration = require("transliteration"); import TwEmoji = require("twemoji"); import { isNullOrUndefined } from "util"; -import { TextDocument, window, workspace, WorkspaceFolder } from "vscode"; +import { Progress, TextDocument, window, workspace, WorkspaceFolder } from "vscode"; import { ConversionType } from "../Conversion/ConversionType"; import { Converter } from "../Conversion/Converter"; +import { IConvertedFile } from "../Conversion/IConvertedFile"; import { MarkdownConverterExtension } from "../MarkdownConverterExtension"; import { Resources } from "../Properties/Resources"; import { Settings } from "../Properties/Settings"; @@ -73,7 +72,7 @@ export class ConversionRunner /** * Executes the underlying `Converter`. */ - public async Execute(document: TextDocument): Promise + public async Execute(document: TextDocument, fileReporter?: Progress): Promise { let tasks: Array> = []; let converter: Converter; @@ -82,6 +81,14 @@ export class ConversionRunner let parsedSourcePath = Path.parse(document.fileName); let currentWorkspace: WorkspaceFolder; + if (!fileReporter) + { + fileReporter = { + report() + { } + }; + } + if (document.isUntitled) { if ((workspace.workspaceFolders || []).length === 1) @@ -224,31 +231,11 @@ export class ConversionRunner await FileSystem.ensureDir(Path.dirname(destinationPath)); await converter.Start(type, destinationPath); - (async () => - { - let result = await (window.showInformationMessage( - Format(Resources.Resources.Get("SuccessMessage"), ConversionType[type], destinationPath), - Resources.Resources.Get("OpenFileLabel")) as Promise); - - if (result === Resources.Resources.Get("OpenFileLabel")) + fileReporter.report( { - switch (process.platform) - { - case "win32": - ChildProcess.exec(`"${destinationPath}"`); - break; - case "darwin": - ChildProcess.exec(`bash -c 'open "${destinationPath}"'`); - break; - case "linux": - ChildProcess.exec(`bash -c 'xdg-open "${destinationPath}"'`); - break; - default: - window.showWarningMessage(Resources.Resources.Get("UnsupportedPlatformException")); - break; - } - } - })(); + Type: type, + FileName: destinationPath + }); })()); } diff --git a/src/Tasks/ConvertAllTask.ts b/src/Tasks/ConvertAllTask.ts index dd996e11..1798de7a 100644 --- a/src/Tasks/ConvertAllTask.ts +++ b/src/Tasks/ConvertAllTask.ts @@ -1,4 +1,5 @@ -import { extensions, TextDocument, workspace } from "vscode"; +import { extensions, Progress, TextDocument, workspace } from "vscode"; +import { IConvertedFile } from "../Conversion/IConvertedFile"; import { MarkdownConverterExtension } from "../MarkdownConverterExtension"; import { MarkdownFileNotFoundException } from "../MarkdownFileNotFoundException"; import { ConversionTask } from "./ConversionTask"; @@ -22,7 +23,7 @@ export class ConvertAllTask extends ConversionTask /** * @inheritdoc */ - public async Execute() + public async Execute(fileReporter?: Progress) { if ((await this.GetDocuments()).length === 0) { @@ -30,18 +31,18 @@ export class ConvertAllTask extends ConversionTask } else { - return super.Execute(); + return super.Execute(fileReporter); } } /** * @inheritdoc */ - protected async ExecuteTask() + protected async ExecuteTask(fileReporter?: Progress) { for (let document of await this.GetDocuments()) { - await this.ConversionRunner.Execute(document); + await this.ConversionRunner.Execute(document, fileReporter); } } diff --git a/src/Tasks/ConvertTask.ts b/src/Tasks/ConvertTask.ts index 466c0191..d17b620e 100644 --- a/src/Tasks/ConvertTask.ts +++ b/src/Tasks/ConvertTask.ts @@ -1,4 +1,5 @@ -import { TextDocument, window } from "vscode"; +import { Progress, TextDocument, window } from "vscode"; +import { IConvertedFile } from "../Conversion/IConvertedFile"; import { MarkdownConverterExtension } from "../MarkdownConverterExtension"; import { MarkdownFileNotFoundException } from "../MarkdownFileNotFoundException"; import { Settings } from "../Properties/Settings"; @@ -23,9 +24,9 @@ export class ConvertTask extends ConversionTask /** * @inheritdoc */ - protected async ExecuteTask() + protected async ExecuteTask(fileReporter?: Progress) { - return this.ConversionRunner.Execute(this.GetMarkdownDocument()); + return this.ConversionRunner.Execute(this.GetMarkdownDocument(), fileReporter); } /** diff --git a/src/Tasks/PuppeteerTask.ts b/src/Tasks/PuppeteerTask.ts index f37fb723..96cc74c4 100644 --- a/src/Tasks/PuppeteerTask.ts +++ b/src/Tasks/PuppeteerTask.ts @@ -1,5 +1,7 @@ import FileSystem = require("fs-extra"); import Puppeteer = require("puppeteer"); +import { Progress } from "vscode"; +import { IConvertedFile } from "../Conversion/IConvertedFile"; import { MarkdownConverterExtension } from "../MarkdownConverterExtension"; import { ChromiumNotFoundException } from "./ChromiumNotFoundException"; import { Task } from "./Task"; @@ -30,12 +32,15 @@ export abstract class PuppeteerTask extends Task /** * Executes the task. + * + * @param fileReporter + * A component for reporting converted files. */ - public async Execute() + public async Execute(fileReporter?: Progress) { if (await FileSystem.pathExists(Puppeteer.executablePath())) { - await this.ExecuteTask(); + await this.ExecuteTask(fileReporter); } else { @@ -46,5 +51,5 @@ export abstract class PuppeteerTask extends Task /** * Executes the task. */ - protected abstract async ExecuteTask(): Promise; + protected abstract async ExecuteTask(fileReporter?: Progress): Promise; } \ No newline at end of file From 58d5f505996a9da5673ab3ac243c25fe890dc235 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 17 Aug 2019 23:39:14 +0200 Subject: [PATCH 64/77] Move the error-output to the extension-class --- src/MarkdownConverterExtension.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/MarkdownConverterExtension.ts b/src/MarkdownConverterExtension.ts index 8090de52..a8e8540a 100644 --- a/src/MarkdownConverterExtension.ts +++ b/src/MarkdownConverterExtension.ts @@ -6,8 +6,11 @@ import Format = require("string-template"); import { commands, ExtensionContext, Progress, ProgressLocation, window } from "vscode"; import { ConversionType } from "./Conversion/ConversionType"; import { IConvertedFile } from "./Conversion/IConvertedFile"; +import { MarkdownFileNotFoundException } from "./MarkdownFileNotFoundException"; import { Resources } from "./Properties/Resources"; import { Extension } from "./System/Extensibility/Extension"; +import { FileException } from "./System/IO/FileException"; +import { YAMLException } from "./System/YAML/YAMLException"; import { ChainTask } from "./Tasks/ChainTask"; import { ChromiumNotFoundException } from "./Tasks/ChromiumNotFoundException"; import { ConvertAllTask } from "./Tasks/ConvertAllTask"; @@ -165,6 +168,13 @@ export class MarkdownConverterExtension extends Extension Resources.Resources.Get("No"))) === Resources.Resources.Get("Yes")); } } + else if ( + exception instanceof FileException || + exception instanceof YAMLException || + exception instanceof MarkdownFileNotFoundException) + { + window.showErrorMessage(exception.Message); + } else { throw exception; From 9272b873ac65944f4d3bc87aee2303f276c0d92c Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 17 Aug 2019 23:42:28 +0200 Subject: [PATCH 65/77] Move all tasks to the system-directory --- src/MarkdownConverterExtension.ts | 10 +++---- src/System/Extensibility/Extension.ts | 2 +- src/{ => System}/Tasks/ChainTask.ts | 4 +-- .../Tasks/ChromiumNotFoundException.ts | 2 +- src/{ => System}/Tasks/ConversionRunner.ts | 26 +++++++++---------- src/{ => System}/Tasks/ConversionTask.ts | 2 +- src/{ => System}/Tasks/ConvertAllTask.ts | 6 ++--- src/{ => System}/Tasks/ConvertTask.ts | 8 +++--- src/{ => System}/Tasks/PuppeteerTask.ts | 4 +-- src/{ => System}/Tasks/Task.ts | 2 +- 10 files changed, 33 insertions(+), 33 deletions(-) rename src/{ => System}/Tasks/ChainTask.ts (89%) rename src/{ => System}/Tasks/ChromiumNotFoundException.ts (75%) rename src/{ => System}/Tasks/ConversionRunner.ts (95%) rename src/{ => System}/Tasks/ConversionTask.ts (91%) rename src/{ => System}/Tasks/ConvertAllTask.ts (92%) rename src/{ => System}/Tasks/ConvertTask.ts (81%) rename src/{ => System}/Tasks/PuppeteerTask.ts (90%) rename src/{ => System}/Tasks/Task.ts (92%) diff --git a/src/MarkdownConverterExtension.ts b/src/MarkdownConverterExtension.ts index a8e8540a..46abda66 100644 --- a/src/MarkdownConverterExtension.ts +++ b/src/MarkdownConverterExtension.ts @@ -11,11 +11,11 @@ import { Resources } from "./Properties/Resources"; import { Extension } from "./System/Extensibility/Extension"; import { FileException } from "./System/IO/FileException"; import { YAMLException } from "./System/YAML/YAMLException"; -import { ChainTask } from "./Tasks/ChainTask"; -import { ChromiumNotFoundException } from "./Tasks/ChromiumNotFoundException"; -import { ConvertAllTask } from "./Tasks/ConvertAllTask"; -import { ConvertTask } from "./Tasks/ConvertTask"; -import { PuppeteerTask } from "./Tasks/PuppeteerTask"; +import { ChainTask } from "./System/Tasks/ChainTask"; +import { ChromiumNotFoundException } from "./System/Tasks/ChromiumNotFoundException"; +import { ConvertAllTask } from "./System/Tasks/ConvertAllTask"; +import { ConvertTask } from "./System/Tasks/ConvertTask"; +import { PuppeteerTask } from "./System/Tasks/PuppeteerTask"; /** * Represents the `Markdown Converter` extension. diff --git a/src/System/Extensibility/Extension.ts b/src/System/Extensibility/Extension.ts index 82f49211..91734cd8 100644 --- a/src/System/Extensibility/Extension.ts +++ b/src/System/Extensibility/Extension.ts @@ -3,7 +3,7 @@ import MarkdownIt = require("markdown-it"); import Format = require("string-template"); import { commands, env, ExtensionContext, TextEditor, Uri, ViewColumn, window, workspace } from "vscode"; import { Resources } from "../../Properties/Resources"; -import { Task } from "../../Tasks/Task"; +import { Task } from "../Tasks/Task"; /** * Represents an extension. diff --git a/src/Tasks/ChainTask.ts b/src/System/Tasks/ChainTask.ts similarity index 89% rename from src/Tasks/ChainTask.ts rename to src/System/Tasks/ChainTask.ts index 76c85185..63024b16 100644 --- a/src/Tasks/ChainTask.ts +++ b/src/System/Tasks/ChainTask.ts @@ -1,7 +1,7 @@ import { EOL } from "os"; import { Progress, TextDocument, workspace } from "vscode"; -import { IConvertedFile } from "../Conversion/IConvertedFile"; -import { MarkdownConverterExtension } from "../MarkdownConverterExtension"; +import { IConvertedFile } from "../../Conversion/IConvertedFile"; +import { MarkdownConverterExtension } from "../../MarkdownConverterExtension"; import { ConvertAllTask } from "./ConvertAllTask"; /** diff --git a/src/Tasks/ChromiumNotFoundException.ts b/src/System/Tasks/ChromiumNotFoundException.ts similarity index 75% rename from src/Tasks/ChromiumNotFoundException.ts rename to src/System/Tasks/ChromiumNotFoundException.ts index ea11c76c..452b8ee3 100644 --- a/src/Tasks/ChromiumNotFoundException.ts +++ b/src/System/Tasks/ChromiumNotFoundException.ts @@ -1,4 +1,4 @@ -import { Exception } from "../System/Exception"; +import { Exception } from "../Exception"; /** * An exception that occurrs when chromium could not be found or is not installed. diff --git a/src/Tasks/ConversionRunner.ts b/src/System/Tasks/ConversionRunner.ts similarity index 95% rename from src/Tasks/ConversionRunner.ts rename to src/System/Tasks/ConversionRunner.ts index ee743d87..00efc211 100644 --- a/src/Tasks/ConversionRunner.ts +++ b/src/System/Tasks/ConversionRunner.ts @@ -13,19 +13,19 @@ import Path = require("path"); import TwEmoji = require("twemoji"); import { isNullOrUndefined } from "util"; import { Progress, TextDocument, window, workspace, WorkspaceFolder } from "vscode"; -import { ConversionType } from "../Conversion/ConversionType"; -import { Converter } from "../Conversion/Converter"; -import { IConvertedFile } from "../Conversion/IConvertedFile"; -import { MarkdownConverterExtension } from "../MarkdownConverterExtension"; -import { Resources } from "../Properties/Resources"; -import { Settings } from "../Properties/Settings"; -import { Document } from "../System/Documents/Document"; -import { EmojiType } from "../System/Documents/EmojiType"; -import { ListType } from "../System/Documents/ListType"; -import { Slugifier } from "../System/Documents/Slugifier"; -import { MarkdownContributions } from "../System/Extensibility/MarkdownContributions"; -import { FileException } from "../System/IO/FileException"; -import { Utilities } from "../Utilities"; +import { ConversionType } from "../../Conversion/ConversionType"; +import { Converter } from "../../Conversion/Converter"; +import { IConvertedFile } from "../../Conversion/IConvertedFile"; +import { MarkdownConverterExtension } from "../../MarkdownConverterExtension"; +import { Resources } from "../../Properties/Resources"; +import { Settings } from "../../Properties/Settings"; +import { Utilities } from "../../Utilities"; +import { Document } from "../Documents/Document"; +import { EmojiType } from "../Documents/EmojiType"; +import { ListType } from "../Documents/ListType"; +import { Slugifier } from "../Documents/Slugifier"; +import { MarkdownContributions } from "../Extensibility/MarkdownContributions"; +import { FileException } from "../IO/FileException"; /** * Provides the functionality to load settings and run a `Converter`. diff --git a/src/Tasks/ConversionTask.ts b/src/System/Tasks/ConversionTask.ts similarity index 91% rename from src/Tasks/ConversionTask.ts rename to src/System/Tasks/ConversionTask.ts index a5472702..97d3ca3e 100644 --- a/src/Tasks/ConversionTask.ts +++ b/src/System/Tasks/ConversionTask.ts @@ -1,4 +1,4 @@ -import { MarkdownConverterExtension } from "../MarkdownConverterExtension"; +import { MarkdownConverterExtension } from "../../MarkdownConverterExtension"; import { ConversionRunner } from "./ConversionRunner"; import { PuppeteerTask } from "./PuppeteerTask"; diff --git a/src/Tasks/ConvertAllTask.ts b/src/System/Tasks/ConvertAllTask.ts similarity index 92% rename from src/Tasks/ConvertAllTask.ts rename to src/System/Tasks/ConvertAllTask.ts index 1798de7a..36fa7804 100644 --- a/src/Tasks/ConvertAllTask.ts +++ b/src/System/Tasks/ConvertAllTask.ts @@ -1,7 +1,7 @@ import { extensions, Progress, TextDocument, workspace } from "vscode"; -import { IConvertedFile } from "../Conversion/IConvertedFile"; -import { MarkdownConverterExtension } from "../MarkdownConverterExtension"; -import { MarkdownFileNotFoundException } from "../MarkdownFileNotFoundException"; +import { IConvertedFile } from "../../Conversion/IConvertedFile"; +import { MarkdownConverterExtension } from "../../MarkdownConverterExtension"; +import { MarkdownFileNotFoundException } from "../../MarkdownFileNotFoundException"; import { ConversionTask } from "./ConversionTask"; /** diff --git a/src/Tasks/ConvertTask.ts b/src/System/Tasks/ConvertTask.ts similarity index 81% rename from src/Tasks/ConvertTask.ts rename to src/System/Tasks/ConvertTask.ts index d17b620e..e01281ff 100644 --- a/src/Tasks/ConvertTask.ts +++ b/src/System/Tasks/ConvertTask.ts @@ -1,8 +1,8 @@ import { Progress, TextDocument, window } from "vscode"; -import { IConvertedFile } from "../Conversion/IConvertedFile"; -import { MarkdownConverterExtension } from "../MarkdownConverterExtension"; -import { MarkdownFileNotFoundException } from "../MarkdownFileNotFoundException"; -import { Settings } from "../Properties/Settings"; +import { IConvertedFile } from "../../Conversion/IConvertedFile"; +import { MarkdownConverterExtension } from "../../MarkdownConverterExtension"; +import { MarkdownFileNotFoundException } from "../../MarkdownFileNotFoundException"; +import { Settings } from "../../Properties/Settings"; import { ConversionTask } from "./ConversionTask"; /** diff --git a/src/Tasks/PuppeteerTask.ts b/src/System/Tasks/PuppeteerTask.ts similarity index 90% rename from src/Tasks/PuppeteerTask.ts rename to src/System/Tasks/PuppeteerTask.ts index 96cc74c4..7e680e81 100644 --- a/src/Tasks/PuppeteerTask.ts +++ b/src/System/Tasks/PuppeteerTask.ts @@ -1,8 +1,8 @@ import FileSystem = require("fs-extra"); import Puppeteer = require("puppeteer"); import { Progress } from "vscode"; -import { IConvertedFile } from "../Conversion/IConvertedFile"; -import { MarkdownConverterExtension } from "../MarkdownConverterExtension"; +import { IConvertedFile } from "../../Conversion/IConvertedFile"; +import { MarkdownConverterExtension } from "../../MarkdownConverterExtension"; import { ChromiumNotFoundException } from "./ChromiumNotFoundException"; import { Task } from "./Task"; diff --git a/src/Tasks/Task.ts b/src/System/Tasks/Task.ts similarity index 92% rename from src/Tasks/Task.ts rename to src/System/Tasks/Task.ts index 61dd9597..c7547d17 100644 --- a/src/Tasks/Task.ts +++ b/src/System/Tasks/Task.ts @@ -1,4 +1,4 @@ -import { Extension } from "../System/Extensibility/Extension"; +import { Extension } from "../Extensibility/Extension"; /** * Represents a task. From 928fcca5404273cfc29835c137c9ca3a2acdfe8d Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 18 Aug 2019 01:20:41 +0200 Subject: [PATCH 66/77] Add progress-infos to the tasks This commit fixes #28 --- Resources/MarkdownConverter.de.json | 22 +++++++++++ Resources/MarkdownConverter.json | 22 +++++++++++ src/Conversion/Converter.ts | 47 +++++++++++++++++++++++- src/MarkdownConverterExtension.ts | 16 ++++++-- src/System/Extensibility/Extension.ts | 13 ++++++- src/System/Tasks/ChainTask.ts | 34 +++++++++++++++-- src/System/Tasks/ConversionRunner.ts | 49 ++++++++++++++----------- src/System/Tasks/ConvertAllTask.ts | 53 ++++++++++++++++++++++++--- src/System/Tasks/ConvertTask.ts | 14 ++++++- src/System/Tasks/IProgressState.ts | 15 ++++++++ src/System/Tasks/PuppeteerTask.ts | 7 ++-- src/System/Tasks/Task.ts | 9 ++++- 12 files changed, 259 insertions(+), 42 deletions(-) create mode 100644 src/System/Tasks/IProgressState.ts diff --git a/Resources/MarkdownConverter.de.json b/Resources/MarkdownConverter.de.json index dbac67d8..39949135 100644 --- a/Resources/MarkdownConverter.de.json +++ b/Resources/MarkdownConverter.de.json @@ -14,6 +14,28 @@ "UpdateFailed": "Der download ist fehlgeschlagen.\nMöglicherweise hilft es, \"http.proxy\" oder \"http.proxyStrictSSL\" zu deklarieren, falls Sie eine Proxy nutzen.\nWollen Sie den Download erneut starten?", "DestinationPath": "Bitte geben Sie einen Ordner an, in dem Sie die Ausgabedatei ablegen wollen.", "DestinationPathExample": "Bspw. C:\\Temp oder /tmp/", + "Progress": { + "LaunchWebserver": "Web-Server starten…", + "LaunchChromium": "Chromium-Browser starten…", + "ConversionStarting": "Die Konvertierung der Datei zum {0}-Typ wird gestartet…", + "ResolveFileName": "Ziel-Pfad bestimmen…", + "WriteHTML": "HTML-Datei generieren und schreiben…", + "Scrape": "Dateien und Resourcen abrufen…", + "ScrapeFolder": "Abgerufene Dateien und Resourcen in den Ziel-Ordner verschieben…", + "ChromiumPage": "Website in Chromium öffnen…", + "PDF": "PDF-Datei generieren…", + "Screenshot": "Screenshot aufnehmen…", + "ConverterFinished": "Die Konvertierung der {0}-Datei wurde erfolgreich abgeschlossen", + "SearchDocuments": "Markdown-Dokumente werden gesucht…", + "DocumentsFound": "{0} Markdown-Dokumente wurden gefunden", + "CollectionStep": "Dokument {0} von {1} wird konvertiert…", + "ChainDocuments": "Dokumente verketten…" + }, + "TaskTitle": { + "Convert": "Dokument Konvertieren", + "ConvertAll": "Alle Dokumente Konvertieren", + "Chain": "Alle Dokumente Verketten" + }, "DateTime": { "Formats": { "Default": "dd.MM.yyyy" diff --git a/Resources/MarkdownConverter.json b/Resources/MarkdownConverter.json index 0fbfa34e..9d89c3c0 100644 --- a/Resources/MarkdownConverter.json +++ b/Resources/MarkdownConverter.json @@ -16,6 +16,28 @@ "UpdateFailed": "The download failed.\nYou may want to declare \"http.proxy\" or \"http.proxyStrictSSL\" if you're using a proxy.\nDo you want to retry the download?", "DestinationPath": "Please specify a destination-path to save the document to.", "DestinationPathExample": "e.g. C:\\Temp or /tmp/", + "Progress": { + "LaunchWebserver": "Initializing a web-server…", + "LaunchChromium": "Launching a chromium-instance…", + "ConversionStarting": "Starting to convert the file to the {0}-type…", + "ResolveFileName": "Resolving the destination-filename…", + "WriteHTML": "Rendering and writing html-file…", + "Scrape": "Scraping all files and resources…", + "ScrapeFolder": "Moving the scraped files to the correct folder…", + "ChromiumPage": "Launching the page in chromium…", + "PDF": "Rendering a PDF-file…", + "Screenshot": "Taking a screenshot…", + "ConverterFinished": "The conversion of the {0}-file has finished", + "SearchDocuments": "Searching for markdown-documents…", + "DocumentsFound": "Found {0} markdown-documents", + "CollectionStep": "Converting document {0} out of {1}…", + "ChainDocuments": "Chaining all documents together…" + }, + "TaskTitle": { + "Convert": "Convert Document", + "ConvertAll": "Convert all Documents", + "Chain": "Chain all Documents" + }, "DateTime": { "Formats": { "Default": "yyyy-MM-dd", diff --git a/src/Conversion/Converter.ts b/src/Conversion/Converter.ts index 4ff36e2b..5f27e946 100644 --- a/src/Conversion/Converter.ts +++ b/src/Conversion/Converter.ts @@ -8,9 +8,12 @@ import Puppeteer = require("puppeteer"); import { TempDirectory } from "temp-filesystem"; import URL = require("url"); import { isNullOrUndefined, promisify } from "util"; +import { Progress } from "vscode"; import Scrape = require("website-scraper"); +import { Resources } from "../Properties/Resources"; import { Document } from "../System/Documents/Document"; import { FileException } from "../System/IO/FileException"; +import { IProgressState } from "../System/Tasks/IProgressState"; import { ConversionType } from "./ConversionType"; import { ConverterPlugin } from "./ConverterPlugin"; @@ -139,7 +142,7 @@ export class Converter /** * Initializes the converter. */ - public async Initialize() + public async Initialize(progressReporter?: Progress) { if (this.Initialized || this.Disposed) { @@ -147,6 +150,11 @@ export class Converter } else { + progressReporter.report( + { + message: Resources.Resources.Get("Progress.LaunchWebserver") + }); + this.portNumber = await PortFinder(); this.webServer = (Server.createServer({ root: this.WorkspaceRoot, @@ -157,6 +165,11 @@ export class Converter let browserArguments = ["--disable-web-security"]; + progressReporter.report( + { + message: Resources.Resources.Get("Progress.LaunchChromium") + }); + try { this.browser = await Puppeteer.launch({ @@ -206,7 +219,7 @@ export class Converter * @param path * The path to save the converted file to. */ - public async Start(conversionType: ConversionType, path: string): Promise + public async Start(conversionType: ConversionType, path: string, progressReporter?: Progress): Promise { if (!this.Initialized) { @@ -217,12 +230,22 @@ export class Converter switch (conversionType) { case ConversionType.HTML: + progressReporter.report( + { + message: Resources.Resources.Get("Progress.WriteHTML") + }); + await FileSystem.writeFile(path, await this.Document.Render()); break; case ConversionType.SelfContainedHTML: let tempDir = new TempDirectory(); await FileSystem.remove(tempDir.FullName); + progressReporter.report( + { + message: Resources.Resources.Get("Progress.Scrape") + }); + await Scrape( { urls: [this.URL], @@ -234,6 +257,11 @@ export class Converter ] } as any); + progressReporter.report( + { + message: Resources.Resources.Get("Progress.ScrapeFolder") + }); + for (let filename of await promisify(Glob)("**/*", { cwd: tempDir.FullName })) { if (await FileSystem.pathExists(tempDir.MakePath(filename))) @@ -249,6 +277,11 @@ export class Converter { let page = await this.Browser.newPage(); + progressReporter.report( + { + message: Resources.Resources.Get("Progress.ChromiumPage") + }); + page.on( "request", async request => @@ -299,6 +332,11 @@ export class Converter pdfOptions.footerTemplate = styles + await this.Document.Footer.Render(); } + progressReporter.report( + { + message: Resources.Resources.Get("Progress.PDF") + }); + await page.pdf(pdfOptions); break; default: @@ -312,6 +350,11 @@ export class Converter screenshotOptions.quality = this.Document.Quality; } + progressReporter.report( + { + message: Resources.Resources.Get("Progress.Screenshot") + }); + await page.screenshot(screenshotOptions); break; } diff --git a/src/MarkdownConverterExtension.ts b/src/MarkdownConverterExtension.ts index 46abda66..10543c67 100644 --- a/src/MarkdownConverterExtension.ts +++ b/src/MarkdownConverterExtension.ts @@ -10,12 +10,12 @@ import { MarkdownFileNotFoundException } from "./MarkdownFileNotFoundException"; import { Resources } from "./Properties/Resources"; import { Extension } from "./System/Extensibility/Extension"; import { FileException } from "./System/IO/FileException"; -import { YAMLException } from "./System/YAML/YAMLException"; import { ChainTask } from "./System/Tasks/ChainTask"; import { ChromiumNotFoundException } from "./System/Tasks/ChromiumNotFoundException"; import { ConvertAllTask } from "./System/Tasks/ConvertAllTask"; import { ConvertTask } from "./System/Tasks/ConvertTask"; import { PuppeteerTask } from "./System/Tasks/PuppeteerTask"; +import { YAMLException } from "./System/YAML/YAMLException"; /** * Represents the `Markdown Converter` extension. @@ -95,7 +95,8 @@ export class MarkdownConverterExtension extends Extension if (task instanceof ConvertAllTask) { fileReporter = { - report() { } + report() + { } }; } else @@ -103,7 +104,16 @@ export class MarkdownConverterExtension extends Extension fileReporter = this.fileReporter; } - task.Execute(fileReporter); + window.withProgress( + { + cancellable: true, + location: ProgressLocation.Notification, + title: task.Title + }, + async (progressReporter) => + { + await task.Execute(progressReporter, fileReporter); + }); } catch (exception) { diff --git a/src/System/Extensibility/Extension.ts b/src/System/Extensibility/Extension.ts index 91734cd8..cf36c579 100644 --- a/src/System/Extensibility/Extension.ts +++ b/src/System/Extensibility/Extension.ts @@ -1,7 +1,7 @@ import { CultureInfo } from "culture-info"; import MarkdownIt = require("markdown-it"); import Format = require("string-template"); -import { commands, env, ExtensionContext, TextEditor, Uri, ViewColumn, window, workspace } from "vscode"; +import { commands, env, ExtensionContext, ProgressLocation, TextEditor, Uri, ViewColumn, window, workspace } from "vscode"; import { Resources } from "../../Properties/Resources"; import { Task } from "../Tasks/Task"; @@ -156,6 +156,15 @@ export class Extension */ protected async ExecuteTaskInternal(task: Task) { - return task.Execute(); + return window.withProgress( + { + cancellable: true, + location: ProgressLocation.Notification, + title: task.Title + }, + async (progressReporter) => + { + await task.Execute(progressReporter); + }); } } \ No newline at end of file diff --git a/src/System/Tasks/ChainTask.ts b/src/System/Tasks/ChainTask.ts index 63024b16..be442c24 100644 --- a/src/System/Tasks/ChainTask.ts +++ b/src/System/Tasks/ChainTask.ts @@ -1,8 +1,11 @@ import { EOL } from "os"; +import Format = require("string-template"); import { Progress, TextDocument, workspace } from "vscode"; import { IConvertedFile } from "../../Conversion/IConvertedFile"; import { MarkdownConverterExtension } from "../../MarkdownConverterExtension"; +import { Resources } from "../../Properties/Resources"; import { ConvertAllTask } from "./ConvertAllTask"; +import { IProgressState } from "./IProgressState"; /** * Represents a task for chaining multiple documents. @@ -23,12 +26,37 @@ export class ChainTask extends ConvertAllTask /** * @inheritdoc */ - protected async ExecuteTask(fileReporter?: Progress) + public get Title() + { + return Resources.Resources.Get("TaskTitle.Chain"); + } + + /** + * @inheritdoc + */ + protected async ExecuteTask(progressReporter: Progress, fileReporter?: Progress) { let document: TextDocument; - let documents = await this.GetDocuments(); + let documents: TextDocument[] = []; let contents: string[]; + progressReporter.report( + { + message: Resources.Resources.Get("Progress.SearchDocuments") + }); + + documents = await this.GetDocuments(); + + progressReporter.report( + { + message: Format(Resources.Resources.Get("Progress.DocumentsFound"), documents.length) + }); + + progressReporter.report( + { + message: Resources.Resources.Get("Progress.ChainDocuments") + }); + documents.sort( (x, y) => { @@ -43,6 +71,6 @@ export class ChainTask extends ConvertAllTask content: contents.join(EOL + EOL) }); - await this.ConversionRunner.Execute(document, fileReporter); + await this.ConversionRunner.Execute(document, progressReporter, fileReporter); } } \ No newline at end of file diff --git a/src/System/Tasks/ConversionRunner.ts b/src/System/Tasks/ConversionRunner.ts index 00efc211..5a9752c9 100644 --- a/src/System/Tasks/ConversionRunner.ts +++ b/src/System/Tasks/ConversionRunner.ts @@ -1,4 +1,3 @@ -import ChildProcess = require("child_process"); import Clone = require("clone"); import { CultureInfo } from "culture-info"; import Template = require("es6-template-string"); @@ -10,6 +9,7 @@ import Checkbox = require("markdown-it-checkbox"); import MarkdownItEmoji = require("markdown-it-emoji"); import MarkdownItToc = require("markdown-it-table-of-contents"); import Path = require("path"); +import Format = require("string-template"); import TwEmoji = require("twemoji"); import { isNullOrUndefined } from "util"; import { Progress, TextDocument, window, workspace, WorkspaceFolder } from "vscode"; @@ -26,6 +26,7 @@ import { ListType } from "../Documents/ListType"; import { Slugifier } from "../Documents/Slugifier"; import { MarkdownContributions } from "../Extensibility/MarkdownContributions"; import { FileException } from "../IO/FileException"; +import { IProgressState } from "./IProgressState"; /** * Provides the functionality to load settings and run a `Converter`. @@ -72,7 +73,7 @@ export class ConversionRunner /** * Executes the underlying `Converter`. */ - public async Execute(document: TextDocument, fileReporter?: Progress): Promise + public async Execute(document: TextDocument, progressReporter?: Progress, fileReporter?: Progress): Promise { let tasks: Array> = []; let converter: Converter; @@ -89,6 +90,14 @@ export class ConversionRunner }; } + if (!progressReporter) + { + progressReporter = { + report() + { } + }; + } + if (document.isUntitled) { if ((workspace.workspaceFolders || []).length === 1) @@ -107,7 +116,7 @@ export class ConversionRunner workspaceRoot = !isNullOrUndefined(currentWorkspace) ? currentWorkspace.uri.fsPath : null; converter = await this.LoadConverter(workspaceRoot || documentFolder, document); - await converter.Initialize(); + await converter.Initialize(progressReporter); for (let type of Settings.Default.ConversionType) { @@ -120,6 +129,11 @@ export class ConversionRunner let extension: string; let context: object; + progressReporter.report( + { + message: Format(Resources.Resources.Get("Progress.ConversionStarting"), ConversionType[type]) + }); + switch (type) { case ConversionType.SelfContainedHTML: @@ -173,25 +187,13 @@ export class ConversionRunner this.basename = parsedSourcePath.name; this.extension = extension; } - - /** - * Either the path of the workspace-folder or the path to the folder of the document. - */ - public get workspaceFolder() - { - workspaceFolderRequired = isNullOrUndefined(workspaceFolder); - - if (workspaceFolderRequired) - { - return ""; - } - else - { - return workspaceFolder; - } - } }(); + progressReporter.report( + { + message: Resources.Resources.Get("Progress.ResolveFileName") + }); + do { try @@ -229,7 +231,12 @@ export class ConversionRunner while (workspaceFolderRequired); await FileSystem.ensureDir(Path.dirname(destinationPath)); - await converter.Start(type, destinationPath); + await converter.Start(type, destinationPath, progressReporter); + + progressReporter.report( + { + message: Format("ConverterFinished", ConversionType[type]) + }); fileReporter.report( { diff --git a/src/System/Tasks/ConvertAllTask.ts b/src/System/Tasks/ConvertAllTask.ts index 36fa7804..b789da1b 100644 --- a/src/System/Tasks/ConvertAllTask.ts +++ b/src/System/Tasks/ConvertAllTask.ts @@ -1,8 +1,11 @@ +import Format = require("string-template"); import { extensions, Progress, TextDocument, workspace } from "vscode"; import { IConvertedFile } from "../../Conversion/IConvertedFile"; import { MarkdownConverterExtension } from "../../MarkdownConverterExtension"; import { MarkdownFileNotFoundException } from "../../MarkdownFileNotFoundException"; +import { Resources } from "../../Properties/Resources"; import { ConversionTask } from "./ConversionTask"; +import { IProgressState } from "./IProgressState"; /** * Represents a task for converting all documents in the workspace. @@ -23,7 +26,15 @@ export class ConvertAllTask extends ConversionTask /** * @inheritdoc */ - public async Execute(fileReporter?: Progress) + public get Title() + { + return Resources.Resources.Get("TaskTitle.ConvertAll"); + } + + /** + * @inheritdoc + */ + public async Execute(progressReporter?: Progress, fileReporter?: Progress) { if ((await this.GetDocuments()).length === 0) { @@ -31,18 +42,50 @@ export class ConvertAllTask extends ConversionTask } else { - return super.Execute(fileReporter); + return super.Execute(progressReporter, fileReporter); } } /** * @inheritdoc */ - protected async ExecuteTask(fileReporter?: Progress) + protected async ExecuteTask(progressReporter?: Progress, fileReporter?: Progress) { - for (let document of await this.GetDocuments()) + let documents: TextDocument[]; + let totalCount: number; + let progress = 0; + + progressReporter.report( + { + message: Resources.Resources.Get("Progress.SearchDocuments") + }); + + documents = await this.GetDocuments(); + totalCount = documents.length; + + progressReporter.report( + { + message: Format(Resources.Resources.Get("Progress.DocumentsFound"), totalCount) + }); + + for (let i = 0; i < documents.length; i++) { - await this.ConversionRunner.Execute(document, fileReporter); + let document = documents[i]; + let progressState: IProgressState = {}; + let newProgress = ((i + 1) / totalCount) * 100; + + progressState = { + message: Format(Resources.Resources.Get("Progress.CollectionStep"), i + 1, totalCount) + }; + + if (newProgress > progress) + { + progressState.increment = newProgress - progress; + progress = newProgress; + } + + await this.ConversionRunner.Execute(document, null, fileReporter); + progressReporter.report(progressState); } } diff --git a/src/System/Tasks/ConvertTask.ts b/src/System/Tasks/ConvertTask.ts index e01281ff..488b0129 100644 --- a/src/System/Tasks/ConvertTask.ts +++ b/src/System/Tasks/ConvertTask.ts @@ -2,8 +2,10 @@ import { Progress, TextDocument, window } from "vscode"; import { IConvertedFile } from "../../Conversion/IConvertedFile"; import { MarkdownConverterExtension } from "../../MarkdownConverterExtension"; import { MarkdownFileNotFoundException } from "../../MarkdownFileNotFoundException"; +import { Resources } from "../../Properties/Resources"; import { Settings } from "../../Properties/Settings"; import { ConversionTask } from "./ConversionTask"; +import { IProgressState } from "./IProgressState"; /** * Represens a task for converting the currently opened document. @@ -24,9 +26,17 @@ export class ConvertTask extends ConversionTask /** * @inheritdoc */ - protected async ExecuteTask(fileReporter?: Progress) + public get Title() { - return this.ConversionRunner.Execute(this.GetMarkdownDocument(), fileReporter); + return Resources.Resources.Get("TaskTitle.Convert"); + } + + /** + * @inheritdoc + */ + protected async ExecuteTask(progressReporter?: Progress, fileReporter?: Progress) + { + return this.ConversionRunner.Execute(this.GetMarkdownDocument(), progressReporter, fileReporter); } /** diff --git a/src/System/Tasks/IProgressState.ts b/src/System/Tasks/IProgressState.ts new file mode 100644 index 00000000..a55ea013 --- /dev/null +++ b/src/System/Tasks/IProgressState.ts @@ -0,0 +1,15 @@ +/** + * Provides information about the progress. + */ +export interface IProgressState +{ + /** + * The message of the progress. + */ + message?: string; + + /** + * The increment of the percentage of the progress. + */ + increment?: number; +} \ No newline at end of file diff --git a/src/System/Tasks/PuppeteerTask.ts b/src/System/Tasks/PuppeteerTask.ts index 7e680e81..831d90c0 100644 --- a/src/System/Tasks/PuppeteerTask.ts +++ b/src/System/Tasks/PuppeteerTask.ts @@ -4,6 +4,7 @@ import { Progress } from "vscode"; import { IConvertedFile } from "../../Conversion/IConvertedFile"; import { MarkdownConverterExtension } from "../../MarkdownConverterExtension"; import { ChromiumNotFoundException } from "./ChromiumNotFoundException"; +import { IProgressState } from "./IProgressState"; import { Task } from "./Task"; /** @@ -36,11 +37,11 @@ export abstract class PuppeteerTask extends Task * @param fileReporter * A component for reporting converted files. */ - public async Execute(fileReporter?: Progress) + public async Execute(progressReporter?: Progress, fileReporter?: Progress) { if (await FileSystem.pathExists(Puppeteer.executablePath())) { - await this.ExecuteTask(fileReporter); + await this.ExecuteTask(progressReporter, fileReporter); } else { @@ -51,5 +52,5 @@ export abstract class PuppeteerTask extends Task /** * Executes the task. */ - protected abstract async ExecuteTask(fileReporter?: Progress): Promise; + protected abstract async ExecuteTask(progressReporter?: Progress, fileReporter?: Progress): Promise; } \ No newline at end of file diff --git a/src/System/Tasks/Task.ts b/src/System/Tasks/Task.ts index c7547d17..18afee0d 100644 --- a/src/System/Tasks/Task.ts +++ b/src/System/Tasks/Task.ts @@ -1,4 +1,6 @@ +import { Progress } from "vscode"; import { Extension } from "../Extensibility/Extension"; +import { IProgressState } from "./IProgressState"; /** * Represents a task. @@ -32,8 +34,13 @@ export abstract class Task return this.extension; } + /** + * Gets the title of the task. + */ + public abstract get Title(): string; + /** * Executes the task. */ - public abstract async Execute(): Promise; + public abstract async Execute(progressReporter?: Progress): Promise; } \ No newline at end of file From 7f8b58462ae2f348a63777d8cb03d2fa3398b5a4 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 18 Aug 2019 01:59:31 +0200 Subject: [PATCH 67/77] Provide the functionality to show files after converting all This commit fixes #26 --- Resources/MarkdownConverter.json | 1 + src/MarkdownConverterExtension.ts | 55 +++++++++++++++++++++---------- 2 files changed, 38 insertions(+), 18 deletions(-) diff --git a/Resources/MarkdownConverter.json b/Resources/MarkdownConverter.json index 9d89c3c0..43f23998 100644 --- a/Resources/MarkdownConverter.json +++ b/Resources/MarkdownConverter.json @@ -1,5 +1,6 @@ { "SuccessMessage": "Successfully wrote the {0}-file to \"{1}\".", + "CollectionFinished": "The documents have been converted successfully. Do you want to show info about the files?", "OpenFileLabel": "Open File", "UncaughtException": "An unexpected error occurred", "UnknownException": "{{UncaughtException}}:\n{0}: {1}", diff --git a/src/MarkdownConverterExtension.ts b/src/MarkdownConverterExtension.ts index 10543c67..135f72ce 100644 --- a/src/MarkdownConverterExtension.ts +++ b/src/MarkdownConverterExtension.ts @@ -90,30 +90,49 @@ export class MarkdownConverterExtension extends Extension { try { - let fileReporter: Progress; + let run = async (fileReporter: Progress) => + { + await window.withProgress( + { + cancellable: true, + location: ProgressLocation.Notification, + title: task.Title + }, + async (progressReporter) => + { + await task.Execute(progressReporter, fileReporter); + }); + }; - if (task instanceof ConvertAllTask) + if (task instanceof ConvertAllTask && + !(task instanceof ChainTask)) { - fileReporter = { - report() - { } - }; + let files: IConvertedFile[] = []; + + await run( + { + report(file) + { + files.push(file); + } + }); + + if ( + await(window.showInformationMessage( + Resources.Resources.Get("CollectionFinished"), + Resources.Resources.Get("Yes"), + Resources.Resources.Get("No"))) === Resources.Resources.Get("Yes")) + { + for (let file of files) + { + this.fileReporter.report(file); + } + } } else { - fileReporter = this.fileReporter; + await run(this.fileReporter); } - - window.withProgress( - { - cancellable: true, - location: ProgressLocation.Notification, - title: task.Title - }, - async (progressReporter) => - { - await task.Execute(progressReporter, fileReporter); - }); } catch (exception) { From dc82f03ea7375fbb2001e5227c10938e375aa988 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 18 Aug 2019 02:02:12 +0200 Subject: [PATCH 68/77] Provide the functionality to choose the name of the chained document --- Resources/MarkdownConverter.json | 2 ++ src/System/Tasks/ChainTask.ts | 29 +++++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/Resources/MarkdownConverter.json b/Resources/MarkdownConverter.json index 43f23998..625c65fd 100644 --- a/Resources/MarkdownConverter.json +++ b/Resources/MarkdownConverter.json @@ -17,6 +17,8 @@ "UpdateFailed": "The download failed.\nYou may want to declare \"http.proxy\" or \"http.proxyStrictSSL\" if you're using a proxy.\nDo you want to retry the download?", "DestinationPath": "Please specify a destination-path to save the document to.", "DestinationPathExample": "e.g. C:\\Temp or /tmp/", + "DocumentName": "Please specify the name of the document to create.", + "DocumentNameExample": "e.g. Handbook or Manual", "Progress": { "LaunchWebserver": "Initializing a web-server…", "LaunchChromium": "Launching a chromium-instance…", diff --git a/src/System/Tasks/ChainTask.ts b/src/System/Tasks/ChainTask.ts index be442c24..38d56706 100644 --- a/src/System/Tasks/ChainTask.ts +++ b/src/System/Tasks/ChainTask.ts @@ -1,6 +1,8 @@ +import FileSystem = require("fs-extra"); import { EOL } from "os"; +import Path = require("path"); import Format = require("string-template"); -import { Progress, TextDocument, workspace } from "vscode"; +import { Progress, TextDocument, window, workspace } from "vscode"; import { IConvertedFile } from "../../Conversion/IConvertedFile"; import { MarkdownConverterExtension } from "../../MarkdownConverterExtension"; import { Resources } from "../../Properties/Resources"; @@ -37,9 +39,20 @@ export class ChainTask extends ConvertAllTask protected async ExecuteTask(progressReporter: Progress, fileReporter?: Progress) { let document: TextDocument; + let documentName: string; let documents: TextDocument[] = []; let contents: string[]; + while (!documentName) + { + documentName = await window.showInputBox( + { + ignoreFocusOut: true, + prompt: Resources.Resources.Get("DocumentName"), + placeHolder: Resources.Resources.Get("DocumentNameExample") + }); + } + progressReporter.report( { message: Resources.Resources.Get("Progress.SearchDocuments") @@ -71,6 +84,18 @@ export class ChainTask extends ConvertAllTask content: contents.join(EOL + EOL) }); - await this.ConversionRunner.Execute(document, progressReporter, fileReporter); + return this.ConversionRunner.Execute( + document, + progressReporter, + { + report(file) + { + let parsedPath = Path.parse(file.FileName); + let newFileName = Path.join(parsedPath.dir, `${documentName}${parsedPath.ext}`); + FileSystem.renameSync(file.FileName, newFileName); + file.FileName = newFileName; + fileReporter.report(file); + } + }); } } \ No newline at end of file From 9bb60479a201299bb860754b6fca2b375ea796c4 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 18 Aug 2019 02:34:23 +0200 Subject: [PATCH 69/77] Rework the look and feel of the changelog --- CHANGELOG.md | 60 ++++++++++++++++++---------------------------------- 1 file changed, 20 insertions(+), 40 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e468d3a8..513af8e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,19 +7,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## MarkdownConverter Unreleased - Prevented port-collisions when converting multiple files at once -[Show differences][v1.2.0] +[Show differences](https://github.com/manuth/MarkdownConverter/compare/v1.1.2...v1.2.0) ## MarkdownConverter v1.1.2 - Implemented a clean way to handle files outside of the current workspace Thanks to [@jkhsjdhjs](https://github.com/jkhsjdhjs) for reporting the issue -[Show differences][v1.1.2] +[Show differences](https://github.com/manuth/MarkdownConverter/compare/v1.1.1...v1.1.2) ## MarkdownConverter v1.1.1 - Fixed absolute path handling Thanks to [@007pig](https://github.com/007pig) for reporting the issue -[Show differences][v1.1.1] +[Show differences](https://github.com/manuth/MarkdownConverter/compare/v1.1.0...v1.1.1) ## MarkdownConverter v1.1.0 ### Breaking Changes @@ -32,7 +32,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - People can now choose whether to consider the `DestinationPath` relative to the `WorkspaceFolder` or relative to the directory of the document-file. - Added a prompt for specifying a `DestinationPath` which is displayed when `MarkdownConverter` the `DestinationPath`, none or more than 1 workspace-folders are opened and the name of the file is untitled -[Show differences][v1.1.0] +[Show differences](https://github.com/manuth/MarkdownConverter/compare/v1.0.0...v1.1.0) ## MarkdownConverter v1.0.1 - Allowed users to enable the default parser rather than the default stylesheets @@ -42,21 +42,21 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - `markdownConverter.Document.EmojiType` => `markdownConverter.Parser.EmojiType` - `markdownConverter.Document.Toc` => `markdownConverter.Parser.Toc` -[Show differences][v1.0.1] +[Show differences](https://github.com/manuth/MarkdownConverter/compare/v1.0.0...v1.0.1) ## MarkdownConverter v1.0.0 - Replace [PhantomJS](http://phantomjs.org/) by [puppeteer](https://github.com/GoogleChrome/puppeteer) - Provide the functionality to render local files - Provide the functionality to - - Rework the path-handling of the settings - - Rework the code for better readability + - Reworked the path-handling of the settings + - Reworked the code for better readability -[Show differences][v1.0.0] +[Show differences](https://github.com/manuth/MarkdownConverter/compare/v0.0.13...v1.0.0) ## MarkdownConverter v0.0.13 - Reworked the system-stylesheet -[Show differences][v0.0.13] +[Show differences](https://github.com/manuth/MarkdownConverter/compare/v0.0.12...v0.0.13) ## MarkdownConverter v0.0.12 - Cleaned up all settings @@ -64,19 +64,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Improved path-handling for untitled files - Implemented localization using [`localizable-resources`](https://npmjs.org/package/localizable-resources) -[Show differences][v0.0.12] +[Show differences](https://github.com/manuth/MarkdownConverter/compare/v0.0.11...v0.0.12) ## Markdown Converter v0.0.11 - Renamed `MarkdownConverter` to `Markdown Converter` - Fixed Multi-Workspacefolder support -[Show differences][v0.0.11] +[Show differences](https://github.com/manuth/MarkdownConverter/compare/v0.0.10...v0.0.11) ## MakrdownConverter v0.0.10 - Added support for Chinese headings - Disabled markdown-it's link policy -[Show differences][v0.0.10] +[Show differences](https://github.com/manuth/MarkdownConverter/compare/v0.0.9...v0.0.10) ## MarkdownConverter v0.0.9 - Made the rebuild-process platform-independent @@ -84,7 +84,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Updated the sync-request-module - Added "table of content"-feature -[Show differences][v0.0.9] +[Show differences](https://github.com/manuth/MarkdownConverter/compare/v0.0.8...v0.0.9) ## MarkdownConverter v0.0.8 - Reworked the PhantomJS-process [#1](https://github.com/manuth/MarkdownConverter/issues/1) @@ -92,7 +92,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Provided the functionallity to choose whether to embed or link certain css-files [#4](https://github.com/manuth/MarkdownConverter/issues/4) - Patched missleading error-messages [#7](https://github.com/manuth/MarkdownConverter/issues/7) -[Show differences][v0.0.8] +[Show differences](https://github.com/manuth/MarkdownConverter/compare/v0.0.7...v0.0.8) ## MarkdownConverter v0.0.7 - Adjusted the version-numbers @@ -100,7 +100,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added TypeScript-definitions - Added PhantomJS-rebuild functionallity in order to build PhantomJS for the propper os. [#2](https://github.com/manuth/MarkdownConverter/issues/2) -[Show differences][v0.0.7] +[Show differences](https://github.com/manuth/MarkdownConverter/compare/v0.0.6...v0.0.7) ## MarkdownConverter v0.0.6 - Added malformated FrontMatter-Recognition @@ -108,47 +108,27 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added JavaScript-logic-variables - Fixed the broken PageNumber and PageCount-variables -[Show differences][v0.0.6] +[Show differences](https://github.com/manuth/MarkdownConverter/compare/v0.0.5...v0.0.6) ## MarkdownConverter v0.0.5 - Reworked the error-messages -[Show differences][v0.0.5] +[Show differences](https://github.com/manuth/MarkdownConverter/compare/v0.0.4...v0.0.5) ## MarkdownConverter v0.0.4 - Added a new Icon - Reworked the README - Added [Checkbox-Support](https://www.npmjs.com/package/markdown-it-checkbox) -[Show differences][v0.0.4] +[Show differences](https://github.com/manuth/MarkdownConverter/compare/v0.0.2...v0.0.4) ## MarkdownConverter v0.0.2 - Improved the error-handling - Improved the stability of the code -[Show differences][v0.0.2] +[Show differences](https://github.com/manuth/MarkdownConverter/compare/v0.0.1...v0.0.2) ## MarkdownConverter v0.0.1 - Initial release -[Show differences][v0.0.1] - - -[v0.0.1]: https://github.com/manuth/MarkdownConverter/compare/97826ca...v0.0.1 -[v0.0.2]: https://github.com/manuth/MarkdownConverter/compare/v0.0.1...v0.0.2 -[v0.0.4]: https://github.com/manuth/MarkdownConverter/compare/v0.0.2...v0.0.4 -[v0.0.5]: https://github.com/manuth/MarkdownConverter/compare/v0.0.4...v0.0.5 -[v0.0.6]: https://github.com/manuth/MarkdownConverter/compare/v0.0.5...v0.0.6 -[v0.0.7]: https://github.com/manuth/MarkdownConverter/compare/v0.0.6...v0.0.7 -[v0.0.8]: https://github.com/manuth/MarkdownConverter/compare/v0.0.7...v0.0.8 -[v0.0.9]: https://github.com/manuth/MarkdownConverter/compare/v0.0.8...v0.0.9 -[v0.0.10]: https://github.com/manuth/MarkdownConverter/compare/v0.0.9...v0.0.10 -[v0.0.11]: https://github.com/manuth/MarkdownConverter/compare/v0.0.10...v0.0.11 -[v0.0.12]: https://github.com/manuth/MarkdownConverter/compare/v0.0.11...v0.0.12 -[v0.0.13]: https://github.com/manuth/MarkdownConverter/compare/v0.0.12...v0.0.13 -[v1.0.0]: https://github.com/manuth/MarkdownConverter/compare/v0.0.13...v1.0.0 -[v1.0.1]: https://github.com/manuth/MarkdownConverter/compare/v1.0.0...v1.0.1 -[v1.1.0]: https://github.com/manuth/MarkdownConverter/compare/v1.0.0...v1.1.0 -[v1.1.1]: https://github.com/manuth/MarkdownConverter/compare/v1.1.0...v1.1.1 -[v1.1.2]: https://github.com/manuth/MarkdownConverter/compare/v1.1.1...v1.1.2 -[v1.2.0]: https://github.com/manuth/MarkdownConverter/compare/v1.1.2...v1.2.0 \ No newline at end of file +[Show differences](https://github.com/manuth/MarkdownConverter/compare/97826ca...v0.0.1) \ No newline at end of file From 05152902a0452f71f4a4f18629281a72f4d8e974 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 18 Aug 2019 02:39:09 +0200 Subject: [PATCH 70/77] Add information about the output-pattern to the readme --- README.md | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 9d76a420..04653800 100644 --- a/README.md +++ b/README.md @@ -7,15 +7,7 @@ A markdown-converter for [Visual Studio Code][VSCode] ## Usage 1. Set your desired conversion-types or skip this step to convert your markdown-file to `PDF`: - - Open up your Visual Studio Code-Settings and set `markdownConverter.ConversionType` to either your desired type or an array of types: - ```json - { - "markdownConverter.ConversionType": [ - "PNG" - ] - } - ``` - or + - Open up your Visual Studio Code-Settings and set `markdownConverter.ConversionType` to an array of types: ```json { "markdownConverter.ConversionType": [ @@ -24,8 +16,13 @@ A markdown-converter for [Visual Studio Code][VSCode] ] } ``` - 2. Open up the command pallet (Ctrl, Shift+P) and search for `Markdown: Convert Document` (`Markdown: Dokument Konvertieren` in German) or `mco` (`mk` in German) for short - 3. Press enter and wait for the process to finish + 2. Optionally set the pattern for resolving the destination-path: + ```json + { + "markdownConverter.DestinationPattern": "${workspaceFolder}/output/${dirname}/${basename}.${extension}" + } + 3. Open up the command pallet (Ctrl, Shift+P) and search for `Markdown: Convert Document` (`Markdown: Dokument Konvertieren` in German) or `mco` (`mk` in German) for short + 4. Press enter and wait for the process to finish [VSCode]: https://code.visualstudio.com/ \ No newline at end of file From ab1cd7d8882828cc0cabd98755b900b3d18e8541 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 18 Aug 2019 02:57:45 +0200 Subject: [PATCH 71/77] Provide the functionality to make tasks cancellable --- src/MarkdownConverterExtension.ts | 6 +++--- src/System/Extensibility/Extension.ts | 6 +++--- src/System/Tasks/ChainTask.ts | 12 ++++++++++-- src/System/Tasks/ConvertAllTask.ts | 18 +++++++++++++----- src/System/Tasks/ConvertTask.ts | 4 ++-- src/System/Tasks/PuppeteerTask.ts | 8 ++++---- src/System/Tasks/Task.ts | 12 ++++++++++-- 7 files changed, 45 insertions(+), 21 deletions(-) diff --git a/src/MarkdownConverterExtension.ts b/src/MarkdownConverterExtension.ts index 135f72ce..954dbfd1 100644 --- a/src/MarkdownConverterExtension.ts +++ b/src/MarkdownConverterExtension.ts @@ -94,13 +94,13 @@ export class MarkdownConverterExtension extends Extension { await window.withProgress( { - cancellable: true, + cancellable: task.Cancellable, location: ProgressLocation.Notification, title: task.Title }, - async (progressReporter) => + async (progressReporter, cancellationToken) => { - await task.Execute(progressReporter, fileReporter); + await task.Execute(progressReporter, cancellationToken, fileReporter); }); }; diff --git a/src/System/Extensibility/Extension.ts b/src/System/Extensibility/Extension.ts index cf36c579..f6473d5f 100644 --- a/src/System/Extensibility/Extension.ts +++ b/src/System/Extensibility/Extension.ts @@ -158,13 +158,13 @@ export class Extension { return window.withProgress( { - cancellable: true, + cancellable: task.Cancellable, location: ProgressLocation.Notification, title: task.Title }, - async (progressReporter) => + async (progressReporter, cancellationToken) => { - await task.Execute(progressReporter); + await task.Execute(progressReporter, cancellationToken); }); } } \ No newline at end of file diff --git a/src/System/Tasks/ChainTask.ts b/src/System/Tasks/ChainTask.ts index 38d56706..fa2ca973 100644 --- a/src/System/Tasks/ChainTask.ts +++ b/src/System/Tasks/ChainTask.ts @@ -2,7 +2,7 @@ import FileSystem = require("fs-extra"); import { EOL } from "os"; import Path = require("path"); import Format = require("string-template"); -import { Progress, TextDocument, window, workspace } from "vscode"; +import { CancellationToken, Progress, TextDocument, window, workspace } from "vscode"; import { IConvertedFile } from "../../Conversion/IConvertedFile"; import { MarkdownConverterExtension } from "../../MarkdownConverterExtension"; import { Resources } from "../../Properties/Resources"; @@ -36,7 +36,15 @@ export class ChainTask extends ConvertAllTask /** * @inheritdoc */ - protected async ExecuteTask(progressReporter: Progress, fileReporter?: Progress) + public get Cancellable() + { + return false; + } + + /** + * @inheritdoc + */ + protected async ExecuteTask(progressReporter: Progress, cancellationToken?: CancellationToken, fileReporter?: Progress) { let document: TextDocument; let documentName: string; diff --git a/src/System/Tasks/ConvertAllTask.ts b/src/System/Tasks/ConvertAllTask.ts index b789da1b..cf15b015 100644 --- a/src/System/Tasks/ConvertAllTask.ts +++ b/src/System/Tasks/ConvertAllTask.ts @@ -1,5 +1,5 @@ import Format = require("string-template"); -import { extensions, Progress, TextDocument, workspace } from "vscode"; +import { CancellationToken, extensions, Progress, TextDocument, workspace } from "vscode"; import { IConvertedFile } from "../../Conversion/IConvertedFile"; import { MarkdownConverterExtension } from "../../MarkdownConverterExtension"; import { MarkdownFileNotFoundException } from "../../MarkdownFileNotFoundException"; @@ -34,7 +34,15 @@ export class ConvertAllTask extends ConversionTask /** * @inheritdoc */ - public async Execute(progressReporter?: Progress, fileReporter?: Progress) + public get Cancellable() + { + return true; + } + + /** + * @inheritdoc + */ + public async Execute(progressReporter?: Progress, cancellationToken?: CancellationToken, fileReporter?: Progress) { if ((await this.GetDocuments()).length === 0) { @@ -42,14 +50,14 @@ export class ConvertAllTask extends ConversionTask } else { - return super.Execute(progressReporter, fileReporter); + return super.Execute(progressReporter, cancellationToken, fileReporter); } } /** * @inheritdoc */ - protected async ExecuteTask(progressReporter?: Progress, fileReporter?: Progress) + protected async ExecuteTask(progressReporter?: Progress, cancellationToken?: CancellationToken, fileReporter?: Progress) { let documents: TextDocument[]; let totalCount: number; @@ -68,7 +76,7 @@ export class ConvertAllTask extends ConversionTask message: Format(Resources.Resources.Get("Progress.DocumentsFound"), totalCount) }); - for (let i = 0; i < documents.length; i++) + for (let i = 0; i < documents.length && !cancellationToken.isCancellationRequested; i++) { let document = documents[i]; let progressState: IProgressState = {}; diff --git a/src/System/Tasks/ConvertTask.ts b/src/System/Tasks/ConvertTask.ts index 488b0129..fa6fd914 100644 --- a/src/System/Tasks/ConvertTask.ts +++ b/src/System/Tasks/ConvertTask.ts @@ -1,4 +1,4 @@ -import { Progress, TextDocument, window } from "vscode"; +import { CancellationToken, Progress, TextDocument, window } from "vscode"; import { IConvertedFile } from "../../Conversion/IConvertedFile"; import { MarkdownConverterExtension } from "../../MarkdownConverterExtension"; import { MarkdownFileNotFoundException } from "../../MarkdownFileNotFoundException"; @@ -34,7 +34,7 @@ export class ConvertTask extends ConversionTask /** * @inheritdoc */ - protected async ExecuteTask(progressReporter?: Progress, fileReporter?: Progress) + protected async ExecuteTask(progressReporter?: Progress, cancellationToken?: CancellationToken, fileReporter?: Progress) { return this.ConversionRunner.Execute(this.GetMarkdownDocument(), progressReporter, fileReporter); } diff --git a/src/System/Tasks/PuppeteerTask.ts b/src/System/Tasks/PuppeteerTask.ts index 831d90c0..bf38ba23 100644 --- a/src/System/Tasks/PuppeteerTask.ts +++ b/src/System/Tasks/PuppeteerTask.ts @@ -1,6 +1,6 @@ import FileSystem = require("fs-extra"); import Puppeteer = require("puppeteer"); -import { Progress } from "vscode"; +import { CancellationToken, Progress } from "vscode"; import { IConvertedFile } from "../../Conversion/IConvertedFile"; import { MarkdownConverterExtension } from "../../MarkdownConverterExtension"; import { ChromiumNotFoundException } from "./ChromiumNotFoundException"; @@ -37,11 +37,11 @@ export abstract class PuppeteerTask extends Task * @param fileReporter * A component for reporting converted files. */ - public async Execute(progressReporter?: Progress, fileReporter?: Progress) + public async Execute(progressReporter?: Progress, cancellationToken?: CancellationToken, fileReporter?: Progress) { if (await FileSystem.pathExists(Puppeteer.executablePath())) { - await this.ExecuteTask(progressReporter, fileReporter); + await this.ExecuteTask(progressReporter, cancellationToken, fileReporter); } else { @@ -52,5 +52,5 @@ export abstract class PuppeteerTask extends Task /** * Executes the task. */ - protected abstract async ExecuteTask(progressReporter?: Progress, fileReporter?: Progress): Promise; + protected abstract async ExecuteTask(progressReporter?: Progress, cancellationToken?: CancellationToken, fileReporter?: Progress): Promise; } \ No newline at end of file diff --git a/src/System/Tasks/Task.ts b/src/System/Tasks/Task.ts index 18afee0d..a3c23bfd 100644 --- a/src/System/Tasks/Task.ts +++ b/src/System/Tasks/Task.ts @@ -1,4 +1,4 @@ -import { Progress } from "vscode"; +import { CancellationToken, Progress } from "vscode"; import { Extension } from "../Extensibility/Extension"; import { IProgressState } from "./IProgressState"; @@ -39,8 +39,16 @@ export abstract class Task */ public abstract get Title(): string; + /** + * Gets a value indicating whether this task can be canceled. + */ + public get Cancellable(): boolean + { + return false; + } + /** * Executes the task. */ - public abstract async Execute(progressReporter?: Progress): Promise; + public abstract async Execute(progressReporter?: Progress, cancellationToken?: CancellationToken): Promise; } \ No newline at end of file From c2df92b384aba9b8bd244b23be98b266487b6a2b Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 18 Aug 2019 03:51:57 +0200 Subject: [PATCH 72/77] Add missing commands to the readme --- README.md | 5 ++++- src/Conversion/Converter.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 04653800..fb64e6aa 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,10 @@ A markdown-converter for [Visual Studio Code][VSCode] { "markdownConverter.DestinationPattern": "${workspaceFolder}/output/${dirname}/${basename}.${extension}" } - 3. Open up the command pallet (Ctrl, Shift+P) and search for `Markdown: Convert Document` (`Markdown: Dokument Konvertieren` in German) or `mco` (`mk` in German) for short + 3. Open up the command pallet (Ctrl, Shift+P) and search one of these commands: + - `Markdown: Convert Document` (`Markdown: Dokument Konvertieren` in German) or `mco` (`mk` in German) for short + - `Markdown: Convert all Documents` (`Markdown: Alle Dokumente konvertieren`) or `mcd` (`madk` in German) for short + - `Markdown: Chain all Documents` (`Markdown: Alle Dokumente verketten`) or `mcad` (`madv` in German) for short 4. Press enter and wait for the process to finish diff --git a/src/Conversion/Converter.ts b/src/Conversion/Converter.ts index 5f27e946..7d566b81 100644 --- a/src/Conversion/Converter.ts +++ b/src/Conversion/Converter.ts @@ -284,7 +284,7 @@ export class Converter page.on( "request", - async request => + async (request) => { if (request.url() === this.URL) { From abb133f8ece30ee470b49570b02136f9d1579dca Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 18 Aug 2019 04:12:56 +0200 Subject: [PATCH 73/77] Update all packages --- package-lock.json | 169 ++++------------------------------------------ package.json | 7 +- 2 files changed, 17 insertions(+), 159 deletions(-) diff --git a/package-lock.json b/package-lock.json index 89b10308..d82c190d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -152,14 +152,14 @@ "dev": true }, "@types/node": { - "version": "12.7.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.1.tgz", - "integrity": "sha512-aK9jxMypeSrhiYofWWBf/T7O+KwaiAHzM4sveCdWPn71lzUSMimRnKzhXDKfKwV1kWoBo2P1aGgaIYGLf9/ljw==" + "version": "12.7.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.2.tgz", + "integrity": "sha512-dyYO+f6ihZEtNPDcWNR1fkoTDf3zAK3lAABDze3mz6POyIercH0lEUawUFXlG8xaQZmm1yEBON/4TsYv/laDYg==" }, "@types/puppeteer": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/@types/puppeteer/-/puppeteer-1.19.0.tgz", - "integrity": "sha512-Db9LWOuTm2bR/qgPE7PQCmnsCQ6flHdULuIDWTks8YdQ/SGHKg5WGWG54gl0734NDKCTF5MbqAp2qWuvBiyQ3Q==", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/@types/puppeteer/-/puppeteer-1.19.1.tgz", + "integrity": "sha512-ReWZvoEfMiJIA3AG+eM+nCx5GKrU2ANVYY5TC0nbpeiTCtnJbcqnmBbR8TkXMBTvLBYcuTOAELbTcuX73siDNQ==", "dev": true, "requires": { "@types/node": "*" @@ -240,6 +240,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", + "dev": true, "requires": { "es6-promisify": "^5.0.0" } @@ -313,11 +314,6 @@ "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" }, - "async-limiter": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", - "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==" - }, "async-shelljs": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/async-shelljs/-/async-shelljs-0.1.2.tgz", @@ -380,11 +376,6 @@ "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" - }, "builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", @@ -504,17 +495,6 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -752,12 +732,14 @@ "es6-promise": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", + "dev": true }, "es6-promisify": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", + "dev": true, "requires": { "es6-promise": "^4.0.3" } @@ -809,27 +791,6 @@ "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" }, - "extract-zip": { - "version": "1.6.7", - "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.7.tgz", - "integrity": "sha1-qEC0uK9kAyZMjbV/Txp0Mz74H+k=", - "requires": { - "concat-stream": "1.6.2", - "debug": "2.6.9", - "mkdirp": "0.5.1", - "yauzl": "2.4.1" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - } - } - }, "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", @@ -845,14 +806,6 @@ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" }, - "fd-slicer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", - "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=", - "requires": { - "pend": "~1.2.0" - } - }, "find-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", @@ -1106,6 +1059,7 @@ "version": "2.2.2", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz", "integrity": "sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg==", + "dev": true, "requires": { "agent-base": "^4.3.0", "debug": "^3.1.0" @@ -1199,11 +1153,6 @@ "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "dev": true }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -1399,9 +1348,9 @@ } }, "markdown-it": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-9.0.1.tgz", - "integrity": "sha512-XC9dMBHg28Xi7y5dPuLjM61upIGPJG8AiHNHYqIaXER2KNnn7eKnM5/sF0ImNnyoV224Ogn9b1Pck8VH4k0bxw==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-9.1.0.tgz", + "integrity": "sha512-xHKG4C8iPriyfu/jc2hsCC045fKrMQ0VexX2F1FGYiRxDxqMB2aAhF8WauJ3fltn2kb90moGBkiiEdooGIg55w==", "requires": { "argparse": "^1.0.7", "entities": "~1.1.1", @@ -1456,11 +1405,6 @@ "p-is-promise": "^2.0.0" } }, - "mime": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", - "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==" - }, "mime-db": { "version": "1.40.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", @@ -1907,11 +1851,6 @@ "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=" }, - "pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=" - }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -1937,21 +1876,6 @@ } } }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" - }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==" - }, - "proxy-from-env": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz", - "integrity": "sha1-M8UDmPcOp+uW0h97gXYwpVeRx+4=" - }, "psl": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.3.0.tgz", @@ -1972,36 +1896,6 @@ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" }, - "puppeteer": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-1.19.0.tgz", - "integrity": "sha512-2S6E6ygpoqcECaagDbBopoSOPDv0pAZvTbnBgUY+6hq0/XDFDOLEMNlHF/SKJlzcaZ9ckiKjKDuueWI3FN/WXw==", - "requires": { - "debug": "^4.1.0", - "extract-zip": "^1.6.6", - "https-proxy-agent": "^2.2.1", - "mime": "^2.0.3", - "progress": "^2.0.1", - "proxy-from-env": "^1.0.0", - "rimraf": "^2.6.1", - "ws": "^6.1.0" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - } - } - }, "qs": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", @@ -2018,20 +1912,6 @@ "strip-json-comments": "~2.0.1" } }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, "rechoir": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", @@ -2385,11 +2265,6 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==" }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" - }, "typescript": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz", @@ -2593,14 +2468,6 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, - "ws": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", - "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", - "requires": { - "async-limiter": "~1.0.0" - } - }, "y18n": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", @@ -2786,14 +2653,6 @@ } } } - }, - "yauzl": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz", - "integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=", - "requires": { - "fd-slicer": "~1.0.1" - } } } } diff --git a/package.json b/package.json index 0c4d0ef0..dc961930 100644 --- a/package.json +++ b/package.json @@ -56,8 +56,8 @@ "@types/markdown-it-anchor": "^4.0.3", "@types/mocha": "^5.2.7", "@types/mustache": "^0.8.32", - "@types/node": "^12.7.1", - "@types/puppeteer": "^1.19.0", + "@types/node": "^12.7.2", + "@types/puppeteer": "^1.19.1", "@types/string-template": "^1.0.2", "@types/transliteration": "^1.6.1", "@types/utf8": "^2.1.6", @@ -83,14 +83,13 @@ "highlightjs": "^9.12.0", "http-server": "^0.11.1", "localized-resource-manager": "^1.0.3", - "markdown-it": "^9.0.1", + "markdown-it": "^9.1.0", "markdown-it-anchor": "^5.2.4", "markdown-it-checkbox": "^1.1.0", "markdown-it-emoji": "^1.4.0", "markdown-it-table-of-contents": "^0.4.4", "multi-integer-range": "^4.0.7", "mustache": "^3.0.1", - "puppeteer": "^1.19.0", "rc": "^1.2.8", "string-template": "^1.0.0", "temp-filesystem": "^1.1.3", From 2102895d6490b21bee896e62ffc959ee5fe1947f Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 18 Aug 2019 04:16:23 +0200 Subject: [PATCH 74/77] Add changelog-entries --- CHANGELOG.md | 60 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 513af8e9..84b4f5b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,64 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## MarkdownConverter Unreleased +## MarkdownConverter 2.0.0 +### General +It's about time to publish another more verbose release. +This time I put lots of effort into `MarkdownConverter` to finish some features I wanted to add for a long time. + +One of the most notable things I think you might find very useful is +that the destination-path is now fully customizable using the `DestinationPattern`-option. +The `DestinationPath` and `DestinationOrigin`-options have been dropped in favor of said option. + +You might want to set the `DestinationPattern` to whatever pattern to save your documents to, like, for example: +```json +{ + "markdownConverter.DestinationPattern": "${workspaceFolder}/output/${dirname}/${basename}.${extension}" +} +``` + +Also, I finally added an option for converting all files at once and one for chaining all documents together. +These features make great use of the `DestinationPattern`-option as this makes very clear where to store converted files. + +Another pretty nice thing is that now every single command reports each progress that's made. +This makes it easier to you to check whether the conversion's still running or what's causing trouble. + +Continue reading to see what else changed. + +Thank you guys for using `MarkdownConverter` and for keeping me motivated! +You guys are the best! 🎉 + +## Breaking Changes + - Added the `DestinationPattern`-option for specifying a pattern for resolving the destination-path + You can use following epressions in the `DestinationPattern`: + - `${workspaceFolder}`: + Either the path to the `workspace`, if any, or the directory which contains the document. + - `${dirname}`: + The relative path from the `${workspaceFolder}` to the directory which contains the document. + - `${basename}`: + The name of the document-file without extension. + - `${extension}`: + The file-extension of the destination-datatype. + - `${filename}`: + The name of the document-file with its original extension. + - Dropped `DestinationPath` and `DestinationOrigin` in favor of `DestinationPattern` + +## Other Changes - Prevented port-collisions when converting multiple files at once - -[Show differences](https://github.com/manuth/MarkdownConverter/compare/v1.1.2...v1.2.0) + - Fixed the threading-issues by automatically disabling sandboxed mode if it fails + Special thanks to [@jkhsjdhjs](https://github.com/jkhsjdhjs) for reporting and also fixing this issue + - Improved the exception-handling + - Improved the stability of the code + - Added a command `Convert All Documents` for converting all markdown-documents in the current workspace at once + - Added a command `Chain All Documents` for chaining all markdown-documents in the current workspace and convert them afterwards + - Added a fix for loading the VSCodes `markdown-it`-instance + Sadly VSCodes `markdown-it`-parser can only be loaded once a markdown-file has been opened. + Thus a temporary, empty markdown-file will be opened once a conversion has started + if the VSCode-parser has not been loaded yet. + - Provided the functionality to convert to self-contained html-files + - Added progress-report to every command + +[Show differences](https://github.com/manuth/MarkdownConverter/compare/v1.1.2...v2.0.0) ## MarkdownConverter v1.1.2 - Implemented a clean way to handle files outside of the current workspace From 9b6e0d738d705c32836439c01292d8f37d0236cd Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 18 Aug 2019 04:17:07 +0200 Subject: [PATCH 75/77] Update the version-number --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index d82c190d..a69d6045 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "markdown-converter", - "version": "1.1.2", + "version": "2.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index dc961930..7131adbe 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "markdown-converter", "displayName": "Markdown Converter", "icon": "Resources/Icon.png", - "version": "1.1.2", + "version": "2.0.0", "description": "A markdown-converter for Visual Studio Code", "markdownDescription": "A Markdown-converter for Visual Studio Code", "author": "Manuel Thalmann (https://nuth.ch)", From 383ae8f967e3faf722ee7525cfccd967c665ed1d Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 18 Aug 2019 04:26:40 +0200 Subject: [PATCH 76/77] Add the vsce-package --- package-lock.json | 225 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 1 + 2 files changed, 226 insertions(+) diff --git a/package-lock.json b/package-lock.json index a69d6045..ac8b843c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -338,6 +338,18 @@ "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" }, + "azure-devops-node-api": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/azure-devops-node-api/-/azure-devops-node-api-7.2.0.tgz", + "integrity": "sha512-pMfGJ6gAQ7LRKTHgiRF+8iaUUeGAI0c8puLaqHLc7B8AR7W6GJLozK9RFeUHFjEGybC9/EB3r67WPd7e46zQ8w==", + "dev": true, + "requires": { + "os": "0.1.1", + "tunnel": "0.0.4", + "typed-rest-client": "1.2.0", + "underscore": "1.8.3" + } + }, "balanced-match": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", @@ -376,6 +388,12 @@ "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, + "buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", + "dev": true + }, "builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", @@ -621,6 +639,18 @@ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, + "denodeify": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/denodeify/-/denodeify-1.2.1.tgz", + "integrity": "sha1-OjYof1A05pnnV3kBBSwubJQlFjE=", + "dev": true + }, + "didyoumean": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.1.tgz", + "integrity": "sha1-6S7f2tplN9SE1zwBcv0eugxJdv8=", + "dev": true + }, "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", @@ -806,6 +836,15 @@ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" }, + "fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", + "dev": true, + "requires": { + "pend": "~1.2.0" + } + }, "find-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", @@ -1405,6 +1444,12 @@ "p-is-promise": "^2.0.0" } }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true + }, "mime-db": { "version": "1.40.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", @@ -1658,6 +1703,12 @@ "resolved": "https://registry.npmjs.org/mustache/-/mustache-3.0.1.tgz", "integrity": "sha512-jFI/4UVRsRYdUbuDTKT7KzfOp7FiD5WzYmmwNwXyUVypC0xjoTL78Fqc0jHUPIvvGD+6DQSPHIt1NE7D1ArsqA==" }, + "mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true + }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -1772,6 +1823,18 @@ } } }, + "os": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/os/-/os-0.1.1.tgz", + "integrity": "sha1-IIhF6J4ZOtTZcUdLk5R3NqVtE/M=", + "dev": true + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, "os-locale": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", @@ -1783,6 +1846,22 @@ "mem": "^4.0.0" } }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "osenv": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "dev": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, "p-defer": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", @@ -1830,6 +1909,24 @@ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" }, + "parse-semver": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/parse-semver/-/parse-semver-1.1.1.tgz", + "integrity": "sha1-mkr9bfBj3Egm+T+6SpnPIj9mbLg=", + "dev": true, + "requires": { + "semver": "^5.1.0" + } + }, + "parse5": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-3.0.3.tgz", + "integrity": "sha512-rgO9Zg5LLLkfJF9E6CCmXlSE4UVceloys8JrFqCcHloC3usd/kJCyPDwH2SOlzix2j3xaP9sUX3e8+kvkuleAA==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", @@ -1851,6 +1948,12 @@ "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=" }, + "pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", + "dev": true + }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -1912,6 +2015,15 @@ "strip-json-comments": "~2.0.1" } }, + "read": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", + "integrity": "sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ=", + "dev": true, + "requires": { + "mute-stream": "~0.0.4" + } + }, "rechoir": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", @@ -2220,6 +2332,12 @@ "tslib": "^1.8.1" } }, + "tunnel": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.4.tgz", + "integrity": "sha1-LTeFoVjBdMmhbcLARuxfxfF0IhM=", + "dev": true + }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -2265,6 +2383,16 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==" }, + "typed-rest-client": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.2.0.tgz", + "integrity": "sha512-FrUshzZ1yxH8YwGR29PWWnfksLEILbWJydU7zfIRkyH7kAEzB62uMAl2WY6EyolWpLpVHeJGgQm45/MaruaHpw==", + "dev": true, + "requires": { + "tunnel": "0.0.4", + "underscore": "1.8.3" + } + }, "typescript": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz", @@ -2276,6 +2404,12 @@ "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==" }, + "underscore": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", + "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=", + "dev": true + }, "union": { "version": "0.4.6", "resolved": "https://registry.npmjs.org/union/-/union-0.4.6.tgz", @@ -2334,6 +2468,78 @@ "extsprintf": "^1.2.0" } }, + "vsce": { + "version": "1.66.0", + "resolved": "https://registry.npmjs.org/vsce/-/vsce-1.66.0.tgz", + "integrity": "sha512-Zf4+WD4PhEcOr7jkU08SI9lwFqDhmhk73YOCGQ/tNLaBy+PnnX4eSdqj9LdzDLuI2dsyomJLXzDSNgxuaInxCQ==", + "dev": true, + "requires": { + "azure-devops-node-api": "^7.2.0", + "chalk": "^2.4.2", + "cheerio": "^1.0.0-rc.1", + "commander": "^2.8.1", + "denodeify": "^1.2.1", + "didyoumean": "^1.2.1", + "glob": "^7.0.6", + "lodash": "^4.17.10", + "markdown-it": "^8.3.1", + "mime": "^1.3.4", + "minimatch": "^3.0.3", + "osenv": "^0.1.3", + "parse-semver": "^1.1.1", + "read": "^1.0.7", + "semver": "^5.1.0", + "tmp": "0.0.29", + "typed-rest-client": "1.2.0", + "url-join": "^1.1.0", + "yauzl": "^2.3.1", + "yazl": "^2.2.2" + }, + "dependencies": { + "cheerio": { + "version": "1.0.0-rc.3", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.3.tgz", + "integrity": "sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA==", + "dev": true, + "requires": { + "css-select": "~1.2.0", + "dom-serializer": "~0.1.1", + "entities": "~1.1.1", + "htmlparser2": "^3.9.1", + "lodash": "^4.15.0", + "parse5": "^3.0.1" + } + }, + "markdown-it": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.2.tgz", + "integrity": "sha512-GcRz3AWTqSUphY3vsUqQSFMbgR38a4Lh3GWlHRh/7MRwz8mcu9n2IO7HOh+bXHrR9kOPDl5RNCaEsrneb+xhHQ==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "entities": "~1.1.1", + "linkify-it": "^2.0.0", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + } + }, + "tmp": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.29.tgz", + "integrity": "sha1-8lEl/w3Z2jzLDC3Tce4SiLuRKMA=", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.1" + } + }, + "url-join": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-1.1.0.tgz", + "integrity": "sha1-dBxsL0WWxIMNZxhGCSDQySIC3Hg=", + "dev": true + } + } + }, "vscode-test": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/vscode-test/-/vscode-test-1.2.0.tgz", @@ -2653,6 +2859,25 @@ } } } + }, + "yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", + "dev": true, + "requires": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + }, + "yazl": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/yazl/-/yazl-2.5.1.tgz", + "integrity": "sha512-phENi2PLiHnHb6QBVot+dJnaAZ0xosj7p3fWl+znIjBDlnMI2PsZCJZ306BPTFOaHf5qdDEI8x5qFrSOBN5vrw==", + "dev": true, + "requires": { + "buffer-crc32": "~0.2.3" + } } } } diff --git a/package.json b/package.json index 7131adbe..03d67d46 100644 --- a/package.json +++ b/package.json @@ -69,6 +69,7 @@ "mocha": "^6.2.0", "tslint": "^5.18.0", "typescript": "^3.5.3", + "vsce": "^1.66.0", "vscode-test": "^1.2.0" }, "dependencies": { From ced5e67b13386c46aca9feaa0e94d4cf79ddb01e Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 18 Aug 2019 04:35:08 +0200 Subject: [PATCH 77/77] Fix typo --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84b4f5b8..a8cc8f7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## MarkdownConverter 2.0.0 +## MarkdownConverter v2.0.0 ### General It's about time to publish another more verbose release. This time I put lots of effort into `MarkdownConverter` to finish some features I wanted to add for a long time.