diff --git a/.circleci/config.yml b/.circleci/config.yml index 033ca27..7e1c3ef 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,27 +2,18 @@ version: 2 jobs: build: docker: - - image: dlanguage/ldc + - image: node:11-slim steps: - checkout - run: name: Install debian-packaged dependencies command: | apt update - apt install -y git build-essential curl build-essential - curl -sL https://deb.nodesource.com/setup_11.x | bash - - apt update && apt install -y nodejs + # curl/apt-transport-https for yarn, python, build-essential for node-gyp + apt install -y curl apt-transport-https python build-essential curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list apt update && apt install -y yarn - ln -s $(which ldc2) /usr/local/bin/ldc - - run: - name: Install btest - command: | - git clone https://github.com/briansteffens/btest - cd btest - make - make install - run: name: Install Node dependencies, run tests command: | diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..80c577f --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,25 @@ +module.exports = { + parser: '@typescript-eslint/parser', + extends: [ + 'plugin:@typescript-eslint/recommended', + 'prettier', + ], + parserOptions: { + ecmaVersion: 2018, + sourceType: 'module', + }, + rules: { + '@typescript-eslint/explicit-function-return-type': 0, + '@typescript-eslint/no-use-before-define': 0, + "arrow-parens": [ + 1, + "always" + ], + "class-methods-use-this": 1, + "func-names": 0, + "function-paren-newline": 0, + "no-plusplus": 0, + "object-curly-newline": 0, + "prefer-arrow-callback": 0, + } +}; diff --git a/.gitignore b/.gitignore index 0f2f937..5236c97 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ bin build node_modules *~ +yarn-error.log \ No newline at end of file diff --git a/README.md b/README.md index 3bd5d25..d1d0e24 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ $ node bin/index.js * Prototype functions * Nested functions * Closures +* And much, much more! ### Code produced @@ -61,56 +62,57 @@ Gets compiled to: ```cpp #include "lib.cc" -void tco_fib(const FunctionCallbackInfo& _args) { - Isolate* isolate = _args.GetIsolate(); - std::vector> args(_args.Length());; - for (int i = 0; i < _args.Length(); i++) args[i] = _args[i]; +void tco_fib(const FunctionCallbackInfo &args) { + Isolate *isolate = args.GetIsolate(); + Local tco_n = args[0]; + Local tco_a = args[1]; + Local tco_b = args[2]; tail_recurse_0: - Local sym_rhs_4 = Number::New(isolate, 0); - Local sym_anon_2 = args[0]->StrictEquals(sym_rhs_4) ? True(isolate) : False(isolate); - if (sym_anon_2->IsTrue()) { - _args.GetReturnValue().Set(args[1]); + if (tco_n->StrictEquals(Number::New(isolate, 0))) { + args.GetReturnValue().Set(tco_a); return; } - Local sym_rhs_11 = Number::New(isolate, 1); - Local sym_anon_9 = args[0]->StrictEquals(sym_rhs_11) ? True(isolate) : False(isolate); - if (sym_anon_9->IsTrue()) { - _args.GetReturnValue().Set(args[2]); + if (tco_n->StrictEquals(Number::New(isolate, 1))) { + args.GetReturnValue().Set(tco_b); return; } - Local sym_rhs_19 = Number::New(isolate, 1); - Local sym_arg_17 = genericMinus(isolate, args[0], sym_rhs_19); - Local sym_arg_21 = genericPlus(isolate, args[1], args[2]); - args[0] = sym_arg_17; - args[1] = args[2]; - args[2] = sym_arg_21; + Local sym_arg_20 = + genericMinus(isolate, tco_n, Number::New(isolate, 1)); + Local sym_arg_23 = tco_b; + Local sym_arg_24 = genericPlus(isolate, tco_a, tco_b); + tco_n = Local::Cast(sym_arg_20); + tco_a = sym_arg_23; + tco_b = sym_arg_24; goto tail_recurse_0; return; } -void jsc_main(const FunctionCallbackInfo& _args) { - Isolate* isolate = _args.GetIsolate(); - std::vector> args(_args.Length());; - for (int i = 0; i < _args.Length(); i++) args[i] = _args[i]; +void jsc_main(const FunctionCallbackInfo &args) { + Isolate *isolate = args.GetIsolate(); tail_recurse_1: - Local sym_arg_29 = Number::New(isolate, 100); - Local sym_arg_30 = Number::New(isolate, 0); - Local sym_arg_31 = Number::New(isolate, 1); - Local sym_args_32[] = { sym_arg_29, sym_arg_30, sym_arg_31 }; - Local sym_fn_33 = FunctionTemplate::New(isolate, tco_fib)->GetFunction(); - sym_fn_33->SetName(String::NewFromUtf8(isolate, "tco_fib")); - Local sym_arg_28 = sym_fn_33->Call(sym_fn_33, 3, sym_args_32); - - Local sym_args_34[] = { sym_arg_28 }; - Local sym_parent_37 = isolate->GetCurrentContext()->Global()->Get(String::NewFromUtf8(isolate, "console")); - Local sym_anon_36 = sym_parent_37.As()->Get(String::NewFromUtf8(isolate, "log")); - Local sym_fn_35 = Local::Cast(sym_anon_36); - Local sym_anon_27 = sym_fn_35->Call(sym_fn_35, 1, sym_args_34); + Local sym_args_33[] = {Number::New(isolate, 50), + Number::New(isolate, 0), + Number::New(isolate, 1)}; + Local sym_arg_29 = + Local::Cast( + Local::Cast( + FunctionTemplate::New(isolate, tco_fib)->GetFunction())) + ->Call(Local::Cast(Local::Cast( + FunctionTemplate::New(isolate, tco_fib)->GetFunction())), + 3, sym_args_33); + + Local sym_args_35[] = {sym_arg_29}; + Local sym_parent_37 = isolate->GetCurrentContext()->Global()->Get( + String::NewFromUtf8(isolate, "console")); + Local sym_fn_36 = + sym_parent_37.As()->Get(String::NewFromUtf8(isolate, "log")); + Local sym_block_28 = Local::Cast(sym_fn_36)->Call( + Local::Cast(sym_fn_36), 1, sym_args_35); return; } @@ -121,5 +123,3 @@ void Init(Local exports) { NODE_MODULE(NODE_GYP_MODULE_NAME, Init) ``` - -By running `./build.sh examples/recursion.js`. diff --git a/package.json b/package.json index 7e47f5b..dfaa2bf 100644 --- a/package.json +++ b/package.json @@ -3,14 +3,27 @@ "version": "0.0.1", "bin": "./build/jsc", "scripts": { - "install": "yarn tsc", - "test": "./tests/run.sh" + "install": "tsc", + "test": "./scripts/test.sh", + "lint": "./scripts/lint.sh", + "lint:fix": "./scripts/lint.sh --fix" }, "dependencies": { "@types/node": "^11.9.4", + "@typescript-eslint/eslint-plugin": "^1.4.2", + "@typescript-eslint/parser": "^1.4.2", + "eslint": "^5.15.0", + "eslint-config-prettier": "^4.1.0", "node-gyp": "^3.8.0", + "prettier": "^1.16.4", + "prettylint": "^1.0.0", "rimraf": "^2.6.3", "tsc": "^1.20150623.0", "typescript": "^3.3.3" + }, + "prettier": { + "singleQuote": true, + "arrowParens": "always", + "trailingComma": "all" } } diff --git a/scripts/lint.sh b/scripts/lint.sh new file mode 100755 index 0000000..68fc985 --- /dev/null +++ b/scripts/lint.sh @@ -0,0 +1,2 @@ +eslint src/*.ts src/**/*.ts $1 +prettylint src/*.ts src/**/*.ts $1 diff --git a/tests/run.sh b/scripts/test.sh similarity index 73% rename from tests/run.sh rename to scripts/test.sh index 71d9fb8..cf2ddf6 100755 --- a/tests/run.sh +++ b/scripts/test.sh @@ -4,6 +4,8 @@ set -e for f in tests/*.js; do echo "Testing $f" - node build/main "$f" + node build/jsc.js "$f" node bin done + +exit diff --git a/src/build.ts b/src/build.ts index 86afdfb..16220ea 100644 --- a/src/build.ts +++ b/src/build.ts @@ -9,26 +9,48 @@ export function build(buildDirectory: string, program: string) { try { rimraf.sync(buildDirectory); fs.mkdirSync(buildDirectory); - } catch (e) {} + } catch (e) { + // Ignore + } - fs.writeFileSync(path.join(buildDirectory, 'lib.cc'), - fs.readFileSync(path.join(__dirname, '../src/compile/lib.cc'))); - fs.writeFileSync(path.join(buildDirectory, 'jsc.cc'), - program); - fs.writeFileSync(path.join(buildDirectory, 'binding.gyp'), - JSON.stringify({ - targets: [ - { - target_name: 'jsc', - sources: ['jsc.cc'], - }, - ], - })); + fs.writeFileSync( + path.join(buildDirectory, 'lib.cc'), + fs.readFileSync(path.join(__dirname, '../src/compile/lib.cc')), + ); + fs.writeFileSync(path.join(buildDirectory, 'jsc.cc'), program); + fs.writeFileSync( + path.join(buildDirectory, 'binding.gyp'), + JSON.stringify({ + targets: [ + { + sources: ['jsc.cc'], + // eslint-disable-next-line @typescript-eslint/camelcase + target_name: 'jsc', + }, + ], + }), + ); + + try { + cp.execSync( + ['clang-format -i', path.join(buildDirectory, 'lib.cc')].join(' '), + ); + cp.execSync( + ['clang-format -i', path.join(buildDirectory, 'jsc.cc')].join(' '), + ); + } catch (e) { + // Oh well + } // Build library - cp.execSync('../node_modules/.bin/node-gyp configure', { cwd: buildDirectory }); + cp.execSync('../node_modules/.bin/node-gyp configure', { + cwd: buildDirectory, + }); cp.execSync('../node_modules/.bin/node-gyp build', { cwd: buildDirectory }); // Create Node entrypoint - fs.writeFileSync(path.join(buildDirectory, 'index.js'), 'require(\"./build/Release/jsc.node\").jsc_main();\n'); + fs.writeFileSync( + path.join(buildDirectory, 'index.js'), + 'require("./build/Release/jsc.node").jsc_main();\n', + ); } diff --git a/src/compile/compile.ts b/src/compile/compile.ts index dfada98..9e7b438 100644 --- a/src/compile/compile.ts +++ b/src/compile/compile.ts @@ -1,5 +1,5 @@ -import * as path from 'path'; import { readFileSync } from 'fs'; +import * as path from 'path'; import * as ts from 'typescript'; @@ -12,13 +12,19 @@ interface Context { buffer: string[]; depth: number; emit: (s: string, d?: number) => void; - emitAssign: (l: Local, s: string, d?: number) => void; + emitAssign: (l: Local, s: string | null, d?: number) => void; + emitAssignLiteral: (l: Local, s: string, d?: number) => void; emitStatement: (s: string, d?: number) => void; labelCounter: number; locals: Locals; moduleName: string; tc: ts.TypeChecker; - tco: { [name: string]: string }; + tco: { + [name: string]: { + label: string; + parameters: ts.NodeArray; + }; + }; } function mangle(moduleName: string, local: string) { @@ -29,6 +35,27 @@ function identifier(id: ts.Identifier): string { return id.escapedText as string; } +function propagateType(local: Local, type: Type) { + if (!local.initialized) { + local.type = type; + } +} + +function getType(context: Context, node: ts.Node) { + const flags = context.tc.getTypeAtLocation(node).getFlags(); + const primitives = { + [ts.TypeFlags.String]: Type.V8String, + [ts.TypeFlags.Number]: Type.V8Number, + [ts.TypeFlags.Boolean]: Type.V8Boolean, + }; + + return primitives[flags] || Type.V8Value; +} + +function setType(context: Context, node: ts.Node, local: Local) { + local.type = getType(context, node); +} + function compileArrayLiteral( context: Context, destination: Local, @@ -38,13 +65,13 @@ function compileArrayLiteral( if (!destination.initialized) { tmp = destination; } else { - tmp = context.locals.symbol(); + tmp = context.locals.symbol('arr_lit'); } tmp.type = Type.V8Array; context.emitAssign(tmp, `Local::New(isolate, ${elements.length})`); const init = context.locals.symbol('init'); - elements.forEach(function (e, i) { + elements.forEach((e, i) => { compileNode(context, init, e); context.emitStatement(`${tmp}->Set(${i}, ${init.name})`); }); @@ -54,15 +81,16 @@ function compileArrayLiteral( } } -function compileBlock( - context: Context, - block: ts.Block, -) { - block.statements.forEach(function (statement, i) { - compileNode({ - ...context, - tco: i < block.statements.length - 1 ? {} : context.tco, - }, context.locals.symbol(), statement); +function compileBlock(context: Context, block: ts.Block) { + block.statements.forEach((statement, i) => { + compileNode( + { + ...context, + tco: i < block.statements.length - 1 ? {} : context.tco, + }, + context.locals.symbol('block'), + statement, + ); }); } @@ -71,16 +99,28 @@ function compileParameter( p: ts.ParameterDeclaration, n: number, last: boolean, + tailCallArgument?: Local, ) { - if (p.name.kind === ts.SyntaxKind.ObjectBindingPattern || - p.name.kind === ts.SyntaxKind.ArrayBindingPattern) { + if ( + p.name.kind === ts.SyntaxKind.ObjectBindingPattern || + p.name.kind === ts.SyntaxKind.ArrayBindingPattern + ) { throw new Error('Parameter destructuring not supported'); } const id = identifier(p.name); - const safe = context.locals.register(mangle(context.moduleName, id)); - safe.name = `args[${n}]`; - safe.initialized = true; + const mangled = mangle(context.moduleName, id); + if (!tailCallArgument) { + const safe = context.locals.register(mangled); + setType(context, p.name, safe); + const argn = context.locals.symbol('arg'); + argn.name = `args[${n}]`; + context.emitAssign(safe, format.cast(safe, argn, true)); + } else { + const safe = context.locals.get(mangled); + setType(context, p.name, safe); + context.emitAssign(safe, format.cast(safe, tailCallArgument, true)); + } } function compileFunctionDeclaration( @@ -88,16 +128,19 @@ function compileFunctionDeclaration( fd: ts.FunctionDeclaration, ) { const name = fd.name ? identifier(fd.name) : 'lambda'; - const mangled = name === 'main' ? 'jsc_main' : mangle(context.moduleName, name); + const mangled = + name === 'main' ? 'jsc_main' : mangle(context.moduleName, name); const safe = context.locals.register(mangled); + safe.type = Type.Function; + safe.initialized = true; const tcoLabel = `tail_recurse_${context.labelCounter++}`; - context.emit(`void ${mangled}(const FunctionCallbackInfo& _args) {`); - context.emitStatement('Isolate* isolate = _args.GetIsolate()', context.depth + 1); - context.emitStatement('std::vector> args(_args.Length());', context.depth + 1); - context.emitStatement('for (int i = 0; i < _args.Length(); i++) args[i] = _args[i]', context.depth + 1); - context.emit(`${tcoLabel}:\n`, context.depth); + context.emit(`void ${mangled}(const FunctionCallbackInfo& args) {`); + context.emitStatement( + 'Isolate* isolate = args.GetIsolate()', + context.depth + 1, + ); const childContext = { ...context, @@ -105,15 +148,20 @@ function compileFunctionDeclaration( // Body, parameters get new context locals: context.locals.clone(), // Copying might not allow for mutually tail-recursive functions? - tco: { ...context.tco, [safe.name]: tcoLabel }, + tco: { + ...context.tco, + [safe.name]: { label: tcoLabel, parameters: fd.parameters }, + }, }; if (fd.parameters) { - fd.parameters.forEach(function (p, i) { + fd.parameters.forEach((p, i) => { compileParameter(childContext, p, i, i === fd.parameters.length - 1); }); } + context.emit(`${tcoLabel}:\n`, context.depth); + if (fd.body) { compileBlock(childContext, fd.body); } @@ -129,28 +177,31 @@ function compileCall( ce: ts.CallExpression, ) { let tcoLabel; + let tcoParameters; if (ce.expression.kind === ts.SyntaxKind.Identifier) { const id = identifier(ce.expression as ts.Identifier); const safe = context.locals.get(mangle(context.moduleName, id)); - if (safe) { - tcoLabel = context.tco[safe.name]; + if (safe && context.tco[safe.name]) { + tcoLabel = context.tco[safe.name].label; + tcoParameters = context.tco[safe.name].parameters; } } - const args = ce.arguments.map(function (argument) { + const args = ce.arguments.map((argument) => { const arg = context.locals.symbol('arg'); + const argName = arg.name; compileNode(context, arg, argument); - return arg.name; + // Force assignment before TCE + if (!arg.initialized) { + const initializer = arg.name; + arg.name = argName; + context.emitAssign(arg, initializer); + } + return arg; }); - const argArray = context.locals.symbol('args'); - if (!tcoLabel && args.length) { - context.emitStatement(`Local ${argArray.name}[] = { ${args.join(', ')} }`); - } - - const fn = context.locals.symbol('fn', false, Type.V8Function); - let literal = false; + // Handle tail call elimination if (ce.expression.kind === ts.SyntaxKind.Identifier) { const id = identifier(ce.expression as ts.Identifier); const mangled = mangle(context.moduleName, id); @@ -158,29 +209,39 @@ function compileCall( if (safe) { if (tcoLabel) { - args.forEach(function (arg, i) { - context.emitStatement(`args[${i}] = ${arg}`); - }); - - context.emitStatement(`goto ${tcoLabel}`); - context.emit('', 0); - return; + args.forEach((arg, i) => { + compileParameter( + context, + tcoParameters[i], + i, + i === args.length - 1, + arg, + ); + }); + + context.emitStatement(`goto ${tcoLabel}`); + context.emit('', 0); + destination.tce = true; + return; } - - literal = true; - context.emitAssign(fn, `FunctionTemplate::New(isolate, ${safe.name})->GetFunction()`); - context.emitStatement(`${fn.name}->SetName(${format.v8String(mangled)})`); } } - if (!literal) { - const tmp = context.locals.symbol(); - compileNode(context, tmp, ce.expression); - context.emitAssign(fn, `Local::Cast(${tmp.name})`); + const argArray = context.locals.symbol('args'); + if (!tcoLabel && args.length) { + context.emitStatement( + `Local ${argArray.name}[] = { ${args + .map((a) => a.name) + .join(', ')} }`, + ); } + const fn = context.locals.symbol('fn'); + compileNode(context, fn, ce.expression); + const argArrayName = args.length ? argArray.name : 0; - const call = `${fn.name}->Call(${fn.name}, ${args.length}, ${argArrayName})`; + const v8f = format.v8Function(fn); + const call = `${v8f}->Call(${v8f}, ${args.length}, ${argArrayName})`; context.emitAssign(destination, call); context.emit('', 0); } @@ -193,7 +254,10 @@ function compilePropertyAccess( const exp = context.locals.symbol('parent'); compileNode(context, exp, pae.expression); const id = identifier(pae.name); - context.emitAssign(destination, `${exp.name}.As()->Get(${format.v8String(id)})`); + context.emitAssign( + destination, + `${exp.name}.As()->Get(${format.v8String(id)})`, + ); } function compileElementAccess( @@ -221,14 +285,14 @@ function compileIdentifier( const mangled = mangle(context.moduleName, val); const local = context.locals.get(mangled); if (local) { - if (!local.initialized) { - destination.name = mangled; + const isDeclaration = !local.initialized; + + if (isDeclaration) { + context.emitAssign(destination, format.cast(destination, local)); } else { - destination.name = local.name; - destination.type = local.type; + destination.name = format.cast(destination, local, true); } - destination.initialized = true; return; } else if (val === 'global') { val = global; @@ -239,16 +303,12 @@ function compileIdentifier( context.emitAssign(destination, val); } -function compileReturn( - context: Context, - exp: ts.Expression, -) { - const tmp = context.locals.symbol(); +function compileReturn(context: Context, exp: ts.Expression) { + const tmp = context.locals.symbol('ret'); compileNode(context, tmp, exp); - // Should only be uninitialized if this was tail-call optimized - if (tmp.initialized) { - context.emitStatement(`_args.GetReturnValue().Set(${tmp.name})`); + if (!tmp.tce) { + context.emitStatement(`args.GetReturnValue().Set(${tmp.name})`); context.emitStatement('return'); } } @@ -261,16 +321,17 @@ function compileIf( ) { context.emit('', 0); - const test = context.locals.symbol(); + const test = context.locals.symbol('if_test'); + test.type = Type.Boolean; compileNode(context, test, exp); context.emit(`if (${format.boolean(test)}) {`); const c = { ...context, depth: context.depth + 1 }; - compileNode(c, context.locals.symbol(), thenStmt); + compileNode(c, context.locals.symbol('then'), thenStmt); if (elseStmt) { context.emit('} else {'); - compileNode(c, context.locals.symbol(), elseStmt); + compileNode(c, context.locals.symbol('else'), elseStmt); } context.emit('}\n'); @@ -281,12 +342,13 @@ function compilePostfixUnaryExpression( destination: Local, pue: ts.PostfixUnaryExpression, ) { - const lhs = context.locals.symbol('lhs'); - lhs.type = Type.V8Number; + let lhs = context.locals.symbol('pue'); + // In `f++`, previous value of f is returned compileNode(context, lhs, pue.operand); - // f++ previous value of f is returned - destination.type = Type.V8Number; + // Grab lhs + lhs = compileLhs(context, pue.operand); + propagateType(destination, lhs.type); context.emitAssign(destination, lhs.name); switch (pue.operator) { @@ -302,11 +364,51 @@ function compilePostfixUnaryExpression( } } +function compileLhs(context: Context, n: ts.Node) { + if (n.kind === ts.SyntaxKind.Identifier) { + const id = identifier(n as ts.Identifier); + const mangled = mangle(context.moduleName, id); + const local = context.locals.get(mangled); + if (local) { + return local; + } else { + // This is an easy case, but punting for now. + throw new Error('Unsupported global assignment'); + } + } else { + throw new Error( + 'Unsupported lhs assignment node: ' + ts.SyntaxKind[n.kind], + ); + } +} + +// This is the expression form, variable declaration/initialization +// is entirely separate. +function compileAssignment( + context: Context, + destination: Local, + be: ts.BinaryExpression, +) { + destination = compileLhs(context, be.left); + + const rhs = context.locals.symbol('rhs'); + compileNode(context, rhs, be.right); + + context.emitAssign(destination, format.cast(destination, rhs)); + return; +} + function compileBinaryExpression( context: Context, destination: Local, be: ts.BinaryExpression, ) { + // Assignment is a special case. + if (be.operatorToken.kind === ts.SyntaxKind.EqualsToken) { + compileAssignment(context, destination, be); + return; + } + const lhs = context.locals.symbol('lhs'); compileNode(context, lhs, be.left); @@ -317,10 +419,6 @@ function compileBinaryExpression( let value; switch (be.operatorToken.kind) { - case ts.SyntaxKind.EqualsToken: - context.emitAssign(lhs, format.cast(lhs, rhs, true)); - context.emitAssign(destination, format.cast(destination, lhs, true)); - return; case ts.SyntaxKind.LessThanToken: bool = `${format.number(lhs)} < ${format.number(rhs)}`; break; @@ -346,32 +444,40 @@ function compileBinaryExpression( bool = `${lhs.name}->StrictEquals(${rhs.name})`; break; case ts.SyntaxKind.AmpersandAmpersandToken: - bool = `${format.boolean(lhs)} ? (${format.boolean(rhs)} ? ${rhs.name} : ${lhs.name}) : ${lhs.name}`; + bool = `${format.boolean(lhs)} ? (${format.boolean(rhs)} ? ${ + rhs.name + } : ${lhs.name}) : ${lhs.name}`; break; case ts.SyntaxKind.PlusToken: value = format.plus(lhs, rhs); break; case ts.SyntaxKind.MinusToken: - lhs.type = Type.V8Number; - rhs.type = Type.V8Number; + propagateType(lhs, Type.V8Number); + propagateType(rhs, Type.V8Number); value = `genericMinus(isolate, ${lhs.name}, ${rhs.name})`; break; default: - throw new Error('Unsupported operator: ' + ts.SyntaxKind[be.operatorToken.kind]); + throw new Error( + 'Unsupported operator: ' + ts.SyntaxKind[be.operatorToken.kind], + ); break; } if (bool) { - destination.type = Type.V8Boolean; - context.emitAssign(destination, format.v8Boolean(bool)); + if (destination.type === Type.Boolean) { + destination.name = bool; + } else { + propagateType(destination, Type.V8Boolean); + context.emitAssign(destination, format.v8Boolean(bool)); + } } else if (value) { if (lhs.type === Type.V8String || rhs.type === Type.V8String) { - destination.type = Type.V8String; + propagateType(destination, Type.V8String); } else if (lhs.type === Type.V8Number && rhs.type === Type.V8Number) { - destination.type = Type.V8Number; + propagateType(destination, Type.V8Number); } - context.emitAssign(destination, value); + destination.name = value; } } @@ -379,33 +485,50 @@ function compileVariable( context: Context, destination: Local, vd: ts.VariableDeclaration, + flags: ts.NodeFlags, ) { - if (vd.name.kind === ts.SyntaxKind.ObjectBindingPattern || - vd.name.kind === ts.SyntaxKind.ArrayBindingPattern) { + if ( + vd.name.kind === ts.SyntaxKind.ObjectBindingPattern || + vd.name.kind === ts.SyntaxKind.ArrayBindingPattern + ) { throw new Error('Variable destructuring not supported'); } const id = identifier(vd.name); const safe = context.locals.register(mangle(context.moduleName, id)); + destination = safe; + const initializer = context.locals.symbol('var_init'); if (vd.initializer) { - compileNode(context, safe, vd.initializer); + compileNode(context, initializer, vd.initializer); + + let forceConversion = false; + if ((flags & ts.NodeFlags.Const) === ts.NodeFlags.Const) { + setType(context, vd.name, destination); + } else { + // Cannot infer on types at declaration without a separate pass. + destination.type = Type.V8Value; + forceConversion = true; + } + + context.emitAssign( + destination, + format.cast(destination, initializer, forceConversion), + ); } } function compileDo( context: Context, - { - statement: body, - expression: test, - }: ts.DoStatement, + { statement: body, expression: test }: ts.DoStatement, ) { context.emit('do {'); const bodyContext = { ...context, depth: context.depth + 1 }; - compileNode(bodyContext, context.locals.symbol(), body); + compileNode(bodyContext, context.locals.symbol('do'), body); const tmp = context.locals.symbol('test'); + tmp.type = Type.Boolean; compileNode(bodyContext, tmp, test); context.emitStatement(`} while (${tmp.name})`); @@ -413,33 +536,25 @@ function compileDo( function compileWhile( context: Context, - { - statement: body, - expression: exp, - }: ts.WhileStatement, + { statement: body, expression: exp }: ts.WhileStatement, ) { - const test = context.locals.symbol(); + const test = context.locals.symbol('while_test'); + test.type = Type.Boolean; compileNode(context, test, exp); context.emit(`while (${format.boolean(test)}) {`); const bodyContext = { ...context, depth: context.depth + 1 }; - compileNode(bodyContext, context.locals.symbol(), body); + compileNode(bodyContext, context.locals.symbol('while'), body); compileNode(bodyContext, test, exp); context.emit('}'); } - function compileFor( context: Context, - { - initializer, - condition, - incrementor, - statement: body, - }: ts.ForStatement, + { initializer, condition, incrementor, statement: body }: ts.ForStatement, ) { const init = context.locals.symbol('init'); if (initializer) { @@ -475,17 +590,15 @@ function compileFor( } } -function compileImport( - context: Context, - id: ts.ImportDeclaration, -) { +function compileImport(context: Context, id: ts.ImportDeclaration) { // TODO: validate import was exported - const t = id.importClause && - id.importClause.namedBindings && - id.importClause.namedBindings.kind === ts.SyntaxKind.NamedImports ? - id.importClause.namedBindings : - { elements: undefined }; + const t = + id.importClause && + id.importClause.namedBindings && + id.importClause.namedBindings.kind === ts.SyntaxKind.NamedImports + ? id.importClause.namedBindings + : { elements: undefined }; if (t.elements) { // Only root-relative import paths for now const { text } = id.moduleSpecifier as ts.StringLiteral; @@ -500,26 +613,31 @@ function compileImport( const moduleContext = { ...context, depth: 0, - locals: new Locals, + locals: new Locals(), moduleName: '', tco: {}, }; compileSource(moduleContext, source); - t.elements.forEach(function (exportObject) { + t.elements.forEach((exportObject) => { if (exportObject.propertyName) { - throw new Error('Unsupported import style: import { <> as <> } from \'<>\';'); + throw new Error( + "Unsupported import style: import { <> as <> } from '<>';", + ); } const exportName = identifier(exportObject.name); // Put the name the module will reference into context const local = context.locals.register( - mangle(context.moduleName, exportName)); + mangle(context.moduleName, exportName), + ); // Grab the location it will have been registered in the other module const real = moduleContext.locals.get( - mangle(moduleContext.moduleName, exportName)); - // Set the local lookup value to the real lookup value + mangle(moduleContext.moduleName, exportName), + ); + // Set the local lookup type & value to the real lookup value & type local.name = real.name; + propagateType(local, real.type); local.initialized = true; }); @@ -529,11 +647,7 @@ function compileImport( throw new Error('Unsupported import style'); } -function compileNode( - context: Context, - destination: Local, - node: ts.Node, -) { +function compileNode(context: Context, destination: Local, node: ts.Node) { switch (node.kind) { case ts.SyntaxKind.FunctionDeclaration: { const fd = node as ts.FunctionDeclaration; @@ -547,24 +661,54 @@ function compileNode( } case ts.SyntaxKind.VariableStatement: { const vs = node as ts.VariableStatement; - compileNode(context, destination, vs.declarationList); + compileNode( + { + ...context, + tco: {}, + }, + destination, + vs.declarationList, + ); break; } case ts.SyntaxKind.VariableDeclarationList: { const dl = node as ts.VariableDeclarationList; - dl.declarations.forEach(function (d) { - compileVariable(context, context.locals.symbol(), d); + dl.declarations.forEach((d) => { + compileVariable( + { + ...context, + tco: {}, + }, + context.locals.symbol('var'), + d, + dl.flags, + ); }); break; } case ts.SyntaxKind.BinaryExpression: { const be = node as ts.BinaryExpression; - compileBinaryExpression(context, destination, be); + compileBinaryExpression( + { + ...context, + tco: {}, + }, + destination, + be, + ); break; } case ts.SyntaxKind.PostfixUnaryExpression: { const pue = node as ts.PostfixUnaryExpression; - compilePostfixUnaryExpression(context, destination, pue); + compilePostfixUnaryExpression( + { + ...context, + tco: {}, + }, + destination, + pue, + ); + break; } case ts.SyntaxKind.CallExpression: { const ce = node as ts.CallExpression; @@ -573,65 +717,118 @@ function compileNode( } case ts.SyntaxKind.PropertyAccessExpression: { const pae = node as ts.PropertyAccessExpression; - compilePropertyAccess(context, destination, pae); + compilePropertyAccess( + { + ...context, + tco: {}, + }, + destination, + pae, + ); break; } case ts.SyntaxKind.ElementAccessExpression: { const eae = node as ts.ElementAccessExpression; - compileElementAccess(context, destination, eae); + compileElementAccess( + { + ...context, + tco: {}, + }, + destination, + eae, + ); break; } case ts.SyntaxKind.Identifier: { const id = node as ts.Identifier; - compileIdentifier(context, destination, id); + compileIdentifier( + { + ...context, + tco: {}, + }, + destination, + id, + ); break; } case ts.SyntaxKind.StringLiteral: { const sl = node as ts.StringLiteral; - destination.type = Type.V8String; + propagateType(destination, Type.V8String); context.emitAssign(destination, format.v8String(sl.text)); break; } case ts.SyntaxKind.NullKeyword: - context.emitAssign(destination, "Null(isolate)"); + context.emitAssign(destination, 'Null(isolate)'); break; case ts.SyntaxKind.TrueKeyword: - destination.type = Type.V8Boolean; - context.emitAssign(destination, format.v8Boolean(true)); + propagateType(destination, Type.V8Boolean); + if (destination.type === Type.Boolean) { + context.emitAssign(destination, 'true'); + } else { + context.emitAssign(destination, format.v8Boolean(true)); + } break; case ts.SyntaxKind.FalseKeyword: - destination.type = Type.V8Boolean; - context.emitAssign(destination, format.v8Boolean(false)); + propagateType(destination, Type.V8Boolean); + if (destination.type === Type.Boolean) { + context.emitAssign(destination, 'false'); + } else { + context.emitAssign(destination, format.v8Boolean(false)); + } break; - case ts.SyntaxKind.ArrayLiteralExpression: { const ale = node as ts.ArrayLiteralExpression; - compileArrayLiteral(context, destination, ale); + compileArrayLiteral( + { + ...context, + tco: {}, + }, + destination, + ale, + ); break; } case ts.SyntaxKind.FirstLiteralToken: case ts.SyntaxKind.NumericLiteral: { const nl = node as ts.NumericLiteral; - destination.type = Type.V8Number; - context.emitAssign(destination, format.v8Number(nl.text)); + propagateType(destination, Type.V8Number); + context.emitAssignLiteral(destination, format.v8Number(nl.text)); break; } case ts.SyntaxKind.DoStatement: { const ds = node as ts.DoStatement; - compileDo(context, ds); + compileDo( + { + ...context, + tco: {}, + }, + ds, + ); break; } case ts.SyntaxKind.WhileStatement: { const ws = node as ts.WhileStatement; - compileWhile(context, ws); + compileWhile( + { + ...context, + tco: {}, + }, + ws, + ); break; } case ts.SyntaxKind.ForStatement: { const fs = node as ts.ForStatement; - compileFor(context, fs); + compileFor( + { + ...context, + tco: {}, + }, + fs, + ); break; } @@ -652,28 +849,35 @@ function compileNode( } case ts.SyntaxKind.ImportDeclaration: { const id = node as ts.ImportDeclaration; - compileImport(context, id); + compileImport( + { + ...context, + tco: {}, + }, + id, + ); + break; } case ts.SyntaxKind.ExportDeclaration: { // TODO: add export to exports list; + break; } case ts.SyntaxKind.EndOfFileToken: break; default: - throw new Error('Unsupported syntax element: ' + ts.SyntaxKind[node.kind]); + throw new Error( + 'Unsupported syntax element: ' + ts.SyntaxKind[node.kind], + ); } } -export function compileSource( - context: Context, - ast: ts.SourceFile, -) { - const locals = new Locals; +export function compileSource(context: Context, ast: ts.SourceFile) { + const locals = new Locals(); // TODO: mangle module name appropriately (e.g. replace('.', '_'), etc.) const moduleName = path.basename(ast.fileName, path.extname(ast.fileName)); context.moduleName = moduleName; - ts.forEachChild(ast, function(node) { - compileNode(context, locals.symbol(), node); + ts.forEachChild(ast, (node) => { + compileNode(context, locals.symbol('source'), node); }); } @@ -682,11 +886,15 @@ function emitPrefix(buffer: string[]) { } function emitPostfix(buffer: string[]) { - emit.emit(buffer, 0, `void Init(Local exports) { + emit.emit( + buffer, + 0, + `void Init(Local exports) { NODE_SET_METHOD(exports, "jsc_main", jsc_main); } -NODE_MODULE(NODE_GYP_MODULE_NAME, Init)\n`); +NODE_MODULE(NODE_GYP_MODULE_NAME, Init)\n`, + ); } export function compile(program: ts.Program) { @@ -694,7 +902,7 @@ export function compile(program: ts.Program) { emitPrefix(buffer); const tc = program.getTypeChecker(); - program.getSourceFiles().forEach(function (source) { + program.getSourceFiles().forEach((source) => { if (source.fileName.endsWith('.d.ts')) { return; } @@ -703,16 +911,19 @@ export function compile(program: ts.Program) { buffer, depth: 0, emit(s: string, d?: number) { - emit.emit(this.buffer, d === undefined ? this.depth : d, s); + emit.emit(this.buffer, d === undefined ? this.depth : d, s); + }, + emitAssign(l: Local, s: string | null, d?: number) { + emit.assign(this.buffer, d === undefined ? this.depth : d, l, s); }, - emitAssign(l: Local, s: string, d?:number) { - emit.assign(this.buffer, d === undefined ? this.depth : d, l, s); + emitAssignLiteral(l: Local, s: string, d?: number) { + emit.assignLiteral(this.buffer, d === undefined ? this.depth : d, l, s); }, - emitStatement(s: string, d?:number) { - emit.statement(this.buffer, d === undefined ? this.depth : d, s); + emitStatement(s: string, d?: number) { + emit.statement(this.buffer, d === undefined ? this.depth : d, s); }, labelCounter: 0, - locals: new Locals, + locals: new Locals(), moduleName: '', tc, tco: {}, @@ -721,7 +932,5 @@ export function compile(program: ts.Program) { }); emitPostfix(buffer); - return buffer.join('\n') // Format nicely - .replace(/\n\n+/g, '\n\n') // No more than two consecutive newlines - .replace(/\n\n+}/g, '\n}'); // Now more than one newline before an ending brace + return buffer.join('\n'); } diff --git a/src/compile/emitters.ts b/src/compile/emitters.ts index 6f1b453..bf6a675 100644 --- a/src/compile/emitters.ts +++ b/src/compile/emitters.ts @@ -1,11 +1,7 @@ import { Local } from './locals'; import { Type } from './type'; -export function emit( - buffer: string[], - indentation: number, - output: string, -) { +export function emit(buffer: string[], indentation: number, output: string) { buffer.push(new Array(indentation + 1).join(' ') + output); } @@ -17,19 +13,64 @@ export function statement( emit(buffer, indentation, output + ';'); } -export function assign(buffer: string[], depth: number, destination: Local, val: string) { +export function assign( + buffer: string[], + depth: number, + destination: Local, + val: string | null, +) { if (!destination.initialized) { - const type = destination.type === Type.V8Function ? 'Local' : - destination.type === Type.V8Array ? 'Local' : - destination.type === Type.V8Object ? 'Local' : - destination.type === Type.V8String ? 'Local' : - destination.type === Type.V8Number ? 'Local' : - destination.type === Type.V8Boolean ? 'Local' : - 'Local'; - statement(buffer, depth, `${type} ${destination.name} = ${val}`); + const type = + destination.type === Type.V8Function + ? 'Local' + : destination.type === Type.V8Array + ? 'Local' + : destination.type === Type.V8Object + ? 'Local' + : destination.type === Type.V8String + ? 'Local' + : destination.type === Type.V8Number + ? 'Local' + : destination.type === Type.V8Boolean + ? 'Local' + : destination.type === Type.V8Value + ? 'Local' + : destination.type === Type.Boolean + ? 'bool' + : destination.type === Type.Function + ? (n: string) => `void (*${n})(const FunctionCallbackInfo &args)` + : null; + + if (type === null) { + throw new Error('Unsupported assign type: ' + Type[destination.type]); + } + + const prefix = + typeof type === 'string' + ? `${type} ${destination.name}` + : type(destination.name); + const suffix = val === null ? '' : ` = ${val}`; + + statement(buffer, depth, `${prefix}${suffix}`); destination.initialized = true; + return; } statement(buffer, depth, `${destination.name} = ${val}`); } + +export function assignLiteral( + buffer: string[], + depth: number, + destination: Local, + val: string, +) { + if (!destination.initialized) { + destination.name = val; + destination.initialized = true; + return; + } + + assign(buffer, depth, destination, val); +} diff --git a/src/compile/formatters.ts b/src/compile/formatters.ts index 0ca04c7..c150d5e 100644 --- a/src/compile/formatters.ts +++ b/src/compile/formatters.ts @@ -1,9 +1,26 @@ import { Local } from './locals'; -import { Type } from './type'; +import { isV8Type, Type } from './type'; + +export function v8Function(local: Local | string) { + if (typeof local === 'string') { + return `Local::Cast(${local})`; + } + + if (local.type === Type.V8Function) { + return local.name; + } + + if (local.type === Type.Function) { + return `FunctionTemplate::New(isolate, ${local.name})->GetFunction()`; + } + + return `Local::Cast(${local.name})`; +} export function v8String(local: Local | string) { if (typeof local === 'string') { - return `String::NewFromUtf8(isolate, "${local}")`; + const safe = local.replace('\n', '\\\n'); + return `String::NewFromUtf8(isolate, "${safe}")`; } if (local.type === Type.V8String) { @@ -50,6 +67,10 @@ export function v8Boolean(local: Local | string | boolean) { } export function boolean(local: Local) { + if (local.type === Type.Boolean) { + return local.name; + } + if (local.type === Type.V8Boolean) { return `${local.name}->IsTrue()`; } @@ -57,23 +78,73 @@ export function boolean(local: Local) { return `toBoolean(${local.name})`; } -export function cast(targetLocal: Local, castingLocal: Local, assign?: boolean) { - if (targetLocal.type !== castingLocal.type && targetLocal.initialized) { - const type = targetLocal.type === Type.V8String ? 'String' : - targetLocal.type === Type.V8Number ? 'Number' : - targetLocal.type === Type.V8Boolean ? 'Boolean' : - targetLocal.type === Type.V8Array ? 'Array' : - targetLocal.type === Type.V8Object ? 'Object' : - targetLocal.type === Type.V8Function ? 'Function' : - 'Value'; - if (assign) { - targetLocal.type = castingLocal.type; +export function cast(targetLocal: Local, castingLocal: Local, force?: boolean) { + const tlType = targetLocal.type; + if (!targetLocal.initialized && !force) { + targetLocal.type = castingLocal.type; + } + + if (isV8Type(tlType) && !isV8Type(castingLocal.type)) { + if (castingLocal.type === Type.Function) { + return cast( + targetLocal, + { + ...castingLocal, + name: v8Function(castingLocal), + type: Type.V8Function, + }, + force, + ); + } + + throw new Error( + `Unsupported cast of non-V8 rhs (${Type[castingLocal.type]}) to V8 lhs (${ + Type[tlType] + })`, + ); + } else if (!isV8Type(tlType) && isV8Type(castingLocal.type)) { + if (tlType === Type.Boolean) { + return cast( + targetLocal, + { + ...castingLocal, + name: boolean(castingLocal), + type: Type.Boolean, + }, + force, + ); + } + + throw new Error( + `Unsupported cast of V8 rhs (${Type[castingLocal.type]}) to non-V8 lhs (${ + Type[tlType] + })`, + ); + } else if (isV8Type(tlType) && isV8Type(castingLocal.type)) { + if (tlType !== castingLocal.type && (targetLocal.initialized || force)) { + const type = + tlType === Type.V8String + ? 'String' + : tlType === Type.V8Number + ? 'Number' + : tlType === Type.V8Boolean + ? 'Boolean' + : tlType === Type.V8Array + ? 'Array' + : tlType === Type.V8Object + ? 'Object' + : tlType === Type.V8Function + ? 'Function' + : 'Value'; + return `Local<${type}>::Cast(${castingLocal.name})`; } - return `Local<${type}>::Cast(${castingLocal.name})`; - } else if (assign) { - targetLocal.type = castingLocal.type; return castingLocal.name; + } else { + if (castingLocal.type === tlType) { + return castingLocal.name; + } + throw new Error('Cannot cast between C++ types.'); } } diff --git a/src/compile/lib.cc b/src/compile/lib.cc index 6b20b1f..86f953a 100644 --- a/src/compile/lib.cc +++ b/src/compile/lib.cc @@ -59,7 +59,7 @@ inline Local toString(Isolate* isolate, Local s) { inline Local genericPlus(Isolate* isolate, Local l, Local r) { if (l->IsString() || r->IsString()) { - return String::Concat(toString(isolate, l), toString(isolate, r)); + return String::Concat(isolate, toString(isolate, l), toString(isolate, r)); } return Number::New(isolate, toNumber(l) + toNumber(r)); @@ -74,5 +74,5 @@ inline Local numberPlus(Isolate* isolate, Local l, Local } inline Local stringPlus(Isolate* isolate, Local l, Local r) { - return String::Concat(toString(isolate, l), toString(isolate, r)); + return String::Concat(isolate, toString(isolate, l), toString(isolate, r)); } diff --git a/src/compile/locals.ts b/src/compile/locals.ts index c8ee551..3934d81 100644 --- a/src/compile/locals.ts +++ b/src/compile/locals.ts @@ -1,47 +1,55 @@ import { Type } from './type'; export class Local { - initialized?: boolean; - name: string; - type: Type; - - constructor(name: string, initialized?: boolean, type?: Type) { + public initialized?: boolean; + public name: string; + public type: Type; + public tce?: boolean; + + public constructor( + name: string, + initialized?: boolean, + type?: Type, + tce?: boolean, + ) { this.name = name; this.initialized = initialized; this.type = type || Type.V8Value; + this.tce = tce || false; } } let uniqueCounter = 0; +// tslint:disable-next-line export class Locals { - map: { [local: string]: Local } = {}; + public map: { [local: string]: Local } = {}; - symbol(prefix?: string, initialized?: boolean, type?: Type) { + public symbol(prefix?: string, initialized?: boolean, type?: Type) { let mapped; do { - mapped = 'sym_' + (prefix || 'anon') + '_' + (uniqueCounter++); + mapped = 'sym_' + (prefix || 'anon') + '_' + uniqueCounter++; } while (this.map[mapped]); this.map[mapped] = new Local(mapped, initialized, type); return this.map[mapped]; } - register(local: string, initialized?: boolean, type?: Type) { + public register(local: string, initialized?: boolean, type?: Type) { let mapped = local; while (this.map[mapped]) { - mapped = local + '_' + Object.keys(this.map); + mapped = local + '_' + Object.keys(this.map).length; } this.map[local] = new Local(mapped, initialized, type); return this.map[local]; } - get(local: string) { + public get(local: string) { return this.map[local]; } - clone() { - const c = new Locals; + public clone() { + const c = new Locals(); c.map = { ...this.map }; return c; } diff --git a/src/compile/type.ts b/src/compile/type.ts index 4a916dc..7d0d83d 100644 --- a/src/compile/type.ts +++ b/src/compile/type.ts @@ -6,4 +6,21 @@ export enum Type { V8Boolean, V8Number, V8String, + Boolean, + Function, +} + +export function isV8Type(t: Type) { + switch (t) { + case Type.V8Value: + case Type.V8Function: + case Type.V8Array: + case Type.V8Object: + case Type.V8Boolean: + case Type.V8Number: + case Type.V8String: + return true; + default: + return false; + } } diff --git a/src/jsc.ts b/src/jsc.ts index 0cf4f94..9ab0d71 100644 --- a/src/jsc.ts +++ b/src/jsc.ts @@ -1,5 +1,5 @@ -import { compile } from './compile'; import { build } from './build'; +import { compile } from './compile'; import { parse } from './parse'; function main(entrypoint: string) { diff --git a/src/parse.ts b/src/parse.ts index 3c63987..b23e52c 100644 --- a/src/parse.ts +++ b/src/parse.ts @@ -1,6 +1,3 @@ -import * as path from 'path'; -import { readFileSync } from 'fs'; - import * as ts from 'typescript'; export function parse(fileName: string): ts.Program { diff --git a/tests/const.js b/tests/const.js index 7ea219e..7ff340a 100644 --- a/tests/const.js +++ b/tests/const.js @@ -1,5 +1,4 @@ function main() { - let a = 1; - a = 2; - console.log(a); + const a = 1; + const b = "foo"; } diff --git a/tests/import_test.js b/tests/etc/import_helper.js similarity index 100% rename from tests/import_test.js rename to tests/etc/import_helper.js diff --git a/tests/for.js b/tests/for.js index a960473..5651c8b 100644 --- a/tests/for.js +++ b/tests/for.js @@ -1,5 +1,7 @@ function main() { + const cl = console.log; + for (var i = 0; i < 10; i++) { - console.log(i); + cl(i); } } diff --git a/tests/import.js b/tests/import.js index 151bd33..17c5501 100644 --- a/tests/import.js +++ b/tests/import.js @@ -1,4 +1,4 @@ -import { test } from './tests/import_test.js'; +import { test } from './tests/etc/import_helper.js'; function main() { test(); diff --git a/tests/let.js b/tests/let.js new file mode 100644 index 0000000..7ea219e --- /dev/null +++ b/tests/let.js @@ -0,0 +1,5 @@ +function main() { + let a = 1; + a = 2; + console.log(a); +} diff --git a/tests/nounwrap_boolean.js b/tests/nounwrap_boolean.js new file mode 100644 index 0000000..1edf924 --- /dev/null +++ b/tests/nounwrap_boolean.js @@ -0,0 +1,9 @@ +function main() { + const a = 4; + const test = a === 1; + if (test) { + return true; + } + + return false; +} diff --git a/tests/number_and_any.js b/tests/number_and_any.js new file mode 100644 index 0000000..18cbc93 --- /dev/null +++ b/tests/number_and_any.js @@ -0,0 +1,12 @@ +// implicit any +function c(a) { + let d = a; + let b = 1; + b = a; + b = 2; + console.log(b); +} + +function main() { + c("fooobar"); +} diff --git a/tests/object_literal.js b/tests/object_literal.js deleted file mode 100644 index 6c68585..0000000 --- a/tests/object_literal.js +++ /dev/null @@ -1,5 +0,0 @@ -function main() { - const a = { elk: 2 }; - a.flubs = 3; - console.log(a); -} diff --git a/tests/postfix_unary.js b/tests/postfix_unary.js new file mode 100644 index 0000000..675b603 --- /dev/null +++ b/tests/postfix_unary.js @@ -0,0 +1,4 @@ +function main() { + let i = 1; + let a = i++; +} diff --git a/tests/string_and_number.js b/tests/string_and_number.js new file mode 100644 index 0000000..31273ad --- /dev/null +++ b/tests/string_and_number.js @@ -0,0 +1,10 @@ +function a(b: string) { + let c = 1; + c = b; + c = 2; + console.log(2); +} + +function main() { + a("foo"); +} diff --git a/tests/unwrap_boolean.js b/tests/unwrap_boolean.js new file mode 100644 index 0000000..8b95c4a --- /dev/null +++ b/tests/unwrap_boolean.js @@ -0,0 +1,8 @@ +function main() { + const a = 4; + if (a === 1) { + return true; + } + + return false; +} diff --git a/tests/upcast.js b/tests/upcast.js new file mode 100644 index 0000000..1e41167 --- /dev/null +++ b/tests/upcast.js @@ -0,0 +1,8 @@ +function a(b: number) { + let c = 1; + c = b; +} + +function main() { + a(1); +} diff --git a/tests/upcast2.js b/tests/upcast2.js new file mode 100644 index 0000000..c60c6b8 --- /dev/null +++ b/tests/upcast2.js @@ -0,0 +1,7 @@ +function test(a) { + let i = a; + i = 1; + i = a; +} + +function main() {} diff --git a/tests/while.js b/tests/while.js index 9ff9e9c..02e6f62 100644 --- a/tests/while.js +++ b/tests/while.js @@ -3,10 +3,10 @@ function fib(i) { return i; } - var n = i; - var previous_first = 0; - var previous_second = 1; - var next = 1; + let n = i; + let previous_first = 0; + let previous_second = 1; + let next = 1; while (n >= 2) { next = previous_first + previous_second; diff --git a/tsconfig.json b/tsconfig.json index af76a05..39ab84f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "target": "ES5", "outDir": "./build", - "rootDir": "./src/" + "rootDir": "./src/", + "sourceMap": true } } diff --git a/yarn.lock b/yarn.lock index ae93ecd..d7f5af2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,16 +2,69 @@ # yarn lockfile v1 +"@babel/code-frame@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" + integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA== + dependencies: + "@babel/highlight" "^7.0.0" + +"@babel/highlight@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" + integrity sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw== + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^4.0.0" + "@types/node@^11.9.4": version "11.9.4" resolved "https://registry.yarnpkg.com/@types/node/-/node-11.9.4.tgz#ceb0048a546db453f6248f2d1d95e937a6f00a14" integrity sha512-Zl8dGvAcEmadgs1tmSPcvwzO1YRsz38bVJQvH1RvRqSR9/5n61Q1ktcDL0ht3FXWR+ZpVmXVwN1LuH4Ax23NsA== +"@typescript-eslint/eslint-plugin@^1.4.2": + version "1.4.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.4.2.tgz#370bc32022d1cc884a5dcf62624ef2024182769d" + integrity sha512-6WInypy/cK4rM1dirKbD5p7iFW28DbSRKT/+PGn+DYzBWEvHq5KnZAqQ5cX25JBc0qMkFxJNxNfBbFXJyyzVcw== + dependencies: + "@typescript-eslint/parser" "1.4.2" + "@typescript-eslint/typescript-estree" "1.4.2" + requireindex "^1.2.0" + tsutils "^3.7.0" + +"@typescript-eslint/parser@1.4.2", "@typescript-eslint/parser@^1.4.2": + version "1.4.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-1.4.2.tgz#acfdee2019958a41d308d768e53ded975ef90ce8" + integrity sha512-OqLkY9295DXXaWToItUv3olO2//rmzh6Th6Sc7YjFFEpEuennsm5zhygLLvHZjPxPlzrQgE8UDaOPurDylaUuw== + dependencies: + "@typescript-eslint/typescript-estree" "1.4.2" + eslint-scope "^4.0.0" + eslint-visitor-keys "^1.0.0" + +"@typescript-eslint/typescript-estree@1.4.2": + version "1.4.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.4.2.tgz#b16bc36c9a4748a7fca92cba4c2d73c5325c8a85" + integrity sha512-wKgi/w6k1v3R4b6oDc20cRWro2gBzp0wn6CAeYC8ExJMfvXMfiaXzw2tT9ilxdONaVWMCk7B9fMdjos7bF/CWw== + dependencies: + lodash.unescape "4.0.1" + semver "5.5.0" + abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== +acorn-jsx@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.1.tgz#32a064fd925429216a09b141102bfdd185fae40e" + integrity sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg== + +acorn@^6.0.7: + version "6.1.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f" + integrity sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA== + ajv@^6.5.5: version "6.9.1" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.9.1.tgz#a4d3683d74abc5670e75f0b16520f70a20ea8dc1" @@ -22,6 +75,26 @@ ajv@^6.5.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" +ajv@^6.9.1: + version "6.9.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.9.2.tgz#4927adb83e7f48e5a32b45729744c71ec39c9c7b" + integrity sha512-4UFy0/LgDo7Oa/+wOAlj44tp9K78u38E5/359eSrqEp1Z5PdVfimCcs7SluXMP755RUQu6d2b4AvF0R1C9RZjg== + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-escapes@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-2.0.0.tgz#5bae52be424878dd9783e8910e3fc2922e83c81b" + integrity sha1-W65SvkJIeN2Xg+iRDj/Cki6DyBs= + +ansi-escapes@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" + integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== + ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" @@ -32,6 +105,18 @@ ansi-regex@^3.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= +ansi-regex@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.0.0.tgz#70de791edf021404c3fd615aa89118ae0432e5a9" + integrity sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w== + +ansi-styles@^3.2.0, ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + aproba@^1.0.3: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" @@ -45,6 +130,30 @@ are-we-there-yet@~1.1.2: delegates "^1.0.0" readable-stream "^2.0.6" +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +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" + integrity sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E= + +array-union@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + integrity sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk= + dependencies: + array-uniq "^1.0.1" + +array-uniq@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + integrity sha1-r2rId6Jcx/dOBYiUdThY39sk/bY= + asn1@~0.2.3: version "0.2.4" resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" @@ -57,6 +166,11 @@ assert-plus@1.0.0, assert-plus@^1.0.0: resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -99,16 +213,72 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +callsites@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.0.0.tgz#fb7eb569b72ad7a45812f93fd9430a3e410b3dd3" + integrity sha512-tWnkwu9YEq2uzlBDI4RcLn8jrFvF9AOi8PxDNU3hZZjJcjkcRAq3vCI+vZcg1SuxISDYe86k9VZFwAxDiJGoAw== + +camelcase-keys@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" + integrity sha1-MIvur/3ygRkFHvodkyITyRuPkuc= + dependencies: + camelcase "^2.0.0" + map-obj "^1.0.0" + +camelcase@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" + integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= + caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + +cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= + dependencies: + restore-cursor "^2.0.0" + +cli-width@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" + integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= + code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + combined-stream@^1.0.6, combined-stream@~1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828" @@ -131,6 +301,24 @@ core-util-is@1.0.2, core-util-is@~1.0.0: resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= +cross-spawn@^6.0.5: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +currently-unhandled@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" + integrity sha1-mI3zP+qxke95mmE2nddsF635V+o= + dependencies: + array-find-index "^1.0.1" + dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" @@ -138,6 +326,23 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" +debug@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== + dependencies: + ms "^2.1.1" + +decamelize@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= + delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -148,6 +353,13 @@ delegates@^1.0.0: resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" @@ -156,11 +368,161 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" +emoji-regex@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== + +error-ex@^1.2.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +eslint-config-prettier@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-4.1.0.tgz#181364895899fff9fd3605fecb5c4f20e7d5f395" + integrity sha512-zILwX9/Ocz4SV2vX7ox85AsrAgXV3f2o2gpIicdMIOra48WYqgUnWNH/cR/iHtmD2Vb3dLSC3LiEJnS05Gkw7w== + dependencies: + get-stdin "^6.0.0" + +eslint-formatter-pretty@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/eslint-formatter-pretty/-/eslint-formatter-pretty-1.3.0.tgz#985d9e41c1f8475f4a090c5dbd2dfcf2821d607e" + integrity sha512-5DY64Y1rYCm7cfFDHEGUn54bvCnK+wSUVF07N8oXeqUJFSd+gnYOTXbzelQ1HurESluY6gnEQPmXOIkB4Wa+gA== + dependencies: + ansi-escapes "^2.0.0" + chalk "^2.1.0" + log-symbols "^2.0.0" + plur "^2.1.2" + string-width "^2.0.0" + +eslint-plugin-prettier@^2.2.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.7.0.tgz#b4312dcf2c1d965379d7f9d5b5f8aaadc6a45904" + integrity sha512-CStQYJgALoQBw3FsBzH0VOVDRnJ/ZimUlpLm226U8qgqYJfPOY/CPK6wyRInMxh73HSKg5wyRwdS4BVYYHwokA== + dependencies: + fast-diff "^1.1.1" + jest-docblock "^21.0.0" + +eslint-scope@^4.0.0, eslint-scope@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.2.tgz#5f10cd6cabb1965bf479fa65745673439e21cb0e" + integrity sha512-5q1+B/ogmHl8+paxtOKx38Z8LtWkVGuNt3+GQNErqwLl6ViNp/gdJGMCjZNxZ8j/VYjDNZ2Fo+eQc1TAVPIzbg== + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-utils@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512" + integrity sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q== + +eslint-visitor-keys@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" + integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== + +eslint@^5.15.0: + version "5.15.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.15.0.tgz#f313a2f7c7628d39adeefdba4a9c41f842012c9e" + integrity sha512-xwG7SS5JLeqkiR3iOmVgtF8Y6xPdtr6AAsN6ph7Q6R/fv+3UlKYoika8SmNzmb35qdRF+RfTY35kMEdtbi+9wg== + dependencies: + "@babel/code-frame" "^7.0.0" + ajv "^6.9.1" + chalk "^2.1.0" + cross-spawn "^6.0.5" + debug "^4.0.1" + doctrine "^3.0.0" + eslint-scope "^4.0.2" + eslint-utils "^1.3.1" + eslint-visitor-keys "^1.0.0" + espree "^5.0.1" + esquery "^1.0.1" + esutils "^2.0.2" + file-entry-cache "^5.0.1" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^11.7.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + inquirer "^6.2.2" + js-yaml "^3.12.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.11" + minimatch "^3.0.4" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.2" + progress "^2.0.0" + regexpp "^2.0.1" + semver "^5.5.1" + strip-ansi "^4.0.0" + strip-json-comments "^2.0.1" + table "^5.2.3" + text-table "^0.2.0" + +espree@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.1.tgz#5d6526fa4fc7f0788a5cf75b15f30323e2f81f7a" + integrity sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A== + dependencies: + acorn "^6.0.7" + acorn-jsx "^5.0.0" + eslint-visitor-keys "^1.0.0" + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +esquery@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" + integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA== + dependencies: + estraverse "^4.0.0" + +esrecurse@^4.1.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" + integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== + dependencies: + estraverse "^4.1.0" + +estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: + version "4.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= + extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== +external-editor@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.0.3.tgz#5866db29a97826dbe4bf3afd24070ead9ea43a27" + integrity sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA== + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + extsprintf@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" @@ -176,11 +538,57 @@ fast-deep-equal@^2.0.1: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= +fast-diff@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" + integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== + fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= + dependencies: + escape-string-regexp "^1.0.5" + +file-entry-cache@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" + integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== + dependencies: + flat-cache "^2.0.1" + +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + integrity sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8= + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + +flat-cache@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" + integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== + dependencies: + flatted "^2.0.0" + rimraf "2.6.3" + write "1.0.3" + +flatted@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916" + integrity sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg== + forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" @@ -210,6 +618,11 @@ fstream@^1.0.0, fstream@^1.0.2: mkdirp ">=0.5 0" rimraf "2" +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= + gauge@~2.7.3: version "2.7.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" @@ -224,6 +637,16 @@ gauge@~2.7.3: strip-ansi "^3.0.1" wide-align "^1.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" + integrity sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4= + +get-stdin@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" + integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g== + getpass@^0.1.1: version "0.1.7" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" @@ -231,7 +654,7 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" -glob@^7.0.3, glob@^7.1.3: +glob@^7.0.3, glob@^7.1.2, glob@^7.1.3: version "7.1.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== @@ -243,6 +666,22 @@ glob@^7.0.3, glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" +globals@^11.7.0: + version "11.11.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.11.0.tgz#dcf93757fa2de5486fbeed7118538adf789e9c2e" + integrity sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw== + +globby@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" + integrity sha1-9abXDoOV4hyFj7BInWTfAkJNUGw= + dependencies: + array-union "^1.0.1" + glob "^7.0.3" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + graceful-fs@^4.1.2: version "4.1.15" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" @@ -261,11 +700,21 @@ har-validator@~5.1.0: ajv "^6.5.5" har-schema "^2.0.0" +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + has-unicode@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= +hosted-git-info@^2.1.4: + version "2.7.1" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" + integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w== + http-signature@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" @@ -275,6 +724,43 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" +iconv-lite@^0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ignore@^3.3.5: + version "3.3.10" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" + integrity sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug== + +ignore@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== + +import-fresh@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.0.0.tgz#a3d897f420cab0e671236897f75bc14b4885c390" + integrity sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + +indent-string@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80" + integrity sha1-ji1INIdCEhtKghi3oTfppSBJ3IA= + 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" @@ -288,6 +774,42 @@ inherits@2, inherits@~2.0.0, inherits@~2.0.3: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= +inquirer@^6.2.2: + version "6.2.2" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.2.2.tgz#46941176f65c9eb20804627149b743a218f25406" + integrity sha512-Z2rREiXA6cHRR9KBOarR3WuLlFzlIfAEIiB45ll5SSadMg7WqOh1MKEjjndfuH5ewXdixWCxqnVfGOQzPeiztA== + dependencies: + ansi-escapes "^3.2.0" + chalk "^2.4.2" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^3.0.3" + figures "^2.0.0" + lodash "^4.17.11" + mute-stream "0.0.7" + run-async "^2.2.0" + rxjs "^6.4.0" + string-width "^2.1.0" + strip-ansi "^5.0.0" + through "^2.3.6" + +irregular-plurals@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/irregular-plurals/-/irregular-plurals-1.4.0.tgz#2ca9b033651111855412f16be5d77c62a458a766" + integrity sha1-LKmwM2UREYVUEvFr5dd8YqRYp2Y= + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + +is-finite@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + integrity sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko= + dependencies: + number-is-nan "^1.0.0" + is-fullwidth-code-point@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" @@ -300,11 +822,21 @@ is-fullwidth-code-point@^2.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= +is-promise@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" + integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= + is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= + isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -320,6 +852,24 @@ isstream@~0.1.2: resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= +jest-docblock@^21.0.0: + version "21.2.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414" + integrity sha512-5IZ7sY9dBAYSV+YjQ0Ovb540Ku7AO9Z5o2Cg789xj167iQuZ2cG+z0f3Uct6WeYLbU6aQiM2pCs7sZ+4dotydw== + +js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-yaml@^3.12.0: + version "3.12.2" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.2.tgz#ef1d067c5a9d9cb65bd72f285b5d8105c77f14fc" + integrity sha512-QHn/Lh/7HhZ/Twc7vJYQTkjuCa0kaCcDcjK5Zlk2rvnUpy7DxMJ23+Jc2dcyvltwQVg1nygAVlB2oRDFHoRS5Q== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" @@ -335,6 +885,11 @@ json-schema@0.2.3: resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= + json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" @@ -350,6 +905,76 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.10.0" +levn@^0.3.0, levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +lines-and-columns@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" + integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= + +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" + integrity sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA= + 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.unescape@4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c" + integrity sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw= + +lodash@^4.17.11: + version "4.17.11" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== + +log-symbols@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" + integrity sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== + dependencies: + chalk "^2.0.1" + +loud-rejection@^1.0.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" + integrity sha1-W0b4AUft7leIcPCG0Eghz5mOVR8= + dependencies: + currently-unhandled "^0.4.1" + signal-exit "^3.0.0" + +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" + integrity sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0= + +meow@^3.7.0: + version "3.7.0" + resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" + integrity sha1-cstmi0JSKCkKu/qFaJJYcwioAfs= + 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" + mime-db@~1.38.0: version "1.38.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.38.0.tgz#1a2aab16da9eb167b49c6e4df2d9c68d63d8e2ad" @@ -362,6 +987,11 @@ mime-types@^2.1.12, mime-types@~2.1.19: dependencies: mime-db "~1.38.0" +mimic-fn@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== + minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" @@ -374,13 +1004,38 @@ minimist@0.0.8: resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= -"mkdirp@>=0.5 0", mkdirp@^0.5.0: +minimist@^1.1.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= + +"mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= dependencies: minimist "0.0.8" +ms@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + +mute-stream@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + node-gyp@^3.8.0: version "3.8.0" resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-3.8.0.tgz#540304261c330e80d0d5edce253a68cb3964218c" @@ -406,6 +1061,16 @@ node-gyp@^3.8.0: dependencies: abbrev "1" +normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: + version "2.5.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" + integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== + dependencies: + hosted-git-info "^2.1.4" + resolve "^1.10.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + "npmlog@0 || 1 || 2 || 3 || 4": version "4.1.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" @@ -426,7 +1091,7 @@ oauth-sign@~0.9.0: resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== -object-assign@^4.1.0: +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" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= @@ -438,12 +1103,31 @@ once@^1.3.0: dependencies: wrappy "1" +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= + dependencies: + mimic-fn "^1.0.0" + +optionator@^0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= -os-tmpdir@^1.0.0: +os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= @@ -456,21 +1140,118 @@ osenv@0: os-homedir "^1.0.0" os-tmpdir "^1.0.0" +parent-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.0.tgz#df250bdc5391f4a085fb589dad761f5ad6b865b5" + integrity sha512-8Mf5juOMmiE4FcmzYc4IaiS9L3+9paz2KOiXzkRviCP6aDmN49Hz6EMWz0lGNp9pX80GvvAuLADtyGfW/Em3TA== + dependencies: + callsites "^3.0.0" + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck= + dependencies: + error-ex "^1.2.0" + +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s= + 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" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= +path-is-inside@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= + +path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= + +path-parse@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + integrity sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE= + dependencies: + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" + performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= + 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" + integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= + +plur@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/plur/-/plur-2.1.2.tgz#7482452c1a0f508e3e344eaec312c91c29dc655a" + integrity sha1-dIJFLBoPUI4+NE6uwxLJHCncZVo= + dependencies: + irregular-plurals "^1.0.0" + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= + +prettier@^1.16.4: + version "1.16.4" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.16.4.tgz#73e37e73e018ad2db9c76742e2647e21790c9717" + integrity sha512-ZzWuos7TI5CKUeQAtFd6Zhm2s6EpAD/ZLApIhsF9pRvRtM1RFo61dM/4MSRUA0SuLugA/zgrZD8m0BaY46Og7g== + +prettylint@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prettylint/-/prettylint-1.0.0.tgz#b71720ad9733e098fdd8ebea90c61cda33371aa1" + integrity sha512-IjIAoGeIve8NQR6WbslnMs5rcnEVbJkZN/IXm302wNlSEo+3pIyxroy+3bkEFLP14prz1Aq1GGlKsX0UXHXuEQ== + dependencies: + eslint-formatter-pretty "^1.3.0" + eslint-plugin-prettier "^2.2.0" + globby "^6.1.0" + ignore "^3.3.5" + lines-and-columns "^1.1.6" + meow "^3.7.0" + tslib "^1.8.0" + 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" integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== +progress@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== + psl@^1.1.24: version "1.1.31" resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184" @@ -491,6 +1272,23 @@ qs@~6.5.2: resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== +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" + integrity sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI= + 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" + integrity sha1-9f+qXs0pyzHAR0vKfXVra7KePyg= + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + readable-stream@^2.0.6: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" @@ -504,6 +1302,26 @@ readable-stream@^2.0.6: string_decoder "~1.1.1" util-deprecate "~1.0.1" +redent@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" + integrity sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94= + dependencies: + indent-string "^2.1.0" + strip-indent "^1.0.1" + +regexpp@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" + integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= + dependencies: + is-finite "^1.0.0" + request@^2.87.0: version "2.88.0" resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" @@ -530,23 +1348,72 @@ request@^2.87.0: tunnel-agent "^0.6.0" uuid "^3.3.2" -rimraf@2, rimraf@^2.6.3: +requireindex@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/requireindex/-/requireindex-1.2.0.tgz#3463cdb22ee151902635aa6c9535d4de9c2ef1ef" + integrity sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww== + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + +resolve@^1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.10.0.tgz#3bdaaeaf45cc07f375656dfd2e54ed0810b101ba" + integrity sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg== + dependencies: + path-parse "^1.0.6" + +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= + dependencies: + onetime "^2.0.0" + signal-exit "^3.0.2" + +rimraf@2, rimraf@2.6.3, rimraf@^2.6.3: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== dependencies: glob "^7.1.3" +run-async@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" + integrity sha1-A3GrSuC91yDUFm19/aZP96RFpsA= + dependencies: + is-promise "^2.1.0" + +rxjs@^6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.4.0.tgz#f3bb0fe7bda7fb69deac0c16f17b50b0b8790504" + integrity sha512-Z9Yfa11F6B9Sg/BK9MnqnQ+aQYicPLtilXBp2yUtDt2JRCE0h26d33EnfO3ZxoNxG0T92OUucP3Ct7cpfkdFfw== + dependencies: + tslib "^1.9.0" + safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: +"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== +"semver@2 || 3 || 4 || 5", semver@^5.5.0, semver@^5.5.1: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + +semver@5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" + integrity sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA== + semver@~5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" @@ -557,11 +1424,63 @@ set-blocking@~2.0.0: resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= -signal-exit@^3.0.0: +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= + +signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= +slice-ansi@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" + integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== + dependencies: + ansi-styles "^3.2.0" + astral-regex "^1.0.0" + is-fullwidth-code-point "^2.0.0" + +spdx-correct@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" + integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q== + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" + integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== + +spdx-expression-parse@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" + integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz#81c0ce8f21474756148bbb5f3bfc0f36bf15d76e" + integrity sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g== + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + sshpk@^1.7.0: version "1.16.1" resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" @@ -586,7 +1505,7 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2": +"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== @@ -594,6 +1513,15 @@ string-width@^1.0.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" +string-width@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.0.0.tgz#5a1690a57cc78211fffd9bf24bbe24d090604eb1" + integrity sha512-rr8CUxBbvOZDUvc5lNIJ+OC1nPVpz+Siw9VBtUjB9b6jZehZLFt0JMCZzShFHIsI8cbhm0EsNIfWJMFV3cu3Ew== + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.0.0" + string_decoder@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" @@ -615,6 +1543,49 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" +strip-ansi@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.0.0.tgz#f78f68b5d0866c20b2c9b8c61b5298508dc8756f" + integrity sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow== + dependencies: + ansi-regex "^4.0.0" + +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + integrity sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4= + 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" + integrity sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI= + dependencies: + get-stdin "^4.0.1" + +strip-json-comments@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +table@^5.2.3: + version "5.2.3" + resolved "https://registry.yarnpkg.com/table/-/table-5.2.3.tgz#cde0cc6eb06751c009efab27e8c820ca5b67b7f2" + integrity sha512-N2RsDAMvDLvYwFcwbPyF3VmVSSkuF+G1e+8inhBLtHpvwXGw4QRPEZhihQNeEN0i1up6/f6ObCJXNdlRG3YVyQ== + dependencies: + ajv "^6.9.1" + lodash "^4.17.11" + slice-ansi "^2.1.0" + string-width "^3.0.0" + tar@^2.0.0: version "2.2.1" resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" @@ -624,6 +1595,23 @@ tar@^2.0.0: fstream "^1.0.2" inherits "2" +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= + +through@^2.3.6: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + tough-cookie@~2.4.3: version "2.4.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" @@ -632,11 +1620,28 @@ tough-cookie@~2.4.3: psl "^1.1.24" punycode "^1.4.1" +trim-newlines@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" + integrity sha1-WIeWa7WCpFA6QetST301ARgVphM= + tsc@^1.20150623.0: version "1.20150623.0" resolved "https://registry.yarnpkg.com/tsc/-/tsc-1.20150623.0.tgz#4ebc3c774e169148cbc768a7342533f082c7a6e5" integrity sha1-Trw8d04WkUjLx2inNCUz8ILHpuU= +tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== + +tsutils@^3.7.0: + version "3.8.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.8.0.tgz#7a3dbadc88e465596440622b65c04edc8e187ae5" + integrity sha512-XQdPhgcoTbCD8baXC38PQ0vpTZ8T3YrE+vR66YIj/xvDt1//8iAhafpIT/4DmvzzC1QFapEImERu48Pa01dIUA== + dependencies: + tslib "^1.8.1" + tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" @@ -649,6 +1654,13 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0: resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= + dependencies: + prelude-ls "~1.1.2" + typescript@^3.3.3: version "3.3.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.3.3.tgz#f1657fc7daa27e1a8930758ace9ae8da31403221" @@ -671,6 +1683,14 @@ uuid@^3.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + verror@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" @@ -680,7 +1700,7 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" -which@1: +which@1, which@^1.2.9: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== @@ -694,7 +1714,19 @@ wide-align@^1.1.0: dependencies: string-width "^1.0.2 || 2" +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +write@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" + integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== + dependencies: + mkdirp "^0.5.1"