diff --git a/.npmignore b/.npmignore index c16d57c..cf5b4b4 100644 --- a/.npmignore +++ b/.npmignore @@ -1,8 +1,7 @@ /.vscode/ -/lib/ /out/ +/scripts/ /src/ /test/ -/release/dev/ -/gulpfile.js +/.gitignore /.npmignore diff --git a/README.md b/README.md index e445c60..d68e8d7 100644 --- a/README.md +++ b/README.md @@ -7,21 +7,37 @@ YAML language plugin for the Monaco Editor. It provides the following features w * Formatting * Document Symbols * Syntax highlighting +* Automatically load remote schema files -Schemas can be provided by configuration. See [here](https://github.com/Microsoft/monaco-json/blob/master/src/monaco.d.ts) +Schemas can also be provided by configuration. See [here](https://github.com/Microsoft/monaco-json/blob/master/src/monaco.d.ts) for the API that the JSON plugin offers to configure the JSON language support. ## Installing -TODO: Document exact distribution method +`yarn add monaco-yaml` +See `test/index.html` as an example. Currently only load with vs loader is supported. (AMD) +Load with ESM is added, but not yet tested. ## Development * `git clone https://github.com/kpdecker/monaco-yaml` * `cd monaco-yaml` * `yarn` -* `npm run watch` +* `yarn watch` * open `$/monaco-yaml/test/index.html` in your favorite browser. +A running example: +![demo-image](test-demo.png) + +## Credits +- https://github.com/redhat-developer/yaml-language-server + +### Maintain +Manually clone dependencies list below and update the project files accordingly: +- `src/languageservice`: https://github.com/redhat-developer/yaml-language-server + - `cp yaml-language-server/src/languageservice monaco-yaml/src/languageservice` + - Modify the import paths, go to the test page and see if it still works +- `src/yaml-ast-parser`: https://github.com/mulesoft-labs/yaml-ast-parser/tree/master/src + ## License [MIT](https://github.com/kpdecker/monaco-yaml/blob/master/LICENSE.md) diff --git a/gulpfile.js b/gulpfile.js deleted file mode 100644 index 8c84b3e..0000000 --- a/gulpfile.js +++ /dev/null @@ -1,190 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var gulp = require('gulp'); -var tsb = require('gulp-tsb'); -var assign = require('object-assign'); -var fs = require('fs'); -var path = require('path'); -var merge = require('merge-stream'); -var rjs = require('gulp-requirejs'); -var uglify = require('gulp-uglify'); -var rimraf = require('rimraf'); -var es = require('event-stream'); - -gulp.task('clean-release', function (cb) { rimraf('release', { maxBusyTries: 1 }, cb); }); -gulp.task('release', ['clean-release', 'compile'], function () { - - var sha1 = getGitVersion(__dirname); - var semver = require('./package.json').version; - var headerVersion = semver + '(' + sha1 + ')'; - - var BUNDLED_FILE_HEADER = [ - '/*!-----------------------------------------------------------------------------', - ' * Copyright (c) Microsoft Corporation. All rights reserved.', - ' * monaco-json version: ' + headerVersion, - ' * Released under the MIT license', - ' * https://github.com/Microsoft/monaco-json/blob/master/LICENSE.md', - ' *-----------------------------------------------------------------------------*/', - '' - ].join('\n'); - - function getDependencyLocation(name, libLocation, container) { - var location = __dirname + '/node_modules/' + name + '/' + libLocation; - if (!fs.existsSync(location)) { - var oldLocation = __dirname + '/node_modules/' + container + '/node_modules/' + name + '/' + libLocation; - if (!fs.existsSync(oldLocation)) { - console.error('Unable to find ' + name + ' node module at ' + location + ' or ' + oldLocation); - return; - } - return oldLocation; - } - return location; - } - - var jsoncLocation = getDependencyLocation('jsonc-parser', 'lib', 'vscode-json-languageservice'); - var uriLocation = getDependencyLocation('vscode-uri', 'lib', 'vscode-json-languageservice'); - - function bundleOne(moduleId, exclude) { - - - return rjs({ - baseUrl: '/out/', - name: 'vs/languages/yaml/' + moduleId, - out: moduleId + '.js', - exclude: exclude, - paths: { - 'vs/languages/yaml': __dirname + '/out' - }, - packages: [{ - name: 'yaml-ast-parser', - location: __dirname + '/out/yaml-ast-parser', - main: 'index' - }, { - name: 'js-yaml', - location: __dirname + '/node_modules/js-yaml/dist', - main: 'js-yaml' - }, { - name: 'vscode-json-languageservice', - location: __dirname + '/node_modules/vscode-json-languageservice', - main: 'jsonLanguageService' - }, { - name: 'vscode-languageserver-types', - location: __dirname + '/node_modules/vscode-languageserver-types/lib', - main: 'main' - }, { - name: 'vscode-uri', - location: uriLocation, - main: 'index' - }, { - name: 'jsonc-parser', - location: jsoncLocation, - main: 'main' - }, { - name: 'vscode-uri', - location: uriLocation, - main: 'index' - }, { - name: 'vscode-nls', - location: __dirname + '/out/fillers', - main: 'vscode-nls' - }, { - name: 'os', - location: __dirname + '/out/fillers', - main: 'os' - }] - }) - } - - return merge( - merge( - bundleOne('monaco.contribution', ['vs/languages/yaml/yamlMode']), - bundleOne('yamlMode'), - bundleOne('yamlWorker') - ) - .pipe(es.through(function (data) { - data.contents = new Buffer( - BUNDLED_FILE_HEADER - + data.contents.toString() - ); - this.emit('data', data); - })) - .pipe(gulp.dest('./release/dev')) - .pipe(uglify({ - preserveComments: 'some' - })) - .pipe(gulp.dest('./release/min')), - gulp.src('src/monaco.d.ts').pipe(gulp.dest('./release/min')) - ); -}); - - -var compilation = tsb.create(assign({ verbose: true }, require('./src/tsconfig.json').compilerOptions)); - -var tsSources = 'src/**/*.ts'; - -function compileTask() { - return merge( - gulp.src(tsSources).pipe(compilation()) - ) - .pipe(gulp.dest('out')); -} - -gulp.task('clean-out', function (cb) { rimraf('out', { maxBusyTries: 1 }, cb); }); -gulp.task('compile', ['clean-out'], compileTask); -gulp.task('compile-without-clean', compileTask); -gulp.task('watch', ['compile'], function () { - gulp.watch(tsSources, ['compile-without-clean']); -}); - -function getGitVersion(repo) { - var git = path.join(repo, '.git'); - var headPath = path.join(git, 'HEAD'); - var head; - - try { - head = fs.readFileSync(headPath, 'utf8').trim(); - } catch (e) { - return void 0; - } - - if (/^[0-9a-f]{40}$/i.test(head)) { - return head; - } - - var refMatch = /^ref: (.*)$/.exec(head); - - if (!refMatch) { - return void 0; - } - - var ref = refMatch[1]; - var refPath = path.join(git, ref); - - try { - return fs.readFileSync(refPath, 'utf8').trim(); - } catch (e) { - // noop - } - - var packedRefsPath = path.join(git, 'packed-refs'); - var refsRaw; - - try { - refsRaw = fs.readFileSync(packedRefsPath, 'utf8').trim(); - } catch (e) { - return void 0; - } - - var refsRegex = /^([0-9a-f]{40})\s+(.+)$/gm; - var refsMatch; - var refs = {}; - - while (refsMatch = refsRegex.exec(refsRaw)) { - refs[refsMatch[2]] = refsMatch[1]; - } - - return refs[ref]; -} \ No newline at end of file diff --git a/package.json b/package.json index 365b1ed..dd53d85 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,39 @@ { "name": "monaco-yaml", - "version": "1.0.0", + "version": "1.1.0", "description": "YAML plugin for the Monaco Editor", "scripts": { - "compile": "gulp compile", - "watch": "gulp watch", - "prepublish": "gulp release" + "compile": "rimraf ./out && tsc -p ./src/tsconfig.json && tsc -p ./src/tsconfig.esm.json", + "watch": "tsc -p ./src --watch", + "prepublish": "rimraf ./release && yarn run compile && node ./scripts/release.js && node ./scripts/bundle && mcopy ./src/monaco.d.ts ./release/monaco.d.ts" }, "author": "Kevin Decker (http://incaseofstairs.com)", + "maintainers": [ + "kpdecker", + "pengx17" + ], "license": "MIT", "repository": { "type": "git", "url": "https://github.com/kpdecker/monaco-yaml" }, + "bugs": { + "url": "https://github.com/kpdecker/monaco-yaml/issues" + }, "devDependencies": { - "event-stream": "^3.3.2", - "gulp": "^3.9.1", - "gulp-requirejs": "^0.1.3", - "gulp-tsb": "^2.0.0", - "gulp-uglify": "^1.5.3", - "js-yaml": "^3.10.0", - "jsonc-parser": "1.0.0", - "merge-stream": "^1.0.0", - "monaco-editor-core": "^0.10.1", - "monaco-languages": "^0.9.0", - "object-assign": "^4.1.0", - "rimraf": "^2.5.2", - "typescript": "^2.7.1", - "vscode-json-languageservice": "^3.0.5", - "vscode-languageserver-types": "^3.5.0" + "@types/chai": "^4.1.4", + "@types/mocha": "^5.2.5", + "@types/node": "^10.9.3", + "js-yaml": "^3.12.0", + "jsonc-parser": "^2.0.2", + "monaco-editor-core": "0.14.6", + "monaco-languages": "1.5.1", + "monaco-plugin-helpers": "^1.0.2", + "requirejs": "^2.3.5", + "rimraf": "^2.6.2", + "typescript": "^3.0.3", + "uglify-es": "^3.3.9", + "vscode-json-languageservice": "^3.1.6", + "vscode-languageserver-types": "3.12.0" } } diff --git a/scripts/bundle.js b/scripts/bundle.js new file mode 100644 index 0000000..51ff186 --- /dev/null +++ b/scripts/bundle.js @@ -0,0 +1,82 @@ +const requirejs = require('requirejs'); +const path = require('path'); +const fs = require('fs'); +const UglifyES = require("uglify-es"); +const helpers = require('monaco-plugin-helpers'); + +const REPO_ROOT = path.resolve(__dirname, '..'); + +const sha1 = helpers.getGitVersion(REPO_ROOT); +const semver = require('../package.json').version; +const headerVersion = semver + '(' + sha1 + ')'; + +const BUNDLED_FILE_HEADER = [ + '/*!-----------------------------------------------------------------------------', + ' * Copyright (c) Microsoft Corporation. All rights reserved.', + ' * monaco-yaml version: ' + headerVersion, + ' * Released under the MIT license', + ' * https://github.com/kpdecker/monaco-yaml/blob/master/LICENSE.md', + ' *-----------------------------------------------------------------------------*/', + '' +].join('\n'); + +bundleOne('monaco.contribution'); +bundleOne('yamlMode'); +bundleOne('yamlWorker'); + +function bundleOne(moduleId, exclude) { + requirejs.optimize({ + baseUrl: 'out/amd/', + name: 'vs/language/yaml/' + moduleId, + out: 'release/dev/' + moduleId + '.js', + exclude: exclude, + paths: { + 'vs/language/yaml': REPO_ROOT + '/out/amd' + }, + optimize: 'none', + packages: [ + { + name: 'js-yaml', + location: path.join(REPO_ROOT, 'node_modules/js-yaml/dist'), + main: 'js-yaml' + }, + + // The following is required by YAML language service + { + name: 'jsonc-parser', + location: path.join(REPO_ROOT, 'node_modules/jsonc-parser/lib/umd'), + main: 'main' + }, { + name: 'vscode-json-languageservice/lib', + location: path.join(REPO_ROOT, 'node_modules/vscode-json-languageservice/lib/umd') + }, + + { + name: 'vscode-languageserver-types', + location: path.join(REPO_ROOT, 'node_modules/vscode-languageserver-types/lib/umd'), + main: 'main' + }, { + name: 'vscode-uri', + location: path.join(REPO_ROOT, 'node_modules/vscode-uri/lib/umd'), + main: 'index' + }, { + name: 'vscode-nls', + location: path.join(REPO_ROOT, '/out/amd/fillers'), + main: 'vscode-nls' + }] + }, function () { + const devFilePath = path.join(REPO_ROOT, 'release/dev/' + moduleId + '.js'); + const minFilePath = path.join(REPO_ROOT, 'release/min/' + moduleId + '.js'); + const fileContents = fs.readFileSync(devFilePath).toString(); + console.log(); + console.log(`Minifying ${devFilePath}...`); + const result = UglifyES.minify(fileContents, { + output: { + comments: 'some' + } + }); + console.log(`Done.`); + try { fs.mkdirSync(path.join(REPO_ROOT, 'release/min')) } catch (err) { } + fs.writeFileSync(minFilePath, BUNDLED_FILE_HEADER + result.code); + }) +} diff --git a/scripts/release.js b/scripts/release.js new file mode 100644 index 0000000..593140c --- /dev/null +++ b/scripts/release.js @@ -0,0 +1,28 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +const path = require("path"); +const helpers = require("monaco-plugin-helpers"); + +const REPO_ROOT = path.join(__dirname, "../"); + +helpers.packageESM({ + repoRoot: REPO_ROOT, + esmSource: "out/esm", + esmDestination: "release/esm", + entryPoints: ["monaco.contribution.js", "yamlMode.js", "yaml.worker.js"], + resolveAlias: { + "vscode-nls": path.join(REPO_ROOT, "out/esm/fillers/vscode-nls.js") + }, + resolveSkip: ["monaco-editor-core", "js-yaml"], + destinationFolderSimplification: { + node_modules: "_deps", + "jsonc-parser/lib/esm": "jsonc-parser", + "vscode-languageserver-types/lib/esm": "vscode-languageserver-types", + "vscode-uri/lib/esm": "vscode-uri", + "vscode-json-languageservice/lib/esm": "vscode-json-languageservice", + // "js-yaml/dist": "js-yaml" + } +}); diff --git a/src/languageFeatures.ts b/src/languageFeatures.ts index 97afcbd..b518e9e 100644 --- a/src/languageFeatures.ts +++ b/src/languageFeatures.ts @@ -12,6 +12,7 @@ import * as ls from 'vscode-languageserver-types'; import Uri = monaco.Uri; import Position = monaco.Position; import Range = monaco.Range; +import IRange = monaco.IRange; import Thenable = monaco.Thenable; import Promise = monaco.Promise; import CancellationToken = monaco.CancellationToken; @@ -24,19 +25,19 @@ export interface WorkerAccessor { // --- diagnostics --- --- -export class DiagnostcsAdapter { +export class DiagnosticsAdapter { private _disposables: IDisposable[] = []; private _listener: { [uri: string]: IDisposable } = Object.create(null); - constructor(private _languageId: string, private _worker: WorkerAccessor) { + constructor(private _languageId: string, private _worker: WorkerAccessor, defaults: LanguageServiceDefaultsImpl) { const onModelAdd = (model: monaco.editor.IModel): void => { let modeId = model.getModeId(); if (modeId !== this._languageId) { return; } - let handle: number; + let handle: NodeJS.Timer; this._listener[model.uri.toString()] = model.onDidChangeContent(() => { clearTimeout(handle); handle = setTimeout(() => this._doValidate(model.uri, modeId), 500); @@ -66,8 +67,18 @@ export class DiagnostcsAdapter { this._resetSchema(event.model.uri); })); + this._disposables.push(defaults.onDidChange(_ => { + monaco.editor.getModels().forEach(model => { + if (model.getModeId() === this._languageId) { + onModelRemoved(model); + onModelAdd(model); + } + }); + })); + this._disposables.push({ dispose: () => { + monaco.editor.getModels().forEach(onModelRemoved); for (let key in this._listener) { this._listener[key].dispose(); } @@ -104,14 +115,14 @@ export class DiagnostcsAdapter { } -function toSeverity(lsSeverity: number): monaco.Severity { +function toSeverity(lsSeverity: number): monaco.MarkerSeverity { switch (lsSeverity) { - case ls.DiagnosticSeverity.Error: return monaco.Severity.Error; - case ls.DiagnosticSeverity.Warning: return monaco.Severity.Warning; - case ls.DiagnosticSeverity.Information: - case ls.DiagnosticSeverity.Hint: + case ls.DiagnosticSeverity.Error: return monaco.MarkerSeverity.Error; + case ls.DiagnosticSeverity.Warning: return monaco.MarkerSeverity.Warning; + case ls.DiagnosticSeverity.Information: return monaco.MarkerSeverity.Info; + case ls.DiagnosticSeverity.Hint: return monaco.MarkerSeverity.Hint; default: - return monaco.Severity.Info; + return monaco.MarkerSeverity.Info; } } @@ -139,13 +150,12 @@ function fromPosition(position: Position): ls.Position { return { character: position.column - 1, line: position.lineNumber - 1 }; } -function fromRange(range: Range): ls.Range { +function fromRange(range: IRange): ls.Range { if (!range) { return void 0; } - return { start: fromPosition(range.getStartPosition()), end: fromPosition(range.getEndPosition()) }; + return { start: { line: range.startLineNumber - 1, character: range.startColumn - 1 }, end: { line: range.endLineNumber - 1, character: range.endColumn - 1 } }; } - function toRange(range: ls.Range): Range { if (!range) { return void 0; @@ -233,12 +243,19 @@ function toCompletionItem(entry: ls.CompletionItem): DataCompletionItem { }; } +function fromMarkdownString(entry: string | monaco.IMarkdownString): ls.MarkupContent { + return { + kind: (typeof entry === 'string' ? ls.MarkupKind.PlainText : ls.MarkupKind.Markdown), + value: (typeof entry === 'string' ? entry : entry.value) + } +} + function fromCompletionItem(entry: DataCompletionItem): ls.CompletionItem { let item: ls.CompletionItem = { label: entry.label, sortText: entry.sortText, filterText: entry.filterText, - documentation: entry.documentation, + documentation: fromMarkdownString(entry.documentation), detail: entry.detail, kind: fromCompletionItemKind(entry.kind), data: entry.data @@ -303,14 +320,38 @@ export class CompletionAdapter implements monaco.languages.CompletionItemProvide } } -function toMarkedStringArray(contents: ls.MarkedString | ls.MarkedString[]): monaco.MarkedString[] { +function isMarkupContent(thing: any): thing is ls.MarkupContent { + return thing && typeof thing === 'object' && typeof (thing).kind === 'string'; +} + +function toMarkdownString(entry: ls.MarkupContent | ls.MarkedString): monaco.IMarkdownString { + if (typeof entry === 'string') { + return { + value: entry + }; + } + if (isMarkupContent(entry)) { + if (entry.kind === 'plaintext') { + return { + value: entry.value.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&') + }; + } + return { + value: entry.value + }; + } + + return { value: '```' + entry.language + '\n' + entry.value + '\n```\n' }; +} + +function toMarkedStringArray(contents: ls.MarkupContent | ls.MarkedString | ls.MarkedString[]): monaco.IMarkdownString[] { if (!contents) { return void 0; } if (Array.isArray(contents)) { - return (contents); + return contents.map(toMarkdownString); } - return [contents]; + return [toMarkdownString(contents)]; } @@ -382,7 +423,7 @@ export class DocumentSymbolAdapter implements monaco.languages.DocumentSymbolPro constructor(private _worker: WorkerAccessor) { } - public provideDocumentSymbols(model: monaco.editor.IReadOnlyModel, token: CancellationToken): Thenable { + public provideDocumentSymbols(model: monaco.editor.IReadOnlyModel, token: CancellationToken): Thenable { const resource = model.uri; return wireCancellationToken(token, this._worker(resource).then(worker => worker.findDocumentSymbols(resource.toString())).then(items => { @@ -391,9 +432,11 @@ export class DocumentSymbolAdapter implements monaco.languages.DocumentSymbolPro } return items.map(item => ({ name: item.name, + detail: '', containerName: item.containerName, kind: toSymbolKind(item.kind), - location: toLocation(item.location) + range: toRange(item.location.range), + selectionRange: toRange(item.location.range) })); })); } diff --git a/src/yaml-languageservice/jsonContributions.ts b/src/languageservice/jsonContributions.ts similarity index 96% rename from src/yaml-languageservice/jsonContributions.ts rename to src/languageservice/jsonContributions.ts index 081d242..f11bcd0 100644 --- a/src/yaml-languageservice/jsonContributions.ts +++ b/src/languageservice/jsonContributions.ts @@ -1,4 +1,5 @@ /*--------------------------------------------------------------------------------------------- + * Copyright (c) Red Hat, Inc. All rights reserved. * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ diff --git a/src/yaml-languageservice/jsonSchema.ts b/src/languageservice/jsonSchema.ts similarity index 89% rename from src/yaml-languageservice/jsonSchema.ts rename to src/languageservice/jsonSchema.ts index 9f9f19f..0052129 100644 --- a/src/yaml-languageservice/jsonSchema.ts +++ b/src/languageservice/jsonSchema.ts @@ -1,4 +1,5 @@ /*--------------------------------------------------------------------------------------------- + * Copyright (c) Red Hat, Inc. All rights reserved. * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ @@ -43,6 +44,7 @@ export interface JSONSchema { patternErrorMessage?: string; // VSCode extension deprecationMessage?: string; // VSCode extension enumDescriptions?: string[]; // VSCode extension + schemaSequence?: JSONSchema[]; // extension for multiple schemas related to multiple documents in single yaml file "x-kubernetes-group-version-kind"?; //Kubernetes extension } diff --git a/src/yaml-languageservice/parser/jsonParser.ts b/src/languageservice/parser/jsonParser.ts similarity index 99% rename from src/yaml-languageservice/parser/jsonParser.ts rename to src/languageservice/parser/jsonParser.ts index a18140b..584341e 100644 --- a/src/yaml-languageservice/parser/jsonParser.ts +++ b/src/languageservice/parser/jsonParser.ts @@ -1,10 +1,11 @@ /*--------------------------------------------------------------------------------------------- + * Copyright (c) Red Hat, Inc. All rights reserved. * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; -import Json = require('jsonc-parser'); +import * as Json from 'jsonc-parser'; import { JSONSchema } from '../jsonSchema'; import * as objects from '../utils/objects'; @@ -118,7 +119,7 @@ export class ASTNode { collector.push(item); } } - return node; + return node; }; let foundNode = findNode(this); return collector.length; @@ -157,7 +158,7 @@ export class ASTNode { if (!matchingSchemas.include(this)) { return; } - + if (Array.isArray(schema.type)) { if ((schema.type).indexOf(this.type) === -1) { validationResult.problems.push({ @@ -539,7 +540,7 @@ export class StringASTNode extends ASTNode { }); } } - + } } @@ -649,7 +650,7 @@ export class ObjectASTNode extends ASTNode { let seenKeys: { [key: string]: ASTNode } = Object.create(null); let unprocessedProperties: string[] = []; this.properties.forEach((node) => { - + let key = node.key.value; //Replace the merge key with the actual values of what the node value points to in seen keys @@ -682,7 +683,7 @@ export class ObjectASTNode extends ASTNode { seenKeys[key] = node.value; unprocessedProperties.push(key); } - + }); if (Array.isArray(schema.required)) { @@ -770,7 +771,7 @@ export class ObjectASTNode extends ASTNode { } }); } - } + } if (schema.maxProperties) { if (this.properties.length > schema.maxProperties) { diff --git a/src/yaml-languageservice/parser/yamlParser.ts b/src/languageservice/parser/yamlParser.ts similarity index 78% rename from src/yaml-languageservice/parser/yamlParser.ts rename to src/languageservice/parser/yamlParser.ts index c1752f2..15af94f 100644 --- a/src/yaml-languageservice/parser/yamlParser.ts +++ b/src/languageservice/parser/yamlParser.ts @@ -1,6 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Red Hat, Inc. All rights reserved. + * Copyright (c) Adam Voss. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { JSONSchema } from 'vscode-json-languageservice/lib/jsonSchema'; import { ASTNode, ErrorCode, BooleanASTNode, NullASTNode, ArrayASTNode, NumberASTNode, ObjectASTNode, PropertyASTNode, StringASTNode, IApplicableSchema, JSONDocument } from './jsonParser'; import * as nls from 'vscode-nls'; @@ -8,8 +12,10 @@ const localize = nls.loadMessageBundle(); import * as Yaml from '../../yaml-ast-parser/index' import { Kind } from '../../yaml-ast-parser/index' +import { Schema, Type } from 'js-yaml'; import { getLineStartPositions, getPosition } from '../utils/documentPositionCalculator' +import YAMLException from '../../yaml-ast-parser/exception'; export class SingleYAMLDocument extends JSONDocument { private lines; @@ -153,7 +159,7 @@ function recursivelyBuildAst(parent: ASTNode, node: Yaml.YAMLNode): ASTNode { switch (type) { case Yaml.ScalarType.null: { - return new NullASTNode(parent, name, instance.startPosition, instance.endPosition); + return new StringASTNode(parent, name, false, instance.startPosition, instance.endPosition); } case Yaml.ScalarType.bool: { return new BooleanASTNode(parent, name, Yaml.parseYamlBoolean(value), node.startPosition, node.endPosition) @@ -193,11 +199,11 @@ function recursivelyBuildAst(parent: ASTNode, node: Yaml.YAMLNode): ASTNode { } } -function convertError(e: Yaml.YAMLException) { +function convertError(e: YAMLException) { return { message: `${e.reason}`, location: { start: e.mark.position, end: e.mark.position + e.mark.column, code: ErrorCode.Undefined } } } -function createJSONDocument(yamlDoc: Yaml.YAMLNode, startPositions: number[]) { +function createJSONDocument(yamlDoc: Yaml.YAMLNode, startPositions: number[], text: string) { let _doc = new SingleYAMLDocument(startPositions); _doc.root = recursivelyBuildAst(null, yamlDoc) @@ -208,8 +214,18 @@ function createJSONDocument(yamlDoc: Yaml.YAMLNode, startPositions: number[]) { const duplicateKeyReason = 'duplicate key' + //Patch ontop of yaml-ast-parser to disable duplicate key message on merge key + let isDuplicateAndNotMergeKey = function (error: YAMLException, yamlText: string) { + let errorConverted = convertError(error); + let errorStart = errorConverted.location.start; + let errorEnd = errorConverted.location.end; + if (error.reason === duplicateKeyReason && yamlText.substring(errorStart, errorEnd).startsWith("<<")) { + return false; + } + return true; + }; const errors = yamlDoc.errors.filter(e => e.reason !== duplicateKeyReason && !e.isWarning).map(e => convertError(e)) - const warnings = yamlDoc.errors.filter(e => e.reason === duplicateKeyReason || e.isWarning).map(e => convertError(e)) + const warnings = yamlDoc.errors.filter(e => (e.reason === duplicateKeyReason && isDuplicateAndNotMergeKey(e, text)) || e.isWarning).map(e => convertError(e)) errors.forEach(e => _doc.errors.push(e)); warnings.forEach(e => _doc.warnings.push(e)); @@ -230,13 +246,29 @@ export class YAMLDocument { } -export function parse(text: string): YAMLDocument { +export function parse(text: string, customTags = []): YAMLDocument { const startPositions = getLineStartPositions(text) // This is documented to return a YAMLNode even though the // typing only returns a YAMLDocument const yamlDocs = [] - Yaml.loadAll(text, doc => yamlDocs.push(doc), {}) - return new YAMLDocument(yamlDocs.map(doc => createJSONDocument(doc, startPositions))); -} \ No newline at end of file + let schemaWithAdditionalTags = Schema.create(customTags.map((tag) => { + const typeInfo = tag.split(' '); + return new Type(typeInfo[0], { kind: typeInfo[1] || 'scalar' }); + })); + + //We need compiledTypeMap to be available from schemaWithAdditionalTags before we add the new custom properties + customTags.map((tag) => { + const typeInfo = tag.split(' '); + schemaWithAdditionalTags.compiledTypeMap[typeInfo[0]] = new Type(typeInfo[0], { kind: typeInfo[1] || 'scalar' }); + }); + + let additionalOptions: Yaml.LoadOptions = { + schema: schemaWithAdditionalTags + } + + Yaml.loadAll(text, doc => yamlDocs.push(doc), additionalOptions); + + return new YAMLDocument(yamlDocs.map(doc => createJSONDocument(doc, startPositions, text))); +} diff --git a/src/yaml-languageservice/services/documentSymbols.ts b/src/languageservice/services/documentSymbols.ts similarity index 95% rename from src/yaml-languageservice/services/documentSymbols.ts rename to src/languageservice/services/documentSymbols.ts index da0de0c..92a03e7 100644 --- a/src/yaml-languageservice/services/documentSymbols.ts +++ b/src/languageservice/services/documentSymbols.ts @@ -1,11 +1,11 @@ /*--------------------------------------------------------------------------------------------- + * Copyright (c) Red Hat, Inc. All rights reserved. * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; -import Parser = require('../parser/jsonParser'); -import Strings = require('../utils/strings'); +import * as Parser from '../parser/jsonParser'; import { SymbolInformation, SymbolKind, TextDocument, Range, Location } from 'vscode-languageserver-types'; import { Thenable } from "../yamlLanguageService"; @@ -18,7 +18,7 @@ export class YAMLDocumentSymbols { if(!doc || doc["documents"].length === 0){ return null; } - + let collectOutlineEntries = (result: SymbolInformation[], node: Parser.ASTNode, containerName: string): SymbolInformation[] => { if (node.type === 'array') { (node).items.forEach((node: Parser.ASTNode) => { @@ -26,7 +26,7 @@ export class YAMLDocumentSymbols { }); } else if (node.type === 'object') { let objectNode = node; - + objectNode.properties.forEach((property: Parser.PropertyASTNode) => { let location = Location.create(document.uri, Range.create(document.positionAt(property.start), document.positionAt(property.end))); let valueNode = property.value; @@ -48,7 +48,7 @@ export class YAMLDocumentSymbols { results = results.concat(result); } } - + return results; } diff --git a/src/yaml-languageservice/services/jsonSchemaService.ts b/src/languageservice/services/jsonSchemaService.ts similarity index 90% rename from src/yaml-languageservice/services/jsonSchemaService.ts rename to src/languageservice/services/jsonSchemaService.ts index 9d998c3..761dc10 100644 --- a/src/yaml-languageservice/services/jsonSchemaService.ts +++ b/src/languageservice/services/jsonSchemaService.ts @@ -1,20 +1,42 @@ /*--------------------------------------------------------------------------------------------- + * Copyright (c) Red Hat, Inc. All rights reserved. * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; -import Json = require('jsonc-parser'); +import * as Json from 'jsonc-parser'; import {JSONSchema, JSONSchemaMap} from '../jsonSchema'; import URI from 'vscode-uri'; -import Strings = require('../utils/strings'); -import Parser = require('../parser/jsonParser'); +import * as Strings from '../utils/strings'; import {SchemaRequestService, WorkspaceContextService, PromiseConstructor, Thenable} from '../yamlLanguageService'; import * as nls from 'vscode-nls'; const localize = nls.loadMessageBundle(); +/** + * getParseErrorMessage has been removed from jsonc-parser since 1.0.0 + * + * see https://github.com/Microsoft/node-jsonc-parser/blob/42ec16f9c91582d4267a0c48199cdac283c90fc9/CHANGELOG.md + * 1.0.0 + * remove nls dependency (remove getParseErrorMessage) + */ +function getParseErrorMessage(errorCode: Json.ParseErrorCode): string { + switch (errorCode) { + case Json.ParseErrorCode.InvalidSymbol: return localize('error.invalidSymbol', 'Invalid symbol'); + case Json.ParseErrorCode.InvalidNumberFormat: return localize('error.invalidNumberFormat', 'Invalid number format'); + case Json.ParseErrorCode.PropertyNameExpected: return localize('error.propertyNameExpected', 'Property name expected'); + case Json.ParseErrorCode.ValueExpected: return localize('error.valueExpected', 'Value expected'); + case Json.ParseErrorCode.ColonExpected: return localize('error.colonExpected', 'Colon expected'); + case Json.ParseErrorCode.CommaExpected: return localize('error.commaExpected', 'Comma expected'); + case Json.ParseErrorCode.CloseBraceExpected: return localize('error.closeBraceExpected', 'Closing brace expected'); + case Json.ParseErrorCode.CloseBracketExpected: return localize('error.closeBracketExpected', 'Closing bracket expected'); + case Json.ParseErrorCode.EndOfFileExpected: return localize('error.endOfFileExpected', 'End of file expected'); + default: return ''; + } +} + export interface IJSONSchemaService { /** @@ -82,7 +104,7 @@ export class FilePatternAssociation { constructor(pattern: string) { this.combinedSchemaId = 'schemaservice://combinedSchema/' + encodeURIComponent(pattern); try { - this.patternRegExp = new RegExp(Strings.convertSimple2RegExpPattern(pattern) + '$'); + this.patternRegExp = Strings.convertSimple2RegExp(pattern); } catch (e) { // invalid pattern this.patternRegExp = null; @@ -368,7 +390,7 @@ export class JSONSchemaService implements IJSONSchemaService { let schemaContent: JSONSchema = {}; let jsonErrors = []; schemaContent = Json.parse(content, jsonErrors); - let errors = jsonErrors.length ? [localize('json.schema.invalidFormat', 'Unable to parse content from \'{0}\': {1}.', toDisplayString(url), Json.getParseErrorMessage(jsonErrors[0]))] : []; + let errors = jsonErrors.length ? [localize('json.schema.invalidFormat', 'Unable to parse content from \'{0}\': {1}.', toDisplayString(url), getParseErrorMessage(jsonErrors[0]))] : []; return new UnresolvedSchema(schemaContent, errors); }, (error: any) => { @@ -479,7 +501,7 @@ export class JSONSchemaService implements IJSONSchemaService { } collectEntries(next.items, next.additionalProperties, next.not); collectMapEntries(next.definitions, next.properties, next.patternProperties, next.dependencies); - collectArrayEntries(next.anyOf, next.allOf, next.oneOf, next.items); + collectArrayEntries(next.anyOf, next.allOf, next.oneOf, next.items, next.schemaSequence); } return this.promise.all(openPromises); }; @@ -496,7 +518,7 @@ export class JSONSchemaService implements IJSONSchemaService { return entry.getCombinedSchema(this).getResolvedSchema(); } } - return null; + return this.promise.resolve(null); }; if (this.customSchemaProvider) { return this.customSchemaProvider(resource).then(schemaUri => { diff --git a/src/yaml-languageservice/services/yamlCompletion.ts b/src/languageservice/services/yamlCompletion.ts similarity index 50% rename from src/yaml-languageservice/services/yamlCompletion.ts rename to src/languageservice/services/yamlCompletion.ts index 96f5e6a..72457b6 100644 --- a/src/yaml-languageservice/services/yamlCompletion.ts +++ b/src/languageservice/services/yamlCompletion.ts @@ -6,14 +6,14 @@ 'use strict'; -import Parser = require('../parser/jsonParser'); -import Json = require('jsonc-parser'); -import SchemaService = require('./jsonSchemaService'); +import * as Parser from '../parser/jsonParser'; +import * as Json from 'jsonc-parser'; +import * as SchemaService from './jsonSchemaService'; import { JSONSchema } from '../jsonSchema'; import { JSONWorkerContribution, CompletionsCollector } from '../jsonContributions'; import { PromiseConstructor, Thenable } from 'vscode-json-languageservice'; -import { CompletionItem, CompletionItemKind, CompletionList, TextDocument, Position, Range, TextEdit } from 'vscode-languageserver-types'; +import { CompletionItem, CompletionItemKind, CompletionList, TextDocument, Position, Range, TextEdit, InsertTextFormat } from 'vscode-languageserver-types'; import * as nls from 'vscode-nls'; import { matchOffsetToDocument } from '../utils/arrUtils'; @@ -25,11 +25,17 @@ export class YAMLCompletion { private schemaService: SchemaService.IJSONSchemaService; private contributions: JSONWorkerContribution[]; private promise: PromiseConstructor; + private customTags: Array; constructor(schemaService: SchemaService.IJSONSchemaService, contributions: JSONWorkerContribution[] = [], promiseConstructor?: PromiseConstructor) { this.schemaService = schemaService; this.contributions = contributions; this.promise = promiseConstructor || Promise; + this.customTags = []; + } + + public configure(customTags: Array){ + this.customTags = customTags; } public doResolve(item: CompletionItem): Thenable { @@ -44,7 +50,7 @@ export class YAMLCompletion { return this.promise.resolve(item); } - public doComplete(document: TextDocument, position: Position, doc: Parser.JSONDocument): Thenable { + public doComplete(document: TextDocument, position: Position, doc): Thenable { let result: CompletionList = { items: [], @@ -52,14 +58,15 @@ export class YAMLCompletion { }; let offset = document.offsetAt(position); - if (document.getText()[offset] === ":") { - return null; + if(document.getText()[offset] === ":"){ + return Promise.resolve(result); } let currentDoc = matchOffsetToDocument(offset, doc); - if (currentDoc === null) { - return null; + if(currentDoc === null){ + return Promise.resolve(result); } + const currentDocIndex = doc.documents.indexOf(currentDoc); let node = currentDoc.getNodeFromOffsetEndInclusive(offset); if (this.isInComment(document, node ? node.start : 0, offset)) { return Promise.resolve(result); @@ -67,12 +74,32 @@ export class YAMLCompletion { let currentWord = this.getCurrentWord(document, offset); + let overwriteRange = null; + if(node && node.type === 'null'){ + let nodeStartPos = document.positionAt(node.start); + nodeStartPos.character += 1; + let nodeEndPos = document.positionAt(node.end); + nodeEndPos.character += 1; + overwriteRange = Range.create(nodeStartPos, nodeEndPos); + }else if (node && (node.type === 'string' || node.type === 'number' || node.type === 'boolean')) { + overwriteRange = Range.create(document.positionAt(node.start), document.positionAt(node.end)); + } else { + let overwriteStart = offset - currentWord.length; + if (overwriteStart > 0 && document.getText()[overwriteStart - 1] === '"') { + overwriteStart--; + } + overwriteRange = Range.create(document.positionAt(overwriteStart), position); + } + let proposed: { [key: string]: CompletionItem } = {}; let collector: CompletionsCollector = { add: (suggestion: CompletionItem) => { let existing = proposed[suggestion.label]; if (!existing) { proposed[suggestion.label] = suggestion; + if (overwriteRange) { + suggestion.textEdit = TextEdit.replace(overwriteRange, suggestion.insertText); + } result.items.push(suggestion); } else if (!existing.documentation) { existing.documentation = suggestion.documentation; @@ -94,8 +121,12 @@ export class YAMLCompletion { return this.schemaService.getSchemaForResource(document.uri).then((schema) => { - if (!schema) { - return null; + if(!schema){ + return Promise.resolve(result); + } + let newSchema = schema; + if (schema.schema && schema.schema.schemaSequence && schema.schema.schemaSequence[currentDocIndex]) { + newSchema = new SchemaService.ResolvedSchema(schema.schema.schemaSequence[currentDocIndex]); } let collectionPromises: Thenable[] = []; @@ -129,9 +160,14 @@ export class YAMLCompletion { } }); - if (schema) { + let separatorAfter = ''; + if (addValue) { + separatorAfter = this.evaluateSeparatorAfter(document, document.offsetAt(overwriteRange.end)); + } + + if (newSchema) { // property proposals with schema - this.getPropertyCompletions(schema, currentDoc, node, addValue, collector); + this.getPropertyCompletions(newSchema, currentDoc, node, addValue, collector, separatorAfter); } let location = node.getPath(); @@ -144,19 +180,24 @@ export class YAMLCompletion { if ((!schema && currentWord.length > 0 && document.getText().charAt(offset - currentWord.length - 1) !== '"')) { collector.add({ kind: CompletionItemKind.Property, - label: this.getLabelForValue(currentWord) + label: this.getLabelForValue(currentWord), + insertText: this.getInsertTextForProperty(currentWord, null, false, separatorAfter), + insertTextFormat: InsertTextFormat.Snippet, + documentation: '' }); } } // proposals for values - let types: { [type: string]: boolean } = {}; - if (schema) { - this.getValueCompletions(schema, currentDoc, node, offset, document, collector, types); + if (newSchema) { + this.getValueCompletions(newSchema, currentDoc, node, offset, document, collector); } if (this.contributions.length > 0) { this.getContributedValueCompletions(currentDoc, node, offset, document, collector, collectionPromises); } + if (this.customTags.length > 0) { + this.getCustomTagValueCompletions(collector); + } return this.promise.all(collectionPromises).then(() => { return result; @@ -164,7 +205,7 @@ export class YAMLCompletion { }); } - private getPropertyCompletions(schema: SchemaService.ResolvedSchema, doc, node: Parser.ASTNode, addValue: boolean, collector: CompletionsCollector): void { + private getPropertyCompletions(schema: SchemaService.ResolvedSchema, doc, node: Parser.ASTNode, addValue: boolean, collector: CompletionsCollector, separatorAfter: string): void { let matchingSchemas = doc.getMatchingSchemas(schema.schema); matchingSchemas.forEach((s) => { if (s.node === node && !s.inverted) { @@ -176,18 +217,26 @@ export class YAMLCompletion { collector.add({ kind: CompletionItemKind.Property, label: key, - insertText: `${key}:`, - filterText: this.getFilterTextForValue(key), + insertText: this.getInsertTextForProperty(key, propertySchema, addValue, separatorAfter), + insertTextFormat: InsertTextFormat.Snippet, documentation: propertySchema.description || '' }); } }); } + // Error fix + // If this is a array of string/boolean/number + // test: + // - item1 + // it will treated as a property key since `:` has been appended + if (node.type === 'object' && node.parent && node.parent.type === 'array' && s.schema.type !== 'object') { + this.addSchemaValueCompletions(s.schema, collector, separatorAfter) + } } }); } - private getValueCompletions(schema: SchemaService.ResolvedSchema, doc, node: Parser.ASTNode, offset: number, document: TextDocument, collector: CompletionsCollector, types: { [type: string]: boolean }): void { + private getValueCompletions(schema: SchemaService.ResolvedSchema, doc, node: Parser.ASTNode, offset: number, document: TextDocument, collector: CompletionsCollector): void { let offsetForSeparator = offset; let parentKey: string = null; let valueNode: Parser.ASTNode = null; @@ -198,17 +247,17 @@ export class YAMLCompletion { node = node.parent; } - if (node && node.type === 'null') { + if(node && node.type === 'null'){ let nodeParent = node.parent; /* * This is going to be an object for some reason and we need to find the property * Its an issue with the null node */ - if (nodeParent && nodeParent.type === "object") { - for (let prop in nodeParent["properties"]) { + if(nodeParent && nodeParent.type === "object"){ + for(let prop in nodeParent["properties"]){ let currNode = nodeParent["properties"][prop]; - if (currNode.key && currNode.key.location === node.location) { + if(currNode.key && currNode.key.location === node.location){ node = currNode; } } @@ -216,7 +265,7 @@ export class YAMLCompletion { } if (!node) { - this.addSchemaValueCompletions(schema.schema, collector, types); + this.addSchemaValueCompletions(schema.schema, collector, ""); return; } @@ -230,6 +279,7 @@ export class YAMLCompletion { node = node.parent; } + let separatorAfter = this.evaluateSeparatorAfter(document, offsetForSeparator); if (node && (parentKey !== null || node.type === 'array')) { let matchingSchemas = doc.getMatchingSchemas(schema.schema); matchingSchemas.forEach(s => { @@ -238,30 +288,30 @@ export class YAMLCompletion { if (Array.isArray(s.schema.items)) { let index = this.findItemAtOffset(node, document, offset); if (index < s.schema.items.length) { - this.addSchemaValueCompletions(s.schema.items[index], collector, types); + this.addSchemaValueCompletions(s.schema.items[index], collector, separatorAfter, true); } - } else { - this.addSchemaValueCompletions(s.schema.items, collector, types); + } else if (s.schema.items.type === 'object') { + collector.add({ + kind: this.getSuggestionKind(s.schema.items.type), + label: `- (array item)`, + documentation: `Create an item of an array${s.schema.description === undefined ? '' : '(' + s.schema.description + ')'}`, + insertText: `- ${this.getInsertTextForObject(s.schema.items, separatorAfter).insertText.trimLeft()}`, + insertTextFormat: InsertTextFormat.Snippet, + }); + } + else { + this.addSchemaValueCompletions(s.schema.items, collector, separatorAfter, true); } } if (s.schema.properties) { let propertySchema = s.schema.properties[parentKey]; if (propertySchema) { - this.addSchemaValueCompletions(propertySchema, collector, types); + this.addSchemaValueCompletions(propertySchema, collector, separatorAfter, false); } } } }); } - if (node) { - if (types['boolean']) { - this.addBooleanValueCompletion(true, collector); - this.addBooleanValueCompletion(false, collector); - } - if (types['null']) { - this.addNullValueCompletion(collector); - } - } } private getContributedValueCompletions(doc: Parser.JSONDocument, node: Parser.ASTNode, offset: number, document: TextDocument, collector: CompletionsCollector, collectionPromises: Thenable[]) { @@ -293,22 +343,43 @@ export class YAMLCompletion { } } - private addSchemaValueCompletions(schema: JSONSchema, collector: CompletionsCollector, types: { [type: string]: boolean }): void { - this.addDefaultValueCompletions(schema, collector); - this.addEnumValueCompletions(schema, collector); - this.collectTypes(schema, types); - if (Array.isArray(schema.allOf)) { - schema.allOf.forEach(s => this.addSchemaValueCompletions(s, collector, types)); + private getCustomTagValueCompletions(collector: CompletionsCollector) { + this.customTags.forEach((customTagItem) => { + let tagItemSplit = customTagItem.split(" "); + if(tagItemSplit && tagItemSplit[0]){ + this.addCustomTagValueCompletion(collector, " ", tagItemSplit[0]); + } + }); + } + + private addSchemaValueCompletions(schema: JSONSchema, collector: CompletionsCollector, separatorAfter: string, forArrayItem = false): void { + let types: { [type: string]: boolean } = {}; + this.addSchemaValueCompletionsCore(schema, collector, types, separatorAfter, forArrayItem); + if (types['boolean']) { + this.addBooleanValueCompletion(true, collector, separatorAfter); + this.addBooleanValueCompletion(false, collector, separatorAfter); } - if (Array.isArray(schema.anyOf)) { - schema.anyOf.forEach(s => this.addSchemaValueCompletions(s, collector, types)); - } - if (Array.isArray(schema.oneOf)) { - schema.oneOf.forEach(s => this.addSchemaValueCompletions(s, collector, types)); + if (types['null']) { + this.addNullValueCompletion(collector, separatorAfter); } } - private addDefaultValueCompletions(schema: JSONSchema, collector: CompletionsCollector, arrayDepth = 0): void { + private addSchemaValueCompletionsCore(schema: JSONSchema, collector: CompletionsCollector, types: { [type: string]: boolean }, separatorAfter: string, forArrayItem = false): void { + this.addDefaultValueCompletions(schema, collector, separatorAfter, 0, forArrayItem); + this.addEnumValueCompletions(schema, collector, separatorAfter, forArrayItem); + this.collectTypes(schema, types); + if (Array.isArray(schema.allOf)) { + schema.allOf.forEach(s => this.addSchemaValueCompletionsCore(s, collector, types, separatorAfter, forArrayItem)); + } + if (Array.isArray(schema.anyOf)) { + schema.anyOf.forEach(s => this.addSchemaValueCompletionsCore(s, collector, types, separatorAfter, forArrayItem)); + } + if (Array.isArray(schema.oneOf)) { + schema.oneOf.forEach(s => this.addSchemaValueCompletionsCore(s, collector, types, separatorAfter, forArrayItem)); + } + } + + private addDefaultValueCompletions(schema: JSONSchema, collector: CompletionsCollector, separatorAfter: string, arrayDepth = 0, forArrayItem = false): void { let hasProposals = false; if (schema.default) { let type = schema.type; @@ -319,17 +390,19 @@ export class YAMLCompletion { } collector.add({ kind: this.getSuggestionKind(type), - label: this.getLabelForValue(value), + label: forArrayItem ? `- ${this.getLabelForValue(value)}` : this.getLabelForValue(value), + insertText: forArrayItem ? `- ${this.getInsertTextForValue(value, separatorAfter)}` : this.getInsertTextForValue(value, separatorAfter), + insertTextFormat: InsertTextFormat.Snippet, detail: localize('json.suggest.default', 'Default value'), }); hasProposals = true; } if (!hasProposals && schema.items && !Array.isArray(schema.items)) { - this.addDefaultValueCompletions(schema.items, collector, arrayDepth + 1); + this.addDefaultValueCompletions(schema.items, collector, separatorAfter, arrayDepth + 1); } } - private addEnumValueCompletions(schema: JSONSchema, collector: CompletionsCollector): void { + private addEnumValueCompletions(schema: JSONSchema, collector: CompletionsCollector, separatorAfter: string, forArrayItem = false): void { if (Array.isArray(schema.enum)) { for (let i = 0, length = schema.enum.length; i < length; i++) { let enm = schema.enum[i]; @@ -339,7 +412,9 @@ export class YAMLCompletion { } collector.add({ kind: this.getSuggestionKind(schema.type), - label: this.getLabelForValue(enm), + label: forArrayItem ? `- ${this.getLabelForValue(enm)}` : this.getLabelForValue(enm), + insertText: forArrayItem ? `- ${this.getInsertTextForValue(enm, separatorAfter)}` : this.getInsertTextForValue(enm, separatorAfter), + insertTextFormat: InsertTextFormat.Snippet, documentation }); } @@ -355,18 +430,32 @@ export class YAMLCompletion { } } - private addBooleanValueCompletion(value: boolean, collector: CompletionsCollector): void { + private addBooleanValueCompletion(value: boolean, collector: CompletionsCollector, separatorAfter: string): void { collector.add({ kind: this.getSuggestionKind('boolean'), label: value ? 'true' : 'false', + insertText: this.getInsertTextForValue(value, separatorAfter), + insertTextFormat: InsertTextFormat.Snippet, documentation: '' }); } - private addNullValueCompletion(collector: CompletionsCollector): void { + private addNullValueCompletion(collector: CompletionsCollector, separatorAfter: string): void { collector.add({ kind: this.getSuggestionKind('null'), label: 'null', + insertText: 'null' + separatorAfter, + insertTextFormat: InsertTextFormat.Snippet, + documentation: '' + }); + } + + private addCustomTagValueCompletion(collector: CompletionsCollector, separatorAfter: string, label: string): void { + collector.add({ + kind: this.getSuggestionKind('string'), + label: label, + insertText: label + separatorAfter, + insertTextFormat: InsertTextFormat.Snippet, documentation: '' }); } @@ -379,10 +468,6 @@ export class YAMLCompletion { return label; } - private getFilterTextForValue(value): string { - return JSON.stringify(value); - } - private getSuggestionKind(type: any): CompletionItemKind { if (Array.isArray(type)) { let array = type; @@ -436,4 +521,178 @@ export class YAMLCompletion { } return (token === Json.SyntaxKind.LineCommentTrivia || token === Json.SyntaxKind.BlockCommentTrivia) && scanner.getTokenOffset() <= offset; } + + private getInsertTextForPlainText(text: string): string { + return text.replace(/[\\\$\}]/g, '\\$&'); // escape $, \ and } + } + + private getInsertTextForValue(value: any, separatorAfter: string): string { + var text = value; + if (text === '{}') { + return '{\n\t$1\n}' + separatorAfter; + } else if (text === '[]') { + return '[\n\t$1\n]' + separatorAfter; + } + return this.getInsertTextForPlainText(text + separatorAfter); + } + + private getInsertTextForObject(schema: JSONSchema, separatorAfter: string, indent = '\t', insertIndex = 1) { + let insertText = ""; + if (!schema.properties) { + insertText = `${indent}\$${insertIndex++}\n`; + return { insertText, insertIndex }; + } + + Object.keys(schema.properties).forEach((key: string) => { + let propertySchema = schema.properties[key]; + let type = Array.isArray(propertySchema.type) ? propertySchema.type[0] : propertySchema.type; + if (!type) { + if (propertySchema.properties) { + type = 'object'; + } + if (propertySchema.items) { + type = 'array'; + } + } + if (schema.required && schema.required.indexOf(key) > -1) { + switch (type) { + case 'boolean': + case 'string': + case 'number': + case 'integer': + insertText += `${indent}${key}: \$${insertIndex++}\n` + break; + case 'array': + let arrayInsertResult = this.getInsertTextForArray(propertySchema.items, separatorAfter, `${indent}\t`, insertIndex++); + insertIndex = arrayInsertResult.insertIndex; + insertText += `${indent}${key}:\n${indent}\t- ${arrayInsertResult.insertText}\n`; + break; + case 'object': + let objectInsertResult = this.getInsertTextForObject(propertySchema, separatorAfter, `${indent}\t`, insertIndex++); + insertIndex = objectInsertResult.insertIndex; + insertText += `${indent}${key}:\n${objectInsertResult.insertText}\n`; + break; + } + } else if (propertySchema.default !== undefined) { + switch (type) { + case 'boolean': + case 'string': + case 'number': + case 'integer': + insertText += `${indent}${key}: \${${insertIndex++}:${propertySchema.default}}\n` + break; + case 'array': + case 'object': + // TODO: support default value for array object + break; + } + } + }); + if (insertText.trim().length === 0) { + insertText = `${indent}\$${insertIndex++}\n`; + } + insertText = insertText.trimRight() + separatorAfter; + return { insertText, insertIndex }; + } + + private getInsertTextForArray(schema: JSONSchema, separatorAfter: string, indent = '\t', insertIndex = 1) { + let insertText = ''; + if (!schema) { + insertText = `\$${insertIndex++}`; + } + let type = Array.isArray(schema.type) ? schema.type[0] : schema.type; + if (!type) { + if (schema.properties) { + type = 'object'; + } + if (schema.items) { + type = 'array'; + } + } + switch (schema.type) { + case 'boolean': + insertText = `\${${insertIndex++}:false}`; + break; + case 'number': + case 'integer': + insertText = `\${${insertIndex++}:0}`; + break; + case 'string': + insertText = `\${${insertIndex++}:null}`; + break; + case 'object': + let objectInsertResult = this.getInsertTextForObject(schema, separatorAfter, `${indent}\t`, insertIndex++); + insertText = objectInsertResult.insertText.trimLeft(); + insertIndex = objectInsertResult.insertIndex; + break; + } + return { insertText, insertIndex }; + } + + private getInsertTextForProperty(key: string, propertySchema: JSONSchema, addValue: boolean, separatorAfter: string): string { + + let propertyText = this.getInsertTextForValue(key, ''); + // if (!addValue) { + // return propertyText; + // } + let resultText = propertyText + ':'; + + let value; + if (propertySchema) { + if (propertySchema.default !== undefined) { + value = ` \${1:${propertySchema.default}}` + } + else if (propertySchema.properties) { + return `${resultText}\n${this.getInsertTextForObject(propertySchema, separatorAfter).insertText}`; + } + else if (propertySchema.items) { + return `${resultText}\n\t- ${this.getInsertTextForArray(propertySchema.items, separatorAfter).insertText}`; + } + else { + var type = Array.isArray(propertySchema.type) ? propertySchema.type[0] : propertySchema.type; + switch (type) { + case 'boolean': + value = ' $1'; + break; + case 'string': + value = ' $1'; + break; + case 'object': + value = '\n\t'; + break; + case 'array': + value = '\n\t- '; + break; + case 'number': + case 'integer': + value = ' ${1:0}'; + break; + case 'null': + value = ' ${1:null}'; + break; + default: + return propertyText; + } + } + } + if (!value) { + value = '$1'; + } + return resultText + value + separatorAfter; + } + + private evaluateSeparatorAfter(document: TextDocument, offset: number) { + let scanner = Json.createScanner(document.getText(), true); + scanner.setPosition(offset); + let token = scanner.scan(); + switch (token) { + case Json.SyntaxKind.CommaToken: + case Json.SyntaxKind.CloseBraceToken: + case Json.SyntaxKind.CloseBracketToken: + case Json.SyntaxKind.EOF: + return ''; + default: + return ''; + } + } } \ No newline at end of file diff --git a/src/languageservice/services/yamlFormatter.ts b/src/languageservice/services/yamlFormatter.ts new file mode 100644 index 0000000..f299224 --- /dev/null +++ b/src/languageservice/services/yamlFormatter.ts @@ -0,0 +1,47 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Red Hat, Inc. All rights reserved. + * Copyright (c) Adam Voss. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import * as jsyaml from 'js-yaml'; +import * as Yaml from '../../yaml-ast-parser/index' +import { EOL } from '../../fillers/os'; +import { TextDocument, Range, Position, FormattingOptions, TextEdit } from 'vscode-languageserver-types'; + +export function format(document: TextDocument, options: FormattingOptions, customTags: Array): TextEdit[] { + const text = document.getText(); + + let schemaWithAdditionalTags = jsyaml.Schema.create(customTags.map((tag) => { + const typeInfo = tag.split(' '); + return new jsyaml.Type(typeInfo[0], { kind: typeInfo[1] || 'scalar' }); + })); + + //We need compiledTypeMap to be available from schemaWithAdditionalTags before we add the new custom properties + customTags.map((tag) => { + const typeInfo = tag.split(' '); + schemaWithAdditionalTags.compiledTypeMap[typeInfo[0]] = new jsyaml.Type(typeInfo[0], { kind: typeInfo[1] || 'scalar' }); + }); + + let additionalOptions: Yaml.LoadOptions = { + schema: schemaWithAdditionalTags + } + + const documents = [] + jsyaml.loadAll(text, doc => documents.push(doc), additionalOptions) + + const dumpOptions = { indent: options.tabSize, noCompatMode: true }; + + let newText; + if (documents.length == 1) { + const yaml = documents[0] + newText = jsyaml.safeDump(yaml, dumpOptions) + } + else { + const formatted = documents.map(d => jsyaml.safeDump(d, dumpOptions)) + newText = '%YAML 1.2' + EOL + '---' + EOL + formatted.join('...' + EOL + '---' + EOL) + '...' + EOL + } + + return [TextEdit.replace(Range.create(Position.create(0, 0), document.positionAt(text.length)), newText)] +} \ No newline at end of file diff --git a/src/yaml-languageservice/services/yamlHover.ts b/src/languageservice/services/yamlHover.ts similarity index 85% rename from src/yaml-languageservice/services/yamlHover.ts rename to src/languageservice/services/yamlHover.ts index a332d7b..2b794a5 100644 --- a/src/yaml-languageservice/services/yamlHover.ts +++ b/src/languageservice/services/yamlHover.ts @@ -1,12 +1,13 @@ /*--------------------------------------------------------------------------------------------- + * Copyright (c) Red Hat, Inc. All rights reserved. * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; -import Parser = require('../parser/jsonParser'); -import SchemaService = require('./jsonSchemaService'); +import * as Parser from '../parser/jsonParser'; +import * as SchemaService from './jsonSchemaService'; import {JSONWorkerContribution} from '../jsonContributions'; import {PromiseConstructor, Thenable} from 'vscode-json-languageservice'; @@ -25,13 +26,18 @@ export class YAMLHover { this.promise = promiseConstructor || Promise; } - public doHover(document: TextDocument, position: Position, doc: Parser.JSONDocument): Thenable { + public doHover(document: TextDocument, position: Position, doc): Thenable { + + if(!document){ + this.promise.resolve(void 0); + } let offset = document.offsetAt(position); let currentDoc = matchOffsetToDocument(offset, doc); if(currentDoc === null){ - return null; + return this.promise.resolve(void 0); } + const currentDocIndex = doc.documents.indexOf(currentDoc); let node = currentDoc.getNodeFromOffset(offset); if (!node || (node.type === 'object' || node.type === 'array') && offset > node.start + 1 && offset < node.end - 1) { return this.promise.resolve(void 0); @@ -46,7 +52,7 @@ export class YAMLHover { node = propertyNode.value; if (!node) { return this.promise.resolve(void 0); - } + } } } @@ -71,8 +77,11 @@ export class YAMLHover { return this.schemaService.getSchemaForResource(document.uri).then((schema) => { if (schema) { - - let matchingSchemas = currentDoc.getMatchingSchemas(schema.schema, node.start); + let newSchema = schema; + if (schema.schema && schema.schema.schemaSequence && schema.schema.schemaSequence[currentDocIndex]) { + newSchema = new SchemaService.ResolvedSchema(schema.schema.schemaSequence[currentDocIndex]); + } + let matchingSchemas = currentDoc.getMatchingSchemas(newSchema.schema, node.start); let title: string = null; let markdownDescription: string = null; diff --git a/src/yaml-languageservice/services/yamlValidation.ts b/src/languageservice/services/yamlValidation.ts similarity index 57% rename from src/yaml-languageservice/services/yamlValidation.ts rename to src/languageservice/services/yamlValidation.ts index 6b8a78c..91c59d4 100644 --- a/src/yaml-languageservice/services/yamlValidation.ts +++ b/src/languageservice/services/yamlValidation.ts @@ -1,15 +1,17 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the MIT License. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Red Hat, Inc. All rights reserved. + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; -import { JSONSchemaService } from './jsonSchemaService'; +import { JSONSchemaService, ResolvedSchema } from './jsonSchemaService'; import { JSONDocument, ObjectASTNode, IProblem, ProblemSeverity } from '../parser/jsonParser'; import { TextDocument, Diagnostic, DiagnosticSeverity } from 'vscode-languageserver-types'; -import { LanguageSettings, PromiseConstructor, Thenable } from '../yamlLanguageService'; +import { PromiseConstructor, Thenable, LanguageSettings} from '../yamlLanguageService'; export class YAMLValidation { - + private jsonSchemaService: JSONSchemaService; private promise: PromiseConstructor; private comments: boolean; @@ -21,35 +23,59 @@ export class YAMLValidation { this.validationEnabled = true; } - public configure(shouldValidate: LanguageSettings) { - if (shouldValidate) { + public configure(shouldValidate: LanguageSettings){ + if(shouldValidate){ this.validationEnabled = shouldValidate.validate; } } - + public doValidation(textDocument, yamlDocument) { - if (!this.validationEnabled) { + if(!this.validationEnabled){ return this.promise.resolve([]); } return this.jsonSchemaService.getSchemaForResource(textDocument.uri).then(function (schema) { + var diagnostics = []; + var added = {}; + let newSchema = schema; if (schema) { - - for (let currentYAMLDoc in yamlDocument.documents) { + let documentIndex = 0; + for(let currentYAMLDoc in yamlDocument.documents){ let currentDoc = yamlDocument.documents[currentYAMLDoc]; - let diagnostics = currentDoc.getValidationProblems(schema.schema); - for (let diag in diagnostics) { + if (schema.schema && schema.schema.schemaSequence && schema.schema.schemaSequence[documentIndex]) { + newSchema = new ResolvedSchema(schema.schema.schemaSequence[documentIndex]); + } + let diagnostics = currentDoc.getValidationProblems(newSchema.schema); + for(let diag in diagnostics){ let curDiagnostic = diagnostics[diag]; currentDoc.errors.push({ location: { start: curDiagnostic.location.start, end: curDiagnostic.location.end }, message: curDiagnostic.message }) } + documentIndex++; } + } + if(newSchema && newSchema.errors.length > 0){ + + for(let curDiagnostic of newSchema.errors){ + diagnostics.push({ + severity: DiagnosticSeverity.Error, + range: { + start: { + line: 0, + character: 0 + }, + end: { + line: 0, + character: 1 + } + }, + message: curDiagnostic + }); + } } - var diagnostics = []; - var added = {}; - for (let currentYAMLDoc in yamlDocument.documents) { + for(let currentYAMLDoc in yamlDocument.documents){ let currentDoc = yamlDocument.documents[currentYAMLDoc]; currentDoc.errors.concat(currentDoc.warnings).forEach(function (error, idx) { // remove duplicated messages diff --git a/src/languageservice/utils/arrUtils.ts b/src/languageservice/utils/arrUtils.ts new file mode 100644 index 0000000..4130f35 --- /dev/null +++ b/src/languageservice/utils/arrUtils.ts @@ -0,0 +1,75 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Red Hat, Inc. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import { SingleYAMLDocument } from "../parser/yamlParser"; + +export function removeDuplicates(arr, prop) { + var new_arr = []; + var lookup = {}; + + for (var i in arr) { + lookup[arr[i][prop]] = arr[i]; + } + + for (i in lookup) { + new_arr.push(lookup[i]); + } + + return new_arr; +} + +export function getLineOffsets(textDocString: String): number[] { + + let lineOffsets: number[] = []; + let text = textDocString; + let isLineStart = true; + for (let i = 0; i < text.length; i++) { + if (isLineStart) { + lineOffsets.push(i); + isLineStart = false; + } + let ch = text.charAt(i); + isLineStart = (ch === '\r' || ch === '\n'); + if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') { + i++; + } + } + if (isLineStart && text.length > 0) { + lineOffsets.push(text.length); + } + + return lineOffsets; +} + +export function removeDuplicatesObj(objArray){ + + let nonDuplicateSet = new Set(); + let nonDuplicateArr = []; + for(let obj in objArray){ + + let currObj = objArray[obj]; + let stringifiedObj = JSON.stringify(currObj); + if(!nonDuplicateSet.has(stringifiedObj)){ + nonDuplicateArr.push(currObj); + nonDuplicateSet.add(stringifiedObj); + } + + } + + return nonDuplicateArr; + +} + +export function matchOffsetToDocument(offset: number, jsonDocuments): SingleYAMLDocument { + + for(let jsonDoc in jsonDocuments.documents){ + let currJsonDoc = jsonDocuments.documents[jsonDoc]; + if(currJsonDoc.root && currJsonDoc.root.end >= offset && currJsonDoc.root.start <= offset){ + return currJsonDoc; + } + } + + return null; + +} \ No newline at end of file diff --git a/src/yaml-languageservice/utils/documentPositionCalculator.ts b/src/languageservice/utils/documentPositionCalculator.ts similarity index 79% rename from src/yaml-languageservice/utils/documentPositionCalculator.ts rename to src/languageservice/utils/documentPositionCalculator.ts index b408a38..04d1d64 100644 --- a/src/yaml-languageservice/utils/documentPositionCalculator.ts +++ b/src/languageservice/utils/documentPositionCalculator.ts @@ -1,3 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Red Hat, Inc. All rights reserved. + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ "use strict" export function insertionPointReturnValue(pt: number) { diff --git a/src/yaml-languageservice/utils/errorHandler.ts b/src/languageservice/utils/errorHandler.ts similarity index 92% rename from src/yaml-languageservice/utils/errorHandler.ts rename to src/languageservice/utils/errorHandler.ts index afa865c..eff20f1 100644 --- a/src/yaml-languageservice/utils/errorHandler.ts +++ b/src/languageservice/utils/errorHandler.ts @@ -2,12 +2,11 @@ * Copyright (c) Red Hat, Inc. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { DiagnosticSeverity } from "vscode-languageserver/lib/main"; export class ErrorHandler { private errorResultsList; private textDocument; - + constructor(textDocument){ this.errorResultsList = []; this.textDocument = textDocument; @@ -22,7 +21,7 @@ export class ErrorHandler { }, message: errorMessage }); - + } public getErrorResultsList(){ diff --git a/src/yaml-languageservice/utils/objects.ts b/src/languageservice/utils/objects.ts similarity index 100% rename from src/yaml-languageservice/utils/objects.ts rename to src/languageservice/utils/objects.ts diff --git a/src/yaml-languageservice/utils/strings.ts b/src/languageservice/utils/strings.ts similarity index 64% rename from src/yaml-languageservice/utils/strings.ts rename to src/languageservice/utils/strings.ts index bd1bee1..2050772 100644 --- a/src/yaml-languageservice/utils/strings.ts +++ b/src/languageservice/utils/strings.ts @@ -32,6 +32,16 @@ export function endsWith(haystack: string, needle: string): boolean { } } -export function convertSimple2RegExpPattern(pattern: string): string { - return pattern.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, '\\$&').replace(/[\*]/g, '.*'); +export function convertSimple2RegExp(pattern: string): RegExp { + var match = pattern.match(new RegExp('^/(.*?)/([gimy]*)$')); + return match ? convertRegexString2RegExp(match[1], match[2]) + : convertGlobalPattern2RegExp(pattern) +} + +function convertGlobalPattern2RegExp(pattern: string): RegExp { + return new RegExp(pattern.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, '\\$&').replace(/[\*]/g, '.*') + '$'); +} + +function convertRegexString2RegExp(pattern: string, flag: string): RegExp { + return new RegExp(pattern, flag); } \ No newline at end of file diff --git a/src/yaml-languageservice/utils/uri.ts b/src/languageservice/utils/uri.ts similarity index 100% rename from src/yaml-languageservice/utils/uri.ts rename to src/languageservice/utils/uri.ts diff --git a/src/languageservice/yamlLanguageService.ts b/src/languageservice/yamlLanguageService.ts new file mode 100644 index 0000000..d43aa17 --- /dev/null +++ b/src/languageservice/yamlLanguageService.ts @@ -0,0 +1,155 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Red Hat, Inc. All rights reserved. + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import { JSONSchemaService } from "./services/jsonSchemaService"; +import { + TextDocument, + Position, + CompletionList, + FormattingOptions, + Diagnostic +} from "vscode-languageserver-types"; +import { JSONSchema } from "./jsonSchema"; +import { YAMLDocumentSymbols } from "./services/documentSymbols"; +import { YAMLCompletion } from "./services/yamlCompletion"; +import { JSONDocument } from "vscode-json-languageservice"; +import { YAMLHover } from "./services/yamlHover"; +import { YAMLValidation } from "./services/yamlValidation"; +import { format } from "./services/yamlFormatter"; +import { parse as parseYAML } from "./parser/yamlParser"; +export interface LanguageSettings { + validate?: boolean; //Setting for whether we want to validate the schema + isKubernetes?: boolean; //If true then its validating against kubernetes + schemas?: any[]; //List of schemas, + customTags?: Array; //Array of Custom Tags +} + +export type YAMLDocument = { documents: JSONDocument[] }; + +export interface PromiseConstructor { + /** + * Creates a new Promise. + * @param executor A callback used to initialize the promise. This callback is passed two arguments: + * a resolve callback used resolve the promise with a value or the result of another promise, + * and a reject callback used to reject the promise with a provided reason or error. + */ + new ( + executor: ( + resolve: (value?: T | Thenable) => void, + reject: (reason?: any) => void + ) => void + ): Thenable; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: Array>): Thenable; + /** + * Creates a new rejected promise for the provided reason. + * @param reason The reason the promise was rejected. + * @returns A new rejected Promise. + */ + reject(reason: any): Thenable; + + /** + * Creates a new resolved promise for the provided value. + * @param value A promise. + * @returns A promise whose internal state matches the provided promise. + */ + resolve(value: T | Thenable): Thenable; + +} + +export interface Thenable { + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then( + onfulfilled?: (value: R) => TResult | Thenable, + onrejected?: (reason: any) => TResult | Thenable + ): Thenable; + then( + onfulfilled?: (value: R) => TResult | Thenable, + onrejected?: (reason: any) => void + ): Thenable; +} + +export interface WorkspaceContextService { + resolveRelativePath(relativePath: string, resource: string): string; +} +/** + * The schema request service is used to fetch schemas. The result should the schema file comment, or, + * in case of an error, a displayable error string + */ +export interface SchemaRequestService { + (uri: string): Thenable; +} + +export interface SchemaConfiguration { + /** + * The URI of the schema, which is also the identifier of the schema. + */ + uri: string; + /** + * A list of file names that are associated to the schema. The '*' wildcard can be used. For example '*.schema.json', 'package.json' + */ + fileMatch?: string[]; + /** + * The schema for the given URI. + * If no schema is provided, the schema will be fetched with the schema request service (if available). + */ + schema?: JSONSchema; +} + +export interface LanguageService { + configure(settings): void; + doComplete(document: TextDocument, position: Position, doc): Thenable; + doValidation(document: TextDocument, yamlDocument): Thenable; + doHover(document: TextDocument, position: Position, doc); + findDocumentSymbols(document: TextDocument, doc); + doResolve(completionItem); + resetSchema(uri: string): boolean; + doFormat(document: TextDocument, options: FormattingOptions, customTags: Array); + parseYAMLDocument(document: TextDocument): YAMLDocument; +} + +export function getLanguageService(schemaRequestService, workspaceContext, contributions, customSchemaProvider, promiseConstructor?): LanguageService { + let promise = promiseConstructor || Promise; + + let schemaService = new JSONSchemaService(schemaRequestService, workspaceContext, customSchemaProvider); + + let completer = new YAMLCompletion(schemaService, contributions, promise); + let hover = new YAMLHover(schemaService, contributions, promise); + let yamlDocumentSymbols = new YAMLDocumentSymbols(); + let yamlValidation = new YAMLValidation(schemaService, promise); + + return { + configure: (settings) => { + schemaService.clearExternalSchemas(); + if (settings.schemas) { + settings.schemas.forEach(settings => { + schemaService.registerExternalSchema(settings.uri, settings.fileMatch, settings.schema); + }); + } + yamlValidation.configure(settings); + let customTagsSetting = settings && settings["customTags"] ? settings["customTags"] : []; + completer.configure(customTagsSetting); + }, + doComplete: completer.doComplete.bind(completer), + doResolve: completer.doResolve.bind(completer), + doValidation: yamlValidation.doValidation.bind(yamlValidation), + doHover: hover.doHover.bind(hover), + findDocumentSymbols: yamlDocumentSymbols.findDocumentSymbols.bind(yamlDocumentSymbols), + resetSchema: (uri: string) => schemaService.onResourceChange(uri), + doFormat: format, + parseYAMLDocument: (document: TextDocument) => parseYAML(document.getText()) + } +} diff --git a/src/monaco.contribution.ts b/src/monaco.contribution.ts index da34a5a..d9b9d39 100644 --- a/src/monaco.contribution.ts +++ b/src/monaco.contribution.ts @@ -8,11 +8,10 @@ import * as mode from './yamlMode'; import Emitter = monaco.Emitter; import IEvent = monaco.IEvent; -import IDisposable = monaco.IDisposable; declare var require: (moduleId: [string], callback: (module: T) => void) => void; -// --- JSON configuration and defaults --------- +// --- YAML configuration and defaults --------- export class LanguageServiceDefaultsImpl implements monaco.languages.yaml.LanguageServiceDefaults { @@ -62,7 +61,7 @@ monaco.languages.yaml = createAPI(); // --- Registration to monaco editor --- function withMode(callback: (module: typeof mode) => void): void { - require(['vs/languages/yaml/yamlMode'], callback); + require(['vs/language/yaml/yamlMode'], callback); } monaco.languages.register({ diff --git a/src/monaco.d.ts b/src/monaco.d.ts index 875ec6d..76e6aa4 100644 --- a/src/monaco.d.ts +++ b/src/monaco.d.ts @@ -5,34 +5,35 @@ declare module monaco.languages.yaml { export interface DiagnosticsOptions { + /** + * If set, the validator will be enabled and perform syntax validation as well as schema based validation. + */ + readonly validate?: boolean; + + /** + * A list of known schemas and/or associations of schemas to file names. + */ + readonly schemas?: { /** - * If set, the validator will be enabled and perform syntax validation as well as schema based validation. + * The URI of the schema, which is also the identifier of the schema. */ - readonly validate?: boolean; + readonly uri: string; /** - * A list of known schemas and/or associations of schemas to file names. + * A list of file names that are associated to the schema. The '*' wildcard can be used. For example '*.schema.json', 'package.json' */ - readonly schemas?: { - /** - * The URI of the schema, which is also the identifier of the schema. - */ - readonly uri: string; - /** - * A list of file names that are associated to the schema. The '*' wildcard can be used. For example '*.schema.json', 'package.json' - */ - readonly fileMatch?: string[]; - /** - * The schema for the given URI. - */ - readonly schema?: any; - }[]; + readonly fileMatch?: string[]; + /** + * The schema for the given URI. + */ + readonly schema?: any; + }[]; } export interface LanguageServiceDefaults { - readonly onDidChange: IEvent; - readonly diagnosticsOptions: DiagnosticsOptions; - setDiagnosticsOptions(options: DiagnosticsOptions): void; + readonly onDidChange: IEvent; + readonly diagnosticsOptions: DiagnosticsOptions; + setDiagnosticsOptions(options: DiagnosticsOptions): void; } export var yamlDefaults: LanguageServiceDefaults; -} \ No newline at end of file + } diff --git a/src/tsconfig.esm.json b/src/tsconfig.esm.json new file mode 100644 index 0000000..3f4a079 --- /dev/null +++ b/src/tsconfig.esm.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "esnext", + "moduleResolution": "node", + "outDir": "../out/esm", + "target": "es5", + "lib": [ + "dom", + "es5", + "es2015.collection", + "es2015.promise", + "es2016", + "es2017.string" + ] + } +} diff --git a/src/tsconfig.json b/src/tsconfig.json index 6bd5e44..1996cf5 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -2,7 +2,17 @@ "compilerOptions": { "module": "umd", "moduleResolution": "node", - "outDir": "../out", - "target": "es5" + "outDir": "../out/amd", + "forceConsistentCasingInFileNames": true, + "target": "es5", + "lib": [ + "dom", + "es5", + "es2015.collection", + "es2015.promise", + "es2016", + "es2017.string" + ], + "downlevelIteration": true } -} \ No newline at end of file +} diff --git a/src/workerManager.ts b/src/workerManager.ts index 63d5827..db6ef9e 100644 --- a/src/workerManager.ts +++ b/src/workerManager.ts @@ -16,7 +16,7 @@ const STOP_WHEN_IDLE_FOR = 2 * 60 * 1000; // 2min export class WorkerManager { private _defaults: LanguageServiceDefaultsImpl; - private _idleCheckInterval: number; + private _idleCheckInterval: NodeJS.Timer; private _lastUsedTime: number; private _configChangeListener: IDisposable; @@ -62,7 +62,7 @@ export class WorkerManager { this._worker = monaco.editor.createWebWorker({ // module that exports the create() method and returns a `YAMLWorker` instance - moduleId: 'vs/languages/yaml/yamlWorker', + moduleId: 'vs/language/yaml/yamlWorker', label: this._defaults.languageId, diff --git a/src/yaml-ast-parser/type.ts b/src/yaml-ast-parser/type.ts index 13a2f84..b80ff79 100644 --- a/src/yaml-ast-parser/type.ts +++ b/src/yaml-ast-parser/type.ts @@ -1,6 +1,6 @@ 'use strict'; -import YAMLException = require('./exception'); +import YAMLException from './exception'; var TYPE_CONSTRUCTOR_OPTIONS = [ 'kind', diff --git a/src/yaml-languageservice/LICENSE b/src/yaml-languageservice/LICENSE deleted file mode 100644 index 867d47e..0000000 --- a/src/yaml-languageservice/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2017 Red Hat Inc. and others. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/src/yaml-languageservice/services/yamlFormatter.ts b/src/yaml-languageservice/services/yamlFormatter.ts deleted file mode 100644 index eb8b80e..0000000 --- a/src/yaml-languageservice/services/yamlFormatter.ts +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -import * as jsyaml from 'js-yaml' -import { EOL } from 'os'; -import { TextDocument, Range, Position, FormattingOptions, TextEdit } from 'vscode-languageserver-types'; - -export function format(document: TextDocument, options: FormattingOptions): TextEdit[] { - const text = document.getText() - - const documents = [] - jsyaml.loadAll(text, doc => documents.push(doc)) - - const dumpOptions = { indent: options.tabSize, noCompatMode: true }; - - let newText; - if (documents.length == 1) { - const yaml = documents[0] - newText = jsyaml.safeDump(yaml, dumpOptions) - } - else { - const formatted = documents.map(d => jsyaml.safeDump(d, dumpOptions)) - newText = '%YAML 1.2' + EOL + '---' + EOL + formatted.join('...' + EOL + '---' + EOL) + '...' + EOL - } - - return [TextEdit.replace(Range.create(Position.create(0, 0), document.positionAt(text.length)), newText)] -} \ No newline at end of file diff --git a/src/yaml-languageservice/utils/arrUtils.ts b/src/yaml-languageservice/utils/arrUtils.ts deleted file mode 100644 index b4295f9..0000000 --- a/src/yaml-languageservice/utils/arrUtils.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { YAMLDocument } from "../yamlLanguageService"; -import { SingleYAMLDocument } from "../parser/yamlParser"; - -export function removeDuplicates(arr, prop) { - var new_arr = []; - var lookup = {}; - - for (var i in arr) { - lookup[arr[i][prop]] = arr[i]; - } - - for (i in lookup) { - new_arr.push(lookup[i]); - } - - return new_arr; -} - -export function getLineOffsets(textDocString: String): number[] { - - let lineOffsets: number[] = []; - let text = textDocString; - let isLineStart = true; - for (let i = 0; i < text.length; i++) { - if (isLineStart) { - lineOffsets.push(i); - isLineStart = false; - } - let ch = text.charAt(i); - isLineStart = (ch === '\r' || ch === '\n'); - if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') { - i++; - } - } - if (isLineStart && text.length > 0) { - lineOffsets.push(text.length); - } - - return lineOffsets; -} - -export function removeDuplicatesObj(objArray) { - - let nonDuplicateSet = new Set(); - let nonDuplicateArr = []; - for (let obj in objArray) { - - let currObj = objArray[obj]; - let stringifiedObj = JSON.stringify(currObj); - if (!nonDuplicateSet.has(stringifiedObj)) { - nonDuplicateArr.push(currObj); - nonDuplicateSet.add(stringifiedObj); - } - - } - - return nonDuplicateArr; - -} - -export function matchOffsetToDocument(offset: number, jsonDocuments): SingleYAMLDocument { - - for (let jsonDoc in jsonDocuments.documents) { - let currJsonDoc = jsonDocuments.documents[jsonDoc]; - if (currJsonDoc.root && currJsonDoc.root.end >= offset && currJsonDoc.root.start <= offset) { - return currJsonDoc; - } - } - - return null; - -} \ No newline at end of file diff --git a/src/yaml-languageservice/yamlLanguageService.ts b/src/yaml-languageservice/yamlLanguageService.ts deleted file mode 100644 index a13127e..0000000 --- a/src/yaml-languageservice/yamlLanguageService.ts +++ /dev/null @@ -1,173 +0,0 @@ - -import { - TextDocument, Position, CompletionItem, CompletionList, Hover, Range, SymbolInformation, Diagnostic, - TextEdit, FormattingOptions, MarkedString -} from 'vscode-languageserver-types'; - -import { JSONSchemaService } from './services/jsonSchemaService' -import { JSONSchema } from './jsonSchema'; -import { parse as parseYAML } from "./parser/yamlParser"; -import { YAMLDocumentSymbols } from './services/documentSymbols'; -import { YAMLCompletion } from "./services/yamlCompletion"; -import { YAMLHover } from "./services/yamlHover"; -import { YAMLValidation } from "./services/yamlValidation"; -import { format as formatYAML } from './services/yamlFormatter'; - -export type JSONDocument = {} -export type YAMLDocument = { documents: JSONDocument[] } - -export interface LanguageService { - configure(settings: LanguageSettings): void; - doValidation(document: TextDocument, yamlDocument: YAMLDocument): Thenable; - parseYAMLDocument(document: TextDocument): YAMLDocument; - resetSchema(uri: string): boolean; - doResolve(item: CompletionItem): Thenable; - doComplete(document: TextDocument, position: Position, doc: YAMLDocument): Thenable; - findDocumentSymbols(document: TextDocument, doc: YAMLDocument): SymbolInformation[]; - doHover(document: TextDocument, position: Position, doc: YAMLDocument): Thenable; - format(document: TextDocument, options: FormattingOptions): TextEdit[]; -} - -export interface LanguageSettings { - /** - * If set, the validator will return syntax errors. - */ - validate?: boolean; - - /** - * A list of known schemas and/or associations of schemas to file names. - */ - schemas?: SchemaConfiguration[]; -} - -export interface SchemaConfiguration { - /** - * The URI of the schema, which is also the identifier of the schema. - */ - uri: string; - /** - * A list of file names that are associated to the schema. The '*' wildcard can be used. For example '*.schema.json', 'package.json' - */ - fileMatch?: string[]; - /** - * The schema for the given URI. - * If no schema is provided, the schema will be fetched with the schema request service (if available). - */ - schema?: JSONSchema; -} -export interface LanguageSettings { - validate?: boolean; //Setting for whether we want to validate the schema - schemas?: any[]; //List of schemas -} - -export interface PromiseConstructor { - /** - * Creates a new Promise. - * @param executor A callback used to initialize the promise. This callback is passed two arguments: - * a resolve callback used resolve the spromise with a value or the result of another promise, - * and a reject callback used to reject the promise with a provided reason or error. - */ - new (executor: (resolve: (value?: T | Thenable) => void, reject: (reason?: any) => void) => void): Thenable; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: Array>): Thenable; - /** - * Creates a new rejected promise for the provided reason. - * @param reason The reason the promise was rejected. - * @returns A new rejected Promise. - */ - reject(reason: any): Thenable; - - /** - * Creates a new resolved promise for the provided value. - * @param value A promise. - * @returns A promise whose internal state matches the provided promise. - */ - resolve(value: T | Thenable): Thenable; - -} - -export interface Thenable { - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: (value: R) => TResult | Thenable, onrejected?: (reason: any) => TResult | Thenable): Thenable; - then(onfulfilled?: (value: R) => TResult | Thenable, onrejected?: (reason: any) => void): Thenable; -} - -export interface WorkspaceContextService { - resolveRelativePath(relativePath: string, resource: string): string; -} -/** - * The schema request service is used to fetch schemas. The result should the schema file comment, or, - * in case of an error, a displayable error string - */ -export interface SchemaRequestService { - (uri: string): Thenable; -} - -export interface SchemaConfiguration { - /** - * The URI of the schema, which is also the identifier of the schema. - */ - uri: string; - /** - * A list of file names that are associated to the schema. The '*' wildcard can be used. For example '*.schema.json', 'package.json' - */ - fileMatch?: string[]; - /** - * The schema for the given URI. - * If no schema is provided, the schema will be fetched with the schema request service (if available). - */ - schema?: JSONSchema; -} - -export interface LanguageService { - configure(settings): void; - parseYAMLDocument(document: TextDocument): YAMLDocument, - doComplete(document: TextDocument, position: Position, doc): Thenable; - doValidation(document: TextDocument, yamlDocument): Thenable; - doHover(document: TextDocument, position: Position, doc); - findDocumentSymbols(document: TextDocument, doc); - doResolve(completionItem); - resetSchema(uri: string): boolean; -} - -export function getLanguageService(schemaRequestService, workspaceContext, contributions, customSchemaProvider, promiseConstructor?): LanguageService { - let promise = promiseConstructor || Promise; - - let schemaService = new JSONSchemaService(schemaRequestService, workspaceContext, customSchemaProvider); - - let completer = new YAMLCompletion(schemaService, contributions, promise); - let hover = new YAMLHover(schemaService, contributions, promise); - let yamlDocumentSymbols = new YAMLDocumentSymbols(); - let yamlValidation = new YAMLValidation(schemaService, promise); - - return { - configure: (settings) => { - schemaService.clearExternalSchemas(); - if (settings.schemas) { - settings.schemas.forEach(settings => { - schemaService.registerExternalSchema(settings.uri, settings.fileMatch, settings.schema); - }); - } - yamlValidation.configure(settings); - }, - parseYAMLDocument: (document: TextDocument) => parseYAML(document.getText()), - doComplete: completer.doComplete.bind(completer), - doResolve: completer.doResolve.bind(completer), - doValidation: yamlValidation.doValidation.bind(yamlValidation), - doHover: hover.doHover.bind(hover), - findDocumentSymbols: yamlDocumentSymbols.findDocumentSymbols.bind(yamlDocumentSymbols), - resetSchema: (uri: string) => schemaService.onResourceChange(uri), - format: formatYAML - } -} diff --git a/src/yaml.worker.ts b/src/yaml.worker.ts new file mode 100644 index 0000000..de9cccc --- /dev/null +++ b/src/yaml.worker.ts @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import * as worker from 'monaco-editor-core/esm/vs/editor/editor.worker'; +import { YAMLWorker } from './yamlWorker'; + +self.onmessage = () => { + // ignore the first message + worker.initialize((ctx, createData) => { + return new YAMLWorker(ctx, createData) + }); +}; diff --git a/src/yamlMode.ts b/src/yamlMode.ts index b0349eb..6001336 100644 --- a/src/yamlMode.ts +++ b/src/yamlMode.ts @@ -1,71 +1,71 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -'use strict'; - -import { WorkerManager } from './workerManager'; -import { YAMLWorker } from './yamlWorker'; -import { LanguageServiceDefaultsImpl } from './monaco.contribution'; -import * as languageFeatures from './languageFeatures'; - -import Promise = monaco.Promise; -import Uri = monaco.Uri; -import IDisposable = monaco.IDisposable; - -export function setupMode(defaults: LanguageServiceDefaultsImpl): void { - - let disposables: IDisposable[] = []; - - const client = new WorkerManager(defaults); - disposables.push(client); - - const worker: languageFeatures.WorkerAccessor = (...uris: Uri[]): Promise => { - return client.getLanguageServiceWorker(...uris); - }; - - let languageId = defaults.languageId; - - disposables.push(monaco.languages.registerCompletionItemProvider(languageId, new languageFeatures.CompletionAdapter(worker))); - disposables.push(monaco.languages.registerHoverProvider(languageId, new languageFeatures.HoverAdapter(worker))); - disposables.push(monaco.languages.registerDocumentSymbolProvider(languageId, new languageFeatures.DocumentSymbolAdapter(worker))); - disposables.push(monaco.languages.registerDocumentFormattingEditProvider(languageId, new languageFeatures.DocumentFormattingEditProvider(worker))); - disposables.push(monaco.languages.registerDocumentRangeFormattingEditProvider(languageId, new languageFeatures.DocumentRangeFormattingEditProvider(worker))); - disposables.push(new languageFeatures.DiagnostcsAdapter(languageId, worker)); - // disposables.push(monaco.languages.setTokensProvider(languageId, createTokenizationSupport(true))); - disposables.push(monaco.languages.setLanguageConfiguration(languageId, richEditConfiguration)); -} - - -const richEditConfiguration: monaco.languages.LanguageConfiguration = { - comments: { - lineComment: '#' - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'] - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: '\'', close: '\'' }, - ], - surroundingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: '\'', close: '\'' }, - ], - - onEnterRules: [ - { - beforeText: /:\s*$/, - action: { indentAction: monaco.languages.IndentAction.Indent } - } - ], -}; - +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import { WorkerManager } from './workerManager'; +import { YAMLWorker } from './yamlWorker'; +import { LanguageServiceDefaultsImpl } from './monaco.contribution'; +import * as languageFeatures from './languageFeatures'; + +import Promise = monaco.Promise; +import Uri = monaco.Uri; +import IDisposable = monaco.IDisposable; + +export function setupMode(defaults: LanguageServiceDefaultsImpl): void { + + let disposables: IDisposable[] = []; + + const client = new WorkerManager(defaults); + disposables.push(client); + + const worker: languageFeatures.WorkerAccessor = (...uris: Uri[]): Promise => { + return client.getLanguageServiceWorker(...uris); + }; + + let languageId = defaults.languageId; + + disposables.push(monaco.languages.registerCompletionItemProvider(languageId, new languageFeatures.CompletionAdapter(worker))); + disposables.push(monaco.languages.registerHoverProvider(languageId, new languageFeatures.HoverAdapter(worker))); + disposables.push(monaco.languages.registerDocumentSymbolProvider(languageId, new languageFeatures.DocumentSymbolAdapter(worker))); + disposables.push(monaco.languages.registerDocumentFormattingEditProvider(languageId, new languageFeatures.DocumentFormattingEditProvider(worker))); + disposables.push(monaco.languages.registerDocumentRangeFormattingEditProvider(languageId, new languageFeatures.DocumentRangeFormattingEditProvider(worker))); + disposables.push(new languageFeatures.DiagnosticsAdapter(languageId, worker, defaults)); + // disposables.push(monaco.languages.setTokensProvider(languageId, createTokenizationSupport(true))); + disposables.push(monaco.languages.setLanguageConfiguration(languageId, richEditConfiguration)); +} + + +const richEditConfiguration: monaco.languages.LanguageConfiguration = { + comments: { + lineComment: '#' + }, + brackets: [ + ['{', '}'], + ['[', ']'], + ['(', ')'] + ], + autoClosingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' }, + { open: '"', close: '"' }, + { open: '\'', close: '\'' }, + ], + surroundingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' }, + { open: '"', close: '"' }, + { open: '\'', close: '\'' }, + ], + + onEnterRules: [ + { + beforeText: /:\s*$/, + action: { indentAction: monaco.languages.IndentAction.Indent } + } + ], +}; + diff --git a/src/yamlWorker.ts b/src/yamlWorker.ts index a9f5c72..0cdf407 100644 --- a/src/yamlWorker.ts +++ b/src/yamlWorker.ts @@ -1,146 +1,214 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Red Hat, Inc. All rights reserved. - * Copyright (c) Adam Voss. All rights reserved. - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -'use strict'; - -import Promise = monaco.Promise; -import Thenable = monaco.Thenable; -import IWorkerContext = monaco.worker.IWorkerContext; - -import * as yamlService from './yaml-languageservice/yamlLanguageService'; -import * as ls from 'vscode-languageserver-types'; -import { getLineOffsets } from './yaml-languageservice/utils/arrUtils'; -import { parse as parseYAML } from "./yaml-languageservice/parser/yamlParser"; - -export class YAMLWorker { - - private _ctx: IWorkerContext; - private _languageService: yamlService.LanguageService; - private _languageSettings: yamlService.LanguageSettings; - private _languageId: string; - - constructor(ctx: IWorkerContext, createData: ICreateData) { - this._ctx = ctx; - this._languageSettings = createData.languageSettings; - this._languageId = createData.languageId; - this._languageService = yamlService.getLanguageService(); - this._languageService.configure(this._languageSettings); - } - - doValidation(uri: string): Thenable { - let document = this._getTextDocument(uri); - if (document) { - let jsonDocument = this._languageService.parseYAMLDocument(document); - return this._languageService.doValidation(document, jsonDocument); - } - return Promise.as([]); - } - doComplete(uri: string, position: ls.Position): Thenable { - let document = this._getTextDocument(uri); - let completionFix = completionHelper(document, position); - let newText = completionFix.newText; - let jsonDocument = parseYAML(newText); - return this._languageService.doComplete(document, position, jsonDocument); - } - doResolve(item: ls.CompletionItem): Thenable { - return this._languageService.doResolve(item); - } - doHover(uri: string, position: ls.Position): Thenable { - let document = this._getTextDocument(uri); - let jsonDocument = this._languageService.parseYAMLDocument(document); - return this._languageService.doHover(document, position, jsonDocument); - } - format(uri: string, range: ls.Range, options: ls.FormattingOptions): Thenable { - let document = this._getTextDocument(uri); - let textEdits = this._languageService.format(document, options); - return Promise.as(textEdits); - } - resetSchema(uri: string): Thenable { - return Promise.as(this._languageService.resetSchema(uri)); - } - findDocumentSymbols(uri: string): Promise { - let document = this._getTextDocument(uri); - let jsonDocument = this._languageService.parseYAMLDocument(document); - let symbols = this._languageService.findDocumentSymbols(document, jsonDocument); - return Promise.as(symbols); - } - private _getTextDocument(uri: string): ls.TextDocument { - let models = this._ctx.getMirrorModels(); - for (let model of models) { - if (model.uri.toString() === uri) { - return ls.TextDocument.create(uri, this._languageId, model.version, model.getValue()); - } - } - return null; - } -} - -export interface ICreateData { - languageId: string; - languageSettings: yamlService.LanguageSettings; -} - -export function create(ctx: IWorkerContext, createData: ICreateData): YAMLWorker { - return new YAMLWorker(ctx, createData); -} - - -// https://github.com/redhat-developer/yaml-language-server/blob/5e069c0e9d7004d57f1fa6e93df670d4895883d1/src/server.ts#L453 -function completionHelper(document: ls.TextDocument, textDocumentPosition: ls.Position) { - - //Get the string we are looking at via a substring - let linePos = textDocumentPosition.line; - let position = textDocumentPosition; - let lineOffset = getLineOffsets(document.getText()); - let start = lineOffset[linePos]; //Start of where the autocompletion is happening - let end = 0; //End of where the autocompletion is happening - if (lineOffset[linePos + 1]) { - end = lineOffset[linePos + 1]; - } else { - end = document.getText().length; - } - let textLine = document.getText().substring(start, end); - - //Check if the string we are looking at is a node - if (textLine.indexOf(":") === -1) { - //We need to add the ":" to load the nodes - let newText = ""; - - //This is for the empty line case - let trimmedText = textLine.trim(); - if (trimmedText.length === 0 || (trimmedText.length === 1 && trimmedText[0] === '-')) { - //Add a temp node that is in the document but we don't use at all. - if (lineOffset[linePos + 1]) { - newText = document.getText().substring(0, start + (textLine.length - 1)) + "holder:\r\n" + document.getText().substr(end + 2); - } else { - newText = document.getText().substring(0, start + (textLine.length)) + "holder:\r\n" + document.getText().substr(end + 2); - } - //For when missing semi colon case - } else { - //Add a semicolon to the end of the current line so we can validate the node - if (lineOffset[linePos + 1]) { - newText = document.getText().substring(0, start + (textLine.length - 1)) + ":\r\n" + document.getText().substr(end + 2); - } else { - newText = document.getText().substring(0, start + (textLine.length)) + ":\r\n" + document.getText().substr(end + 2); - } - } - - return { - "newText": newText, - "newPosition": textDocumentPosition - } - - } else { - - //All the nodes are loaded - position.character = position.character - 1; - return { - "newText": document.getText(), - "newPosition": position - } - } - -} +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Red Hat, Inc. All rights reserved. + * Copyright (c) Adam Voss. All rights reserved. + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import Promise = monaco.Promise; +import Thenable = monaco.Thenable; +import IWorkerContext = monaco.worker.IWorkerContext; + +import * as ls from 'vscode-languageserver-types'; +import * as yamlService from './languageservice/yamlLanguageService'; +import { SchemaRequestService } from './languageservice/yamlLanguageService'; + +class PromiseAdapter implements yamlService.Thenable { + private wrapped: monaco.Promise; + + constructor(executor: (resolve: (value?: T | yamlService.Thenable) => void, reject: (reason?: any) => void) => void) { + this.wrapped = new monaco.Promise(executor); + } + public then(onfulfilled?: (value: T) => TResult | yamlService.Thenable, onrejected?: (reason: any) => void): yamlService.Thenable { + let thenable : yamlService.Thenable = this.wrapped; + return thenable.then(onfulfilled, onrejected); + } + public getWrapped(): monaco.Thenable { + return this.wrapped; + } + public cancel(): void { + this.wrapped.cancel(); + } + public static resolve(v: T | Thenable): yamlService.Thenable { + return > monaco.Promise.as(v); + } + public static reject(v: T): yamlService.Thenable { + return monaco.Promise.wrapError(v); + } + public static all(values: yamlService.Thenable[]): yamlService.Thenable { + return monaco.Promise.join(values); + } +} + +// Currently we only support loading schemas via xhr: +const ajax = (url: string) => + new Promise((resolve, reject) => { + const request = new XMLHttpRequest(); + request.onreadystatechange = () => { + if (request.readyState === XMLHttpRequest.DONE) { + const response = request.responseText; + if (request.status < 400) { + resolve(response); + } else { + reject(response); + } + } + }; + request.onerror = reject; + request.open('GET', url); + request.send(); + }); + +export class YAMLWorker { + + private _ctx: IWorkerContext; + private _languageService: yamlService.LanguageService; + private _languageSettings: yamlService.LanguageSettings; + private _languageId: string; + + constructor(ctx: IWorkerContext, createData: ICreateData) { + this._ctx = ctx; + this._languageSettings = createData.languageSettings; + this._languageId = createData.languageId; + this._languageService = yamlService.getLanguageService(ajax, null, [], null, PromiseAdapter); + this._languageService.configure(this._languageSettings); + } + + doValidation(uri: string): Thenable { + let document = this._getTextDocument(uri); + if (document) { + let yamlDocument = this._languageService.parseYAMLDocument(document); + return this._languageService.doValidation(document, yamlDocument); + } + return Promise.as([]); + } + + doComplete(uri: string, position: ls.Position): Thenable { + let document = this._getTextDocument(uri); + let completionFix = completionHelper(document, position); + let yamlDocument = this._languageService.parseYAMLDocument(document); + return this._languageService.doComplete(document, position, yamlDocument); + } + doResolve(item: ls.CompletionItem): Thenable { + return this._languageService.doResolve(item); + } + doHover(uri: string, position: ls.Position): Thenable { + let document = this._getTextDocument(uri); + let yamlDocument = this._languageService.parseYAMLDocument(document) + return this._languageService.doHover(document, position, yamlDocument); + } + format(uri: string, range: ls.Range, options: ls.FormattingOptions): Thenable { + let document = this._getTextDocument(uri); + let textEdits = this._languageService.doFormat(document, options, []); + return Promise.as(textEdits); + } + resetSchema(uri: string): Thenable { + return Promise.as(this._languageService.resetSchema(uri)); + } + findDocumentSymbols(uri: string): Thenable { + let document = this._getTextDocument(uri); + let yamlDocument = this._languageService.parseYAMLDocument(document); + let symbols = this._languageService.findDocumentSymbols(document, yamlDocument); + return Promise.as(symbols); + } + private _getTextDocument(uri: string): ls.TextDocument { + let models = this._ctx.getMirrorModels(); + for (let model of models) { + if (model.uri.toString() === uri) { + return ls.TextDocument.create(uri, this._languageId, model.version, model.getValue()); + } + } + return null; + } +} + +export interface ICreateData { + languageId: string; + languageSettings: yamlService.LanguageSettings; + schemaRequestService?: SchemaRequestService; +} + +export function create(ctx: IWorkerContext, createData: ICreateData): YAMLWorker { + return new YAMLWorker(ctx, createData); +} + +export function getLineOffsets(textDocString: String): number[] { + + let lineOffsets: number[] = []; + let text = textDocString; + let isLineStart = true; + for (let i = 0; i < text.length; i++) { + if (isLineStart) { + lineOffsets.push(i); + isLineStart = false; + } + let ch = text.charAt(i); + isLineStart = (ch === '\r' || ch === '\n'); + if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') { + i++; + } + } + if (isLineStart && text.length > 0) { + lineOffsets.push(text.length); + } + + return lineOffsets; +} + +// https://github.com/redhat-developer/yaml-language-server/blob/5e069c0e9d7004d57f1fa6e93df670d4895883d1/src/server.ts#L453 +function completionHelper(document: ls.TextDocument, textDocumentPosition: ls.Position) { + + //Get the string we are looking at via a substring + let linePos = textDocumentPosition.line; + let position = textDocumentPosition; + let lineOffset = getLineOffsets(document.getText()); + let start = lineOffset[linePos]; //Start of where the autocompletion is happening + let end = 0; //End of where the autocompletion is happening + if (lineOffset[linePos + 1]) { + end = lineOffset[linePos + 1]; + } else { + end = document.getText().length; + } + let textLine = document.getText().substring(start, end); + + //Check if the string we are looking at is a node + if (textLine.indexOf(":") === -1) { + //We need to add the ":" to load the nodes + let newText = ""; + + //This is for the empty line case + let trimmedText = textLine.trim(); + if (trimmedText.length === 0 || (trimmedText.length === 1 && trimmedText[0] === '-')) { + //Add a temp node that is in the document but we don't use at all. + if (lineOffset[linePos + 1]) { + newText = document.getText().substring(0, start + (textLine.length - 1)) + "holder:\r\n" + document.getText().substr(end + 2); + } else { + newText = document.getText().substring(0, start + (textLine.length)) + "holder:\r\n" + document.getText().substr(end + 2); + } + //For when missing semi colon case + } else { + //Add a semicolon to the end of the current line so we can validate the node + if (lineOffset[linePos + 1]) { + newText = document.getText().substring(0, start + (textLine.length - 1)) + ":\r\n" + document.getText().substr(end + 2); + } else { + newText = document.getText().substring(0, start + (textLine.length)) + ":\r\n" + document.getText().substr(end + 2); + } + } + + return { + "newText": newText, + "newPosition": textDocumentPosition + } + + } else { + + //All the nodes are loaded + position.character = position.character - 1; + return { + "newText": document.getText(), + "newPosition": position + } + } + +} diff --git a/test-demo.png b/test-demo.png new file mode 100644 index 0000000..427719a Binary files /dev/null and b/test-demo.png differ diff --git a/test/index.html b/test/index.html index 6090f40..4182187 100644 --- a/test/index.html +++ b/test/index.html @@ -1,63 +1,110 @@ + - - - + + + + -

Monaco Editor JSON test page

-
+

Monaco Editor YAML test page

+ +
- - - - + if (document.location.protocol === 'http:') { + // Add support for running local http server + let testIndex = document.location.pathname.indexOf('/test/'); + if (testIndex !== -1) { + let prefix = document.location.pathname.substr(0, testIndex); + paths['vs/language/yaml'] = prefix + '/release/dev'; + } + } + var require = { + paths: paths + }; + + + + - + + \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index a6046b1..1b557f6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,43 +2,17 @@ # yarn lockfile v1 -align-text@^0.1.1, align-text@^0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" - dependencies: - kind-of "^3.0.2" - longest "^1.0.1" - repeat-string "^1.5.2" +"@types/chai@^4.1.4": + version "4.1.4" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.1.4.tgz#5ca073b330d90b4066d6ce18f60d57f2084ce8ca" -ansi-gray@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/ansi-gray/-/ansi-gray-0.1.1.tgz#2962cf54ec9792c48510a3deb524436861ef7251" - dependencies: - ansi-wrap "0.1.0" +"@types/mocha@^5.2.5": + version "5.2.5" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.5.tgz#8a4accfc403c124a0bafe8a9fc61a05ec1032073" -ansi-regex@^0.2.0, ansi-regex@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-0.2.1.tgz#0d8e946967a3d8143f93e24e298525fc1b2235f9" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - -ansi-styles@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-1.1.0.tgz#eaecbf66cd706882760b2f4691582b8f55d7a7de" - -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - -ansi-wrap@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf" - -archy@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" +"@types/node@^10.9.3": + version "10.9.3" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.9.3.tgz#85f288502503ade0b3bfc049fe1777b05d0327d5" argparse@^1.0.7: version "1.0.10" @@ -46,512 +20,36 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" -arr-diff@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - -arr-flatten@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - -arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - -array-differ@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-1.0.0.tgz#eff52e3758249d33be402b8bb8e564bb2b5d4031" - -array-each@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/array-each/-/array-each-1.0.1.tgz#a794af0c05ab1752846ee753a1f211a05ba0c44f" - -array-find-index@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" - -array-slice@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-1.1.0.tgz#e368ea15f89bc7069f7ffb89aec3a6c7d4ac22d4" - -array-uniq@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" - -array-unique@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - -assign-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - -async@~0.2.6: - version "0.2.10" - resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1" - -atob@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.0.3.tgz#19c7a760473774468f20b2d2d03372ad7d4cbf5d" - balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" -base@^0.11.1: - version "0.11.2" - resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" - dependencies: - cache-base "^1.0.1" - class-utils "^0.3.5" - component-emitter "^1.2.1" - define-property "^1.0.0" - isobject "^3.0.1" - mixin-deep "^1.2.0" - pascalcase "^0.1.1" - -beeper@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/beeper/-/beeper-1.1.1.tgz#e6d5ea8c5dad001304a70b22638447f69cb2f809" - -brace-expansion@^1.0.0, brace-expansion@^1.1.7: +brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" dependencies: balanced-match "^1.0.0" concat-map "0.0.1" -braces@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.1.tgz#7086c913b4e5a08dbe37ac0ee6a2500c4ba691bb" - dependencies: - arr-flatten "^1.1.0" - array-unique "^0.3.2" - define-property "^1.0.0" - extend-shallow "^2.0.1" - fill-range "^4.0.0" - isobject "^3.0.1" - kind-of "^6.0.2" - repeat-element "^1.1.2" - snapdragon "^0.8.1" - snapdragon-node "^2.0.1" - split-string "^3.0.2" - to-regex "^3.0.1" - -builtin-modules@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" - -cache-base@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" - dependencies: - collection-visit "^1.0.0" - component-emitter "^1.2.1" - get-value "^2.0.6" - has-value "^1.0.0" - isobject "^3.0.1" - set-value "^2.0.0" - to-object-path "^0.3.0" - union-value "^1.0.0" - unset-value "^1.0.0" - -camelcase-keys@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" - dependencies: - camelcase "^2.0.0" - map-obj "^1.0.0" - -camelcase@^1.0.2: - version "1.2.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" - -camelcase@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" - -center-align@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" - dependencies: - align-text "^0.1.3" - lazy-cache "^1.0.3" - -chalk@^0.5.0: - version "0.5.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-0.5.1.tgz#663b3a648b68b55d04690d49167aa837858f2174" - dependencies: - ansi-styles "^1.1.0" - escape-string-regexp "^1.0.0" - has-ansi "^0.1.0" - strip-ansi "^0.3.0" - supports-color "^0.2.0" - -chalk@^1.0.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - dependencies: - 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" - -class-utils@^0.3.5: - version "0.3.6" - resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - dependencies: - arr-union "^3.1.0" - define-property "^0.2.5" - isobject "^3.0.0" - static-extend "^0.1.1" - -cliui@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" - dependencies: - center-align "^0.1.1" - right-align "^0.1.1" - wordwrap "0.0.2" - -clone-stats@^0.0.1, clone-stats@~0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-0.0.1.tgz#b88f94a82cf38b8791d58046ea4029ad88ca99d1" - -clone@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/clone/-/clone-0.2.0.tgz#c6126a90ad4f72dbf5acdb243cc37724fe93fc1f" - -clone@^1.0.0, clone@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.3.tgz#298d7e2231660f40c003c2ed3140decf3f53085f" - -collection-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - dependencies: - map-visit "^1.0.0" - object-visit "^1.0.0" - -color-support@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" - -component-emitter@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" +commander@~2.13.0: + version "2.13.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c" concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" -copy-descriptor@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - -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" - -currently-unhandled@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" - dependencies: - array-find-index "^1.0.1" - -dateformat@^1.0.7-1.2.3: - version "1.0.12" - resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-1.0.12.tgz#9f124b67594c937ff706932e4a642cca8dbbfee9" - dependencies: - get-stdin "^4.0.1" - meow "^3.3.0" - -dateformat@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-2.2.0.tgz#4065e2013cf9fb916ddfd82efb506ad4c6769062" - -deap@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/deap/-/deap-1.0.0.tgz#b148bf82430a27699b7483a03eb6b67585bfc888" - -debug@^2.2.0, debug@^2.3.3: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - dependencies: - ms "2.0.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" - -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - -defaults@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" - dependencies: - clone "^1.0.2" - -define-property@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - dependencies: - is-descriptor "^0.1.0" - -define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - dependencies: - is-descriptor "^1.0.0" - -define-property@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - dependencies: - is-descriptor "^1.0.2" - isobject "^3.0.1" - -deprecated@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/deprecated/-/deprecated-0.0.1.tgz#f9c9af5464afa1e7a971458a8bdef2aa94d5bb19" - -detect-file@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7" - -duplexer2@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.0.2.tgz#c614dcf67e2fb14995a91711e5a617e8a60a31db" - dependencies: - readable-stream "~1.1.9" - -duplexer@~0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" - -end-of-stream@~0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-0.1.5.tgz#8e177206c3c80837d85632e8b9359dfe8b2f6eaf" - dependencies: - once "~1.3.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" - -escape-string-regexp@^1.0.0, escape-string-regexp@^1.0.2: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - esprima@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" - -event-stream@^3.3.2: - version "3.3.4" - resolved "https://registry.yarnpkg.com/event-stream/-/event-stream-3.3.4.tgz#4ab4c9a0f5a54db9338b4c34d86bfce8f4b35571" - dependencies: - 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" - -event-stream@~3.0.20: - version "3.0.20" - resolved "https://registry.yarnpkg.com/event-stream/-/event-stream-3.0.20.tgz#038bbb2ea9ea90385b26fbc1854d0b539f2abea3" - dependencies: - duplexer "~0.1.1" - from "~0" - map-stream "~0.0.3" - pause-stream "0.0.11" - split "0.2" - stream-combiner "~0.0.3" - through "~2.3.1" - -expand-brackets@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - dependencies: - debug "^2.3.3" - define-property "^0.2.5" - extend-shallow "^2.0.1" - posix-character-classes "^0.1.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -expand-tilde@^2.0.0, expand-tilde@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-2.0.2.tgz#97e801aa052df02454de46b02bf621642cdc8502" - dependencies: - homedir-polyfill "^1.0.1" - -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - dependencies: - is-extendable "^0.1.0" - -extend-shallow@^3.0.0, extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" - -extend@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" - -extglob@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -fancy-log@^1.0.0, fancy-log@^1.1.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.2.tgz#f41125e3d84f2e7d89a43d06d958c8f78be16be1" - dependencies: - ansi-gray "^0.1.1" - color-support "^1.1.3" - time-stamp "^1.0.0" - -fill-range@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - dependencies: - extend-shallow "^2.0.1" - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range "^2.1.0" - -find-index@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/find-index/-/find-index-0.1.1.tgz#675d358b2ca3892d795a1ab47232f8b6e2e0dde4" - -find-up@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" - dependencies: - path-exists "^2.0.0" - pinkie-promise "^2.0.0" - -findup-sync@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-2.0.0.tgz#9326b1488c22d1a6088650a86901b2d9a90a2cbc" - dependencies: - detect-file "^1.0.0" - is-glob "^3.1.0" - micromatch "^3.0.4" - resolve-dir "^1.0.1" - -fined@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fined/-/fined-1.1.0.tgz#b37dc844b76a2f5e7081e884f7c0ae344f153476" - dependencies: - expand-tilde "^2.0.2" - is-plain-object "^2.0.3" - object.defaults "^1.1.0" - object.pick "^1.2.0" - parse-filepath "^1.0.1" - -first-chunk-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz#59bfb50cd905f60d7c394cd3d9acaab4e6ad934e" - -flagged-respawn@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/flagged-respawn/-/flagged-respawn-1.0.0.tgz#4e79ae9b2eb38bf86b3bb56bf3e0a56aa5fcabd7" - -for-in@^1.0.1, for-in@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - -for-own@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-1.0.0.tgz#c63332f415cedc4b04dbfe70cf836494c53cb44b" - dependencies: - for-in "^1.0.1" - -fragment-cache@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - dependencies: - map-cache "^0.2.2" - -from@~0: - version "0.1.7" - resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe" + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" -gaze@^0.5.1: - version "0.5.2" - resolved "https://registry.yarnpkg.com/gaze/-/gaze-0.5.2.tgz#40b709537d24d1d45767db5a908689dfe69ac44f" - dependencies: - globule "~0.1.0" - -get-stdin@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" - -get-value@^2.0.3, get-value@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - -glob-stream@^3.1.5: - version "3.1.18" - resolved "https://registry.yarnpkg.com/glob-stream/-/glob-stream-3.1.18.tgz#9170a5f12b790306fdfe598f313f8f7954fd143b" - dependencies: - glob "^4.3.1" - glob2base "^0.0.12" - minimatch "^2.0.1" - ordered-read-streams "^0.1.0" - through2 "^0.6.1" - unique-stream "^1.0.0" - -glob-watcher@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/glob-watcher/-/glob-watcher-0.0.6.tgz#b95b4a8df74b39c83298b0c05c978b4d9a3b710b" - dependencies: - gaze "^0.5.1" - -glob2base@^0.0.12: - version "0.0.12" - resolved "https://registry.yarnpkg.com/glob2base/-/glob2base-0.0.12.tgz#9d419b3e28f12e83a362164a277055922c9c0d56" - dependencies: - find-index "^0.1.1" - -glob@^4.3.1: - version "4.5.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-4.5.3.tgz#c6cb73d3226c1efef04de3c56d012f03377ee15f" - dependencies: - inflight "^1.0.4" - inherits "2" - minimatch "^2.0.1" - once "^1.3.0" - glob@^7.0.5: - version "7.1.2" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -560,210 +58,6 @@ glob@^7.0.5: once "^1.3.0" path-is-absolute "^1.0.0" -glob@~3.1.21: - version "3.1.21" - resolved "https://registry.yarnpkg.com/glob/-/glob-3.1.21.tgz#d29e0a055dea5138f4d07ed40e8982e83c2066cd" - dependencies: - graceful-fs "~1.2.0" - inherits "1" - minimatch "~0.2.11" - -global-modules@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-1.0.0.tgz#6d770f0eb523ac78164d72b5e71a8877265cc3ea" - dependencies: - global-prefix "^1.0.1" - is-windows "^1.0.1" - resolve-dir "^1.0.0" - -global-prefix@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-1.0.2.tgz#dbf743c6c14992593c655568cb66ed32c0122ebe" - dependencies: - expand-tilde "^2.0.2" - homedir-polyfill "^1.0.1" - ini "^1.3.4" - is-windows "^1.0.1" - which "^1.2.14" - -globule@~0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/globule/-/globule-0.1.0.tgz#d9c8edde1da79d125a151b79533b978676346ae5" - dependencies: - glob "~3.1.21" - lodash "~1.0.1" - minimatch "~0.2.11" - -glogg@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/glogg/-/glogg-1.0.1.tgz#dcf758e44789cc3f3d32c1f3562a3676e6a34810" - dependencies: - sparkles "^1.0.0" - -graceful-fs@^3.0.0: - version "3.0.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-3.0.11.tgz#7613c778a1afea62f25c630a086d7f3acbbdd818" - dependencies: - natives "^1.1.0" - -graceful-fs@^4.1.2: - version "4.1.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" - -graceful-fs@~1.2.0: - version "1.2.3" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-1.2.3.tgz#15a4806a57547cb2d2dbf27f42e89a8c3451b364" - -gulp-requirejs@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/gulp-requirejs/-/gulp-requirejs-0.1.3.tgz#0cbfdc3e36ca20bf50332f710a4df7a36a34a3fc" - dependencies: - event-stream "~3.0.20" - gulp-util "~2.2.5" - requirejs "2.1.8" - -gulp-tsb@^2.0.0: - version "2.0.5" - resolved "https://registry.yarnpkg.com/gulp-tsb/-/gulp-tsb-2.0.5.tgz#7f7791f7f54ce41c406382360a21f5d8f1198d04" - dependencies: - gulp-util "^3.0.1" - through "^2.3.6" - vinyl "^0.4.3" - -gulp-uglify@^1.5.3: - version "1.5.4" - resolved "https://registry.yarnpkg.com/gulp-uglify/-/gulp-uglify-1.5.4.tgz#524788d87666d09f9d0c21fb2177f90039a658c9" - dependencies: - deap "^1.0.0" - fancy-log "^1.0.0" - gulp-util "^3.0.0" - isobject "^2.0.0" - through2 "^2.0.0" - uglify-js "2.6.4" - uglify-save-license "^0.4.1" - vinyl-sourcemaps-apply "^0.2.0" - -gulp-util@^3.0.0, gulp-util@^3.0.1: - version "3.0.8" - resolved "https://registry.yarnpkg.com/gulp-util/-/gulp-util-3.0.8.tgz#0054e1e744502e27c04c187c3ecc505dd54bbb4f" - dependencies: - array-differ "^1.0.0" - array-uniq "^1.0.2" - beeper "^1.0.0" - chalk "^1.0.0" - dateformat "^2.0.0" - fancy-log "^1.1.0" - gulplog "^1.0.0" - has-gulplog "^0.1.0" - lodash._reescape "^3.0.0" - lodash._reevaluate "^3.0.0" - lodash._reinterpolate "^3.0.0" - lodash.template "^3.0.0" - minimist "^1.1.0" - multipipe "^0.1.2" - object-assign "^3.0.0" - replace-ext "0.0.1" - through2 "^2.0.0" - vinyl "^0.5.0" - -gulp-util@~2.2.5: - version "2.2.20" - resolved "https://registry.yarnpkg.com/gulp-util/-/gulp-util-2.2.20.tgz#d7146e5728910bd8f047a6b0b1e549bc22dbd64c" - dependencies: - chalk "^0.5.0" - dateformat "^1.0.7-1.2.3" - lodash._reinterpolate "^2.4.1" - lodash.template "^2.4.1" - minimist "^0.2.0" - multipipe "^0.1.0" - through2 "^0.5.0" - vinyl "^0.2.1" - -gulp@^3.9.1: - version "3.9.1" - resolved "https://registry.yarnpkg.com/gulp/-/gulp-3.9.1.tgz#571ce45928dd40af6514fc4011866016c13845b4" - dependencies: - archy "^1.0.0" - chalk "^1.0.0" - deprecated "^0.0.1" - gulp-util "^3.0.0" - interpret "^1.0.0" - liftoff "^2.1.0" - minimist "^1.1.0" - orchestrator "^0.3.0" - pretty-hrtime "^1.0.0" - semver "^4.1.0" - tildify "^1.0.0" - v8flags "^2.0.2" - vinyl-fs "^0.3.0" - -gulplog@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/gulplog/-/gulplog-1.0.0.tgz#e28c4d45d05ecbbed818363ce8f9c5926229ffe5" - dependencies: - glogg "^1.0.0" - -has-ansi@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-0.1.0.tgz#84f265aae8c0e6a88a12d7022894b7568894c62e" - dependencies: - ansi-regex "^0.2.0" - -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - dependencies: - ansi-regex "^2.0.0" - -has-gulplog@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/has-gulplog/-/has-gulplog-0.1.0.tgz#6414c82913697da51590397dafb12f22967811ce" - dependencies: - sparkles "^1.0.0" - -has-value@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - dependencies: - get-value "^2.0.3" - has-values "^0.1.4" - isobject "^2.0.0" - -has-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - dependencies: - get-value "^2.0.6" - has-values "^1.0.0" - isobject "^3.0.0" - -has-values@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - -has-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - -homedir-polyfill@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz#4c2bbc8a758998feebf5ed68580f76d46768b4bc" - dependencies: - parse-passwd "^1.0.0" - -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" - -indent-string@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80" - dependencies: - repeating "^2.0.0" - inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -771,508 +65,20 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-1.0.2.tgz#ca4309dadee6b54cc0b8d247e8d7c7a0975bdc9b" - -inherits@2, inherits@~2.0.1, inherits@~2.0.3: +inherits@2: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" -ini@^1.3.4: - version "1.3.5" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" - -interpret@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" - -is-absolute@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-absolute/-/is-absolute-1.0.0.tgz#395e1ae84b11f26ad1795e73c17378e48a301576" - dependencies: - is-relative "^1.0.0" - is-windows "^1.0.1" - -is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - dependencies: - kind-of "^3.0.2" - -is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - dependencies: - kind-of "^6.0.0" - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - -is-builtin-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" - dependencies: - builtin-modules "^1.0.0" - -is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - dependencies: - kind-of "^3.0.2" - -is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - dependencies: - kind-of "^6.0.0" - -is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" - -is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" - -is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - -is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - dependencies: - is-plain-object "^2.0.4" - -is-extglob@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - -is-finite@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" - dependencies: - number-is-nan "^1.0.0" - -is-glob@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" - dependencies: - is-extglob "^2.1.0" - -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - dependencies: - kind-of "^3.0.2" - -is-number@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" - -is-odd@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-odd/-/is-odd-2.0.0.tgz#7646624671fd7ea558ccd9a2795182f2958f1b24" - dependencies: - is-number "^4.0.0" - -is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - dependencies: - isobject "^3.0.1" - -is-relative@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-relative/-/is-relative-1.0.0.tgz#a1bb6935ce8c5dba1e8b9754b9b2dcc020e2260d" - dependencies: - is-unc-path "^1.0.0" - -is-unc-path@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-unc-path/-/is-unc-path-1.0.0.tgz#d731e8898ed090a12c352ad2eaed5095ad322c9d" - dependencies: - unc-path-regex "^0.1.2" - -is-utf8@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" - -is-windows@^1.0.1, is-windows@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - -isarray@1.0.0, 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" - -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - dependencies: - isarray "1.0.0" - -isobject@^3.0.0, isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - -js-yaml@^3.10.0: - version "3.10.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" +js-yaml@^3.12.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" dependencies: argparse "^1.0.7" esprima "^4.0.0" -jsonc-parser@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-1.0.0.tgz#ddcc864ae708e60a7a6dd36daea00172fa8d9272" - -jsonc-parser@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-1.0.1.tgz#7f8f296414e6e7c4a33b9e4914fc8c47e4421675" - -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.1.0, kind-of@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - dependencies: - is-buffer "^1.1.5" - -kind-of@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - -kind-of@^6.0.0, kind-of@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" - -lazy-cache@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" - -lazy-cache@^2.0.2: +jsonc-parser@^2.0.1, jsonc-parser@^2.0.2: version "2.0.2" - resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-2.0.2.tgz#b9190a4f913354694840859f8a8f7084d8822264" - dependencies: - set-getter "^0.1.0" - -liftoff@^2.1.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/liftoff/-/liftoff-2.5.0.tgz#2009291bb31cea861bbf10a7c15a28caf75c31ec" - dependencies: - extend "^3.0.0" - findup-sync "^2.0.0" - fined "^1.0.1" - flagged-respawn "^1.0.0" - is-plain-object "^2.0.4" - object.map "^1.0.0" - rechoir "^0.6.2" - resolve "^1.1.7" - -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" - dependencies: - graceful-fs "^4.1.2" - parse-json "^2.2.0" - pify "^2.0.0" - pinkie-promise "^2.0.0" - strip-bom "^2.0.0" - -lodash._basecopy@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" - -lodash._basetostring@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz#d1861d877f824a52f669832dcaf3ee15566a07d5" - -lodash._basevalues@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz#5b775762802bde3d3297503e26300820fdf661b7" - -lodash._escapehtmlchar@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash._escapehtmlchar/-/lodash._escapehtmlchar-2.4.1.tgz#df67c3bb6b7e8e1e831ab48bfa0795b92afe899d" - dependencies: - lodash._htmlescapes "~2.4.1" - -lodash._escapestringchar@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash._escapestringchar/-/lodash._escapestringchar-2.4.1.tgz#ecfe22618a2ade50bfeea43937e51df66f0edb72" - -lodash._getnative@^3.0.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" - -lodash._htmlescapes@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash._htmlescapes/-/lodash._htmlescapes-2.4.1.tgz#32d14bf0844b6de6f8b62a051b4f67c228b624cb" - -lodash._isiterateecall@^3.0.0: - version "3.0.9" - resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" - -lodash._isnative@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash._isnative/-/lodash._isnative-2.4.1.tgz#3ea6404b784a7be836c7b57580e1cdf79b14832c" - -lodash._objecttypes@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash._objecttypes/-/lodash._objecttypes-2.4.1.tgz#7c0b7f69d98a1f76529f890b0cdb1b4dfec11c11" - -lodash._reescape@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._reescape/-/lodash._reescape-3.0.0.tgz#2b1d6f5dfe07c8a355753e5f27fac7f1cde1616a" - -lodash._reevaluate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz#58bc74c40664953ae0b124d806996daca431e2ed" - -lodash._reinterpolate@^2.4.1, lodash._reinterpolate@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-2.4.1.tgz#4f1227aa5a8711fc632f5b07a1f4607aab8b3222" - -lodash._reinterpolate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" - -lodash._reunescapedhtml@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash._reunescapedhtml/-/lodash._reunescapedhtml-2.4.1.tgz#747c4fc40103eb3bb8a0976e571f7a2659e93ba7" - dependencies: - lodash._htmlescapes "~2.4.1" - lodash.keys "~2.4.1" - -lodash._root@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692" - -lodash._shimkeys@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash._shimkeys/-/lodash._shimkeys-2.4.1.tgz#6e9cc9666ff081f0b5a6c978b83e242e6949d203" - dependencies: - lodash._objecttypes "~2.4.1" - -lodash.defaults@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-2.4.1.tgz#a7e8885f05e68851144b6e12a8f3678026bc4c54" - dependencies: - lodash._objecttypes "~2.4.1" - lodash.keys "~2.4.1" - -lodash.escape@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-3.2.0.tgz#995ee0dc18c1b48cc92effae71a10aab5b487698" - dependencies: - lodash._root "^3.0.0" - -lodash.escape@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-2.4.1.tgz#2ce12c5e084db0a57dda5e5d1eeeb9f5d175a3b4" - dependencies: - lodash._escapehtmlchar "~2.4.1" - lodash._reunescapedhtml "~2.4.1" - lodash.keys "~2.4.1" - -lodash.isarguments@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" - -lodash.isarray@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" - -lodash.isobject@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash.isobject/-/lodash.isobject-2.4.1.tgz#5a2e47fe69953f1ee631a7eba1fe64d2d06558f5" - dependencies: - lodash._objecttypes "~2.4.1" - -lodash.keys@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" - dependencies: - lodash._getnative "^3.0.0" - lodash.isarguments "^3.0.0" - lodash.isarray "^3.0.0" - -lodash.keys@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-2.4.1.tgz#48dea46df8ff7632b10d706b8acb26591e2b3727" - dependencies: - lodash._isnative "~2.4.1" - lodash._shimkeys "~2.4.1" - lodash.isobject "~2.4.1" - -lodash.restparam@^3.0.0: - version "3.6.1" - resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805" - -lodash.template@^2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-2.4.1.tgz#9e611007edf629129a974ab3c48b817b3e1cf20d" - dependencies: - lodash._escapestringchar "~2.4.1" - lodash._reinterpolate "~2.4.1" - lodash.defaults "~2.4.1" - lodash.escape "~2.4.1" - lodash.keys "~2.4.1" - lodash.templatesettings "~2.4.1" - lodash.values "~2.4.1" - -lodash.template@^3.0.0: - version "3.6.2" - resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-3.6.2.tgz#f8cdecc6169a255be9098ae8b0c53d378931d14f" - dependencies: - lodash._basecopy "^3.0.0" - lodash._basetostring "^3.0.0" - lodash._basevalues "^3.0.0" - lodash._isiterateecall "^3.0.0" - lodash._reinterpolate "^3.0.0" - lodash.escape "^3.0.0" - lodash.keys "^3.0.0" - lodash.restparam "^3.0.0" - lodash.templatesettings "^3.0.0" - -lodash.templatesettings@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz#fb307844753b66b9f1afa54e262c745307dba8e5" - dependencies: - lodash._reinterpolate "^3.0.0" - lodash.escape "^3.0.0" - -lodash.templatesettings@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-2.4.1.tgz#ea76c75d11eb86d4dbe89a83893bb861929ac699" - dependencies: - lodash._reinterpolate "~2.4.1" - lodash.escape "~2.4.1" - -lodash.values@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash.values/-/lodash.values-2.4.1.tgz#abf514436b3cb705001627978cbcf30b1280eea4" - dependencies: - lodash.keys "~2.4.1" - -lodash@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-1.0.2.tgz#8f57560c83b59fc270bd3d561b690043430e2551" - -longest@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" - -loud-rejection@^1.0.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" - dependencies: - currently-unhandled "^0.4.1" - signal-exit "^3.0.0" - -lru-cache@2: - version "2.7.3" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.7.3.tgz#6d4524e8b955f95d4f5b58851ce21dd72fb4e952" - -make-iterator@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/make-iterator/-/make-iterator-1.0.0.tgz#57bef5dc85d23923ba23767324d8e8f8f3d9694b" - dependencies: - kind-of "^3.1.0" - -map-cache@^0.2.0, map-cache@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - -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" - -map-stream@~0.0.3: - version "0.0.7" - resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.0.7.tgz#8a1f07896d82b10926bd3744a2420009f88974a8" - -map-stream@~0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" - -map-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - dependencies: - object-visit "^1.0.0" - -meow@^3.3.0: - version "3.7.0" - resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" - dependencies: - camelcase-keys "^2.0.0" - decamelize "^1.1.2" - loud-rejection "^1.0.0" - map-obj "^1.0.1" - minimist "^1.1.3" - normalize-package-data "^2.3.4" - object-assign "^4.0.1" - read-pkg-up "^1.0.1" - redent "^1.0.0" - trim-newlines "^1.0.0" - -merge-stream@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1" - dependencies: - readable-stream "^2.0.1" - -micromatch@^3.0.4: - version "3.1.9" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.9.tgz#15dc93175ae39e52e93087847096effc73efcf89" - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -minimatch@^2.0.1: - version "2.0.10" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-2.0.10.tgz#8d087c39c6b38c001b97fca7ce6d0e1e80afbac7" - dependencies: - brace-expansion "^1.0.0" + resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.0.2.tgz#42fcf56d70852a043fadafde51ddb4a85649978d" minimatch@^3.0.4: version "3.0.4" @@ -1280,133 +86,19 @@ minimatch@^3.0.4: dependencies: brace-expansion "^1.1.7" -minimatch@~0.2.11: - version "0.2.14" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-0.2.14.tgz#c74e780574f63c6f9a090e90efbe6ef53a6a756a" +monaco-editor-core@0.14.6: + version "0.14.6" + resolved "https://registry.yarnpkg.com/monaco-editor-core/-/monaco-editor-core-0.14.6.tgz#25fae6a2e7c7da6eb2a3bba653a283627dc624e4" + +monaco-languages@1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/monaco-languages/-/monaco-languages-1.5.1.tgz#e0b754a3db9de2133859d88abbf3b2b376439b58" + +monaco-plugin-helpers@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/monaco-plugin-helpers/-/monaco-plugin-helpers-1.0.2.tgz#ee1af42503fe4669f3a8731112b661032e41c8a9" dependencies: - lru-cache "2" - sigmund "~1.0.0" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - -minimist@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.2.0.tgz#4dffe525dae2b864c66c2e23c6271d7afdecefce" - -minimist@^1.1.0, minimist@^1.1.3: - version "1.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - -mixin-deep@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" - dependencies: - for-in "^1.0.2" - is-extendable "^1.0.1" - -mkdirp@^0.5.0: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - dependencies: - minimist "0.0.8" - -monaco-editor-core@^0.10.1: - version "0.10.1" - resolved "https://registry.yarnpkg.com/monaco-editor-core/-/monaco-editor-core-0.10.1.tgz#15121d9e28e51f094d9c556bf852dc9c13dc42a1" - -monaco-languages@^0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/monaco-languages/-/monaco-languages-0.9.0.tgz#03ea9c52031b79837e7a389d4fc6211da3f758fd" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - -multipipe@^0.1.0, multipipe@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/multipipe/-/multipipe-0.1.2.tgz#2a8f2ddf70eed564dff2d57f1e1a137d9f05078b" - dependencies: - duplexer2 "0.0.2" - -nanomatch@^1.2.9: - version "1.2.9" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.9.tgz#879f7150cb2dab7a471259066c104eee6e0fa7c2" - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^2.0.2" - extend-shallow "^3.0.2" - fragment-cache "^0.2.1" - is-odd "^2.0.0" - is-windows "^1.0.2" - kind-of "^6.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -natives@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.1.tgz#011acce1f7cbd87f7ba6b3093d6cd9392be1c574" - -normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: - version "2.4.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" - dependencies: - hosted-git-info "^2.1.4" - is-builtin-module "^1.0.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - -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" - -object-assign@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-3.0.0.tgz#9bedd5ca0897949bca47e7ff408062d549f587f2" - -object-assign@^4.0.1, object-assign@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - -object-copy@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - dependencies: - copy-descriptor "^0.1.0" - define-property "^0.2.5" - kind-of "^3.0.3" - -object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - dependencies: - isobject "^3.0.0" - -object.defaults@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/object.defaults/-/object.defaults-1.1.0.tgz#3a7f868334b407dea06da16d88d5cd29e435fecf" - dependencies: - array-each "^1.0.1" - array-slice "^1.0.0" - for-own "^1.0.0" - isobject "^3.0.0" - -object.map@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object.map/-/object.map-1.0.1.tgz#cf83e59dc8fcc0ad5f4250e1f78b3b81bd801d37" - dependencies: - for-own "^1.0.0" - make-iterator "^1.0.0" - -object.pick@^1.2.0, object.pick@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - dependencies: - isobject "^3.0.1" + typescript "^2.7.2" once@^1.3.0: version "1.4.0" @@ -1414,674 +106,64 @@ once@^1.3.0: dependencies: wrappy "1" -once@~1.3.0: - version "1.3.3" - resolved "https://registry.yarnpkg.com/once/-/once-1.3.3.tgz#b2e261557ce4c314ec8304f3fa82663e4297ca20" - dependencies: - wrappy "1" - -orchestrator@^0.3.0: - version "0.3.8" - resolved "https://registry.yarnpkg.com/orchestrator/-/orchestrator-0.3.8.tgz#14e7e9e2764f7315fbac184e506c7aa6df94ad7e" - dependencies: - end-of-stream "~0.1.5" - sequencify "~0.0.7" - stream-consume "~0.1.0" - -ordered-read-streams@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-0.1.0.tgz#fd565a9af8eb4473ba69b6ed8a34352cb552f126" - -os-homedir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - -parse-filepath@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/parse-filepath/-/parse-filepath-1.0.2.tgz#a632127f53aaf3d15876f5872f3ffac763d6c891" - dependencies: - is-absolute "^1.0.0" - map-cache "^0.2.0" - path-root "^0.1.1" - -parse-json@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" - dependencies: - error-ex "^1.2.0" - -parse-passwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" - -pascalcase@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - -path-exists@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" - dependencies: - pinkie-promise "^2.0.0" - 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-parse@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" +requirejs@^2.3.5: + version "2.3.6" + resolved "https://registry.yarnpkg.com/requirejs/-/requirejs-2.3.6.tgz#e5093d9601c2829251258c0b9445d4d19fa9e7c9" -path-root-regex@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/path-root-regex/-/path-root-regex-0.1.2.tgz#bfccdc8df5b12dc52c8b43ec38d18d72c04ba96d" - -path-root@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/path-root/-/path-root-0.1.1.tgz#9a4a6814cac1c0cd73360a95f32083c8ea4745b7" - dependencies: - path-root-regex "^0.1.0" - -path-type@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" - dependencies: - graceful-fs "^4.1.2" - pify "^2.0.0" - pinkie-promise "^2.0.0" - -pause-stream@0.0.11: - version "0.0.11" - resolved "https://registry.yarnpkg.com/pause-stream/-/pause-stream-0.0.11.tgz#fe5a34b0cbce12b5aa6a2b403ee2e73b602f1445" - dependencies: - through "~2.3" - -pify@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - -pinkie-promise@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - dependencies: - pinkie "^2.0.0" - -pinkie@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - -posix-character-classes@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - -pretty-hrtime@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" - -process-nextick-args@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" - -read-pkg-up@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" - dependencies: - find-up "^1.0.0" - read-pkg "^1.0.0" - -read-pkg@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" - dependencies: - load-json-file "^1.0.0" - normalize-package-data "^2.3.2" - path-type "^1.0.0" - -"readable-stream@>=1.0.33-1 <1.1.0-0", readable-stream@~1.0.17: - version "1.0.34" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - -readable-stream@^2.0.1, readable-stream@^2.1.5: - version "2.3.4" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.4.tgz#c946c3f47fa7d8eabc0b6150f4a12f69a4574071" - dependencies: - 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.0.3" - util-deprecate "~1.0.1" - -readable-stream@~1.1.9: - version "1.1.14" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - -rechoir@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" - dependencies: - resolve "^1.1.6" - -redent@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" - dependencies: - indent-string "^2.1.0" - strip-indent "^1.0.1" - -regex-not@^1.0.0, regex-not@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - dependencies: - extend-shallow "^3.0.2" - safe-regex "^1.1.0" - -repeat-element@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" - -repeat-string@^1.5.2, repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - -repeating@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" - dependencies: - is-finite "^1.0.0" - -replace-ext@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-0.0.1.tgz#29bbd92078a739f0bcce2b4ee41e837953522924" - -requirejs@2.1.8: - version "2.1.8" - resolved "https://registry.yarnpkg.com/requirejs/-/requirejs-2.1.8.tgz#f0dfa656d60d404947da796f9c661d92c1b0257a" - -resolve-dir@^1.0.0, resolve-dir@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/resolve-dir/-/resolve-dir-1.0.1.tgz#79a40644c362be82f26effe739c9bb5382046f43" - dependencies: - expand-tilde "^2.0.0" - global-modules "^1.0.0" - -resolve-url@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - -resolve@^1.1.6, resolve@^1.1.7: - version "1.5.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" - dependencies: - path-parse "^1.0.5" - -ret@~0.1.10: - version "0.1.15" - resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - -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" - -rimraf@^2.5.2: +rimraf@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" dependencies: glob "^7.0.5" -safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" - -safe-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - dependencies: - ret "~0.1.10" - -"semver@2 || 3 || 4 || 5": - version "5.5.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" - -semver@^4.1.0: - version "4.3.6" - resolved "https://registry.yarnpkg.com/semver/-/semver-4.3.6.tgz#300bc6e0e86374f7ba61068b5b1ecd57fc6532da" - -sequencify@~0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/sequencify/-/sequencify-0.0.7.tgz#90cff19d02e07027fd767f5ead3e7b95d1e7380c" - -set-getter@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/set-getter/-/set-getter-0.1.0.tgz#d769c182c9d5a51f409145f2fba82e5e86e80376" - dependencies: - to-object-path "^0.3.0" - -set-value@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.1" - to-object-path "^0.3.0" - -set-value@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.3" - split-string "^3.0.1" - -sigmund@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590" - -signal-exit@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" - -snapdragon-node@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - dependencies: - define-property "^1.0.0" - isobject "^3.0.0" - snapdragon-util "^3.0.1" - -snapdragon-util@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - dependencies: - kind-of "^3.2.0" - -snapdragon@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.1.tgz#e12b5487faded3e3dea0ac91e9400bf75b401370" - dependencies: - base "^0.11.1" - debug "^2.2.0" - define-property "^0.2.5" - extend-shallow "^2.0.1" - map-cache "^0.2.2" - source-map "^0.5.6" - source-map-resolve "^0.5.0" - use "^2.0.0" - -source-map-resolve@^0.5.0: - version "0.5.1" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.1.tgz#7ad0f593f2281598e854df80f19aae4b92d7a11a" - dependencies: - atob "^2.0.0" - decode-uri-component "^0.2.0" - resolve-url "^0.2.1" - source-map-url "^0.4.0" - urix "^0.1.0" - -source-map-url@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" - -source-map@^0.5.1, source-map@^0.5.6, source-map@~0.5.1: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - -sparkles@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/sparkles/-/sparkles-1.0.0.tgz#1acbbfb592436d10bbe8f785b7cc6f82815012c3" - -spdx-correct@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" - dependencies: - spdx-license-ids "^1.0.2" - -spdx-expression-parse@~1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz#9bdf2f20e1f40ed447fbe273266191fced51626c" - -spdx-license-ids@^1.0.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" - -split-string@^3.0.1, split-string@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - dependencies: - extend-shallow "^3.0.0" - -split@0.2: - version "0.2.10" - resolved "https://registry.yarnpkg.com/split/-/split-0.2.10.tgz#67097c601d697ce1368f418f06cd201cf0521a57" - dependencies: - through "2" - -split@0.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/split/-/split-0.3.3.tgz#cd0eea5e63a211dfff7eb0f091c4133e2d0dd28f" - dependencies: - through "2" +source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" -static-extend@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" +typescript@^2.7.2: + version "2.9.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c" + +typescript@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.0.3.tgz#4853b3e275ecdaa27f78fda46dc273a7eb7fc1c8" + +uglify-es@^3.3.9: + version "3.3.9" + resolved "https://registry.yarnpkg.com/uglify-es/-/uglify-es-3.3.9.tgz#0c1c4f0700bed8dbc124cdb304d2592ca203e677" dependencies: - define-property "^0.2.5" - object-copy "^0.1.0" + commander "~2.13.0" + source-map "~0.6.1" -stream-combiner@~0.0.3, stream-combiner@~0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14" +vscode-json-languageservice@^3.1.6: + version "3.1.6" + resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-3.1.6.tgz#272e21eb9abcefe6c1ed38be141f0a76d5ddf0cd" dependencies: - duplexer "~0.1.1" + jsonc-parser "^2.0.1" + vscode-languageserver-types "^3.12.0" + vscode-nls "^3.2.4" + vscode-uri "^1.0.6" -stream-consume@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/stream-consume/-/stream-consume-0.1.1.tgz#d3bdb598c2bd0ae82b8cac7ac50b1107a7996c48" +vscode-languageserver-types@3.12.0, vscode-languageserver-types@^3.12.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.12.0.tgz#f96051381b6a050b7175b37d6cb5d2f2eb64b944" -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" +vscode-nls@^3.2.4: + version "3.2.5" + resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.5.tgz#25520c1955108036dec607c85e00a522f247f1a4" -string_decoder@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" - dependencies: - safe-buffer "~5.1.0" - -strip-ansi@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-0.3.0.tgz#25f48ea22ca79187f3174a4db8759347bb126220" - dependencies: - ansi-regex "^0.2.1" - -strip-ansi@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - dependencies: - ansi-regex "^2.0.0" - -strip-bom@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-1.0.0.tgz#85b8862f3844b5a6d5ec8467a93598173a36f794" - dependencies: - first-chunk-stream "^1.0.0" - is-utf8 "^0.2.0" - -strip-bom@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" - dependencies: - is-utf8 "^0.2.0" - -strip-indent@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2" - dependencies: - get-stdin "^4.0.1" - -supports-color@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-0.2.0.tgz#d92de2694eb3f67323973d7ae3d8b55b4c22190a" - -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - -through2@^0.5.0: - version "0.5.1" - resolved "https://registry.yarnpkg.com/through2/-/through2-0.5.1.tgz#dfdd012eb9c700e2323fd334f38ac622ab372da7" - dependencies: - readable-stream "~1.0.17" - xtend "~3.0.0" - -through2@^0.6.1: - version "0.6.5" - resolved "https://registry.yarnpkg.com/through2/-/through2-0.6.5.tgz#41ab9c67b29d57209071410e1d7a7a968cd3ad48" - dependencies: - readable-stream ">=1.0.33-1 <1.1.0-0" - xtend ">=4.0.0 <4.1.0-0" - -through2@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" - dependencies: - readable-stream "^2.1.5" - xtend "~4.0.1" - -through@2, through@^2.3.6, through@~2.3, through@~2.3.1: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - -tildify@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/tildify/-/tildify-1.2.0.tgz#dcec03f55dca9b7aa3e5b04f21817eb56e63588a" - dependencies: - os-homedir "^1.0.0" - -time-stamp@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-1.1.0.tgz#764a5a11af50561921b133f3b44e618687e0f5c3" - -to-object-path@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - dependencies: - kind-of "^3.0.2" - -to-regex-range@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - dependencies: - is-number "^3.0.0" - repeat-string "^1.6.1" - -to-regex@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - dependencies: - define-property "^2.0.2" - extend-shallow "^3.0.2" - regex-not "^1.0.2" - safe-regex "^1.1.0" - -trim-newlines@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" - -typescript@^2.7.1: - version "2.7.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.2.tgz#2d615a1ef4aee4f574425cdff7026edf81919836" - -uglify-js@2.6.4: - version "2.6.4" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.6.4.tgz#65ea2fb3059c9394692f15fed87c2b36c16b9adf" - dependencies: - async "~0.2.6" - source-map "~0.5.1" - uglify-to-browserify "~1.0.0" - yargs "~3.10.0" - -uglify-save-license@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/uglify-save-license/-/uglify-save-license-0.4.1.tgz#95726c17cc6fd171c3617e3bf4d8d82aa8c4cce1" - -uglify-to-browserify@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" - -unc-path-regex@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" - -union-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" - dependencies: - arr-union "^3.1.0" - get-value "^2.0.6" - is-extendable "^0.1.1" - set-value "^0.4.3" - -unique-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unique-stream/-/unique-stream-1.0.0.tgz#d59a4a75427447d9aa6c91e70263f8d26a4b104b" - -unset-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - dependencies: - has-value "^0.3.1" - isobject "^3.0.0" - -urix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - -use@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/use/-/use-2.0.2.tgz#ae28a0d72f93bf22422a18a2e379993112dec8e8" - dependencies: - define-property "^0.2.5" - isobject "^3.0.0" - lazy-cache "^2.0.2" - -user-home@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" - -util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - -v8flags@^2.0.2: - version "2.1.1" - resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4" - dependencies: - user-home "^1.1.1" - -validate-npm-package-license@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" - dependencies: - spdx-correct "~1.0.0" - spdx-expression-parse "~1.0.0" - -vinyl-fs@^0.3.0: - version "0.3.14" - resolved "https://registry.yarnpkg.com/vinyl-fs/-/vinyl-fs-0.3.14.tgz#9a6851ce1cac1c1cea5fe86c0931d620c2cfa9e6" - dependencies: - defaults "^1.0.0" - glob-stream "^3.1.5" - glob-watcher "^0.0.6" - graceful-fs "^3.0.0" - mkdirp "^0.5.0" - strip-bom "^1.0.0" - through2 "^0.6.1" - vinyl "^0.4.0" - -vinyl-sourcemaps-apply@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz#ab6549d61d172c2b1b87be5c508d239c8ef87705" - dependencies: - source-map "^0.5.1" - -vinyl@^0.2.1: - version "0.2.3" - resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-0.2.3.tgz#bca938209582ec5a49ad538a00fa1f125e513252" - dependencies: - clone-stats "~0.0.1" - -vinyl@^0.4.0, vinyl@^0.4.3: - version "0.4.6" - resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-0.4.6.tgz#2f356c87a550a255461f36bbeb2a5ba8bf784847" - dependencies: - clone "^0.2.0" - clone-stats "^0.0.1" - -vinyl@^0.5.0: - version "0.5.3" - resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-0.5.3.tgz#b0455b38fc5e0cf30d4325132e461970c2091cde" - dependencies: - clone "^1.0.0" - clone-stats "^0.0.1" - replace-ext "0.0.1" - -vscode-json-languageservice@^3.0.5: - version "3.0.7" - resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-3.0.7.tgz#dc00117d51d4a7ac3bde9204afa701f962f00736" - dependencies: - jsonc-parser "^1.0.1" - vscode-languageserver-types "^3.6.0-next.1" - vscode-nls "^2.0.2" - vscode-uri "^1.0.1" - -vscode-languageserver-types@^3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.5.0.tgz#e48d79962f0b8e02de955e3f524908e2b19c0374" - -vscode-languageserver-types@^3.6.0-next.1: - version "3.6.0-next.1" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.6.0-next.1.tgz#98e488d3f87b666b4ee1a3d89f0023e246d358f3" - -vscode-nls@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-2.0.2.tgz#808522380844b8ad153499af5c3b03921aea02da" - -vscode-uri@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-1.0.1.tgz#11a86befeac3c4aa3ec08623651a3c81a6d0bbc8" - -which@^1.2.14: - version "1.3.0" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" - 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" - -wordwrap@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" +vscode-uri@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-1.0.6.tgz#6b8f141b0bbc44ad7b07e94f82f168ac7608ad4d" wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - -"xtend@>=4.0.0 <4.1.0-0", xtend@~4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" - -xtend@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-3.0.0.tgz#5cce7407baf642cba7becda568111c493f59665a" - -yargs@~3.10.0: - version "3.10.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" - dependencies: - camelcase "^1.0.2" - cliui "^2.1.0" - decamelize "^1.0.0" - window-size "0.1.0"