From f3173f08dd166e69ee87205d75d05e4c092c4d2a Mon Sep 17 00:00:00 2001 From: Shusaku NAKAZATO Date: Fri, 20 Dec 2019 23:33:03 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix(prhls):=20=E3=83=86=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=81=8C=E5=8B=95=E4=BD=9C=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - concurrentlyを削除。 - ts-nodeを追加、テスト実行はこちらで。 - diffを追加、差分表示用。 - Handlerクラスをlib/handler.tsに分離しlib/index.tsからインポート。 - テスト用のcreateConnection()に入出力ストリームを明示して渡す。 - 出力ストリームはTransform。 - スナップショットを記録する場合のみファイルストリームにpipeする。 - サーバーからのレスポンスだけを、pipeされたストリームと標準出力へ流す。 - exitイベントハンドラーでレスポンスを比較。 - レスポンスはassert()と===で雑に比較。 - 一致しないときはunified diffを表示。 --- lib/handler.ts | 379 +++++++++++++++++++++++++++ lib/index.ts | 396 +--------------------------- package.json | 7 +- test/input.ts | 145 +++++++++-- test/input.ts.snapshot.txt | 15 ++ yarn.lock | 511 ++++--------------------------------- 6 files changed, 585 insertions(+), 868 deletions(-) create mode 100644 lib/handler.ts create mode 100644 test/input.ts.snapshot.txt diff --git a/lib/handler.ts b/lib/handler.ts new file mode 100644 index 0000000..a4ebe6a --- /dev/null +++ b/lib/handler.ts @@ -0,0 +1,379 @@ +import * as fs from "fs"; + +import { fromYAMLFilePaths, getRuleFilePath, Engine, ChangeSet, Diff } from "prh"; + +import { URI } from "vscode-uri"; +import { + TextDocuments, TextDocument, Diagnostic, DiagnosticSeverity, IConnection, TextDocumentChangeEvent, + InitializeParams, InitializeResult, DidChangeConfigurationParams, DidChangeWatchedFilesParams, + CodeAction, CodeActionKind, CodeActionParams, Command, ExecuteCommandParams, TextEdit, Range, +} from "vscode-languageserver"; + +export interface Settings { + prh: PrhSettings; +} + +export interface PrhSettings { + enable?: boolean; + configFiles?: string[]; + trace?: { + server?: "off" | "messages" | "verbose"; + }; +} + +export interface ReplaceCommandParams { + uri: string; + version: number; + textEdit: TextEdit; +} + +export interface ChangeSetCache { + version: number; + changeSet: ChangeSet; +} + +const enum State { + valid = "valid", + invalid = "invalid", +} + +// https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md +export class Handler { + enable: boolean; + configPaths: string[] | null; + + state = State.valid; + + engineCache: { [concatenatedRulePaths: string]: Engine; } = {}; + validationCache: { [uri: string]: ChangeSetCache; } = {}; + + constructor(public connection: IConnection, public documents: TextDocuments) { + this.connection.onInitialize(arg => this.onInitialized(arg)); + this.connection.onDidChangeConfiguration(arg => this.onDidChangeConfiguration(arg)); + this.connection.onDidChangeWatchedFiles(arg => this.onDidChangeWatchedFiles(arg)); + this.connection.onCodeAction(arg => this.onCodeAction(arg)); + this.connection.onExecuteCommand(arg => this.onExecuteCommand(arg)); + + this.documents.onDidChangeContent(arg => this.onDidChangeContent(arg)); + } + + listen() { + this.connection.listen(); + } + + onInitialized(params: InitializeParams): InitializeResult { + return { + capabilities: { + textDocumentSync: this.documents.syncKind, + hoverProvider: false, + completionProvider: void 0, + signatureHelpProvider: void 0, + definitionProvider: false, + referencesProvider: false, + documentHighlightProvider: false, + documentSymbolProvider: false, + workspaceSymbolProvider: false, + codeActionProvider: { + codeActionKinds: [CodeActionKind.QuickFix] + }, + codeLensProvider: void 0, + documentFormattingProvider: false, + documentRangeFormattingProvider: false, + documentOnTypeFormattingProvider: void 0, + renameProvider: false, + documentLinkProvider: void 0, + executeCommandProvider: { + commands: ["replace"], + }, + experimental: false, + }, + }; + } + + onDidChangeConfiguration(change: DidChangeConfigurationParams) { + this.connection.console.log(`onDidChangeConfiguration: ${JSON.stringify(change, null, 2)}`); + + const settings = change.settings as Settings; + this.enable = !!settings.prh.enable; + this.configPaths = settings.prh.configFiles || []; + + this.checkConfig(); + this.documents.all().forEach(document => this.validateAndSendDiagnostics(document)); + } + + onDidChangeContent(change: TextDocumentChangeEvent) { + this.validateAndSendDiagnostics(change.document); + } + + onDidChangeWatchedFiles(change: DidChangeWatchedFilesParams) { + this.connection.console.log(`onDidChangeWatchedFiles: ${JSON.stringify(change, null, 2)}`); + + // 設定ファイルのいずれかが変更されたらキャッシュを捨てる + const configChanged = change.changes.some(change => { + const uri = URI.parse(change.uri); + return Object.keys(this.engineCache).some(concatenatedRulePaths => { + // 若干雑な条件だけど間違っててもさほど痛くないのでOK + // rulePathはpwdからの相対パス表現なので注意 + const rulePaths = concatenatedRulePaths.split("|"); + return rulePaths.some(rulePath => { + if (uri.path.endsWith(rulePath)) { + this.connection.console.log(`matched: ${uri.path} - ${rulePath}`); + return true; + } + return false; + }); + }); + }); + if (configChanged) { + this.checkConfig(); + this.documents.all().forEach(document => this.validateAndSendDiagnostics(document)); + } + } + + onCodeAction(params: CodeActionParams): CodeAction[] { + const textDocument = this.documents.get(params.textDocument.uri); + if (!textDocument) { + return []; + } + + const changeSet = this.makeChangeSet(textDocument); + if (!changeSet) { + return []; + } + + const diffs: Diff[] = changeSet.diffs.filter(diff => { + const index = textDocument.offsetAt(params.range.start); + const tailIndex = textDocument.offsetAt(params.range.end); + return diff.index === index && diff.tailIndex === tailIndex; + }); + + const { range, context } = params; + + const actions: CodeAction[] = diffs.map(diff => { + const newText = diff.newText || "??"; + const textEdit: TextEdit = { + range, + newText + }; + const commandParams: ReplaceCommandParams = { + uri: textDocument.uri, + version: textDocument.version, + textEdit, + }; + const title = `→ ${diff.newText || "??"}`; + const command = Command.create( + title, + "replace", + commandParams + ); + const action = CodeAction.create( + title, + command, + CodeActionKind.QuickFix + ); + action.diagnostics = context.diagnostics; + return action; + }); + + return actions; + } + + onExecuteCommand(args: ExecuteCommandParams) { + switch (args.command) { + case "replace": + this.executeReplace(args); + break; + case "applyAllQuickFixes": + this.executeApplyAllQuickFixes(args); + break; + default: + this.connection.console.log(`Unknown command: ${args.command}`); + } + } + + invalidateCache() { + this.engineCache = {}; + this.validationCache = {}; + } + + checkConfig() { + this.configPaths = this.configPaths || []; + this.connection.console.log(`loadConfig: ${this.configPaths.join(", ") || "implicit"}`); + + this.invalidateCache(); + + for (let configPath of this.configPaths) { + if (!fs.existsSync(configPath)) { + this.connection.console.log(`rule file not exists: ${configPath}`); + if (this.state !== State.invalid) { + this.connection.window.showWarningMessage(`prh: 指定された設定ファイルが見つかりません ${configPath}`); + } + this.state = State.invalid; + this.documents.all().forEach(document => this.clearDiagnostics(document)); + return; + } + } + this.state = State.valid; + } + + makeChangeSet(textDocument: TextDocument): ChangeSet | null { + if (!this.enable || this.state === State.invalid) { + return null; + } + if (this.validationCache[textDocument.uri] && this.validationCache[textDocument.uri].version === textDocument.version) { + return this.validationCache[textDocument.uri].changeSet; + } + delete this.validationCache[textDocument.uri]; + + let configPaths: string[]; + if (this.configPaths && this.configPaths[0]) { + configPaths = this.configPaths; + } else { + const contentUri = URI.parse(textDocument.uri); + if (contentUri.scheme !== "file") { + return null; + } + let foundPath = getRuleFilePath(contentUri.path); + if (!foundPath) { + this.connection.console.log(`rule file not found for ${textDocument.uri}`); + return null; + } + this.connection.console.log(`rule file found: ${foundPath}`); + configPaths = [foundPath]; + } + + let engine = this.engineCache[configPaths.join("|")]; + if (!engine) { + try { + engine = fromYAMLFilePaths(...configPaths); + } catch (e) { + this.connection.console.error(e); + if (e instanceof Error) { + this.connection.window.showErrorMessage(`prh: \`${e.message}\` from ${configPaths.join(" ,")}`); + return null; + } + } + this.engineCache[configPaths.join("|")] = engine; + } + + const changeSet = engine.makeChangeSet(textDocument.uri, textDocument.getText()); + if (!changeSet) { + return null; + } + this.validationCache[textDocument.uri] = { + version: textDocument.version, + changeSet, + }; + + return changeSet; + } + + makeDiagnostic(textDocument: TextDocument): Diagnostic[] | null { + const changeSet = this.makeChangeSet(textDocument); + if (!changeSet) { + return null; + } + + return changeSet.diffs.map(diff => { + + const start = textDocument.positionAt(diff.index); + const end = textDocument.positionAt(diff.tailIndex); + const range = Range.create(start, end); + let message; + this.connection.console.log(JSON.stringify(diff)); + diff.apply(textDocument.getText()) + if (diff.rule && diff.rule.raw && diff.rule.raw.prh) { + message = `→${diff.newText || "??"} ${diff.rule.raw.prh}`; + } else { + message = `→${diff.newText || "??"}`; + } + return Diagnostic.create( + range, + message, + DiagnosticSeverity.Warning, + undefined, + "prh" + ); + }); + } + + validateAndSendDiagnostics(textDocument: TextDocument) { + const diagnostics = this.makeDiagnostic(textDocument); + this.connection.sendDiagnostics({ uri: textDocument.uri, diagnostics: diagnostics || [] }); + } + + clearDiagnostics(textDocument: TextDocument) { + this.connection.sendDiagnostics({ uri: textDocument.uri, diagnostics: [] }); + } + + executeReplace(args: ExecuteCommandParams) { + if (!args.arguments || !args.arguments[0]) { + return; + } + const commandParams: ReplaceCommandParams = args.arguments[0]; + this.connection.console.log(JSON.stringify(commandParams)); + + const textDocument = this.documents.get(commandParams.uri); + if (!textDocument) { + return; + } + + if (commandParams.version !== textDocument.version) { + this.connection.console.log(`Replace, document version mismatch: expected: ${commandParams.version}, actual: ${textDocument.version}`); + return; + } + + this.connection.workspace.applyEdit({ + documentChanges: [{ + textDocument: { + uri: textDocument.uri, + version: textDocument.version, + }, + edits: [commandParams.textEdit], + }], + }).then(result => { + this.connection.console.log(`Apply edit: ${JSON.stringify(result)}`); + }, e => { + this.connection.console.error(`error on executeReplace: ${e}`) + }); + } + + executeApplyAllQuickFixes(args: ExecuteCommandParams) { + if (!args.arguments || !args.arguments[0]) { + return; + } + + const textDocument = this.documents.get(args.arguments[0]); + if (!textDocument) { + return; + } + + const changeSet = this.makeChangeSet(textDocument); + if (!changeSet) { + return; + } + const edits = changeSet.diffs.map(diff => this.getTextEditFromDiff(textDocument, diff)); + this.connection.workspace.applyEdit({ + documentChanges: [{ + textDocument: { + uri: textDocument.uri, + version: textDocument.version, + }, + edits, + }], + }).then(result => { + this.connection.console.log(`Apply edit: ${JSON.stringify(result)}`); + }, e => { + this.connection.console.error(`error on executeApplyAllQuickFixes: ${e}`) + }); + } + + getTextEditFromDiff(textDocument: TextDocument, diff: Diff): TextEdit { + const start = textDocument.positionAt(diff.index); + const end = textDocument.positionAt(diff.tailIndex); + return { + range: { start, end }, + newText: diff.newText || "??", + }; + } +} diff --git a/lib/index.ts b/lib/index.ts index 6589103..5226c7f 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -1,388 +1,8 @@ -import * as fs from "fs"; - -import { fromYAMLFilePaths, getRuleFilePath, Engine, ChangeSet, Diff } from "prh"; - -import { URI } from "vscode-uri"; -import { - createConnection, - TextDocuments, TextDocument, Diagnostic, DiagnosticSeverity, IConnection, TextDocumentChangeEvent, - InitializeParams, InitializeResult, DidChangeConfigurationParams, DidChangeWatchedFilesParams, - CodeAction, CodeActionKind, CodeActionParams, Command, ExecuteCommandParams, TextEdit, Range, -} from "vscode-languageserver"; - -export interface Settings { - prh: PrhSettings; -} - -export interface PrhSettings { - enable?: boolean; - configFiles?: string[]; - trace?: { - server?: "off" | "messages" | "verbose"; - }; -} - -export interface ReplaceCommandParams { - uri: string; - version: number; - textEdit: TextEdit; -} - -export interface ChangeSetCache { - version: number; - changeSet: ChangeSet; -} - -const enum State { - valid = "valid", - invalid = "invalid", -} - -// https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md -export class Handler { - enable: boolean; - configPaths: string[] | null; - - state = State.valid; - - engineCache: { [concatenatedRulePaths: string]: Engine; } = {}; - validationCache: { [uri: string]: ChangeSetCache; } = {}; - - constructor(public connection: IConnection, public documents: TextDocuments) { - this.connection.onInitialize(arg => this.onInitialized(arg)); - this.connection.onDidChangeConfiguration(arg => this.onDidChangeConfiguration(arg)); - this.connection.onDidChangeWatchedFiles(arg => this.onDidChangeWatchedFiles(arg)); - this.connection.onCodeAction(arg => this.onCodeAction(arg)); - this.connection.onExecuteCommand(arg => this.onExecuteCommand(arg)); - - this.documents.onDidChangeContent(arg => this.onDidChangeContent(arg)); - } - - listen() { - this.connection.listen(); - } - - onInitialized(params: InitializeParams): InitializeResult { - return { - capabilities: { - textDocumentSync: this.documents.syncKind, - hoverProvider: false, - completionProvider: void 0, - signatureHelpProvider: void 0, - definitionProvider: false, - referencesProvider: false, - documentHighlightProvider: false, - documentSymbolProvider: false, - workspaceSymbolProvider: false, - codeActionProvider: { - codeActionKinds: [CodeActionKind.QuickFix] - }, - codeLensProvider: void 0, - documentFormattingProvider: false, - documentRangeFormattingProvider: false, - documentOnTypeFormattingProvider: void 0, - renameProvider: false, - documentLinkProvider: void 0, - executeCommandProvider: { - commands: ["replace"], - }, - experimental: false, - }, - }; - } - - onDidChangeConfiguration(change: DidChangeConfigurationParams) { - this.connection.console.log(`onDidChangeConfiguration: ${JSON.stringify(change, null, 2)}`); - - const settings = change.settings as Settings; - this.enable = !!settings.prh.enable; - this.configPaths = settings.prh.configFiles || []; - - this.checkConfig(); - this.documents.all().forEach(document => this.validateAndSendDiagnostics(document)); - } - - onDidChangeContent(change: TextDocumentChangeEvent) { - this.validateAndSendDiagnostics(change.document); - } - - onDidChangeWatchedFiles(change: DidChangeWatchedFilesParams) { - this.connection.console.log(`onDidChangeWatchedFiles: ${JSON.stringify(change, null, 2)}`); - - // 設定ファイルのいずれかが変更されたらキャッシュを捨てる - const configChanged = change.changes.some(change => { - const uri = URI.parse(change.uri); - return Object.keys(this.engineCache).some(concatenatedRulePaths => { - // 若干雑な条件だけど間違っててもさほど痛くないのでOK - // rulePathはpwdからの相対パス表現なので注意 - const rulePaths = concatenatedRulePaths.split("|"); - return rulePaths.some(rulePath => { - if (uri.path.endsWith(rulePath)) { - this.connection.console.log(`matched: ${uri.path} - ${rulePath}`); - return true; - } - return false; - }); - }); - }); - if (configChanged) { - this.checkConfig(); - this.documents.all().forEach(document => this.validateAndSendDiagnostics(document)); - } - } - - onCodeAction(params: CodeActionParams): CodeAction[] { - const textDocument = this.documents.get(params.textDocument.uri); - if (!textDocument) { - return []; - } - - const changeSet = this.makeChangeSet(textDocument); - if (!changeSet) { - return []; - } - - const diffs: Diff[] = changeSet.diffs.filter(diff => { - const index = textDocument.offsetAt(params.range.start); - const tailIndex = textDocument.offsetAt(params.range.end); - return diff.index === index && diff.tailIndex === tailIndex; - }); - - const { range, context } = params; - - const actions: CodeAction[] = diffs.map(diff => { - const newText = diff.newText || "??"; - const textEdit: TextEdit = { - range, - newText - }; - const commandParams: ReplaceCommandParams = { - uri: textDocument.uri, - version: textDocument.version, - textEdit, - }; - const title = `→ ${diff.newText || "??"}`; - const command = Command.create( - title, - "replace", - commandParams - ); - const action = CodeAction.create( - title, - command, - CodeActionKind.QuickFix - ); - action.diagnostics = context.diagnostics; - return action; - }); - - return actions; - } - - onExecuteCommand(args: ExecuteCommandParams) { - switch (args.command) { - case "replace": - this.executeReplace(args); - break; - case "applyAllQuickFixes": - this.executeApplyAllQuickFixes(args); - break; - default: - this.connection.console.log(`Unknown command: ${args.command}`); - } - } - - invalidateCache() { - this.engineCache = {}; - this.validationCache = {}; - } - - checkConfig() { - this.configPaths = this.configPaths || []; - this.connection.console.log(`loadConfig: ${this.configPaths.join(", ") || "implicit"}`); - - this.invalidateCache(); - - for (let configPath of this.configPaths) { - if (!fs.existsSync(configPath)) { - this.connection.console.log(`rule file not exists: ${configPath}`); - if (this.state !== State.invalid) { - this.connection.window.showWarningMessage(`prh: 指定された設定ファイルが見つかりません ${configPath}`); - } - this.state = State.invalid; - this.documents.all().forEach(document => this.clearDiagnostics(document)); - return; - } - } - this.state = State.valid; - } - - makeChangeSet(textDocument: TextDocument): ChangeSet | null { - if (!this.enable || this.state === State.invalid) { - return null; - } - if (this.validationCache[textDocument.uri] && this.validationCache[textDocument.uri].version === textDocument.version) { - return this.validationCache[textDocument.uri].changeSet; - } - delete this.validationCache[textDocument.uri]; - - let configPaths: string[]; - if (this.configPaths && this.configPaths[0]) { - configPaths = this.configPaths; - } else { - const contentUri = URI.parse(textDocument.uri); - if (contentUri.scheme !== "file") { - return null; - } - let foundPath = getRuleFilePath(contentUri.path); - if (!foundPath) { - this.connection.console.log(`rule file not found for ${textDocument.uri}`); - return null; - } - this.connection.console.log(`rule file found: ${foundPath}`); - configPaths = [foundPath]; - } - - let engine = this.engineCache[configPaths.join("|")]; - if (!engine) { - try { - engine = fromYAMLFilePaths(...configPaths); - } catch (e) { - this.connection.console.error(e); - if (e instanceof Error) { - this.connection.window.showErrorMessage(`prh: \`${e.message}\` from ${configPaths.join(" ,")}`); - return null; - } - } - this.engineCache[configPaths.join("|")] = engine; - } - - const changeSet = engine.makeChangeSet(textDocument.uri, textDocument.getText()); - if (!changeSet) { - return null; - } - this.validationCache[textDocument.uri] = { - version: textDocument.version, - changeSet, - }; - - return changeSet; - } - - makeDiagnostic(textDocument: TextDocument): Diagnostic[] | null { - const changeSet = this.makeChangeSet(textDocument); - if (!changeSet) { - return null; - } - - return changeSet.diffs.map(diff => { - - const start = textDocument.positionAt(diff.index); - const end = textDocument.positionAt(diff.tailIndex); - const range = Range.create(start, end); - let message; - this.connection.console.log(JSON.stringify(diff)); - diff.apply(textDocument.getText()) - if (diff.rule && diff.rule.raw && diff.rule.raw.prh) { - message = `→${diff.newText || "??"} ${diff.rule.raw.prh}`; - } else { - message = `→${diff.newText || "??"}`; - } - return Diagnostic.create( - range, - message, - DiagnosticSeverity.Warning, - undefined, - "prh" - ); - }); - } - - validateAndSendDiagnostics(textDocument: TextDocument) { - const diagnostics = this.makeDiagnostic(textDocument); - this.connection.sendDiagnostics({ uri: textDocument.uri, diagnostics: diagnostics || [] }); - } - - clearDiagnostics(textDocument: TextDocument) { - this.connection.sendDiagnostics({ uri: textDocument.uri, diagnostics: [] }); - } - - executeReplace(args: ExecuteCommandParams) { - if (!args.arguments || !args.arguments[0]) { - return; - } - const commandParams: ReplaceCommandParams = args.arguments[0]; - this.connection.console.log(JSON.stringify(commandParams)); - - const textDocument = this.documents.get(commandParams.uri); - if (!textDocument) { - return; - } - - if (commandParams.version !== textDocument.version) { - this.connection.console.log(`Replace, document version mismatch: expected: ${commandParams.version}, actual: ${textDocument.version}`); - return; - } - - this.connection.workspace.applyEdit({ - documentChanges: [{ - textDocument: { - uri: textDocument.uri, - version: textDocument.version, - }, - edits: [commandParams.textEdit], - }], - }).then(result => { - this.connection.console.log(`Apply edit: ${JSON.stringify(result)}`); - }, e => { - this.connection.console.error(`error on executeReplace: ${e}`) - }); - } - - executeApplyAllQuickFixes(args: ExecuteCommandParams) { - if (!args.arguments || !args.arguments[0]) { - return; - } - - const textDocument = this.documents.get(args.arguments[0]); - if (!textDocument) { - return; - } - - const changeSet = this.makeChangeSet(textDocument); - if (!changeSet) { - return; - } - const edits = changeSet.diffs.map(diff => this.getTextEditFromDiff(textDocument, diff)); - this.connection.workspace.applyEdit({ - documentChanges: [{ - textDocument: { - uri: textDocument.uri, - version: textDocument.version, - }, - edits, - }], - }).then(result => { - this.connection.console.log(`Apply edit: ${JSON.stringify(result)}`); - }, e => { - this.connection.console.error(`error on executeApplyAllQuickFixes: ${e}`) - }); - } - - getTextEditFromDiff(textDocument: TextDocument, diff: Diff): TextEdit { - const start = textDocument.positionAt(diff.index); - const end = textDocument.positionAt(diff.tailIndex); - return { - range: { start, end }, - newText: diff.newText || "??", - }; - } -} - -{ - const connection = createConnection(); - const documents = new TextDocuments(); - documents.listen(connection); - const handler = new Handler(connection, documents); - handler.listen(); -} +import { createConnection, TextDocuments } from 'vscode-languageserver'; +import { Handler } from './handler'; + +const connection = createConnection(); +const documents = new TextDocuments(); +documents.listen(connection); +const handler = new Handler(connection, documents); +handler.listen(); diff --git a/package.json b/package.json index 95bdaf6..f53813e 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,8 @@ "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s", "vscode:update": "npm_package_engines_vscode='^1.11.0' node ./node_modules/vscode/bin/install", "build": "tsfmt -r && tsc", - "test": "concurrently --kill-others \"node lib/index.js --stdio\" \"node test/input.js\"" + "test": "ts-node test/input.ts", + "test:updateSnapshot": "UPDATE_SNAPSHOT=1 ts-node test/input.ts" }, "dependencies": { "prh": "^5.3.0", @@ -25,12 +26,14 @@ "vscode-uri": "2.1.1" }, "devDependencies": { + "@types/diff": "^4.0.2", "@types/mocha": "^2.2.32", "@types/node": "^12.12.0", "@types/vscode": "^1.40.0", - "concurrently": "^5.0.0", "conventional-changelog-cli": "^1.3.2", + "diff": "^4.0.1", "mocha": "^3.5.0", + "ts-node": "^8.5.4", "typescript": "3.6.3", "typescript-formatter": "^6.0.0", "vscode-jsonrpc": "4.0.0", diff --git a/test/input.ts b/test/input.ts index 43262ec..bd076bd 100644 --- a/test/input.ts +++ b/test/input.ts @@ -1,7 +1,122 @@ -import { InitializeParams, DidOpenTextDocumentParams, CodeActionParams, ExecuteCommandParams } from "vscode-languageclient"; -import { RequestMessage, NotificationMessage } from "vscode-jsonrpc"; +import * as Diff from 'diff'; +import * as fs from 'fs'; +import * as assert from 'assert'; +import { + Readable, + Writable, + Transform, + TransformCallback, +} from 'stream'; +import { RequestMessage } from "vscode-jsonrpc"; +import { + createConnection, + CodeActionParams, + DidOpenTextDocumentParams, + ExecuteCommandParams, + InitializeParams, + NotificationMessage, + TextDocuments, +} from 'vscode-languageserver'; +import { Handler } from '../lib/handler'; -import * as fs from "fs"; +/** + * 送信したリクエストを記録する配列。 + */ +const sentRequests: any[] = []; + +/** + * JSON-RPCリクエスト用オブジェクトを受け取り、 + * Content-Lengthヘッダを付与して、入力ストリームへプッシュする。 + * @param reqObj {any} + * @param input {Readable} + */ +function sendRequest(reqObj: any, input: Readable) { + const body = JSON.stringify(reqObj); + const head = `Content-Length: ${body.length + 2}`; + const req = `${head}\r\n\r\n${body}\r\n`; + input.push(req); + sentRequests.push(req); +} + +/** + * 入力ストリーム。 + */ +const input = new Readable(); +input._read = () => {}; + +let actualOut = ''; + +/** + * STDOUTへの出力とスナップショットへの記録を制御する + * Transformストリーム。 + * 入力ストリームと出力ストリームの間にはさむ。 + */ +const buffer: Transform = new Transform({ + transform( + chunk: string | Buffer, + encoding: string, + done: TransformCallback + ): void { + const req = chunk.toString(); + // 送信したリクエストは標準出力にも出さずスナップショットにも記録しない + if (sentRequests.indexOf(req) < 0) { + actualOut += req; + this.push(chunk); + process.stdout.write(req); + } + done(); + } +}); + +/** + * スナップショット記録用の出力ストリーム。 + */ +let file: Writable; + +const snapshotPath = __filename + '.snapshot.txt'; +if (!fs.existsSync(snapshotPath) || process.env['UPDATE_SNAPSHOT'] === '1') { + file = fs.createWriteStream(snapshotPath, { + encoding: 'utf8', + autoClose: true, + }); + input.pipe(buffer).pipe(file); +} else { + input.pipe(buffer); +} + +/** + * 今回の出力結果を記録済みスナップショットと比較する。 + * connection.onExit()に渡すイベントハンドラー。 + */ +function exitHandler(): void { + if (!fs.existsSync(snapshotPath)) { + throw new Error(`${snapshotPath} does not exist!`); + } + + const expectedOut = fs.readFileSync(snapshotPath, { + encoding: 'utf8', + }); + console.log(); + + try { + assert.equal(actualOut, expectedOut, 'Different from snapshot!'); + console.log('ok'); + } catch (err) { + const title = 'Laugnage server responses'; + const patch = Diff.createPatch(title, expectedOut, actualOut, 'snapshot', 'current'); + console.log(patch); + console.log('\n' + err.message); + } +} + +{ + const connection = createConnection(input, buffer); + connection.onExit(exitHandler); + const documents = new TextDocuments(); + documents.listen(connection); + const handler = new Handler(connection, documents); + handler.listen(); +} let seq = 0; { @@ -28,9 +143,7 @@ let seq = 0; params: params, }; - const jsonStr = JSON.stringify(req); - process.stdout.write(`Content-Length: ${jsonStr.length + 2}\r\n\r\n`); - process.stdout.write(`${jsonStr}\r\n`); + sendRequest(req, input); } { const content = fs.readFileSync("./fixture/test.txt", "utf8"); @@ -48,9 +161,7 @@ let seq = 0; params: params, }; - const jsonStr = JSON.stringify(req); - process.stdout.write(`Content-Length: ${jsonStr.length + 2}\r\n\r\n`); - process.stdout.write(`${jsonStr}\r\n`); + sendRequest(req, input); } { const params: CodeActionParams = { @@ -78,9 +189,7 @@ let seq = 0; params: params, }; - const jsonStr = JSON.stringify(req); - process.stdout.write(`Content-Length: ${jsonStr.length + 2}\r\n\r\n`); - process.stdout.write(`${jsonStr}\r\n`); + sendRequest(req, input); } { const params: ExecuteCommandParams = { @@ -110,9 +219,7 @@ let seq = 0; params: params, }; - const jsonStr = JSON.stringify(req); - process.stdout.write(`Content-Length: ${jsonStr.length + 2}\r\n\r\n`); - process.stdout.write(`${jsonStr}\r\n`); + sendRequest(req, input); } { const req: RequestMessage = { @@ -121,9 +228,7 @@ let seq = 0; method: "shutdown", }; - const jsonStr = JSON.stringify(req); - process.stdout.write(`Content-Length: ${jsonStr.length + 2}\r\n\r\n`); - process.stdout.write(`${jsonStr}\r\n`); + sendRequest(req, input); } { const req: NotificationMessage = { @@ -131,7 +236,5 @@ let seq = 0; method: "exit", }; - const jsonStr = JSON.stringify(req); - process.stdout.write(`Content-Length: ${jsonStr.length + 2}\r\n\r\n`); - process.stdout.write(`${jsonStr}\r\n`); + sendRequest(req, input); } diff --git a/test/input.ts.snapshot.txt b/test/input.ts.snapshot.txt new file mode 100644 index 0000000..accd65b --- /dev/null +++ b/test/input.ts.snapshot.txt @@ -0,0 +1,15 @@ +Content-Length: 469 + +{"jsonrpc":"2.0","id":1,"result":{"capabilities":{"textDocumentSync":1,"hoverProvider":false,"definitionProvider":false,"referencesProvider":false,"documentHighlightProvider":false,"documentSymbolProvider":false,"workspaceSymbolProvider":false,"codeActionProvider":{"codeActionKinds":["quickfix"]},"documentFormattingProvider":false,"documentRangeFormattingProvider":false,"renameProvider":false,"executeCommandProvider":{"commands":["replace"]},"experimental":false}}}Content-Length: 115 + +{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"./fixture/test.txt","diagnostics":[]}}Content-Length: 36 + +{"jsonrpc":"2.0","id":2,"result":[]}Content-Length: 256 + +{"jsonrpc":"2.0","method":"window/logMessage","params":{"type":4,"message":"{\"uri\":\"./fixture/test.txt\",\"version\":1,\"textEdit\":{\"range\":{\"start\":{\"line\":0,\"character\":0},\"end\":{\"line\":0,\"character\":10}},\"newText\":\"JavaScript\"}}"}}Content-Length: 263 + +{"jsonrpc":"2.0","id":0,"method":"workspace/applyEdit","params":{"edit":{"documentChanges":[{"textDocument":{"uri":"./fixture/test.txt","version":1},"edits":[{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":10}},"newText":"JavaScript"}]}]}}}Content-Length: 38 + +{"jsonrpc":"2.0","id":3,"result":null}Content-Length: 38 + +{"jsonrpc":"2.0","id":4,"result":null} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 2dd4f52..16d027b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,11 @@ # yarn lockfile v1 +"@types/diff@^4.0.2": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@types/diff/-/diff-4.0.2.tgz#2e9bb89f9acc3ab0108f0f3dc4dbdcf2fff8a99c" + integrity sha512-mIenTfsIe586/yzsyfql69KRnA75S8SVXQbTLpDejRrjH0QSJcpu3AUOi/Vjnt9IOsXKxPhJfGpQUNMueIU1fQ== + "@types/mocha@^2.2.32": version "2.2.41" resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.41.tgz#e27cf0817153eb9f2713b2d3f6c68f1e1c3ca608" @@ -39,22 +44,10 @@ amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= - -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" +arg@^4.1.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.2.tgz#e70c90579e02c63d80e3ad4e31d8bfdb8bd50064" + integrity sha512-+ytCkGcBtHZ3V2r2Z06AncYO8jz46UEamcspGoU8lHcEbpn6J77QK0vdWvChsclg/tM5XIJC5tnjmPp7Eq6Obg== argparse@^1.0.7: version "1.0.9" @@ -93,6 +86,11 @@ browser-stdout@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + buffer-shims@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" @@ -116,11 +114,6 @@ camelcase@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" -camelcase@^5.0.0: - version "5.3.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - center-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" @@ -128,15 +121,6 @@ center-align@^0.1.1: align-text "^0.1.3" lazy-cache "^1.0.3" -chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - cliui@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" @@ -145,32 +129,6 @@ cliui@^2.1.0: right-align "^0.1.1" wordwrap "0.0.2" -cliui@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" - integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== - dependencies: - string-width "^2.1.1" - strip-ansi "^4.0.0" - wrap-ansi "^2.0.0" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - commander@2.9.0, commander@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" @@ -196,21 +154,6 @@ concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" -concurrently@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-5.0.0.tgz#99c7567d009411fbdc98299d553c4b99a978612c" - integrity sha512-1yDvK8mduTIdxIxV9C60KoiOySUl/lfekpdbI+U5GXaPrgdffEavFa9QZB3vh68oWOpbCC+TuvxXV9YRPMvUrA== - dependencies: - chalk "^2.4.2" - date-fns "^2.0.1" - lodash "^4.17.15" - read-pkg "^4.0.1" - rxjs "^6.5.2" - spawn-command "^0.0.2-1" - supports-color "^4.5.0" - tree-kill "^1.2.1" - yargs "^12.0.5" - conventional-changelog-angular@^1.3.4: version "1.4.0" resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-1.4.0.tgz#118b9f7d41a3d99500bfb6bea1f3525e055e8b9b" @@ -350,17 +293,6 @@ core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" -cross-spawn@^6.0.0: - version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" - integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== - dependencies: - nice-try "^1.0.4" - path-key "^2.0.1" - semver "^5.5.0" - shebang-command "^1.2.0" - which "^1.2.9" - currently-unhandled@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" @@ -373,11 +305,6 @@ dargs@^4.0.1: dependencies: number-is-nan "^1.0.0" -date-fns@^2.0.1: - version "2.8.1" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.8.1.tgz#2109362ccb6c87c3ca011e9e31f702bc09e4123b" - integrity sha512-EL/C8IHvYRwAHYgFRse4MGAPSqlJVlOrhVYZ75iQBKrnv+ZedmYsgwH3t+BCDuZDXpoo07+q9j4qgSSOa7irJg== - dateformat@^1.0.11, dateformat@^1.0.12: version "1.0.12" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-1.0.12.tgz#9f124b67594c937ff706932e4a642cca8dbbfee9" @@ -391,7 +318,7 @@ debug@2.6.8: dependencies: ms "2.0.0" -decamelize@^1.0.0, decamelize@^1.1.2, decamelize@^1.2.0: +decamelize@^1.0.0, decamelize@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -403,6 +330,11 @@ diff@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.0.tgz#056695150d7aa93237ca7e378ac3b1682b7963b9" +diff@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.1.tgz#0c667cb467ebbb5cea7f14f135cc2dba7780a8ff" + integrity sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q== + dot-prop@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-3.0.0.tgz#1b708af094a49c9a0e7dbcad790aba539dac1177" @@ -418,27 +350,13 @@ editorconfig@^0.13.2: lru-cache "^3.2.0" sigmund "^1.0.1" -end-of-stream@^1.1.0: - version "1.4.4" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" - integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== - dependencies: - once "^1.4.0" - error-ex@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" dependencies: is-arrayish "^0.2.1" -error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.5: +escape-string-regexp@1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -446,19 +364,6 @@ esprima@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" -execa@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" - integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== - dependencies: - 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" - find-up@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" @@ -472,22 +377,10 @@ find-up@^2.0.0: dependencies: locate-path "^2.0.0" -find-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" - integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== - dependencies: - locate-path "^3.0.0" - fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" -get-caller-file@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" - integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== - get-pkg-repo@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz#c73b489c06d80cc5536c2c853f9e05232056972d" @@ -502,13 +395,6 @@ get-stdin@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" -get-stream@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" - integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== - dependencies: - pump "^3.0.0" - git-raw-commits@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-1.2.0.tgz#0f3a8bfd99ae0f2d8b9224d58892975e9a52d03c" @@ -580,16 +466,6 @@ has-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" -has-flag@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" - integrity sha1-6CB68cx7MNRGzHC3NLXovhj4jVE= - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - hosted-git-info@^2.1.4: version "2.5.0" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.5.0.tgz#6d60e34b3abbc8313062c3b798ef8d901a07af3c" @@ -615,11 +491,6 @@ ini@^1.3.2: version "1.3.4" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e" -invert-kv@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" - integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA== - is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" @@ -640,27 +511,10 @@ is-finite@^1.0.0: dependencies: number-is-nan "^1.0.0" -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= - is-obj@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" -is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= - is-subset@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6" @@ -679,11 +533,6 @@ isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - js-yaml@^3.9.1: version "3.9.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.9.1.tgz#08775cebdfdd359209f0d2acd383c8f86a6904a0" @@ -691,11 +540,6 @@ js-yaml@^3.9.1: argparse "^1.0.7" esprima "^4.0.0" -json-parse-better-errors@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" - integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== - json-stringify-safe@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" @@ -718,13 +562,6 @@ lazy-cache@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" -lcid@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" - integrity sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA== - dependencies: - invert-kv "^2.0.0" - load-json-file@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" @@ -751,14 +588,6 @@ locate-path@^2.0.0: p-locate "^2.0.0" path-exists "^3.0.0" -locate-path@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" - integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== - dependencies: - p-locate "^3.0.0" - path-exists "^3.0.0" - lodash._baseassign@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e" @@ -827,11 +656,6 @@ lodash@^4.0.0, lodash@^4.1.0, lodash@^4.2.1: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" -lodash@^4.17.15: - version "4.17.15" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" - integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== - longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" @@ -849,26 +673,15 @@ lru-cache@^3.2.0: dependencies: pseudomap "^1.0.1" -map-age-cleaner@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" - integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w== - dependencies: - p-defer "^1.0.0" +make-error@^1.1.1: + version "1.3.5" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.5.tgz#efe4e81f6db28cadd605c70f29c831b58ef776c8" + integrity sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g== map-obj@^1.0.0, map-obj@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" -mem@^4.0.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178" - integrity sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w== - dependencies: - map-age-cleaner "^0.1.1" - mimic-fn "^2.0.0" - p-is-promise "^2.0.0" - meow@^3.3.0, meow@^3.7.0: version "3.7.0" resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" @@ -884,11 +697,6 @@ meow@^3.3.0, meow@^3.7.0: redent "^1.0.0" trim-newlines "^1.0.0" -mimic-fn@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - minimatch@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" @@ -937,11 +745,6 @@ ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" -nice-try@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" - integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== - normalize-package-data@^2.3.0, normalize-package-data@^2.3.2, normalize-package-data@^2.3.4, normalize-package-data@^2.3.5: version "2.4.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" @@ -951,13 +754,6 @@ normalize-package-data@^2.3.0, normalize-package-data@^2.3.2, normalize-package- semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" -npm-run-path@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" - integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= - dependencies: - path-key "^2.0.0" - number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" @@ -966,7 +762,7 @@ object-assign@^4.0.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" -once@^1.3.0, once@^1.3.1, once@^1.4.0: +once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" dependencies: @@ -979,63 +775,20 @@ optimist@^0.6.1: minimist "~0.0.1" wordwrap "~0.0.2" -os-locale@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" - integrity sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q== - dependencies: - execa "^1.0.0" - lcid "^2.0.0" - mem "^4.0.0" - os-tmpdir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" -p-defer@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" - integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= - -p-finally@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= - -p-is-promise@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" - integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg== - p-limit@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc" -p-limit@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.1.tgz#aa07a788cc3151c939b5131f63570f0dd2009537" - integrity sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg== - dependencies: - p-try "^2.0.0" - p-locate@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" dependencies: p-limit "^1.1.0" -p-locate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" - integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== - dependencies: - p-limit "^2.0.0" - -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - parse-github-repo-url@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/parse-github-repo-url/-/parse-github-repo-url-1.4.0.tgz#286c53e2c9962e0641649ee3ac9508fca4dd959c" @@ -1046,14 +799,6 @@ parse-json@^2.2.0: dependencies: error-ex "^1.2.0" -parse-json@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" - integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= - dependencies: - error-ex "^1.3.1" - json-parse-better-errors "^1.0.1" - path-exists@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" @@ -1068,11 +813,6 @@ path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" -path-key@^2.0.0, path-key@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= - path-type@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" @@ -1091,11 +831,6 @@ pify@^2.0.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" -pify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= - pinkie-promise@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" @@ -1122,14 +857,6 @@ pseudomap@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" -pump@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" - integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - q@^1.4.1: version "1.5.0" resolved "https://registry.yarnpkg.com/q/-/q-1.5.0.tgz#dd01bac9d06d30e6f219aecb8253ee9ebdc308f1" @@ -1164,15 +891,6 @@ read-pkg@^2.0.0: normalize-package-data "^2.3.2" path-type "^2.0.0" -read-pkg@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-4.0.1.tgz#963625378f3e1c4d48c85872b5a6ec7d5d093237" - integrity sha1-ljYlN48+HE1IyFhytabsfV0JMjc= - dependencies: - normalize-package-data "^2.3.2" - parse-json "^4.0.0" - pify "^3.0.0" - readable-stream@^2.1.5: version "2.2.9" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.9.tgz#cf78ec6f4a6d1eb43d26488cac97f042e74b7fc8" @@ -1202,29 +920,12 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= - -require-main-filename@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" - integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= - right-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" dependencies: align-text "^0.1.1" -rxjs@^6.5.2: - version "6.5.3" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.3.tgz#510e26317f4db91a7eb1de77d9dd9ba0a4899a3a" - integrity sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA== - dependencies: - tslib "^1.9.0" - "semver@2 || 3 || 4 || 5", semver@^5.0.1: version "5.4.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" @@ -1234,23 +935,6 @@ semver@^5.5.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -set-blocking@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= - -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= - dependencies: - shebang-regex "^1.0.0" - -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= - sigmund@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590" @@ -1259,21 +943,29 @@ signal-exit@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" +source-map-support@^0.5.6: + version "0.5.16" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.16.tgz#0ae069e7fe3ba7538c64c98515e35339eac5a042" + integrity sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + source-map@^0.4.4: version "0.4.4" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" dependencies: amdefine ">=0.0.4" +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + source-map@~0.5.1: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" -spawn-command@^0.0.2-1: - version "0.0.2-1" - resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2-1.tgz#62f5e9466981c1b796dc5929937e11c9c6921bd0" - integrity sha1-YvXpRmmBwbeW3Fkpk34RycaSG9A= - spdx-correct@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" @@ -1304,43 +996,12 @@ sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -string-width@^2.0.0, string-width@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - string_decoder@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.0.tgz#f06f41157b664d86069f84bdbdc9b0d8ab281667" dependencies: buffer-shims "~1.0.0" -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= - dependencies: - ansi-regex "^3.0.0" - strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" @@ -1351,11 +1012,6 @@ strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" -strip-eof@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" - integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= - strip-indent@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2" @@ -1368,20 +1024,6 @@ supports-color@3.1.2: dependencies: has-flag "^1.0.0" -supports-color@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b" - integrity sha1-vnoN5ITexcXN34s9WRJQRJEvY1s= - dependencies: - has-flag "^2.0.0" - -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - tempfile@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/tempfile/-/tempfile-1.1.1.tgz#5bcc4eaecc4ab2c707d8bc11d99ccc9a2cb287f2" @@ -1404,11 +1046,6 @@ through@2, "through@>=2.2.7 <3": version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" -tree-kill@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.1.tgz#5398f374e2f292b9dcc7b2e71e30a5c3bb6c743a" - integrity sha512-4hjqbObwlh2dLyW4tcz0Ymw0ggoaVDMveUB9w8kFSQScdRLo0gxO9J7WFcUBo+W3C1TLdFIEwNOWebgZZ0RH9Q== - trim-newlines@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" @@ -1417,10 +1054,16 @@ trim-off-newlines@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz#9f9ba9d9efa8764c387698bcbfeb2c848f11adb3" -tslib@^1.9.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" - integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== +ts-node@^8.5.4: + version "8.5.4" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.5.4.tgz#a152add11fa19c221d0b48962c210cf467262ab2" + integrity sha512-izbVCRV68EasEPQ8MSIGBNK9dc/4sYJJKYA+IarMQct1RtEot6Xp0bXuClsbUSnKpg50ho+aOAx8en5c+y4OFw== + dependencies: + arg "^4.1.0" + diff "^4.0.1" + make-error "^1.1.1" + source-map-support "^0.5.6" + yn "^3.0.0" typescript-formatter@^6.0.0: version "6.0.0" @@ -1506,18 +1149,6 @@ vscode-uri@^1.0.6: resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-1.0.8.tgz#9769aaececae4026fb6e22359cb38946580ded59" integrity sha512-obtSWTlbJ+a+TFRYGaUumtVwb+InIUVI0Lu0VBUAPmj2cU5JutEXg3xUE0c2J5Tcy7h2DEKVJBFi+Y9ZSFzzPQ== -which-module@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" - integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= - -which@^1.2.9: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - window-size@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" @@ -1530,14 +1161,6 @@ wordwrap@~0.0.2: version "0.0.3" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" @@ -1546,37 +1169,6 @@ xtend@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" -"y18n@^3.2.1 || ^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" - integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== - -yargs-parser@^11.1.1: - version "11.1.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-11.1.1.tgz#879a0865973bca9f6bab5cbdf3b1c67ec7d3bcf4" - integrity sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - -yargs@^12.0.5: - version "12.0.5" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" - integrity sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw== - dependencies: - 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@~3.10.0: version "3.10.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" @@ -1585,3 +1177,8 @@ yargs@~3.10.0: cliui "^2.1.0" decamelize "^1.0.0" window-size "0.1.0" + +yn@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== From d9f8f9de6077a7e8fae05d0f0ba708a8b86f0f58 Mon Sep 17 00:00:00 2001 From: Shusaku NAKAZATO Date: Sat, 21 Dec 2019 15:47:03 +0900 Subject: [PATCH 2/2] =?UTF-8?q?chore(prhls):=20tsfmt=E3=81=AB=E3=82=88?= =?UTF-8?q?=E3=82=8B=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/input.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/input.ts b/test/input.ts index bd076bd..ed1bbf2 100644 --- a/test/input.ts +++ b/test/input.ts @@ -42,7 +42,7 @@ function sendRequest(reqObj: any, input: Readable) { * 入力ストリーム。 */ const input = new Readable(); -input._read = () => {}; +input._read = () => { }; let actualOut = '';